18 #ifndef __itkQuadEdgeMeshToQuadEdgeMeshFilter_h
19 #define __itkQuadEdgeMeshToQuadEdgeMeshFilter_h
35 template<
typename TInputMesh,
typename TOutputMesh >
59 typedef typename InputPointDataContainer::ConstPointer
61 typedef typename InputMeshType::PointsContainerConstIterator
63 typedef typename InputMeshType::PointsContainerConstPointer
65 typedef typename InputMeshType::CellsContainerConstIterator
67 typedef typename InputMeshType::CellsContainerConstPointer
74 typedef typename InputCellTraits::PointIdInternalIterator
89 typedef typename OutputMeshType::PointsContainerIterator
91 typedef typename OutputMeshType::PointsContainerPointer
93 typedef typename OutputMeshType::PointsContainerConstPointer
133 template<
typename TInputMesh,
typename TOutputMesh >
144 template<
typename TInputMesh,
typename TOutputMesh >
147 typedef typename TInputMesh::CellDataContainer InputCellDataContainer;
148 typedef typename TOutputMesh::CellDataContainer OutputCellDataContainer;
149 typedef typename InputCellDataContainer::ConstPointer InputCellDataContainerConstPointer;
150 typedef typename OutputCellDataContainer::Pointer OutputCellDataContainerPointer;
152 InputCellDataContainerConstPointer inputCellData = in->GetCellData();
154 if ( inputCellData.IsNull() )
160 OutputCellDataContainerPointer outputCellData = OutputCellDataContainer::New();
161 outputCellData->Reserve( inputCellData->Size() );
164 typedef typename InputCellDataContainer::ConstIterator InputCellDataContainerConstIterator;
165 InputCellDataContainerConstIterator inIt = inputCellData->Begin();
166 while ( inIt != inputCellData->End() )
168 outputCellData->SetElement( inIt.Index(), inIt.Value() );
172 out->SetCellData(outputCellData);
176 template<
typename TInputMesh,
typename TOutputMesh >
179 typedef typename TOutputMesh::PointDataContainer OutputPointDataContainer;
180 typedef typename OutputPointDataContainer::Pointer OutputPointDataContainerPointer;
181 typedef typename TInputMesh::PointDataContainer InputPointDataContainer;
183 const InputPointDataContainer *inputPointData = in->GetPointData();
185 if ( inputPointData == ITK_NULLPTR )
191 OutputPointDataContainerPointer outputPointData = OutputPointDataContainer::New();
192 outputPointData->Reserve( inputPointData->Size() );
195 typedef typename InputPointDataContainer::ConstIterator InputPointDataContainerConstIterator;
196 InputPointDataContainerConstIterator inIt = inputPointData->Begin();
197 while ( inIt != inputPointData->End() )
199 outputPointData->SetElement( inIt.Index(), inIt.Value() );
203 out->SetPointData(outputPointData);
207 template<
typename TInputMesh,
typename TOutputMesh >
211 typedef typename TInputMesh::CellsContainer InputCellsContainer;
212 typedef typename InputCellsContainer::ConstPointer InputCellsContainerConstPointer;
213 typedef typename InputCellsContainer::ConstIterator InputCellsContainerConstIterator;
214 typedef typename TInputMesh::PolygonCellType InputPolygonCellType;
215 typedef typename TInputMesh::PointIdList InputPointIdList;
216 typedef typename TInputMesh::CellTraits InputCellTraits;
217 typedef typename InputCellTraits::PointIdInternalIterator
218 InputPointsIdInternalIterator;
220 out->SetCellsAllocationMethod(TOutputMesh::CellsAllocatedDynamicallyCellByCell);
222 InputCellsContainerConstPointer inCells = in->GetCells();
226 InputCellsContainerConstIterator cIt = inCells->Begin();
227 InputCellsContainerConstIterator cEnd = inCells->End();
228 while ( cIt != cEnd )
230 InputPolygonCellType *pe =
dynamic_cast< InputPolygonCellType *
>( cIt.Value() );
233 InputPointIdList points;
234 InputPointsIdInternalIterator pIt = pe->InternalPointIdsBegin();
235 InputPointsIdInternalIterator pEnd = pe->InternalPointIdsEnd();
237 while ( pIt != pEnd )
239 points.push_back( ( *pIt ) );
242 out->AddFaceWithSecurePointList(points,
false);
250 template<
typename TInputMesh,
typename TOutputMesh >
254 typedef typename TInputMesh::CellsContainer InputCellsContainer;
255 typedef typename InputCellsContainer::ConstPointer InputCellsContainerConstPointer;
256 typedef typename InputCellsContainer::ConstIterator InputCellsContainerConstIterator;
257 typedef typename TInputMesh::EdgeCellType InputEdgeCellType;
259 InputCellsContainerConstPointer inEdgeCells = in->GetEdgeCells();
263 InputCellsContainerConstIterator ecIt = inEdgeCells->Begin();
264 InputCellsContainerConstIterator ecEnd = inEdgeCells->End();
266 while ( ecIt != ecEnd )
268 InputEdgeCellType *pe =
dynamic_cast< InputEdgeCellType *
>( ecIt.Value() );
271 out->AddEdgeWithSecurePointList( pe->GetQEGeom()->GetOrigin(),
272 pe->GetQEGeom()->GetDestination() );
280 template<
typename TInputMesh,
typename TOutputMesh >
284 typedef typename TInputMesh::PointsContainerConstPointer InputPointsContainerConstPointer;
285 typedef typename TInputMesh::PointsContainerConstIterator InputPointsContainerConstIterator;
287 typedef typename TOutputMesh::PointsContainer OutputPointsContainer;
288 typedef typename TOutputMesh::PointsContainerPointer OutputPointsContainerPointer;
289 typedef typename TOutputMesh::PointType OutputPointType;
291 InputPointsContainerConstPointer inPoints = in->GetPoints();
295 InputPointsContainerConstIterator inIt = inPoints->Begin();
296 InputPointsContainerConstIterator inEnd = inPoints->End();
298 OutputPointsContainerPointer oPoints = out->GetPoints();
299 if( oPoints.IsNull() )
301 oPoints = OutputPointsContainer::New();
302 out->SetPoints( oPoints );
304 OutputPointType pOut;
306 while ( inIt != inEnd )
308 pOut.CastFrom( inIt.Value() );
309 oPoints->InsertElement(inIt.Index(), pOut);
316 #ifndef ITK_MANUAL_INSTANTIATION
317 #include "itkQuadEdgeMeshToQuadEdgeMeshFilter.hxx"
InputMeshType::PointIdentifier InputPointIdentifier
void CopyMeshToMeshCells(const TInputMesh *in, TOutputMesh *out)
TOutputMesh OutputMeshType
void operator=(const Self &)
OutputQEPrimal::IteratorGeom OutputQEIterator
InputMeshType::CellsContainerConstPointer InputCellsContainerConstPointer
virtual void CopyInputMeshToOutputMeshCellData()
InputMeshType::PointIdList InputPointIdList
Light weight base class for most itk classes.
OutputMeshType::ConstPointer OutputMeshConstPointer
void CopyMeshToMesh(const TInputMesh *in, TOutputMesh *out)
InputPointDataContainer::ConstPointer InputPointDataContainerConstPointer
SmartPointer< Self > Pointer
QuadEdgeMeshToQuadEdgeMeshFilter()
void CopyMeshToMeshEdgeCells(const TInputMesh *in, TOutputMesh *out)
OutputMeshType::CellDataContainer OutputCellDataContainer
OutputMeshType::PointsContainerConstPointer OutputPointsContainerConstPointer
OutputMeshType::PointIdentifier OutputPointIdentifier
OutputMeshType::QEPrimal OutputQEPrimal
InputMeshType::PolygonCellType InputPolygonCellType
InputMeshType::CoordRepType InputCoordRepType
InputMeshType::EdgeCellType InputEdgeCellType
virtual void CopyInputMeshToOutputMesh()
InputMeshType::PointDataContainer InputPointDataContainer
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
InputMeshType::ConstPointer InputMeshConstPointer
InputMeshType::PointsContainerConstPointer InputPointsContainerConstPointer
InputCellTraits::PointIdInternalIterator InputPointsIdInternalIterator
virtual void CopyInputMeshToOutputMeshPoints()
OutputMeshType::Pointer OutputMeshPointer
InputQEPrimal::IteratorGeom InputQEIterator
InputMeshType::PointType InputPointType
virtual void CopyInputMeshToOutputMeshGeometry()
InputMeshType::VectorType InputVectorType
QuadEdgeMeshToQuadEdgeMeshFilter Self
OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
OutputMeshType::CoordRepType OutputCoordRepType
InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
OutputMeshType::PointDataContainer OutputPointDataContainer
void CopyMeshToMeshCellData(const TInputMesh *in, TOutputMesh *out)
void CopyMeshToMeshPointData(const TInputMesh *in, TOutputMesh *out)
Duplicates the content of a Mesh.
InputMeshType::Pointer InputMeshPointer
virtual ~QuadEdgeMeshToQuadEdgeMeshFilter()
virtual void CopyInputMeshToOutputMeshPointData()
SmartPointer< const Self > ConstPointer
virtual void CopyInputMeshToOutputMeshFieldData()
OutputMeshType::PointType OutputPointType
MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass
InputMeshType::QEPrimal InputQEPrimal
void CopyMeshToMeshPoints(const TInputMesh *in, TOutputMesh *out)
OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
InputMeshType::CellDataContainer InputCellDataContainer
virtual void CopyInputMeshToOutputMeshCells()
InputMeshType::CellTraits InputCellTraits
virtual void CopyInputMeshToOutputMeshEdgeCells()
OutputMeshType::VectorType OutputVectorType
InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator