ITK  4.6.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);
113 
114  virtual CellGeometry GetType() const;
115 
117  static int GetTopologyId();
118 
119  virtual unsigned int GetDimension() const;
120 
121  virtual unsigned int GetNumberOfPoints() const;
122 
123  virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
124 
125  virtual bool GetBoundaryFeature(int dimension,
126  CellFeatureIdentifier cellId,
127  CellAutoPointer & cell);
128 
130  virtual void MakeCopy(CellAutoPointer & cell) const
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);
143 
144  virtual void SetPointIds(PointIdConstIterator first,
145  PointIdConstIterator last);
146 
147  virtual void SetPointId(int localId, PointIdentifier pId);
148 
150  {
152  return &m_PointIds[0];
153  }
154 
156  {
158  return ( &m_PointIds[1] + 1 );
159  }
160 
162  {
164  return &m_PointIds[0];
165  }
166 
168  {
170  return &m_PointIds[0];
171  }
172 
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 &); //purposely not implemented
206  void operator=(const Self &); //purposely not implemented
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
Superclass::CellFeatureIdentifier CellFeatureIdentifier
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const
CellTraits::QuadEdgeType QEType
Superclass::CellConstRawPointer CellConstRawPointer
Superclass::CellRawPointer CellRawPointer
CellTraits::PointIdInternalIterator PointIdInternalIterator
virtual void Accept(CellIdentifier cellId, MultiVisitor *mv)
Superclass::ParametricCoordArrayType ParametricCoordArrayType
Superclass::CellIdentifier CellIdentifier
static const unsigned int CellDimension
virtual PointIdInternalIterator InternalPointIdsBegin()
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier cellId, CellAutoPointer &cell)
void SetIdent(CellIdentifier cid)
QEType::PrimalDataType PrimalDataType
Superclass::PointsContainer PointsContainer
Superclass::PointIdentifier PointIdentifier
Superclass::CellAutoPointer CellAutoPointer
virtual void InternalSetPointIds(PointIdInternalConstIterator first)
virtual void SetPointId(int localId, PointIdentifier pId)
virtual PointIdConstIterator PointIdsEnd() const
Superclass::UsingCellsContainer UsingCellsContainer
virtual void SetPointIds(PointIdConstIterator first)
CellTraits::PointIdIterator PointIdIterator
virtual PointIdInternalConstIterator InternalGetPointIds() const
Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType
virtual CellGeometry GetType() const
CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator
CellTraits::PointIdConstIterator PointIdConstIterator
virtual PointIdInternalIterator InternalPointIdsEnd()
CellIdentifier GetIdent()
AutoPointer< Self > SelfAutoPointer
virtual PointIdIterator PointIdsBegin()
void operator=(const Self &)
virtual void MakeCopy(CellAutoPointer &cell) const
Superclass::CellConstAutoPointer CellConstAutoPointer
virtual unsigned int GetDimension() const
virtual PointIdIterator PointIdsEnd()
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 PointIdConstIterator GetPointIds() const
virtual PointIdConstIterator PointIdsBegin() const
static const unsigned int PointDimension
virtual unsigned int GetNumberOfPoints() const
Class that connects the QuadEdgeMesh with the Mesh.
Superclass::CellFeatureIdentifier CellFeatureCount
AutoPointer< const Self > ConstSelfAutoPointer