ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkQuadraticEdgeCell.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 itkQuadraticEdgeCell_h
19 #define itkQuadraticEdgeCell_h
20 
21 #include "itkVertexCell.h"
22 
23 namespace itk
24 {
36 template< typename TCellInterface >
37 class ITK_TEMPLATE_EXPORT QuadraticEdgeCell:public TCellInterface
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_ASSIGN(QuadraticEdgeCell);
41 
44  itkCellInheritedTypedefs(TCellInterface);
46 
48  itkTypeMacro(QuadraticEdgeCell, CellInterface);
49 
52  using VertexAutoPointer = typename VertexType::SelfAutoPointer;
53 
55  static constexpr unsigned int NumberOfPoints = 3;
56  static constexpr unsigned int NumberOfVertices = 2;
57  static constexpr unsigned int CellDimension = 1;
58 
60  CellGeometry GetType() const override
61  { return Superclass::QUADRATIC_EDGE_CELL; }
62  void MakeCopy(CellAutoPointer &) const override;
64 
65  unsigned int GetDimension() const override;
66 
67  unsigned int GetNumberOfPoints() const override;
68 
69  CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
70 
71  bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
72  void SetPointIds(PointIdConstIterator first) override;
73 
74  void SetPointIds(PointIdConstIterator first,
75  PointIdConstIterator last) override;
76 
77  void SetPointId(int localId, PointIdentifier) override;
78  PointIdIterator PointIdsBegin() override;
79 
80  PointIdConstIterator PointIdsBegin() const override;
81 
82  PointIdIterator PointIdsEnd() override;
83 
84  PointIdConstIterator PointIdsEnd() const override;
85 
87  virtual CellFeatureCount GetNumberOfVertices() const;
88 
89  virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
90 
92  itkCellVisitMacro(Superclass::QUADRATIC_EDGE_CELL);
93 
95  {
96  for ( PointIdentifier i = 0; i < Self::NumberOfPoints; i++ )
97  {
98  m_PointIds[i] = NumericTraits< PointIdentifier >::max();
99  }
100  }
101 
102  ~QuadraticEdgeCell() override = default;
103 
106  void EvaluateShapeFunctions(
107  const ParametricCoordArrayType & parametricCoordinates,
108  ShapeFunctionsArrayType & weights) const override;
109 
110 protected:
112  PointIdentifier m_PointIds[NumberOfPoints];
113 };
114 } // end namespace itk
115 
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkQuadraticEdgeCell.hxx"
118 #endif
119 
120 #endif
CellGeometry GetType() const override
Define numeric traits for std::vector.
An abstract interface for cells.
#define itkCellCommonTypedefs(celltype)
Represents a second order line segment for a Mesh.
typename VertexType::SelfAutoPointer VertexAutoPointer
Represents a single vertex for a Mesh.
Definition: itkVertexCell.h:39
#define itkCellVisitMacro(TopologyId)
#define itkCellInheritedTypedefs(superclassArg)