ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkLineCell.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkLineCell_h
19 #define itkLineCell_h
20 
21 #include "itkVertexCell.h"
22 
23 namespace itk
24 {
41 template< typename TCellInterface >
42 class LineCell:public TCellInterface
43 {
44 public:
47  itkCellInheritedTypedefs(TCellInterface);
49 
51  itkTypeMacro(LineCell, CellInterface);
52 
55  typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
56 
58  itkStaticConstMacro(NumberOfPoints, unsigned int, 2);
59  itkStaticConstMacro(NumberOfVertices, unsigned int, 2);
60  itkStaticConstMacro(CellDimension, unsigned int, 1);
62 
64  virtual CellGeometry GetType(void) const ITK_OVERRIDE
65  { return Superclass::LINE_CELL; }
66  virtual void MakeCopy(CellAutoPointer &) const ITK_OVERRIDE;
68 
69  virtual unsigned int GetDimension(void) const ITK_OVERRIDE;
70 
71  virtual unsigned int GetNumberOfPoints(void) const ITK_OVERRIDE;
72 
73  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const ITK_OVERRIDE;
74 
75  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) ITK_OVERRIDE;
76  virtual void SetPointIds(PointIdConstIterator first) ITK_OVERRIDE;
77 
78  virtual void SetPointIds(PointIdConstIterator first,
79  PointIdConstIterator last) ITK_OVERRIDE;
80 
81  virtual void SetPointId(int localId, PointIdentifier) ITK_OVERRIDE;
82  virtual PointIdIterator PointIdsBegin(void) ITK_OVERRIDE;
83 
84  virtual PointIdConstIterator PointIdsBegin(void) const ITK_OVERRIDE;
85 
86  virtual PointIdIterator PointIdsEnd(void) ITK_OVERRIDE;
87 
88  virtual PointIdConstIterator PointIdsEnd(void) const ITK_OVERRIDE;
89 
91  virtual CellFeatureCount GetNumberOfVertices() const;
92 
93  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
94 
96  itkCellVisitMacro(Superclass::LINE_CELL);
97 
99  {
100  for ( unsigned int i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
101  {
103  }
104  }
105 
107 
108 protected:
110  PointIdentifier m_PointIds[NumberOfPoints];
111 
112 private:
113  LineCell(const Self &) ITK_DELETE_FUNCTION;
114  void operator=(const Self &) ITK_DELETE_FUNCTION;
115 };
116 } // end namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "itkLineCell.hxx"
120 #endif
121 
122 #endif
virtual void MakeCopy(CellAutoPointer &) const override
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
VertexCell< TCellInterface > VertexType
Definition: itkLineCell.h:51
VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkLineCell.h:55
itkCellVisitMacro(Superclass::LINE_CELL)
virtual PointIdIterator PointIdsEnd(void) override
virtual CellFeatureCount GetNumberOfVertices() const
virtual void SetPointId(int localId, PointIdentifier) override
static const unsigned int NumberOfPoints
Definition: itkLineCell.h:58
An abstract interface for cells.
static const unsigned int NumberOfVertices
Definition: itkLineCell.h:59
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
PointIdentifier m_PointIds[NumberOfPoints]
Definition: itkLineCell.h:110
virtual unsigned int GetNumberOfPoints(void) const override
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
static T max(const T &)
virtual CellGeometry GetType(void) const override
Definition: itkLineCell.h:64
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
static const unsigned int CellDimension
Definition: itkLineCell.h:60
virtual unsigned int GetDimension(void) const override
itkCellInheritedTypedefs(TCellInterface)
itkCellCommonTypedefs(LineCell)
virtual void SetPointIds(PointIdConstIterator first) override
virtual PointIdIterator PointIdsBegin(void) override