Orfeo Toolbox  3.16
itkPolygonCell.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkPolygonCell.h,v $
5  Language: C++
6  Date: $Date: 2009-03-03 15:07:57 $
7  Version: $Revision: 1.35 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkPolygonCell_h
21 #define __itkPolygonCell_h
22 
23 #include "itkCellInterface.h"
24 #include "itkLineCell.h"
25 #include "itkPoint.h"
26 #include <vector>
27 #include <deque>
28 
29 namespace itk
30 {
31 
46 template < typename TCellInterface >
47 class ITK_EXPORT PolygonCell: public TCellInterface
48 {
49 public:
52  itkCellInheritedTypedefs(TCellInterface);
53 
55  itkTypeMacro(PolygonCell, CellInterface);
56 
58  itkStaticConstMacro(CellDimension, unsigned int, 2);
59 
62  typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
63 
66  typedef typename EdgeType::SelfAutoPointer EdgeAutoPointer;
67 
69  typedef std::deque<EdgeInfo> EdgeInfoDQ;
70 
72  itkCellVisitMacro(Superclass::POLYGON_CELL);
73 
75  virtual CellGeometry GetType(void) const
76  {return Superclass::POLYGON_CELL;}
77  virtual void MakeCopy( CellAutoPointer & ) const;
78  virtual unsigned int GetDimension(void) const;
79  virtual unsigned int GetNumberOfPoints(void) const;
80  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
81  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,CellAutoPointer &);
82 
83  virtual void SetPointIds(PointIdConstIterator first);
84  virtual void SetPointIds(PointIdConstIterator first,
85  PointIdConstIterator last);
86 
87  void AddPointId(PointIdentifier);
88  void RemovePointId(PointIdentifier);
89  void SetPointIds(int dummy, int num, PointIdConstIterator first);
90  void BuildEdges(void);
91  void ClearPoints(void);
92 
93  virtual void SetPointId(int localId, PointIdentifier);
94  virtual PointIdIterator PointIdsBegin(void);
95  virtual PointIdConstIterator PointIdsBegin(void) const;
96  virtual PointIdIterator PointIdsEnd(void);
97  virtual PointIdConstIterator PointIdsEnd(void) const;
98 
100  virtual CellFeatureCount GetNumberOfVertices(void) const;
101  virtual CellFeatureCount GetNumberOfEdges(void) const;
102  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
103  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
104 
105 
108  PolygonCell(unsigned int NumberOfPoints)
109  {
110  for (unsigned int i = 0; i < NumberOfPoints; i++)
111  {
112  m_PointIds.push_back(NumericTraits<unsigned long>::max());
113  }
114  this->BuildEdges();
115  }
117 
118 protected:
119  std::vector<EdgeInfo> m_Edges;
120  std::vector<PointIdentifier> m_PointIds;
121 
122 private:
123  PolygonCell(const Self&); //purposely not implemented
124  void operator=(const Self&); //purposely not implemented
125 
126 };
127 
128 } //end namespace
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkPolygonCell.txx"
132 #endif
133 
134 #endif

Generated at Sun May 19 2013 00:00:31 for Orfeo Toolbox with doxygen 1.8.3.1