Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / basegfx / point / b3dpoint.hxx
blobc2711202d3de5b7a581acdea11be73e746506848
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_B3DPOINT_HXX
21 #define INCLUDED_BASEGFX_POINT_B3DPOINT_HXX
23 #include <basegfx/tuple/b3dtuple.hxx>
24 #include <basegfx/basegfxdllapi.h>
26 namespace basegfx
28 class B3DHomMatrix;
30 /** Base Point class with three double values
32 This class derives all operators and common handling for
33 a 3D data class from B3DTuple. All necessary extensions
34 which are special for points will be added here.
36 @see B3DTuple
38 class SAL_WARN_UNUSED BASEGFX_DLLPUBLIC B3DPoint : public ::basegfx::B3DTuple
40 public:
41 /** Create a 3D Point
43 The point is initialized to (0.0, 0.0, 0.0)
45 B3DPoint()
46 : B3DTuple()
49 /** Create a 3D Point
51 @param fX
52 This parameter is used to initialize the X-coordinate
53 of the 3D Point.
55 @param fY
56 This parameter is used to initialize the Y-coordinate
57 of the 3D Point.
59 @param fZ
60 This parameter is used to initialize the Z-coordinate
61 of the 3D Point.
63 B3DPoint(double fX, double fY, double fZ)
64 : B3DTuple(fX, fY, fZ)
67 /** Create a copy of a 3D Point
69 @param rVec
70 The 3D Point which will be copied.
72 B3DPoint(const B3DPoint& rVec)
73 : B3DTuple(rVec)
76 /** constructor with tuple to allow copy-constructing
77 from B3DTuple-based classes
79 B3DPoint(const ::basegfx::B3DTuple& rTuple)
80 : B3DTuple(rTuple)
83 /** *=operator to allow usage from B3DPoint, too
85 B3DPoint& operator*=( const B3DPoint& rPnt )
87 mfX *= rPnt.mfX;
88 mfY *= rPnt.mfY;
89 mfZ *= rPnt.mfZ;
90 return *this;
93 /** *=operator to allow usage from B3DPoint, too
95 B3DPoint& operator*=(double t)
97 mfX *= t;
98 mfY *= t;
99 mfZ *= t;
100 return *this;
103 /** assignment operator to allow assigning the results
104 of B3DTuple calculations
106 B3DPoint& operator=( const ::basegfx::B3DTuple& rVec )
108 mfX = rVec.getX();
109 mfY = rVec.getY();
110 mfZ = rVec.getZ();
111 return *this;
114 /** Transform point by given transformation matrix.
116 The translational components of the matrix are, in
117 contrast to B3DVector, applied.
119 B3DPoint& operator*=( const ::basegfx::B3DHomMatrix& rMat );
122 // external operators
125 /** Transform B3DPoint by given transformation matrix.
127 Since this is a Point, translational components of the
128 matrix are used.
130 BASEGFX_DLLPUBLIC B3DPoint operator*( const B3DHomMatrix& rMat, const B3DPoint& rPoint );
132 } // end of namespace basegfx
134 #endif // INCLUDED_BASEGFX_POINT_B3DPOINT_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */