ITK  4.4.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_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);
64 
66  virtual CellGeometry GetType(void) const
67  { return Superclass::QUADRILATERAL_CELL; }
68  virtual void MakeCopy(CellAutoPointer &) const;
70 
71  virtual unsigned int GetDimension(void) const;
72 
73  virtual unsigned int GetNumberOfPoints(void) const;
74 
75  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
76 
77  virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &);
78  virtual void SetPointIds(PointIdConstIterator first);
79 
80  virtual void SetPointIds(PointIdConstIterator first,
81  PointIdConstIterator last);
82 
83  virtual void SetPointId(int localId, PointIdentifier);
84  virtual PointIdIterator PointIdsBegin(void);
85 
86  virtual PointIdConstIterator PointIdsBegin(void) const;
87 
88  virtual PointIdIterator PointIdsEnd(void);
89 
90  virtual PointIdConstIterator PointIdsEnd(void) const;
91 
93  virtual CellFeatureCount GetNumberOfVertices(void) const;
94 
95  virtual CellFeatureCount GetNumberOfEdges(void) const;
96 
97  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
98  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
99 
101  virtual bool EvaluatePosition(CoordRepType *,
102  PointsContainer *,
103  CoordRepType *,
104  CoordRepType[],
105  double *,
106  InterpolationWeightType *);
107 
109  itkCellVisitMacro(Superclass::QUADRILATERAL_CELL);
110 
113  {
114  for ( PointIdentifier i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
115  {
116  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
117  }
118  }
120 
122 
123 protected:
125  PointIdentifier m_PointIds[NumberOfPoints];
126 
127  void InterpolationDerivs(CoordRepType pcoords[2], CoordRepType derivs[8]);
128  void InterpolationFunctions(CoordRepType pcoords[2], InterpolationWeightType sf[4]);
129  void EvaluateLocation(int &itkNotUsed(subId), PointsContainer * points, CoordRepType pcoords[2],
130  CoordRepType x[2], InterpolationWeightType * weights);
131 
132 private:
133  QuadrilateralCell(const Self &); //purposely not implemented
134  void operator=(const Self &); //purposely not implemented
135 };
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkQuadrilateralCell.hxx"
140 #endif
141 
142 #endif
143