ISegmentManager.hpp
1 #pragma once
2 
3 #include "DM/IPoint.hpp"
4 #include "DM/IBox.hpp"
5 #include "DM/IPolyline.hpp"
6 #include "opals/Vector.hpp"
7 #include "opals/SegmentationMethod.hpp"
8 #include "opals/ObjectBase.hpp"
9 
10 namespace opals
11 {
12  /** \brief Segment interface
13 
14  A segment objects provides an objects representation of the segments that have been created by ModuleSegmentation. Plane parameters and plane moments
15  are only available if the plane extraction mode was applied. Alpha shape objects additionally required the alphaRadius parameter being set.
16 
17  \author MPOECHTR, JO
18  \date 29.01.2019
19  */
20  class ISegment
21  {
22  public:
23  /// returns id of segment
24  virtual unsigned getID() const = 0;
25 
26  /// number of points that have been assigned to segment
27  virtual size_t sizePoints() const = 0;
28  /// get point id at index position of the point vector
29  virtual int64_t getPoint(int64_t index) const = 0;
30  /// get point id vector of segment
31  virtual opals::Vector<int64_t> getPoints() const = 0;
32 
33  /// get center of gravity of segment points
34  virtual const DM::PointHandle & getCoG() const = 0;
35  /// get bounding box of segment points
36  virtual const DM::BoxHandle & getBBox() const = 0;
37 
38  /// get plane parameters (a,b,c,d and sigma0) of the extracted plane (in plane extraction mode only. plane equation: a*x + b*y + c*z + d == 0)
39  virtual const opals::Vector<double> & getPlaneParams() const = 0;
40  /// get plane moments (Mxx, Myy, Mzz, Mxy, Mxz, Myz) of the extracted plane (in plane extraction mode only)
41  virtual const opals::Vector<double> & getPlaneMoments() const = 0;
42 
43  /// get alpha shape of segment (only available in plane extraction mode and set alpha radius)
44  virtual const DM::PolylineHandle & getAlphaShape() const = 0;
45  };
46 
47 
48  /** \brief Segment manager interface
49 
50  A segment manager objects stored all segments that have been created by an ModuleSegmentation run.
51 
52  \author MPOECHTR, JO
53  \date 29.01.2019
54  */
55  class ISegmentManager : public ObjectBase
56  {
57  public:
58  /// get number of segments
59  virtual int64_t sizeSegments() const = 0;
60 
61  /// \brief get vector of all segments.
62  /// the lifetime of the segments is attached to the manager. Hence, if the ISegmentManager is deleted, the segment objects are deleted too
63  virtual opals::Vector<opals::ISegment*> getSegments() const = 0;
64 
65  /// get a segement by ids id
66  virtual opals::ISegment* getSegment(unsigned seg_id) const = 0;
67  };
68 }
virtual opals::Vector< opals::ISegment * > getSegments() const =0
get vector of all segments. the lifetime of the segments is attached to the manager....
virtual const DM::BoxHandle & getBBox() const =0
get bounding box of segment points
virtual int64_t getPoint(int64_t index) const =0
get point id at index position of the point vector
Segment interface.
Definition: ISegmentManager.hpp:20
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
virtual const opals::Vector< double > & getPlaneParams() const =0
get plane parameters (a,b,c,d and sigma0) of the extracted plane (in plane extraction mode only....
virtual const opals::Vector< double > & getPlaneMoments() const =0
get plane moments (Mxx, Myy, Mzz, Mxy, Mxz, Myz) of the extracted plane (in plane extraction mode onl...
virtual const DM::PolylineHandle & getAlphaShape() const =0
get alpha shape of segment (only available in plane extraction mode and set alpha radius)
virtual unsigned getID() const =0
returns id of segment
virtual int64_t sizeSegments() const =0
get number of segments
virtual opals::ISegment * getSegment(unsigned seg_id) const =0
get a segement by ids id
Mimics std::vector<T>
Definition: fwd.hpp:18
Smart pointer class using reference counting with support for DM objects (see ObjectBase)
Definition: Handle.hpp:75
virtual const DM::PointHandle & getCoG() const =0
get center of gravity of segment points
virtual opals::Vector< int64_t > getPoints() const =0
get point id vector of segment
Segment manager interface.
Definition: ISegmentManager.hpp:55
virtual size_t sizePoints() const =0
number of points that have been assigned to segment
base class for objects which are controlled using the SharedPtr class. the virutal Delete function is...
Definition: c++_api/inc/opals/ObjectBase.hpp:9