ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkQuadEdgeMeshLineCell.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 * https://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 itkQuadEdgeMeshLineCell_h
19#define itkQuadEdgeMeshLineCell_h
20
21#include "itkAutoPointer.h"
22#include "itkMesh.h"
24#include "itkCommonEnums.h"
25
26namespace itk
27{
40template <typename TCellInterface>
41class ITK_TEMPLATE_EXPORT QuadEdgeMeshLineCell
42 : public TCellInterface
43 , public TCellInterface::CellTraits::QuadEdgeType
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(QuadEdgeMeshLineCell);
47
49 // itkCellCommonTypedefs
53 using RawPointer = Self *;
54 using ConstRawPointer = const Self *;
55
56 // itkCellInheritedTypedefs
57 using Superclass = TCellInterface;
58 using typename Superclass::PixelType;
59 using CellType = typename Superclass::CellType;
60 using typename Superclass::CellAutoPointer;
61 using typename Superclass::CellConstAutoPointer;
62 using typename Superclass::CellRawPointer;
63 using typename Superclass::CellConstRawPointer;
64 using CellTraits = typename Superclass::CellTraits;
65 using typename Superclass::CoordinateType;
66 using typename Superclass::InterpolationWeightType;
67 using typename Superclass::PointIdentifier;
68 using typename Superclass::CellIdentifier;
69 using typename Superclass::CellFeatureIdentifier;
70 using CellFeatureCount = typename Superclass::CellFeatureIdentifier;
71 using typename Superclass::PointType;
72 using typename Superclass::PointsContainer;
73 using typename Superclass::UsingCellsContainer;
74 using typename Superclass::ParametricCoordArrayType;
75 using typename Superclass::ShapeFunctionsArrayType;
76 static constexpr unsigned int PointDimension = Superclass::PointDimension;
77 static constexpr unsigned int CellDimension = 2;
78
80 using MultiVisitor = typename CellType::MultiVisitor;
81
83 using PointIdIterator = typename CellTraits::PointIdIterator;
84 using PointIdConstIterator = typename CellTraits::PointIdConstIterator;
85 using PointIdInternalIterator = typename CellTraits::PointIdInternalIterator;
86 using PointIdInternalConstIterator = typename CellTraits::PointIdInternalConstIterator;
87
89 using QEType = typename CellTraits::QuadEdgeType;
90 using VertexRefType = typename QEType::OriginRefType;
91 using FaceRefType = typename QEType::DualOriginRefType;
92 using PrimalDataType = typename QEType::PrimalDataType;
93 using DualDataType = typename QEType::DualDataType;
94 using QEDual = typename QEType::DualType;
95
96public:
98 itkOverrideGetNameOfClassMacro(QuadEdgeMeshLineCell);
99
100 // accessor to the new QEGeom link that replaces now inheritance.
101 QEType *
102 GetQEGeom() const
103 {
104 return (m_QuadEdgeGeom);
105 }
106
107public:
112
114 void
115 SetIdent(CellIdentifier cid);
116
117 CellIdentifier
119
121 void
122 Accept(CellIdentifier cellId, MultiVisitor * mv) override;
123
125 GetType() const override;
126
128 static constexpr CellGeometryEnum
130 {
131 return CellGeometryEnum::LINE_CELL;
132 }
133
134 unsigned int
135 GetDimension() const override;
136
137 unsigned int
138 GetNumberOfPoints() const override;
139
141 GetNumberOfBoundaryFeatures(int dimension) const override;
142
143 bool
144 GetBoundaryFeature(int dimension, CellFeatureIdentifier cellId, CellAutoPointer & cell) override;
145
147 void
148 MakeCopy(CellAutoPointer & cell) const override
149 {
150 cell.TakeOwnership(new Self);
151 cell->SetPointId(0, this->GetQEGeom()->GetOrigin());
152 cell->SetPointId(1, this->GetQEGeom()->GetDestination());
153 }
154
155
160 void
162
163 void
165
166 void
167 SetPointId(int localId, PointIdentifier pId) override;
168
170 PointIdsBegin() override
171 {
173 return &m_PointIds[0];
174 }
175
176 PointIdIterator
177 PointIdsEnd() override
178 {
180 return (&m_PointIds[1] + 1);
181 }
182
183 PointIdConstIterator
184 GetPointIds() const override
185 {
187 return &m_PointIds[0];
188 }
189
190 PointIdConstIterator
191 PointIdsBegin() const override
192 {
194 return &m_PointIds[0];
195 }
196
197 PointIdConstIterator
198 PointIdsEnd() const override
199 {
201 return (&m_PointIds[1] + 1);
202 }
203
205 void
207 {
208 m_PointIds[0] = GetQEGeom()->GetOrigin();
209 m_PointIds[1] = GetQEGeom()->GetDestination();
210 }
211
212
214 virtual void
216
217 virtual void
219
222
225
228
231
234
235private:
240 CellIdentifier m_Identifier{};
242 mutable PointIdentifier m_PointIds[2]{};
243};
244} // end namespace itk
245
246#ifndef ITK_MANUAL_INSTANTIATION
247# include "itkQuadEdgeMeshLineCell.hxx"
248#endif
249
250#endif
Implements an Automatic Pointer to an object.
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override
typename CellTraits::PointIdIterator PointIdIterator
void SetPointIds(PointIdConstIterator first) override
unsigned int GetNumberOfPoints() const override
void MakeCopy(CellAutoPointer &cell) const override
static constexpr CellGeometryEnum GetTopologyId()
typename Superclass::CellTraits CellTraits
typename CellTraits::PointIdInternalIterator PointIdInternalIterator
typename QEType::DualDataType DualDataType
PointIdIterator PointIdsBegin() override
CellGeometryEnum GetType() const override
PointIdIterator PointIdsEnd() override
unsigned int GetDimension() const override
virtual PointIdInternalConstIterator InternalPointIdsEnd() const
static constexpr unsigned int CellDimension
static constexpr unsigned int PointDimension
typename CellTraits::QuadEdgeType QEType
PointIdConstIterator PointIdsEnd() const override
virtual PointIdInternalIterator InternalPointIdsEnd()
void SetPointId(int localId, PointIdentifier pId) override
virtual void InternalSetPointIds(PointIdInternalConstIterator first)
typename Superclass::CellFeatureIdentifier CellFeatureCount
PointIdConstIterator PointIdsBegin() const override
virtual PointIdInternalIterator InternalPointIdsBegin()
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
typename QEType::PrimalDataType PrimalDataType
CellIdentifier GetIdent()
typename CellTraits::PointIdConstIterator PointIdConstIterator
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier cellId, CellAutoPointer &cell) override
virtual PointIdInternalConstIterator InternalGetPointIds() const
typename QEType::DualOriginRefType FaceRefType
typename CellType::MultiVisitor MultiVisitor
virtual void InternalSetPointIds(PointIdInternalConstIterator first, PointIdInternalConstIterator last)
PointIdConstIterator GetPointIds() const override
typename QEType::OriginRefType VertexRefType
void SetIdent(CellIdentifier cid)
typename CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator
void Accept(CellIdentifier cellId, MultiVisitor *mv) override
virtual PointIdInternalConstIterator InternalPointIdsBegin() const
~QuadEdgeMeshLineCell() override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
CommonEnums::CellGeometry CellGeometryEnum