ITK  5.0.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:
42  ITK_DISALLOW_COPY_AND_ASSIGN(QuadrilateralCell);
43 
46  itkCellInheritedTypedefs(TCellInterface);
48 
50  itkTypeMacro(QuadrilateralCell, CellInterface);
51 
54  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
55 
58  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
59 
61  static constexpr unsigned int NumberOfPoints = 4;
62  static constexpr unsigned int NumberOfVertices = 4;
63  static constexpr unsigned int NumberOfEdges = 4;
64  static constexpr unsigned int CellDimension = 2;
65  static constexpr unsigned int NumberOfDerivatives = 8;
66 
68  CellGeometry GetType() const override
69  { return Superclass::QUADRILATERAL_CELL; }
70  void MakeCopy(CellAutoPointer &) const override;
72 
73  unsigned int GetDimension() const override;
74 
75  unsigned int GetNumberOfPoints() const override;
76 
77  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
78 
79  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
80  void SetPointIds(PointIdConstIterator first) override;
81 
82  void SetPointIds(PointIdConstIterator first,
83  PointIdConstIterator last) override;
84 
85  void SetPointId(int localId, PointIdentifier) override;
86  PointIdIterator PointIdsBegin() override;
87 
88  PointIdConstIterator PointIdsBegin() const override;
89 
90  PointIdIterator PointIdsEnd() override;
91 
92  PointIdConstIterator PointIdsEnd() const override;
93 
95  virtual CellFeatureCount GetNumberOfVertices() const;
96 
97  virtual CellFeatureCount GetNumberOfEdges() const;
98 
99  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
100  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
101 
103  bool EvaluatePosition(CoordRepType * position,
104  PointsContainer * points,
105  CoordRepType * closestPoint,
106  CoordRepType[CellDimension],
107  double * dist2,
108  InterpolationWeightType * weight) override;
109 
111  itkCellVisitMacro(Superclass::QUADRILATERAL_CELL);
112 
115  {
116  for ( PointIdentifier i = 0; i < Self::NumberOfPoints; i++ )
117  {
118  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
119  }
120  }
122 
123 #if defined(__GNUC__) && (__GNUC__ > 5)
124  ~QuadrilateralCell() override = default;
125 #else
126  ~QuadrilateralCell() override {};
127 #endif
128 
129 protected:
131  PointIdentifier m_PointIds[NumberOfPoints];
132 
133  void InterpolationDerivs(const CoordRepType pointCoords[CellDimension], CoordRepType derivs[NumberOfDerivatives]);
134  void InterpolationFunctions(const CoordRepType pointCoords[CellDimension], InterpolationWeightType weights[NumberOfPoints]);
135  void EvaluateLocation(int &itkNotUsed(subId), const PointsContainer * points, const CoordRepType pointCoords[PointDimension],
136  CoordRepType x[PointDimension], InterpolationWeightType * weights);
137 };
138 } // end namespace itk
139 
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "itkQuadrilateralCell.hxx"
142 #endif
143 
144 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
Define numeric traits for std::vector.
Holds data defining the topological connections of the vertices and edges of a QuadrilateralCell.
An abstract interface for cells.
#define itkCellCommonTypedefs(celltype)
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
Represents a quadrilateral for a Mesh.
#define itkCellInheritedTypedefs(superclassArg)
CellGeometry GetType() const override
typename VertexType::SelfAutoPointer VertexAutoPointer