ITK  4.9.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 >
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();
105 
107  void SetIdent(CellIdentifier cid);
108 
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  {
152  return &m_PointIds[0];
153  }
154 
155  virtual PointIdIterator PointIdsEnd() ITK_OVERRIDE
156  {
158  return ( &m_PointIds[1] + 1 );
159  }
160 
161  virtual PointIdConstIterator GetPointIds() const ITK_OVERRIDE
162  {
164  return &m_PointIds[0];
165  }
166 
167  virtual PointIdConstIterator PointIdsBegin() const ITK_OVERRIDE
168  {
170  return &m_PointIds[0];
171  }
172 
173  virtual PointIdConstIterator PointIdsEnd() const ITK_OVERRIDE
174  {
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 
189 
190  virtual void InternalSetPointIds(
193 
195 
197 
199 
201 
203 
204 private:
205  QuadEdgeMeshLineCell(const Self &) ITK_DELETE_FUNCTION;
206  void operator=(const Self &) ITK_DELETE_FUNCTION;
207 
215 };
216 } // end namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkQuadEdgeMeshLineCell.hxx"
220 #endif
221 
222 #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
static const unsigned int CellDimension
virtual PointIdInternalIterator InternalPointIdsBegin()
virtual CellGeometry GetType() const override
void SetIdent(CellIdentifier cid)
QEType::PrimalDataType PrimalDataType
Superclass::PointsContainer PointsContainer
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override
Superclass::PointIdentifier PointIdentifier
Superclass::CellAutoPointer CellAutoPointer
virtual void InternalSetPointIds(PointIdInternalConstIterator first)
virtual PointIdConstIterator PointIdsBegin() const override
virtual unsigned int GetDimension() const override
Superclass::UsingCellsContainer UsingCellsContainer
CellTraits::PointIdIterator PointIdIterator
virtual PointIdInternalConstIterator InternalGetPointIds() const
Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType
virtual unsigned int GetNumberOfPoints() const override
CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator
virtual void MakeCopy(CellAutoPointer &cell) const override
CellTraits::PointIdConstIterator PointIdConstIterator
virtual void SetPointIds(PointIdConstIterator first) override
virtual PointIdInternalIterator InternalPointIdsEnd()
CellIdentifier GetIdent()
AutoPointer< Self > SelfAutoPointer
virtual PointIdConstIterator GetPointIds() const override
virtual void Accept(CellIdentifier cellId, MultiVisitor *mv) override
Superclass::CellConstAutoPointer CellConstAutoPointer
QEType::DualOriginRefType FaceRefType
QEType::OriginRefType VertexRefType
Superclass::InterpolationWeightType InterpolationWeightType
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier cellId, CellAutoPointer &cell) override
Superclass::CellTraits CellTraits
Implements an Automatic Pointer to an object.
QEType::DualDataType DualDataType
Superclass::CellGeometry CellGeometry
Superclass::PointType PointType
virtual PointIdIterator PointIdsEnd() override
static const unsigned int PointDimension
Class that connects the QuadEdgeMesh with the Mesh.
Superclass::CellFeatureIdentifier CellFeatureCount
AutoPointer< const Self > ConstSelfAutoPointer
virtual void SetPointId(int localId, PointIdentifier pId) override