OpenLexocad  28.0
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 #pragma once
25 
26 #include <Base/Axis.h>
27 
28 
29 namespace Base { class Placement; }
30 
31 namespace Base {
32 class Rotation;
37 class LX_BASE_EXPORT CoordinateSystem
38 {
39 public:
44 
48  void setAxis(const Axis& v);
52  void setAxes(const Axis&, const Vector3d& xd);
56  void setAxes(const Vector3d& n, const Vector3d& xd);
57  inline const Axis& getAxis() const
58  { return axis; }
59 
61  void setXDirection(const Vector3d&);
62  inline const Vector3d& getXDirection() const
63  { return xdir; }
64 
66  void setYDirection(const Vector3d&);
67  inline const Vector3d& getYDirection() const
68  { return ydir; }
69 
73  void setZDirection(const Vector3d&);
74  inline const Vector3d& getZDirection() const
75  { return axis.getDirection(); }
76  inline void setPosition(const Vector3d& p)
77  { axis.setBase(p); }
78  inline const Vector3d& getPosition() const
79  { return axis.getBase(); }
80 
85 
88 
90  void transform(const Placement& p);
91 
93  void transform(const Rotation& r);
94 
96  void setPlacement(const Placement& p);
97 
98 private:
99  Axis axis;
100  Vector3d xdir;
101  Vector3d ydir;
102 };
103 
104 }
Base::CoordinateSystem::setPosition
void setPosition(const Vector3d &p)
Definition: CoordinateSystem.h:76
Base::CoordinateSystem::setAxis
void setAxis(const Axis &v)
Base::CoordinateSystem
Definition: CoordinateSystem.h:38
Base::CoordinateSystem::transform
void transform(const Rotation &r)
Base::CoordinateSystem::getXDirection
const Vector3d & getXDirection() const
Definition: CoordinateSystem.h:62
Base::CoordinateSystem::displacement
Placement displacement(const CoordinateSystem &cs) const
Base::Placement
Definition: Placement.h:56
Base::CoordinateSystem::setZDirection
void setZDirection(const Vector3d &)
Base::CoordinateSystem::transformTo
void transformTo(Vector3d &p)
Base::CoordinateSystem::setYDirection
void setYDirection(const Vector3d &)
Base::CoordinateSystem::setXDirection
void setXDirection(const Vector3d &)
Base::CoordinateSystem::getPosition
const Vector3d & getPosition() const
Definition: CoordinateSystem.h:78
Base::Vector3< double >
Axis.h
Base::CoordinateSystem::getYDirection
const Vector3d & getYDirection() const
Definition: CoordinateSystem.h:67
Base::CoordinateSystem::transform
void transform(const Placement &p)
Base::CoordinateSystem::getZDirection
const Vector3d & getZDirection() const
Definition: CoordinateSystem.h:74
Base::CoordinateSystem::setAxes
void setAxes(const Vector3d &n, const Vector3d &xd)
Base::CoordinateSystem::CoordinateSystem
CoordinateSystem()
Base::CoordinateSystem::setPlacement
void setPlacement(const Placement &p)
Base::CoordinateSystem::getAxis
const Axis & getAxis() const
Definition: CoordinateSystem.h:57
Base::CoordinateSystem::setAxes
void setAxes(const Axis &, const Vector3d &xd)
Base::Rotation
Definition: Rotation.h:53
Base::Axis
Definition: Axis.h:56
Base
Definition: AbstractXMLReader.h:5