OpenIndy-Core  0.2.0.43
cone.h
Go to the documentation of this file.
1 #ifndef CONE_H
2 #define CONE_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 
18 {
19  Q_OBJECT
20 
21 public:
22  Cone(const bool &isNominal, QObject *parent = 0);
23  Cone(const bool &isNominal, const Position &apex, const Direction &axis, const double &aperture, QObject *parent = 0);
24 
25  Cone(const Cone &copy, QObject *parent = 0);
26 
27  Cone &operator=(const Cone &copy);
28 
29  ~Cone();
30 
31  //########################################
32  //order of unknown parameters (Qxx-matrix)
33  //########################################
34 
36  unknownApexX = 0,
42  unknownAperture
43  };
44 
45  //###################################################################
46  //check wether this geometry has a direction, a position and a radius
47  //###################################################################
48 
49  bool hasDirection() const;
50  bool hasPosition() const;
51 
52  //##########################
53  //get or set cone parameters
54  //##########################
55 
56  const Direction &getDirection() const;
57  const Position &getPosition() const;
58 
59  const double &getAperture() const;
60 
61  void setCone(const Position &apex, const Direction &axis, const double &aperture);
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  QString getDisplayAperture(const UnitType &type, const int &digits, const bool &showDiff = false) const;
95 
96 private:
97 
98  //###############
99  //cone attributes
100  //###############
101 
102  Position apex; //the peak of the cone
103  Direction axis; //vector pointing from the apex inside the cone
104  double aperture; //opening angle = 2 * angle between surface line and r
105 
106 };
107 
108 }
109 
110 #endif // CONE_H
Definition: cone.h:41
ConeUnknowns
Definition: cone.h:35
The Position class.
Definition: position.h:16
Definition: coordinatesystem.h:15
Definition: cone.h:38
The Geometry class.
Definition: geometry.h:26
Definition: cone.h:39
The Cone class Defines a right circular cone.
Definition: cone.h:17
Definition: cone.h:37
UnitType
Definition: types.h:354
Definition: direction.h:13
#define OI_CORE_EXPORT
Definition: types.h:11
Definition: cone.h:40