Debian Codegraph @

src/Base/Axis.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2
3 /***************************************************************************
4 * Copyright (c) 2011 Jürgen Riegel <[email protected]> *
5 * *
6 * This file is part of the FreeCAD CAx development system. *
7 * *
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Library General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Library General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Library General Public *
19 * License along with this library; see the file COPYING.LIB. If not, *
20 * write to the Free Software Foundation, Inc., 59 Temple Place, *
21 * Suite 330, Boston, MA 02111-1307, USA *
22 * *
23 ***************************************************************************/
24
25
26 #ifndef BASE_AXIS_H
27 #define BASE_AXIS_H
28
29 #include <FCGlobal.h>
30
31 #include "Vector3D.h"
32
33 namespace Base
34 {
35 class Placement;
36
37 /**
38 * The Axis class.
39 */
40 class BaseExport Axis
41 {
42 public:
43 /// default constructor
44 Axis() = default;
45 Axis(const Axis&) = default;
46 Axis(Axis&&) = default;
47 Axis(const Vector3d& Orig, const Vector3d& Dir);
48 /// Destruction
49 ~Axis() = default;
50
51 const Vector3d& getBase() const
52 {
53 return _base;
54 }
55 const Vector3d& getDirection() const
56 {
57 return _dir;
58 }
59 void setBase(const Vector3d& Orig)
60 {
61 _base = Orig;
62 }
63 void setDirection(const Vector3d& Dir)
64 {
65 _dir = Dir;
66 }
67
68 void reverse();
69 Axis reversed() const;
70 void move(const Vector3d& MovVec);
71
72 /** Operators. */
73 //@{
74 Axis& operator*=(const Placement& plm);
75 Axis operator*(const Placement& plm) const;
76 bool operator==(const Axis&) const;
77 bool operator!=(const Axis&) const;
78 Axis& operator=(const Axis&) = default;
79 Axis& operator=(Axis&&) = default;
80 //@}
81
82 private:
83 Vector3d _base;
84 Vector3d _dir;
85 };
86
87 } // namespace Base
88
89 #endif // BASE_AXIS_H