ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkQuadEdgeMeshLineCell.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 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, public TCellInterface::CellTraits::QuadEdgeType
41 {
42 public:
43 
45  // itkCellCommonTypedefs
49  typedef Self * RawPointer;
50  typedef const Self * ConstRawPointer;
51 
52  // itkCellInheritedTypedefs
53  typedef TCellInterface Superclass;
54  typedef typename Superclass::PixelType PixelType;
55  typedef typename Superclass::CellType CellType;
56  typedef typename Superclass::CellAutoPointer CellAutoPointer;
57  typedef typename Superclass::CellConstAutoPointer CellConstAutoPointer;
58  typedef typename Superclass::CellRawPointer CellRawPointer;
59  typedef typename Superclass::CellConstRawPointer CellConstRawPointer;
60  typedef typename Superclass::CellTraits CellTraits;
61  typedef typename Superclass::CoordRepType CoordRepType;
62  typedef typename Superclass::InterpolationWeightType InterpolationWeightType;
63  typedef typename Superclass::PointIdentifier PointIdentifier;
64  typedef typename Superclass::CellIdentifier CellIdentifier;
65  typedef typename Superclass::CellFeatureIdentifier CellFeatureIdentifier;
66  typedef typename Superclass::CellFeatureIdentifier CellFeatureCount;
67  typedef typename Superclass::PointType PointType;
68  typedef typename Superclass::PointsContainer PointsContainer;
69  typedef typename Superclass::UsingCellsContainer UsingCellsContainer;
70  typedef typename Superclass::CellGeometry CellGeometry;
71  typedef typename Superclass::ParametricCoordArrayType ParametricCoordArrayType;
72  typedef typename Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType;
73  itkStaticConstMacro(PointDimension, unsigned int, Superclass::PointDimension);
74  itkStaticConstMacro(CellDimension, unsigned int, 2);
75 
77  typedef typename CellType::MultiVisitor MultiVisitor;
78 
80  typedef typename CellTraits::PointIdIterator PointIdIterator;
81  typedef typename CellTraits::PointIdConstIterator PointIdConstIterator;
82  typedef typename CellTraits::PointIdInternalIterator PointIdInternalIterator;
83  typedef typename CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator;
84 
86  typedef typename CellTraits::QuadEdgeType QEType;
87  typedef typename QEType::OriginRefType VertexRefType;
88  typedef typename QEType::DualOriginRefType FaceRefType;
89  typedef typename QEType::PrimalDataType PrimalDataType;
90  typedef typename QEType::DualDataType DualDataType;
91  typedef typename QEType::DualType QEDual;
92 
93 public:
95  itkTypeMacro(QuadEdgeMeshLineCell, TCellInterface);
96 
97  // accessor to the new QEGeom link that replaces now inheritance.
98  QEType * GetQEGeom() const { return ( m_QuadEdgeGeom ); }
99 
100 public:
103  virtual ~QuadEdgeMeshLineCell() ITK_OVERRIDE;
105 
107  void SetIdent(CellIdentifier cid);
108 
109  CellIdentifier GetIdent();
110 
112  virtual void Accept(CellIdentifier cellId, MultiVisitor *mv) ITK_OVERRIDE;
113 
114  virtual CellGeometry GetType() const ITK_OVERRIDE;
115 
117  static int GetTopologyId();
118 
119  virtual unsigned int GetDimension() const ITK_OVERRIDE;
120 
121  virtual unsigned int GetNumberOfPoints() const ITK_OVERRIDE;
122 
123  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const ITK_OVERRIDE;
124 
125  virtual bool GetBoundaryFeature(int dimension,
126  CellFeatureIdentifier cellId,
127  CellAutoPointer & cell) ITK_OVERRIDE;
128 
130  virtual void MakeCopy(CellAutoPointer & cell) const ITK_OVERRIDE
131  {
132  cell.TakeOwnership(new Self);
133  cell->SetPointId( 0, this->GetQEGeom()->GetOrigin() );
134  cell->SetPointId( 1, this->GetQEGeom()->GetDestination() );
135  }
137 
142  virtual void SetPointIds(PointIdConstIterator first) ITK_OVERRIDE;
143 
144  virtual void SetPointIds(PointIdConstIterator first,
145  PointIdConstIterator last) ITK_OVERRIDE;
146 
147  virtual void SetPointId(int localId, PointIdentifier pId) ITK_OVERRIDE;
148 
149  virtual PointIdIterator PointIdsBegin() ITK_OVERRIDE
150  {
151  SynchronizePointsAPI();
152  return &m_PointIds[0];
153  }
154 
155  virtual PointIdIterator PointIdsEnd() ITK_OVERRIDE
156  {
157  SynchronizePointsAPI();
158  return ( &m_PointIds[1] + 1 );
159  }
160 
161  virtual PointIdConstIterator GetPointIds() const ITK_OVERRIDE
162  {
163  SynchronizePointsAPI();
164  return &m_PointIds[0];
165  }
166 
167  virtual PointIdConstIterator PointIdsBegin() const ITK_OVERRIDE
168  {
169  SynchronizePointsAPI();
170  return &m_PointIds[0];
171  }
172 
173  virtual PointIdConstIterator PointIdsEnd() const ITK_OVERRIDE
174  {
175  SynchronizePointsAPI();
176  return ( &m_PointIds[1] + 1 );
177  }
178 
180  void SynchronizePointsAPI() const
181  {
182  m_PointIds[0] = GetQEGeom()->GetOrigin();
183  m_PointIds[1] = GetQEGeom()->GetDestination();
184  }
186 
188  virtual void InternalSetPointIds(PointIdInternalConstIterator first);
189 
190  virtual void InternalSetPointIds(
191  PointIdInternalConstIterator first,
192  PointIdInternalConstIterator last);
193 
194  virtual PointIdInternalIterator InternalPointIdsBegin();
195 
196  virtual PointIdInternalIterator InternalPointIdsEnd();
197 
198  virtual PointIdInternalConstIterator InternalGetPointIds() const;
199 
200  virtual PointIdInternalConstIterator InternalPointIdsBegin() const;
201 
202  virtual PointIdInternalConstIterator InternalPointIdsEnd() const;
203 
204 private:
205  ITK_DISALLOW_COPY_AND_ASSIGN(QuadEdgeMeshLineCell);
206 
213  mutable PointIdentifier m_PointIds[2];
214 };
215 } // end namespace itk
216 
217 #ifndef ITK_MANUAL_INSTANTIATION
218 #include "itkQuadEdgeMeshLineCell.hxx"
219 #endif
220 
221 #endif
CellType::MultiVisitor MultiVisitor
Superclass::CoordRepType CoordRepType
Superclass::PixelType PixelType
virtual PointIdConstIterator PointIdsEnd() const override
Superclass::CellFeatureIdentifier CellFeatureIdentifier
CellTraits::QuadEdgeType QEType
Superclass::CellConstRawPointer CellConstRawPointer
virtual PointIdIterator PointIdsBegin() override
Superclass::CellRawPointer CellRawPointer
CellTraits::PointIdInternalIterator PointIdInternalIterator
Superclass::ParametricCoordArrayType ParametricCoordArrayType
Superclass::CellIdentifier CellIdentifier
QEType::PrimalDataType PrimalDataType
Superclass::PointsContainer PointsContainer
Superclass::PointIdentifier PointIdentifier
Superclass::CellAutoPointer CellAutoPointer
virtual PointIdConstIterator PointIdsBegin() const override
Superclass::UsingCellsContainer UsingCellsContainer
CellTraits::PointIdIterator PointIdIterator
Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType
CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator
CellTraits::PointIdConstIterator PointIdConstIterator
AutoPointer< Self > SelfAutoPointer
virtual PointIdConstIterator GetPointIds() const override
Superclass::CellConstAutoPointer CellConstAutoPointer
QEType::DualOriginRefType FaceRefType
QEType::OriginRefType VertexRefType
Superclass::InterpolationWeightType InterpolationWeightType
Superclass::CellTraits CellTraits
Implements an Automatic Pointer to an object.
QEType::DualDataType DualDataType
Superclass::CellGeometry CellGeometry
Superclass::PointType PointType
virtual PointIdIterator PointIdsEnd() override
Class that connects the QuadEdgeMesh with the Mesh.
Superclass::CellFeatureIdentifier CellFeatureCount
AutoPointer< const Self > ConstSelfAutoPointer
virtual void SetPointId(int localId, PointIdentifier pId) override