ITK  4.6.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
68  { return Superclass::QUADRILATERAL_CELL; }
69  virtual void MakeCopy(CellAutoPointer &) const;
71 
72  virtual unsigned int GetDimension(void) const;
73 
74  virtual unsigned int GetNumberOfPoints(void) const;
75 
76  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
77 
78  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &);
79  virtual void SetPointIds(PointIdConstIterator first);
80 
81  virtual void SetPointIds(PointIdConstIterator first,
82  PointIdConstIterator last);
83 
84  virtual void SetPointId(int localId, PointIdentifier);
85  virtual PointIdIterator PointIdsBegin(void);
86 
87  virtual PointIdConstIterator PointIdsBegin(void) const;
88 
89  virtual PointIdIterator PointIdsEnd(void);
90 
91  virtual PointIdConstIterator PointIdsEnd(void) const;
92 
94  virtual CellFeatureCount GetNumberOfVertices(void) const;
95 
96  virtual CellFeatureCount GetNumberOfEdges(void) 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);
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
void InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives])
virtual void SetPointIds(PointIdConstIterator first)
static const unsigned int NumberOfPoints
virtual void SetPointId(int localId, PointIdentifier)
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
static const unsigned int NumberOfDerivatives
virtual void MakeCopy(CellAutoPointer &) const
void operator=(const Self &)
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &)
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const
VertexType::SelfAutoPointer VertexAutoPointer
virtual PointIdIterator PointIdsEnd(void)
Holds data defining the topological connections of the vertices and edges of a QuadrilateralCell.
itkCellCommonTypedefs(QuadrilateralCell)
An abstract interface for cells.
void InterpolationFunctions(const CoordRepType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints])
static const unsigned int NumberOfVertices
virtual CellGeometry GetType(void) const
itkCellInheritedTypedefs(TCellInterface)
virtual PointIdIterator PointIdsBegin(void)
static const unsigned int NumberOfEdges
virtual CellFeatureCount GetNumberOfVertices(void) const
static T max(const T &)
virtual CellFeatureCount GetNumberOfEdges(void) const
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
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &)
virtual unsigned int GetDimension(void) const
virtual unsigned int GetNumberOfPoints(void) const
Represents a quadrilateral for a Mesh.
itkCellVisitMacro(Superclass::QUADRILATERAL_CELL)
VertexCell< TCellInterface > VertexType
virtual bool EvaluatePosition(CoordRepType *position, PointsContainer *points, CoordRepType *closestPoint, CoordRepType[CellDimension], double *dist2, InterpolationWeightType *weight)
PointIdentifier m_PointIds[NumberOfPoints]