OpenIndy-Core  0.2.0.43
pointcloud.h
Go to the documentation of this file.
1 #ifndef POINTCLOUD_H
2 #define POINTCLOUD_H
3 
4 #include <QObject>
5 #include <QtXml>
6 
7 #include "geometry.h"
8 #include "position.h"
9 
10 namespace oi{
11 
12 class FeatureWrapper;
13 
18  Point_PC(){ this->isUsed = false; }
19 
20  float xyz[3];
21  bool isUsed;
22 };
23 
28  float min[3];
29  float max[3];
30 };
31 
36 {
37  Q_OBJECT
38 
39 public:
40  PointCloud(bool isNominal, QObject *parent = 0);
41 
42  PointCloud(const PointCloud &copy, QObject *parent = 0);
43 
44  PointCloud &operator=(const PointCloud &copy);
45 
46  ~PointCloud();
47 
48  //###########################
49  //general point cloud methods
50  //###########################
51 
52  unsigned long getPointCount() const;
53 
54  bool addSegment(const QPointer<FeatureWrapper> &segment);
55  void clearSegmentation();
56 
57  //###################################################################
58  //check wether this geometry has a direction, a position and a radius
59  //###################################################################
60 
61  bool hasPosition() const;
62 
63  //#################################
64  //get or set point cloud parameters
65  //#################################
66 
67  const QList<QPointer<Point_PC> > &getPointCloudPoints() const;
68  void addPointCloudPoint(const QPointer<Point_PC> &point);
69 
70  const Position &getPosition() const;
71  void setPosition(const Position &mainFocus);
72 
73  const BoundingBox_PC &getBoundingBox() const;
74  void setBoundingBox(const BoundingBox_PC &bbox);
75 
76  //###########################
77  //reexecute the function list
78  //###########################
79 
80  void recalc();
81 
82  //#################
83  //save and load XML
84  //#################
85 
86  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
87  bool fromOpenIndyXML(QDomElement &xmlElem);
88 
89  //###############
90  //display methods
91  //###############
92 
93  QString getDisplayX(const UnitType &type, const int &digits, const bool &showDiff = false) const;
94  QString getDisplayY(const UnitType &type, const int &digits, const bool &showDiff = false) const;
95  QString getDisplayZ(const UnitType &type, const int &digits, const bool &showDiff = false) const;
96 
97 signals:
98  void pcSegmentAdded(const QPointer<FeatureWrapper> &segment);
99 
100 private:
101 
102  //######################
103  //point cloud attributes
104  //######################
105 
106  QList<QPointer<Point_PC> > points; //all points of the pointcloud
107  Position mainFocus; //centroid of the pointcloud
108  BoundingBox_PC bbox; //bounding box of the pointcloud
109 
110  QList<QPointer<FeatureWrapper> > detectedSegments; //geometry-segments that were detected in the pointcloud
111 
112 };
113 
114 }
115 
116 #endif // POINTCLOUD_H
The Position class.
Definition: position.h:16
The Point_PC class.
Definition: pointcloud.h:17
Definition: coordinatesystem.h:15
The Geometry class.
Definition: geometry.h:26
The PointCloud class.
Definition: pointcloud.h:35
UnitType
Definition: types.h:354
#define OI_CORE_EXPORT
Definition: types.h:11
The BoundingBox_PC class.
Definition: pointcloud.h:27