Go to the documentation of this file.00001
00063 #ifndef __COB_3D_SEGMENTATION_EDGE_TYPES_H__
00064 #define __COB_3D_SEGMENTATION_EDGE_TYPES_H__
00065
00066 #include <list>
00067 #include <map>
00068 #include <utility>
00069
00070 namespace cob_3d_segmentation
00071 {
00072 class BoundaryPoint
00073 {
00074 public:
00075 BoundaryPoint(int idx=0) : brother(idx), normal() { }
00076
00077 int brother;
00078 Eigen::Vector3f normal;
00079 };
00080
00081 class BoundaryPointsEdge
00082 {
00083 public:
00084 BoundaryPointsEdge() : width(1)
00085 , boundary_pairs()
00086 , smoothness(0.0) { }
00087
00088 inline std::pair<std::list<int>::iterator, std::list<int>::iterator> getBoundaryPairs()
00089 { return std::make_pair(boundary_pairs.begin()->second.begin(), boundary_pairs.begin()->second.end()); }
00090
00091 inline std::pair<std::list<int>::iterator, std::list<int>::iterator> getBoundaryPairsOf(int cid)
00092 { return std::make_pair(boundary_pairs[cid].begin(), boundary_pairs[cid].end()); }
00093
00094 inline std::list<int>::size_type size() const { return boundary_pairs.begin()->second.size(); }
00095
00096 inline void addBoundaryIndices(const int cid1, const int cid2, const int idx1, const int idx2)
00097 {
00098 boundary_pairs[cid1].push_back(idx2);
00099 boundary_pairs[cid2].push_back(idx1);
00100 }
00101
00102 inline bool isAttachedTo(int cid) { return (boundary_pairs.find(cid) != boundary_pairs.end()); }
00103
00104 int width;
00105 std::map<int,std::list<int> > boundary_pairs;
00106 float smoothness;
00107 };
00108 }
00109
00110 #endif