OpenLexocad  27.1
CoordinateSystem.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2014 Werner Mayer <wmayer[at]users.sourceforge.net> *
3  * *
4  * This file is part of the FreeCAD CAx development system. *
5  * *
6  * This library is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Library General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU Library General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Library General Public *
17  * License along with this library; see the file COPYING.LIB. If not, *
18  * write to the Free Software Foundation, Inc., 51 Franklin Street, *
19  * Fifth Floor, Boston, MA 02110-1301, USA *
20  * *
21  ***************************************************************************/
22 
23 
24 #ifndef BASE_COORDINATESYSTEM_H
25 #define BASE_COORDINATESYSTEM_H
26 
27 #include "Base/Axis.h"
28 
29 namespace Base {
34 class LX_BASE_EXPORT CoordinateSystem
35 {
36 public:
42 
46  void setAxis(const Axis& v);
50  void setAxes(const Axis&, const Vector3d& xd);
54  void setAxes(const Vector3d& n, const Vector3d& xd);
55  inline const Axis& getAxis() const
56  { return axis; }
57 
59  void setXDirection(const Vector3d&);
60  inline const Vector3d& getXDirection() const
61  { return xdir; }
62 
64  void setYDirection(const Vector3d&);
65  inline const Vector3d& getYDirection() const
66  { return ydir; }
67 
71  void setZDirection(const Vector3d&);
72  inline const Vector3d& getZDirection() const
73  { return axis.getDirection(); }
74  inline void setPosition(const Vector3d& p)
75  { axis.setBase(p); }
76  inline const Vector3d& getPosition() const
77  { return axis.getBase(); }
78 
82  Placement displacement(const CoordinateSystem& cs) const;
83 
85  void transformTo(Vector3d& p);
86 
88  void transform(const Placement& p);
89 
91  void transform(const Rotation& r);
92 
94  void setPlacement(const Placement& p);
95 
96 private:
97  Axis axis;
98  Vector3d xdir;
99  Vector3d ydir;
100 };
101 
102 }
103 
104 #endif // BASE_COORDINATESYSTEM_H
const Vector3d & getPosition() const
Definition: CoordinateSystem.h:76
Definition: CoordinateSystem.h:34
const Axis & getAxis() const
Definition: CoordinateSystem.h:55
Definition: Axis.h:35
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
const Vector3d & getXDirection() const
Definition: CoordinateSystem.h:60
const Vector3d & getYDirection() const
Definition: CoordinateSystem.h:65
Definition: AbstractXMLReader.h:5
void setPosition(const Vector3d &p)
Definition: CoordinateSystem.h:74
Definition: Placement.h:38
Definition: Rotation.h:34
const Vector3d & getZDirection() const
Definition: CoordinateSystem.h:72