nss: upgrade to release 3.73
[LibreOffice.git] / include / basegfx / point / b3dpoint.hxx
blob2cb8acf9be509ad7ac3b908581807f87f42b4871
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 #pragma once
22 #include <basegfx/tuple/b3dtuple.hxx>
23 #include <basegfx/basegfxdllapi.h>
25 namespace basegfx
27 class B3DHomMatrix;
29 /** Base Point class with three double values
31 This class derives all operators and common handling for
32 a 3D data class from B3DTuple. All necessary extensions
33 which are special for points will be added here.
35 @see B3DTuple
37 class SAL_WARN_UNUSED BASEGFX_DLLPUBLIC B3DPoint : public ::basegfx::B3DTuple
39 public:
40 /** Create a 3D Point
42 The point is initialized to (0.0, 0.0, 0.0)
44 B3DPoint()
45 : B3DTuple()
48 /** Create a 3D Point
50 @param fX
51 This parameter is used to initialize the X-coordinate
52 of the 3D Point.
54 @param fY
55 This parameter is used to initialize the Y-coordinate
56 of the 3D Point.
58 @param fZ
59 This parameter is used to initialize the Z-coordinate
60 of the 3D Point.
62 B3DPoint(double fX, double fY, double fZ)
63 : B3DTuple(fX, fY, fZ)
66 /** constructor with tuple to allow copy-constructing
67 from B3DTuple-based classes
69 B3DPoint(const ::basegfx::B3DTuple& rTuple)
70 : B3DTuple(rTuple)
73 /** *=operator to allow usage from B3DPoint, too
75 B3DPoint& operator*=( const B3DPoint& rPnt )
77 mfX *= rPnt.mfX;
78 mfY *= rPnt.mfY;
79 mfZ *= rPnt.mfZ;
80 return *this;
83 /** *=operator to allow usage from B3DPoint, too
85 B3DPoint& operator*=(double t)
87 mfX *= t;
88 mfY *= t;
89 mfZ *= t;
90 return *this;
93 /** assignment operator to allow assigning the results
94 of B3DTuple calculations
96 B3DPoint& operator=( const ::basegfx::B3DTuple& rVec )
98 mfX = rVec.getX();
99 mfY = rVec.getY();
100 mfZ = rVec.getZ();
101 return *this;
104 /** Transform point by given transformation matrix.
106 The translational components of the matrix are, in
107 contrast to B3DVector, applied.
109 B3DPoint& operator*=( const ::basegfx::B3DHomMatrix& rMat );
112 // external operators
115 /** Transform B3DPoint by given transformation matrix.
117 Since this is a Point, translational components of the
118 matrix are used.
120 BASEGFX_DLLPUBLIC B3DPoint operator*( const B3DHomMatrix& rMat, const B3DPoint& rPoint );
122 } // end of namespace basegfx
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */