ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkQuadrilateralCell.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 itkQuadrilateralCell_h
19 #define itkQuadrilateralCell_h
20 
21 #include "itkLineCell.h"
23 
24 namespace itk
25 {
38 template< typename TCellInterface >
39 class ITK_TEMPLATE_EXPORT QuadrilateralCell:public TCellInterface, private QuadrilateralCellTopology
40 {
41 public:
44  itkCellInheritedTypedefs(TCellInterface);
46 
49 
52  typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
53 
56  typedef typename EdgeType::SelfAutoPointer EdgeAutoPointer;
57 
59  itkStaticConstMacro(NumberOfPoints, unsigned int, 4);
60  itkStaticConstMacro(NumberOfVertices, unsigned int, 4);
61  itkStaticConstMacro(NumberOfEdges, unsigned int, 4);
62  itkStaticConstMacro(CellDimension, unsigned int, 2);
63  itkStaticConstMacro(NumberOfDerivatives, unsigned int, 8);
65 
67  virtual CellGeometry GetType(void) const ITK_OVERRIDE
68  { return Superclass::QUADRILATERAL_CELL; }
69  virtual void MakeCopy(CellAutoPointer &) const ITK_OVERRIDE;
71 
72  virtual unsigned int GetDimension(void) const ITK_OVERRIDE;
73 
74  virtual unsigned int GetNumberOfPoints(void) const ITK_OVERRIDE;
75 
76  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const ITK_OVERRIDE;
77 
78  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) ITK_OVERRIDE;
79  virtual void SetPointIds(PointIdConstIterator first) ITK_OVERRIDE;
80 
81  virtual void SetPointIds(PointIdConstIterator first,
82  PointIdConstIterator last) ITK_OVERRIDE;
83 
84  virtual void SetPointId(int localId, PointIdentifier) ITK_OVERRIDE;
85  virtual PointIdIterator PointIdsBegin(void) ITK_OVERRIDE;
86 
87  virtual PointIdConstIterator PointIdsBegin(void) const ITK_OVERRIDE;
88 
89  virtual PointIdIterator PointIdsEnd(void) ITK_OVERRIDE;
90 
91  virtual PointIdConstIterator PointIdsEnd(void) const ITK_OVERRIDE;
92 
94  virtual CellFeatureCount GetNumberOfVertices() const;
95 
96  virtual CellFeatureCount GetNumberOfEdges() const;
97 
98  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
99  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
100 
102  virtual bool EvaluatePosition(CoordRepType * position,
103  PointsContainer * points,
104  CoordRepType * closestPoint,
105  CoordRepType[CellDimension],
106  double * dist2,
107  InterpolationWeightType * weight) ITK_OVERRIDE;
108 
110  itkCellVisitMacro(Superclass::QUADRILATERAL_CELL);
111 
114  {
115  for ( PointIdentifier i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
116  {
117  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
118  }
119  }
121 
122  ~QuadrilateralCell() ITK_OVERRIDE {}
123 
124 protected:
126  PointIdentifier m_PointIds[NumberOfPoints];
127 
128  void InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives]);
129  void InterpolationFunctions(const CoordRepType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints]);
130  void EvaluateLocation(int &itkNotUsed(subId), const PointsContainer * points, const CoordRepType pointCoords[PointDimension],
131  CoordRepType x[PointDimension], InterpolationWeightType * weights);
132 
133 private:
134  ITK_DISALLOW_COPY_AND_ASSIGN(QuadrilateralCell);
135 };
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkQuadrilateralCell.hxx"
140 #endif
141 
142 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
VertexType::SelfAutoPointer VertexAutoPointer
Holds data defining the topological connections of the vertices and edges of a QuadrilateralCell.
An abstract interface for cells.
static ITK_CONSTEXPR_FUNC T max(const T &)
#define itkCellCommonTypedefs(celltype)
EdgeType::SelfAutoPointer EdgeAutoPointer
LineCell< TCellInterface > EdgeType
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
virtual CellGeometry GetType(void) const override
#define itkCellVisitMacro(TopologyId)
Represents a quadrilateral for a Mesh.
VertexCell< TCellInterface > VertexType
#define itkCellInheritedTypedefs(superclassArg)