ITK  5.3.0
Insight Toolkit
itkHexahedronCell.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
46 template <typename TCellInterface>
47 class ITK_TEMPLATE_EXPORT HexahedronCell
48  : public TCellInterface
49  , private HexahedronCellTopology
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(HexahedronCell);
53 
56  itkCellInheritedTypedefs(TCellInterface);
58 
60  itkTypeMacro(HexahedronCell, CellInterface);
61 
64  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
65 
68  using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
69 
72  using FaceAutoPointer = typename FaceType::SelfAutoPointer;
73 
75  static constexpr unsigned int NumberOfPoints = 8;
76  static constexpr unsigned int NumberOfVertices = 8;
77  static constexpr unsigned int NumberOfEdges = 12;
78  static constexpr unsigned int NumberOfFaces = 6;
79  static constexpr unsigned int CellDimension = 3;
80 
86  static constexpr unsigned int CellDimension3D = 3;
87  static constexpr unsigned int PointDimension3D = 3;
88 
91  GetType() const override
92  {
94  }
95  void
96  MakeCopy(CellAutoPointer &) const override;
98 
99  unsigned int
100  GetDimension() const override;
101 
102  unsigned int
103  GetNumberOfPoints() const override;
104 
105  CellFeatureCount
106  GetNumberOfBoundaryFeatures(int dimension) const override;
107 
108  bool
109  GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
110  void
111  SetPointIds(PointIdConstIterator first) override;
112 
113  void
114  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
115 
116  void
117  SetPointId(int localId, PointIdentifier) override;
118  PointIdIterator
119  PointIdsBegin() override;
120 
121  PointIdConstIterator
122  PointIdsBegin() const override;
123 
124  PointIdIterator
125  PointIdsEnd() override;
126 
127  PointIdConstIterator
128  PointIdsEnd() const override;
129 
131  virtual CellFeatureCount
132  GetNumberOfVertices() const;
133 
134  virtual CellFeatureCount
135  GetNumberOfEdges() const;
136 
137  virtual CellFeatureCount
138  GetNumberOfFaces() const;
139 
140  virtual bool
141  GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
142  virtual bool
143  GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
144  virtual bool
145  GetFace(CellFeatureIdentifier, FaceAutoPointer &);
146 
148  bool
149  EvaluatePosition(CoordRepType *,
150  PointsContainer *,
151  CoordRepType *,
152  CoordRepType[],
153  double *,
154  InterpolationWeightType *) override;
155 
158 
159 protected:
161  PointIdentifier m_PointIds[NumberOfPoints];
162 
163  void
164  InterpolationDerivs(CoordRepType pcoords[Self::CellDimension],
165  CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints]);
166  void
167  InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
168  void
169  EvaluateLocation(int & itkNotUsed(subId),
170  PointsContainer * points,
171  CoordRepType pcoords[Self::CellDimension],
172  CoordRepType x[Self::CellDimension],
173  InterpolationWeightType * weights);
174 
175 public:
177  {
178  for (unsigned int i = 0; i < Self::NumberOfPoints; ++i)
179  {
180  m_PointIds[i] = NumericTraits<PointIdentifier>::max();
181  }
182  }
183 
184  ~HexahedronCell() override = default;
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 # include "itkHexahedronCell.hxx"
190 #endif
191 
192 #endif
itk::VertexCell
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
itk::QuadrilateralCell
Represents a quadrilateral for a Mesh.
Definition: itkQuadrilateralCell.h:39
itkQuadrilateralCell.h
itk::HexahedronCellTopology
Holds data defining the topological connections of the vertices and edges of a HexahedronCell.
Definition: itkHexahedronCellTopology.h:39
itk::HexahedronCell::EdgeAutoPointer
typename EdgeType::SelfAutoPointer EdgeAutoPointer
Definition: itkHexahedronCell.h:68
itkCellVisitMacro
#define itkCellVisitMacro(TopologyId)
Definition: itkCellInterface.h:32
itk::HexahedronCell::FaceAutoPointer
typename FaceType::SelfAutoPointer FaceAutoPointer
Definition: itkHexahedronCell.h:72
itk::CommonEnums::CellGeometry::HEXAHEDRON_CELL
itk::HexahedronCell
Represents a hexahedron (cuboid) for a Mesh.
Definition: itkHexahedronCell.h:47
itkCellInheritedTypedefs
#define itkCellInheritedTypedefs(superclassArg)
Definition: itkCellInterface.h:55
itk::HexahedronCell::GetType
CellGeometryEnum GetType() const override
Definition: itkHexahedronCell.h:91
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::HexahedronCell::HexahedronCell
HexahedronCell()
Definition: itkHexahedronCell.h:176
itk::LineCell
Represents a line segment for a Mesh.
Definition: itkLineCell.h:42
itk::NumericTraits::max
static constexpr T max(const T &)
Definition: itkNumericTraits.h:167
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:96
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::HexahedronCell::VertexAutoPointer
typename VertexType::SelfAutoPointer VertexAutoPointer
Definition: itkHexahedronCell.h:64
itkHexahedronCellTopology.h
itkCellCommonTypedefs
#define itkCellCommonTypedefs(celltype)
Definition: itkCellInterface.h:46