ITK  4.8.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 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  {
118  }
119  }
121 
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  QuadrilateralCell(const Self &); //purposely not implemented
135  void operator=(const Self &); //purposely not implemented
136 };
137 } // end namespace itk
138 
139 #ifndef ITK_MANUAL_INSTANTIATION
140 #include "itkQuadrilateralCell.hxx"
141 #endif
142 
143 #endif
virtual void SetPointIds(PointIdConstIterator first) override
void InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives])
static const unsigned int NumberOfPoints
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
static const unsigned int NumberOfDerivatives
void operator=(const Self &)
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
virtual unsigned int GetDimension(void) const override
VertexType::SelfAutoPointer VertexAutoPointer
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
virtual void SetPointId(int localId, PointIdentifier) override
Holds data defining the topological connections of the vertices and edges of a QuadrilateralCell.
itkCellCommonTypedefs(QuadrilateralCell)
An abstract interface for cells.
virtual void MakeCopy(CellAutoPointer &) const override
void InterpolationFunctions(const CoordRepType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints])
virtual PointIdIterator PointIdsBegin(void) override
virtual bool EvaluatePosition(CoordRepType *position, PointsContainer *points, CoordRepType *closestPoint, CoordRepType[CellDimension], double *dist2, InterpolationWeightType *weight) override
static const unsigned int NumberOfVertices
virtual unsigned int GetNumberOfPoints(void) const override
itkCellInheritedTypedefs(TCellInterface)
static const unsigned int NumberOfEdges
static T max(const T &)
void EvaluateLocation(int &, const PointsContainer *points, const CoordRepType pointCoords[PointDimension], CoordRepType x[PointDimension], InterpolationWeightType *weights)
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &)
static const unsigned int CellDimension
EdgeType::SelfAutoPointer EdgeAutoPointer
LineCell< TCellInterface > EdgeType
virtual CellFeatureCount GetNumberOfEdges() const
virtual CellFeatureCount GetNumberOfVertices() const
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
virtual CellGeometry GetType(void) const override
virtual PointIdIterator PointIdsEnd(void) override
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override
Represents a quadrilateral for a Mesh.
itkCellVisitMacro(Superclass::QUADRILATERAL_CELL)
VertexCell< TCellInterface > VertexType
PointIdentifier m_PointIds[NumberOfPoints]