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
107 virtual void CopyInputMeshToOutputMesh();
109 virtual void CopyInputMeshToOutputMeshGeometry();
111 virtual void CopyInputMeshToOutputMeshPoints();
113 virtual void CopyInputMeshToOutputMeshCells();
115 virtual void CopyInputMeshToOutputMeshEdgeCells();
117 virtual void CopyInputMeshToOutputMeshFieldData();
119 virtual void CopyInputMeshToOutputMeshPointData();
121 virtual void CopyInputMeshToOutputMeshCellData();
125 void operator=(
const Self &);
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 typename OutputCellDataContainer::Element point(inIt.Value());
169 outputCellData->SetElement( inIt.Index(), point );
173 out->SetCellData(outputCellData);
177 template<
typename TInputMesh,
typename TOutputMesh >
180 typedef typename TOutputMesh::PointDataContainer OutputPointDataContainer;
181 typedef typename OutputPointDataContainer::Pointer OutputPointDataContainerPointer;
182 typedef typename TInputMesh::PointDataContainer InputPointDataContainer;
184 const InputPointDataContainer *inputPointData = in->GetPointData();
186 if ( inputPointData == ITK_NULLPTR )
192 OutputPointDataContainerPointer outputPointData = OutputPointDataContainer::New();
193 outputPointData->Reserve( inputPointData->Size() );
196 typedef typename InputPointDataContainer::ConstIterator InputPointDataContainerConstIterator;
197 InputPointDataContainerConstIterator inIt = inputPointData->Begin();
198 while ( inIt != inputPointData->End() )
200 typename OutputPointDataContainer::Element point( inIt.Value() );
201 outputPointData->SetElement( inIt.Index(), point );
205 out->SetPointData(outputPointData);
209 template<
typename TInputMesh,
typename TOutputMesh >
213 typedef typename TInputMesh::CellsContainer InputCellsContainer;
214 typedef typename InputCellsContainer::ConstPointer InputCellsContainerConstPointer;
215 typedef typename InputCellsContainer::ConstIterator InputCellsContainerConstIterator;
216 typedef typename TInputMesh::PolygonCellType InputPolygonCellType;
217 typedef typename TInputMesh::PointIdList InputPointIdList;
218 typedef typename TInputMesh::CellTraits InputCellTraits;
219 typedef typename InputCellTraits::PointIdInternalIterator
220 InputPointsIdInternalIterator;
222 out->SetCellsAllocationMethod(TOutputMesh::CellsAllocatedDynamicallyCellByCell);
224 InputCellsContainerConstPointer inCells = in->GetCells();
228 InputCellsContainerConstIterator cIt = inCells->Begin();
229 InputCellsContainerConstIterator cEnd = inCells->End();
230 while ( cIt != cEnd )
232 InputPolygonCellType *pe =
dynamic_cast< InputPolygonCellType *
>( cIt.Value() );
235 InputPointIdList points;
236 InputPointsIdInternalIterator pIt = pe->InternalPointIdsBegin();
237 InputPointsIdInternalIterator pEnd = pe->InternalPointIdsEnd();
239 while ( pIt != pEnd )
241 points.push_back( ( *pIt ) );
244 out->AddFaceWithSecurePointList(points,
false);
252 template<
typename TInputMesh,
typename TOutputMesh >
256 typedef typename TInputMesh::CellsContainer InputCellsContainer;
257 typedef typename InputCellsContainer::ConstPointer InputCellsContainerConstPointer;
258 typedef typename InputCellsContainer::ConstIterator InputCellsContainerConstIterator;
259 typedef typename TInputMesh::EdgeCellType InputEdgeCellType;
261 InputCellsContainerConstPointer inEdgeCells = in->GetEdgeCells();
265 InputCellsContainerConstIterator ecIt = inEdgeCells->Begin();
266 InputCellsContainerConstIterator ecEnd = inEdgeCells->End();
268 while ( ecIt != ecEnd )
270 InputEdgeCellType *pe =
dynamic_cast< InputEdgeCellType *
>( ecIt.Value() );
273 out->AddEdgeWithSecurePointList( pe->GetQEGeom()->GetOrigin(),
274 pe->GetQEGeom()->GetDestination() );
282 template<
typename TInputMesh,
typename TOutputMesh >
286 typedef typename TInputMesh::PointsContainerConstPointer InputPointsContainerConstPointer;
287 typedef typename TInputMesh::PointsContainerConstIterator InputPointsContainerConstIterator;
289 typedef typename TOutputMesh::PointsContainer OutputPointsContainer;
290 typedef typename TOutputMesh::PointsContainerPointer OutputPointsContainerPointer;
293 InputPointsContainerConstPointer inPoints = in->GetPoints();
297 InputPointsContainerConstIterator inIt = inPoints->
Begin();
298 InputPointsContainerConstIterator inEnd = inPoints->End();
300 OutputPointsContainerPointer oPoints = out->GetPoints();
301 if( oPoints.IsNull() )
303 oPoints = OutputPointsContainer::New();
304 out->SetPoints( oPoints );
306 OutputPointType pOut;
308 while ( inIt != inEnd )
310 pOut.CastFrom( inIt.Value() );
311 oPoints->InsertElement(inIt.Index(), pOut);
318 #ifndef ITK_MANUAL_INSTANTIATION
319 #include "itkQuadEdgeMeshToQuadEdgeMeshFilter.hxx"
InputMeshType::PointIdentifier InputPointIdentifier
void CopyMeshToMeshCells(const TInputMesh *in, TOutputMesh *out)
TOutputMesh OutputMeshType
OutputQEPrimal::IteratorGeom OutputQEIterator
InputMeshType::CellsContainerConstPointer InputCellsContainerConstPointer
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
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
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
ImageBaseType::SpacingType VectorType
InputCellTraits::PointIdInternalIterator InputPointsIdInternalIterator
OutputMeshType::Pointer OutputMeshPointer
InputQEPrimal::IteratorGeom InputQEIterator
InputMeshType::PointType InputPointType
InputMeshType::VectorType InputVectorType
QuadEdgeMeshToQuadEdgeMeshFilter Self
ImageBaseType::PointType PointType
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() override
SmartPointer< const Self > ConstPointer
OutputMeshType::PointType OutputPointType
MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass
InputMeshType::QEPrimal InputQEPrimal
void CopyMeshToMeshPoints(const TInputMesh *in, TOutputMesh *out)
OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
InputMeshType::CellDataContainer InputCellDataContainer
InputMeshType::CellTraits InputCellTraits
OutputMeshType::VectorType OutputVectorType
InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator