ITK  5.2.0
Insight Toolkit
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  * 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 itkQuadEdgeMeshLineCell_h
19 #define itkQuadEdgeMeshLineCell_h
20 
21 #include "itkAutoPointer.h"
22 #include "itkGeometricalQuadEdge.h"
23 
24 namespace itk
25 {
38 template <typename TCellInterface>
39 class ITK_TEMPLATE_EXPORT QuadEdgeMeshLineCell
40  : public TCellInterface
41  , public TCellInterface::CellTraits::QuadEdgeType
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(QuadEdgeMeshLineCell);
45 
47  // itkCellCommonTypedefs
51  using RawPointer = Self *;
52  using ConstRawPointer = const Self *;
53 
54  // itkCellInheritedTypedefs
55  using Superclass = TCellInterface;
56  using PixelType = typename Superclass::PixelType;
57  using CellType = typename Superclass::CellType;
58  using CellAutoPointer = typename Superclass::CellAutoPointer;
59  using CellConstAutoPointer = typename Superclass::CellConstAutoPointer;
60  using CellRawPointer = typename Superclass::CellRawPointer;
61  using CellConstRawPointer = typename Superclass::CellConstRawPointer;
62  using CellTraits = typename Superclass::CellTraits;
63  using CoordRepType = typename Superclass::CoordRepType;
64  using InterpolationWeightType = typename Superclass::InterpolationWeightType;
65  using PointIdentifier = typename Superclass::PointIdentifier;
66  using CellIdentifier = typename Superclass::CellIdentifier;
67  using CellFeatureIdentifier = typename Superclass::CellFeatureIdentifier;
68  using CellFeatureCount = typename Superclass::CellFeatureIdentifier;
69  using PointType = typename Superclass::PointType;
70  using PointsContainer = typename Superclass::PointsContainer;
71  using UsingCellsContainer = typename Superclass::UsingCellsContainer;
72  using ParametricCoordArrayType = typename Superclass::ParametricCoordArrayType;
73  using ShapeFunctionsArrayType = typename Superclass::ShapeFunctionsArrayType;
74  static constexpr unsigned int PointDimension = Superclass::PointDimension;
75  static constexpr unsigned int CellDimension = 2;
76 
78  using MultiVisitor = typename CellType::MultiVisitor;
79 
81  using PointIdIterator = typename CellTraits::PointIdIterator;
82  using PointIdConstIterator = typename CellTraits::PointIdConstIterator;
83  using PointIdInternalIterator = typename CellTraits::PointIdInternalIterator;
84  using PointIdInternalConstIterator = typename CellTraits::PointIdInternalConstIterator;
85 
87  using QEType = typename CellTraits::QuadEdgeType;
88  using VertexRefType = typename QEType::OriginRefType;
89  using FaceRefType = typename QEType::DualOriginRefType;
90  using PrimalDataType = typename QEType::PrimalDataType;
91  using DualDataType = typename QEType::DualDataType;
92  using QEDual = typename QEType::DualType;
93 
94 public:
96  itkTypeMacro(QuadEdgeMeshLineCell, TCellInterface);
97 
98  // accessor to the new QEGeom link that replaces now inheritance.
99  QEType *
100  GetQEGeom() const
101  {
102  return (m_QuadEdgeGeom);
103  }
104 
105 public:
108  ~QuadEdgeMeshLineCell() override;
110 
112  void
113  SetIdent(CellIdentifier cid);
114 
115  CellIdentifier
116  GetIdent();
117 
119  void
120  Accept(CellIdentifier cellId, MultiVisitor * mv) override;
121 
123  GetType() const override;
124 
126  static constexpr CellGeometryEnum
128  {
130  }
131 
132  unsigned int
133  GetDimension() const override;
134 
135  unsigned int
136  GetNumberOfPoints() const override;
137 
138  CellFeatureCount
139  GetNumberOfBoundaryFeatures(int dimension) const override;
140 
141  bool
142  GetBoundaryFeature(int dimension, CellFeatureIdentifier cellId, CellAutoPointer & cell) override;
143 
145  void
146  MakeCopy(CellAutoPointer & cell) const override
147  {
148  cell.TakeOwnership(new Self);
149  cell->SetPointId(0, this->GetQEGeom()->GetOrigin());
150  cell->SetPointId(1, this->GetQEGeom()->GetDestination());
151  }
153 
158  void
159  SetPointIds(PointIdConstIterator first) override;
160 
161  void
162  SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
163 
164  void
165  SetPointId(int localId, PointIdentifier pId) override;
166 
167  PointIdIterator
168  PointIdsBegin() override
169  {
170  SynchronizePointsAPI();
171  return &m_PointIds[0];
172  }
173 
174  PointIdIterator
175  PointIdsEnd() override
176  {
177  SynchronizePointsAPI();
178  return (&m_PointIds[1] + 1);
179  }
180 
181  PointIdConstIterator
182  GetPointIds() const override
183  {
184  SynchronizePointsAPI();
185  return &m_PointIds[0];
186  }
187 
188  PointIdConstIterator
189  PointIdsBegin() const override
190  {
191  SynchronizePointsAPI();
192  return &m_PointIds[0];
193  }
194 
195  PointIdConstIterator
196  PointIdsEnd() const override
197  {
198  SynchronizePointsAPI();
199  return (&m_PointIds[1] + 1);
200  }
201 
203  void
205  {
206  m_PointIds[0] = GetQEGeom()->GetOrigin();
207  m_PointIds[1] = GetQEGeom()->GetDestination();
208  }
210 
212  virtual void
213  InternalSetPointIds(PointIdInternalConstIterator first);
214 
215  virtual void
216  InternalSetPointIds(PointIdInternalConstIterator first, PointIdInternalConstIterator last);
217 
218  virtual PointIdInternalIterator
219  InternalPointIdsBegin();
220 
221  virtual PointIdInternalIterator
222  InternalPointIdsEnd();
223 
224  virtual PointIdInternalConstIterator
225  InternalGetPointIds() const;
226 
227  virtual PointIdInternalConstIterator
228  InternalPointIdsBegin() const;
229 
230  virtual PointIdInternalConstIterator
231  InternalPointIdsEnd() const;
232 
233 private:
240  mutable PointIdentifier m_PointIds[2];
241 };
242 } // end namespace itk
243 
244 #ifndef ITK_MANUAL_INSTANTIATION
245 # include "itkQuadEdgeMeshLineCell.hxx"
246 #endif
247 
248 #endif
itk::AutoPointer
Implements an Automatic Pointer to an object.
Definition: itkAutoPointer.h:46
itk::QuadEdgeMeshLineCell::PointIdentifier
typename Superclass::PointIdentifier PointIdentifier
Definition: itkQuadEdgeMeshLineCell.h:65
itk::QuadEdgeMeshLineCell::CellRawPointer
typename Superclass::CellRawPointer CellRawPointer
Definition: itkQuadEdgeMeshLineCell.h:60
itk::QuadEdgeMeshLineCell::CellConstRawPointer
typename Superclass::CellConstRawPointer CellConstRawPointer
Definition: itkQuadEdgeMeshLineCell.h:61
itk::QuadEdgeMeshLineCell::PointIdIterator
typename CellTraits::PointIdIterator PointIdIterator
Definition: itkQuadEdgeMeshLineCell.h:81
itk::QuadEdgeMeshLineCell::CellAutoPointer
typename Superclass::CellAutoPointer CellAutoPointer
Definition: itkQuadEdgeMeshLineCell.h:58
itk::CommonEnums::CellGeometry::LINE_CELL
itkAutoPointer.h
itk::QuadEdgeMeshLineCell::m_Identifier
CellIdentifier m_Identifier
Definition: itkQuadEdgeMeshLineCell.h:238
itk::QuadEdgeMeshLineCell::CellIdentifier
typename Superclass::CellIdentifier CellIdentifier
Definition: itkQuadEdgeMeshLineCell.h:66
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::QuadEdgeMeshLineCell::CoordRepType
typename Superclass::CoordRepType CoordRepType
Definition: itkQuadEdgeMeshLineCell.h:63
itkGeometricalQuadEdge.h
itk::QuadEdgeMeshLineCell::PointsContainer
typename Superclass::PointsContainer PointsContainer
Definition: itkQuadEdgeMeshLineCell.h:70
itk::QuadEdgeMeshLineCell::GetQEGeom
QEType * GetQEGeom() const
Definition: itkQuadEdgeMeshLineCell.h:100
itk::QuadEdgeMeshLineCell::ParametricCoordArrayType
typename Superclass::ParametricCoordArrayType ParametricCoordArrayType
Definition: itkQuadEdgeMeshLineCell.h:72
itk::QuadEdgeMeshLineCell::PointIdsBegin
PointIdConstIterator PointIdsBegin() const override
Definition: itkQuadEdgeMeshLineCell.h:189
itk::QuadEdgeMeshLineCell::SynchronizePointsAPI
void SynchronizePointsAPI() const
Definition: itkQuadEdgeMeshLineCell.h:204
itk::QuadEdgeMeshLineCell::PrimalDataType
typename QEType::PrimalDataType PrimalDataType
Definition: itkQuadEdgeMeshLineCell.h:90
itk::QuadEdgeMeshLineCell::InterpolationWeightType
typename Superclass::InterpolationWeightType InterpolationWeightType
Definition: itkQuadEdgeMeshLineCell.h:64
itk::QuadEdgeMeshLineCell::PointIdConstIterator
typename CellTraits::PointIdConstIterator PointIdConstIterator
Definition: itkQuadEdgeMeshLineCell.h:82
itk::QuadEdgeMeshLineCell::MakeCopy
void MakeCopy(CellAutoPointer &cell) const override
Definition: itkQuadEdgeMeshLineCell.h:146
itk::QuadEdgeMeshLineCell::UsingCellsContainer
typename Superclass::UsingCellsContainer UsingCellsContainer
Definition: itkQuadEdgeMeshLineCell.h:71
itk::QuadEdgeMeshLineCell
Class that connects the QuadEdgeMesh with the Mesh.
Definition: itkQuadEdgeMeshLineCell.h:39
itk::QuadEdgeMeshLineCell::PointIdsEnd
PointIdConstIterator PointIdsEnd() const override
Definition: itkQuadEdgeMeshLineCell.h:196
itk::QuadEdgeMeshLineCell::QEDual
typename QEType::DualType QEDual
Definition: itkQuadEdgeMeshLineCell.h:92
itk::QuadEdgeMeshLineCell::GetPointIds
PointIdConstIterator GetPointIds() const override
Definition: itkQuadEdgeMeshLineCell.h:182
itk::QuadEdgeMeshLineCell::PointIdInternalConstIterator
typename CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator
Definition: itkQuadEdgeMeshLineCell.h:84
itk::CommonEnums::CellGeometry
CellGeometry
Definition: itkCommonEnums.h:138
itk::QuadEdgeMeshLineCell::GetTopologyId
static constexpr CellGeometryEnum GetTopologyId()
Definition: itkQuadEdgeMeshLineCell.h:127
itk::QuadEdgeMeshLineCell::CellFeatureCount
typename Superclass::CellFeatureIdentifier CellFeatureCount
Definition: itkQuadEdgeMeshLineCell.h:68
itk::QuadEdgeMeshLineCell::CellType
typename Superclass::CellType CellType
Definition: itkQuadEdgeMeshLineCell.h:57
itk::QuadEdgeMeshLineCell::Superclass
TCellInterface Superclass
Definition: itkQuadEdgeMeshLineCell.h:55
itk::QuadEdgeMeshLineCell::MultiVisitor
typename CellType::MultiVisitor MultiVisitor
Definition: itkQuadEdgeMeshLineCell.h:78
itk::QuadEdgeMeshLineCell::VertexRefType
typename QEType::OriginRefType VertexRefType
Definition: itkQuadEdgeMeshLineCell.h:88
itk::QuadEdgeMeshLineCell::CellConstAutoPointer
typename Superclass::CellConstAutoPointer CellConstAutoPointer
Definition: itkQuadEdgeMeshLineCell.h:59
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::QuadEdgeMeshLineCell::CellFeatureIdentifier
typename Superclass::CellFeatureIdentifier CellFeatureIdentifier
Definition: itkQuadEdgeMeshLineCell.h:67
itk::QuadEdgeMeshLineCell::FaceRefType
typename QEType::DualOriginRefType FaceRefType
Definition: itkQuadEdgeMeshLineCell.h:89
itk::QuadEdgeMeshLineCell::PointIdsEnd
PointIdIterator PointIdsEnd() override
Definition: itkQuadEdgeMeshLineCell.h:175
itk::QuadEdgeMeshLineCell::PointType
typename Superclass::PointType PointType
Definition: itkQuadEdgeMeshLineCell.h:69
itk::QuadEdgeMeshLineCell::DualDataType
typename QEType::DualDataType DualDataType
Definition: itkQuadEdgeMeshLineCell.h:91
itk::QuadEdgeMeshLineCell::m_QuadEdgeGeom
QEType * m_QuadEdgeGeom
Definition: itkQuadEdgeMeshLineCell.h:239
itk::QuadEdgeMeshLineCell::PointIdsBegin
PointIdIterator PointIdsBegin() override
Definition: itkQuadEdgeMeshLineCell.h:168
itk::QuadEdgeMeshLineCell::CellTraits
typename Superclass::CellTraits CellTraits
Definition: itkQuadEdgeMeshLineCell.h:62
itk::QuadEdgeMeshLineCell::PointIdInternalIterator
typename CellTraits::PointIdInternalIterator PointIdInternalIterator
Definition: itkQuadEdgeMeshLineCell.h:83
itk::QuadEdgeMeshLineCell::QEType
typename CellTraits::QuadEdgeType QEType
Definition: itkQuadEdgeMeshLineCell.h:87
itk::QuadEdgeMeshLineCell::ShapeFunctionsArrayType
typename Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType
Definition: itkQuadEdgeMeshLineCell.h:73
itk::QuadEdgeMeshLineCell::PixelType
typename Superclass::PixelType PixelType
Definition: itkQuadEdgeMeshLineCell.h:56