update emoji autocorrect entries from po-files
[LibreOffice.git] / include / basegfx / point / b2dpoint.hxx
blob6d2018814d530580fcb606bc4bb0207ae090609b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_BASEGFX_POINT_B2DPOINT_HXX
21 #define INCLUDED_BASEGFX_POINT_B2DPOINT_HXX
23 #include <ostream>
25 #include <basegfx/tuple/b2dtuple.hxx>
26 #include <basegfx/point/b2ipoint.hxx>
27 #include <basegfx/basegfxdllapi.h>
29 namespace basegfx
31 class B2DHomMatrix;
33 /** Base Point class with two double values
35 This class derives all operators and common handling for
36 a 2D data class from B2DTuple. All necessary extensions
37 which are special for points will be added here.
39 @see B2DTuple
41 class SAL_WARN_UNUSED B2DPoint : public ::basegfx::B2DTuple
43 public:
44 /** Create a 2D Point
46 The point is initialized to (0.0, 0.0)
48 B2DPoint()
49 : B2DTuple()
52 /** Create a 2D Point
54 @param fX
55 This parameter is used to initialize the X-coordinate
56 of the 2D Point.
58 @param fY
59 This parameter is used to initialize the Y-coordinate
60 of the 2D Point.
62 B2DPoint(double fX, double fY)
63 : B2DTuple(fX, fY)
66 /** Create a copy of a 2D Point
68 @param rPoint
69 The 2D Point which will be copied.
71 B2DPoint(const B2DPoint& rPoint)
72 : B2DTuple(rPoint)
75 /** Create a copy of a 2D Point
77 @param rPoint
78 The 2D Point which will be copied.
80 explicit B2DPoint(const ::basegfx::B2IPoint& rPoint)
81 : B2DTuple(rPoint)
84 /** constructor with tuple to allow copy-constructing
85 from B2DTuple-based classes
87 B2DPoint(const ::basegfx::B2DTuple& rTuple)
88 : B2DTuple(rTuple)
91 ~B2DPoint()
94 /** *=operator to allow usage from B2DPoint, too
96 B2DPoint& operator*=( const B2DPoint& rPnt )
98 mfX *= rPnt.mfX;
99 mfY *= rPnt.mfY;
100 return *this;
103 /** *=operator to allow usage from B2DPoint, too
105 B2DPoint& operator*=(double t)
107 mfX *= t;
108 mfY *= t;
109 return *this;
112 /** assignment operator to allow assigning the results
113 of B2DTuple calculations
115 BASEGFX_DLLPUBLIC B2DPoint& operator=( const ::basegfx::B2DTuple& rPoint );
117 /** Transform point by given transformation matrix.
119 The translational components of the matrix are, in
120 contrast to B2DVector, applied.
122 BASEGFX_DLLPUBLIC B2DPoint& operator*=( const ::basegfx::B2DHomMatrix& rMat );
124 static const B2DPoint& getEmptyPoint()
126 return static_cast<const B2DPoint&>( ::basegfx::B2DTuple::getEmptyTuple() );
130 // external operators
132 /** Transform B2DPoint by given transformation matrix.
134 Since this is a Point, translational components of the
135 matrix are used.
137 BASEGFX_DLLPUBLIC B2DPoint operator*( const B2DHomMatrix& rMat, const B2DPoint& rPoint );
138 } // end of namespace basegfx
140 template< typename charT, typename traits >
141 inline std::basic_ostream<charT, traits> & operator <<(
142 std::basic_ostream<charT, traits> & stream, const basegfx::B2DPoint& point )
144 return stream << "(" << point.getX() << "," << point.getY() << ")";
147 #endif // INCLUDED_BASEGFX_POINT_B2DPOINT_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */