KWStyle - itkPolygonCell.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkPolygonCell.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:45 $
7   Version:   $Revision: 1.4 $
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 IND *****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
32 /** \class PolygonCell
33  * PolygonCell represents a polygon for a Mesh.
34  *  the points of the polygon can be dynamically changed.
35  *
36  * Template parameters for PolygonCell:
37  *
38  * TPixelType =
39  *     The type associated with a point, cell, or boundary for use in storing
40  *     its data.
41  *
42  * TCellTraits =
43  *     Type information of mesh containing cell.
44  * \ingroup MeshObjects
45  */
46 template < typename TCellInterface >
47 class ITK_EXPORT PolygonCell: public TCellInterface
48 {
49 public:
50   /** Standard class typedefs. */
51   itkCellCommonTypedefs(PolygonCell);
52   itkCellInheritedTypedefs(TCellInterface);
53    
54   /** Standard part of every itk Object. */
55   itkTypeMacro(PolygonCell, CellInterface);
56
57   /** Save some template parameter information. */
58   itkStaticConstMacro(CellDimension, unsigned int, 2);
59
60   /** The type of boundary for this triangle's vertices. */
61   typedef VertexCell< TCellInterface >            VertexType;
62   typedef typename VertexType::SelfAutoPointer    VertexAutoPointer;
63   
64   /** The type of boundary for this triangle's edges. */
65   typedef LineCell< TCellInterface >              EdgeType;
66   typedef typename EdgeType::SelfAutoPointer      EdgeAutoPointer;
67     
68   typedef FixedArray<int,2> EdgeInfo;
69 TDA   typedef std::deque<EdgeInfo> EdgeInfoDQ;
70   
71 IND */** Need to add POLYGON_CELL into CellInterface. */
72   itkCellVisitMacro(Superclass::POLYGON_CELL);
73
74   /** Implement the standard CellInterface. */
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 LEN   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   
99   /** Polygon-specific interface. */
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
106   /** Constructor and destructor */
107   PolygonCell() {}
108   ~PolygonCell() {}
109
110 protected:
111   std::vector<EdgeInfo> m_Edges;
112   std::vector<PointIdentifier> m_PointIds;
113
114 private:
115   PolygonCell(const Self&); //purposely not implemented
116   void operator=(const Self&); //purposely not implemented
117
118 };
119
120 //end namespace
121
122 #ifndef ITK_MANUAL_INSTANTIATION
123 #include "itkPolygonCell.txx"
124 #endif
125
126 #endif
127
128 EOF
129 EOF,EML

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:39PM
© Kitware Inc.