1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 _BGFX_POINT_B2DPOINT_HXX
21 #define _BGFX_POINT_B2DPOINT_HXX
23 #include <basegfx/tuple/b2dtuple.hxx>
24 #include <basegfx/point/b2ipoint.hxx>
25 #include <basegfx/basegfxdllapi.h>
27 //////////////////////////////////////////////////////////////////////////////
34 /** Base Point class with two double values
36 This class derives all operators and common handling for
37 a 2D data class from B2DTuple. All necessary extensions
38 which are special for points will be added here.
42 class SAL_WARN_UNUSED B2DPoint
: public ::basegfx::B2DTuple
47 The point is initialized to (0.0, 0.0)
56 This parameter is used to initialize the X-coordinate
60 This parameter is used to initialize the Y-coordinate
63 B2DPoint(double fX
, double fY
)
67 /** Create a copy of a 2D Point
70 The 2D Point which will be copied.
72 B2DPoint(const B2DPoint
& rPoint
)
76 /** Create a copy of a 2D Point
79 The 2D Point which will be copied.
81 explicit B2DPoint(const ::basegfx::B2IPoint
& rPoint
)
85 /** constructor with tuple to allow copy-constructing
86 from B2DTuple-based classes
88 B2DPoint(const ::basegfx::B2DTuple
& rTuple
)
95 /** *=operator to allow usage from B2DPoint, too
97 B2DPoint
& operator*=( const B2DPoint
& rPnt
)
104 /** *=operator to allow usage from B2DPoint, too
106 B2DPoint
& operator*=(double t
)
113 /** assignment operator to allow assigning the results
114 of B2DTuple calculations
116 BASEGFX_DLLPUBLIC B2DPoint
& operator=( const ::basegfx::B2DTuple
& rPoint
);
118 /** Transform point by given transformation matrix.
120 The translational components of the matrix are, in
121 contrast to B2DVector, applied.
123 BASEGFX_DLLPUBLIC B2DPoint
& operator*=( const ::basegfx::B2DHomMatrix
& rMat
);
125 static const B2DPoint
& getEmptyPoint()
127 return (const B2DPoint
&) ::basegfx::B2DTuple::getEmptyTuple();
131 // external operators
132 //////////////////////////////////////////////////////////////////////////
134 /** Transform B2DPoint by given transformation matrix.
136 Since this is a Point, translational components of the
139 BASEGFX_DLLPUBLIC B2DPoint
operator*( const B2DHomMatrix
& rMat
, const B2DPoint
& rPoint
);
140 } // end of namespace basegfx
142 //////////////////////////////////////////////////////////////////////////////
144 #endif /* _BGFX_POINT_B2DPOINT_HXX */
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */