OpenIndy-Core  0.2.0.43
plane.h
Go to the documentation of this file.
1 #ifndef PLANE_H
2 #define PLANE_H
3 
4 #include <QObject>
5 #include <QtXml>
6 
7 #include "geometry.h"
8 #include "position.h"
9 #include "direction.h"
10 
11 namespace oi{
12 
17 {
18  Q_OBJECT
19 
20 public:
21  Plane(const bool &isNominal, QObject *parent = 0);
22  Plane(const bool &isNominal, const Position &xyz, const Direction &normal, QObject *parent = 0);
23  Plane(const bool &isNominal, const Direction &normal, const double &d, QObject *parent = 0);
24 
25  Plane(const Plane &copy, QObject *parent = 0);
26 
27  Plane &operator=(const Plane &copy);
28 
29  ~Plane();
30 
31  //########################################
32  //order of unknown parameters (Qxx-matrix)
33  //########################################
34 
36  unknownPositionX = 0,
41  unknownNormalK
42  };
43 
44  //###################################################################
45  //check wether this geometry has a direction, a position and a radius
46  //###################################################################
47 
48  bool hasDirection() const;
49  bool hasPosition() const;
50 
51  //###########################
52  //get or set plane parameters
53  //###########################
54 
55  const Direction &getDirection() const;
56  const Position &getPosition() const;
57 
58  const double &getDistanceFromOrigin() const;
59 
60  void setPlane(const Position &xyz, const Direction &normal);
61  void setPlane(const Direction &normal, const double &d);
62 
63  //#############################
64  //get or set unknown parameters
65  //#############################
66 
67  virtual QMap<GeometryParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits,
68  const QMap<DimensionType, int> &displayDigits) const;
69  virtual void setUnknownParameters(const QMap<GeometryParameters, double> &parameters);
70 
71  //###########################
72  //reexecute the function list
73  //###########################
74 
75  void recalc();
76 
77  //#################
78  //save and load XML
79  //#################
80 
81  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
82  bool fromOpenIndyXML(QDomElement &xmlElem);
83 
84  //###############
85  //display methods
86  //###############
87 
88  QString getDisplayX(const UnitType &type, const int &digits, const bool &showDiff = false) const;
89  QString getDisplayY(const UnitType &type, const int &digits, const bool &showDiff = false) const;
90  QString getDisplayZ(const UnitType &type, const int &digits, const bool &showDiff = false) const;
91  QString getDisplayPrimaryI(const int &digits, const bool &showDiff = false) const;
92  QString getDisplayPrimaryJ(const int &digits, const bool &showDiff = false) const;
93  QString getDisplayPrimaryK(const int &digits, const bool &showDiff = false) const;
94 
95 private:
96 
97  //################
98  //plane attributes
99  //################
100 
101  Position xyz; //arbitrary point on the plane
102  Direction normal; //normal vector
103 
104  double d; //smallest distance from origin
105 
106 };
107 
108 }
109 
110 #endif // PLANE_H
The Position class.
Definition: position.h:16
Definition: plane.h:39
Definition: coordinatesystem.h:15
Definition: plane.h:40
Definition: plane.h:37
The Geometry class.
Definition: geometry.h:26
PlaneUnknowns
Definition: plane.h:35
The Plane class.
Definition: plane.h:16
Definition: plane.h:38
UnitType
Definition: types.h:354
Definition: direction.h:13
#define OI_CORE_EXPORT
Definition: types.h:11