ISegmentation.hpp
1 #ifndef OPALS_ISEGMENTATION_HPP_INCLUDED
2 #define OPALS_ISEGMENTATION_HPP_INCLUDED
3 
4 #include <opals/IModuleBase.hpp>
5 #include <DM/IPointIndexLeaf.hpp>
6 
7 #if !defined(OPALS_EXPORTS) && !defined(OPALS_MODULE_EXPORTS)
8 #if defined _DEBUG && !defined OPALS_NO_DEBUG
9 #pragma comment(lib, "opalsSegmentation_d.lib")
10 #else
11 #pragma comment(lib, "opalsSegmentation.lib")
12 #endif
13 #endif
14 
15 #include <opals/Path.hpp>
16 #include <opals/String.hpp>
17 #include <opals/Vector.hpp>
18 #include <opals/SearchMode.hpp>
19 #include <opals/SegmentationMethod.hpp>
20 #include <opals/SegmentSort.hpp>
21 #include <opals/SharedPtr.hpp>
22 #include <opals/ISegmentManager.hpp>
23 
24 namespace opals {
25 
26  namespace opts
27  {
28  namespace Segmentation
29  {
30  /// Options of \ref ModuleSegmentation
31  typedef IGroup< Names::_, false, Cons<
32  ILeaf< Names::inFile, false, opals::Path >, Cons<
33  ILeaf< Names::method, false, opals::SegmentationMethod::Type >, Cons<
34  ILeaf< Names::searchRadius, false, opals::Vector< float > >, Cons<
35  ILeaf< Names::searchMode, false, opals::SearchMode::Type >, Cons<
36  ILeaf< Names::minSegSize, false, unsigned >, Cons<
37  ILeaf< Names::filter, false, opals::Vector<opals::String> >, Cons<
38  IGroup< Names::condClustering, false, Cons<
39  ILeaf< Names::criterion, false, opals::String >, Cons<
40  ILeaf< Names::alphaShapeRefPlane, false, opals::Vector<double> >
41  > > >, Cons<
42  IGroup< Names::planeExtraction, false, Cons<
43  ILeaf< Names::maxDist, false, double >, Cons<
44  ILeaf< Names::maxSigma, false, double >, Cons<
45  ILeaf< Names::seedCalculator, false, opals::String >
46  > > > >, Cons<
47  ILeaf< Names::alphaRadius, false, double >, Cons<
48  ILeaf< Names::sort, false, opals::SegmentSort::Type >, Cons<
49  ILeaf< Names::debugOutFile, false, opals::Path >, Cons<
50  ILeaf< Names::segments, true, opals::SharedPtr<opals::ISegmentManager> >
51  > > > > > > > > > > > > > Options;
52  }
53  }
54 
55  /// Provides methods for point cloud segmentation based on local homogeneity using either a generic region growing approach or an adapted region growing for plane extraction.
56  /** TODO:
57  More details on opalsSegmentation with much more words,
58  possibly on several lines. */
59  /// \see \ref ModuleSegmentation
60  class OPALS_API ISegmentation : virtual public IModuleBase
61  {
62 
63  public:
64  static ISegmentation* New();
65  static ISegmentation* New( IControlObject &controlObject );
66  static ISegmentation* New( const IModuleBase &parent );
67  static ISegmentation* New( const IModuleBase &parent, IControlObject &controlObject );
68 
69  virtual ~ISegmentation() {}
70 
71  /// \name Access to module-specific options.
72  ///@{
74  virtual Options& opts() = 0;
75  virtual const Options& opts() const = 0;
76  ///}@
77 
78  /// \brief Static method for an external calculation of segments for points in a local tree
79  virtual opals::SharedPtr<opals::ISegmentManager> calculateSegments(DM::PointIndexLeafHandle localtree) const = 0;
80  };
81 
82 };
83 
84 #endif