ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkHexahedronCell.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 itkHexahedronCell_h
19 #define itkHexahedronCell_h
20 
21 #include "itkQuadrilateralCell.h"
23 
24 namespace itk
25 {
43 template< typename TCellInterface >
44 class ITK_TEMPLATE_EXPORT HexahedronCell:public TCellInterface, private HexahedronCellTopology
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(HexahedronCell);
48 
51  itkCellInheritedTypedefs(TCellInterface);
53 
55  itkTypeMacro(HexahedronCell, CellInterface);
56 
59  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
60 
63  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
64 
67  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
68 
70  static constexpr unsigned int NumberOfPoints = 8;
71  static constexpr unsigned int NumberOfVertices = 8;
72  static constexpr unsigned int NumberOfEdges = 12;
73  static constexpr unsigned int NumberOfFaces = 6;
74  static constexpr unsigned int CellDimension = 3;
75 
77  CellGeometry GetType() const override
78  { return Superclass::HEXAHEDRON_CELL; }
79  void MakeCopy(CellAutoPointer &) const override;
81 
82  unsigned int GetDimension() const override;
83 
84  unsigned int GetNumberOfPoints() const override;
85 
86  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
87 
88  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
89  void SetPointIds(PointIdConstIterator first) override;
90 
91  void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
92 
93  void SetPointId(int localId, PointIdentifier) override;
94  PointIdIterator PointIdsBegin() override;
95 
96  PointIdConstIterator PointIdsBegin() const override;
97 
98  PointIdIterator PointIdsEnd() override;
99 
100  PointIdConstIterator PointIdsEnd() const override;
101 
103  virtual CellFeatureCount GetNumberOfVertices() const;
104 
105  virtual CellFeatureCount GetNumberOfEdges() const;
106 
107  virtual CellFeatureCount GetNumberOfFaces() const;
108 
109  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
110  virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
111  virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
112 
114  bool EvaluatePosition(CoordRepType *,
115  PointsContainer *,
116  CoordRepType *,
117  CoordRepType[],
118  double *,
119  InterpolationWeightType *) override;
120 
122  itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
123 
124 protected:
126  PointIdentifier m_PointIds[NumberOfPoints];
127 
128  void
129  InterpolationDerivs( CoordRepType pcoords[Self::CellDimension],
130  CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints] );
131  void
132  InterpolationFunctions( CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints] );
133  void
134  EvaluateLocation( int& itkNotUsed( subId ), PointsContainer* points, CoordRepType pcoords[Self::CellDimension],
135  CoordRepType x[Self::CellDimension], InterpolationWeightType* weights );
136 
137 public:
139  {
140  for ( unsigned int i = 0; i < Self::NumberOfPoints; i++ )
141  {
142  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
143  }
144  }
145 
146  ~HexahedronCell() override = default;
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkHexahedronCell.hxx"
152 #endif
153 
154 #endif
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
Define numeric traits for std::vector.
typename VertexType::SelfAutoPointer VertexAutoPointer
An abstract interface for cells.
CellGeometry GetType() const override
#define itkCellCommonTypedefs(celltype)
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Represents a hexahedron (cuboid) for a Mesh.
typename EdgeType::SelfAutoPointer EdgeAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
Represents a quadrilateral for a Mesh.
#define itkCellInheritedTypedefs(superclassArg)