Image Component Library (ICL)
PointCloudSegment.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/PointCloudSegment.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter, Andre Ueckermann **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
34 #include <ICLUtils/Exception.h>
35 
36 namespace icl{
37  namespace geom{
39 
49  size_t numPoints;
50  float cutCost;
51 
52  struct AABB{
54  } aabb;
55 
56 
58  : PointCloudObject(0,false,true),
59  featuresComputed(false),
60  numPoints(0) {}
61  PointCloudSegment(int dim, bool withColors=true);
64  const std::vector<int> &indices);
66  const std::vector<const std::vector<int>*> &indices);
67 
68  PointCloudSegment *copy() const;
69 
71 
73 
74  void updateFeatures();
75 
77 
78  bool isParent() { return getChildCount (); }
79 
82  return getChildCount();
83  }
84 
87  ;
88 
91 
92 
94  std::vector<utils::SmartPtr<PointCloudSegment> > extractThisAndChildren() const;
95 
96  protected:
97  void init(PointCloudObject &obj,
98  const std::vector<const std::vector<int>*> &indices);
99  };
100 
103 
104  inline std::ostream &operator<<(std::ostream &str, const PointCloudSegment::AABB &a){
105  return str << "AABB(min: " << a.min.transp() << " max: " << a.max.transp() << ")";
106  }
107  }
108 }
float cutCost
Definition: PointCloudSegment.h:50
std::vector< utils::SmartPtr< PointCloudSegment > > extractThisAndChildren() const
returns a vector containing this and all recursive children
void updateFeatures()
updates the instances features
bool isParent()
parent objects have children and a dimension of 0
Definition: PointCloudSegment.h:78
undocument this line if you encounter any issues!
Definition: Any.h:37
Definition: PointCloudSegment.h:52
ICLGeom_API int getChildCount() const
returns the number of children
PointCloudSegment * copy() const
deep copy function
utils::SmartPtr< PointCloudSegment > flatten() const
creates a flattened deep copy of the segment
utils::SmartPtr< PointCloudSegment > getSubSegment(int i)
returns week pointer to the i-th child (already casted to PointCloudSegment type)
void init(PointCloudObject &obj, const std::vector< const std::vector< int > * > &indices)
math::Vec3 eigenvectors[3]
Definition: PointCloudSegment.h:47
bool featuresComputed
Definition: PointCloudSegment.h:44
Base implementation of the SceneObjectBase interface for compability with common icl::SceneObjects.
Definition: PointCloudObject.h:52
ICLGeom_API std::ostream & operator<<(std::ostream &os, const Camera &cam)
ostream operator (writes camera in XML core::format)
struct icl::geom::PointCloudSegment::AABB aabb
PointCloudSegment()
Definition: PointCloudSegment.h:57
int getNumSubSegments()
returns number of sub-segements (i.e. the number of children)
Definition: PointCloudSegment.h:81
utils::SmartPtr< PointCloudSegment > PointCloudSegmentPtr
Definition: PointCloudSegment.h:102
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
math::Vec3 max
Definition: PointCloudSegment.h:53
FixedMatrix< T, ROWS, COLS > transp() const
returns matrix's transposed
Definition: FixedMatrix.h:728
math::Vec3 mean
Definition: PointCloudSegment.h:46
math::FixedMatrix< float, 3, 3 > covariance
Definition: PointCloudSegment.h:45
PointCloudSegment class used to describe data segments in the scene.
Definition: PointCloudSegment.h:43
size_t numPoints
Definition: PointCloudSegment.h:49
math::Vec3 eigenvalues
Definition: PointCloudSegment.h:48
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75
math::Vec3 min
Definition: PointCloudSegment.h:53