18 #ifndef itkQuadEdgeMeshToQuadEdgeMeshFilter_h
19 #define itkQuadEdgeMeshToQuadEdgeMeshFilter_h
35 template<
typename TInputMesh,
typename TOutputMesh >
100 virtual void CopyInputMeshToOutputMesh();
102 virtual void CopyInputMeshToOutputMeshGeometry();
104 virtual void CopyInputMeshToOutputMeshPoints();
106 virtual void CopyInputMeshToOutputMeshCells();
108 virtual void CopyInputMeshToOutputMeshEdgeCells();
110 virtual void CopyInputMeshToOutputMeshFieldData();
112 virtual void CopyInputMeshToOutputMeshPointData();
114 virtual void CopyInputMeshToOutputMeshCellData();
122 template<
typename TInputMesh,
typename TOutputMesh >
133 template<
typename TInputMesh,
typename TOutputMesh >
136 using InputCellDataContainer =
typename TInputMesh::CellDataContainer;
137 using OutputCellDataContainer =
typename TOutputMesh::CellDataContainer;
138 using InputCellDataContainerConstPointer =
typename InputCellDataContainer::ConstPointer;
139 using OutputCellDataContainerPointer =
typename OutputCellDataContainer::Pointer;
141 InputCellDataContainerConstPointer inputCellData = in->GetCellData();
143 if ( inputCellData.IsNull() )
149 OutputCellDataContainerPointer outputCellData = OutputCellDataContainer::New();
150 outputCellData->Reserve( inputCellData->Size() );
153 using InputCellDataContainerConstIterator =
typename InputCellDataContainer::ConstIterator;
154 InputCellDataContainerConstIterator inIt = inputCellData->Begin();
155 while ( inIt != inputCellData->End() )
157 typename OutputCellDataContainer::Element point(inIt.Value());
158 outputCellData->SetElement( inIt.Index(), point );
162 out->SetCellData(outputCellData);
166 template<
typename TInputMesh,
typename TOutputMesh >
169 using OutputPointDataContainer =
typename TOutputMesh::PointDataContainer;
170 using OutputPointDataContainerPointer =
typename OutputPointDataContainer::Pointer;
171 using InputPointDataContainer =
typename TInputMesh::PointDataContainer;
173 const InputPointDataContainer *inputPointData = in->GetPointData();
175 if ( inputPointData ==
nullptr )
181 OutputPointDataContainerPointer outputPointData = OutputPointDataContainer::New();
182 outputPointData->Reserve( inputPointData->Size() );
185 using InputPointDataContainerConstIterator =
typename InputPointDataContainer::ConstIterator;
186 InputPointDataContainerConstIterator inIt = inputPointData->Begin();
187 while ( inIt != inputPointData->End() )
189 typename OutputPointDataContainer::Element point( inIt.Value() );
190 outputPointData->SetElement( inIt.Index(), point );
194 out->SetPointData(outputPointData);
198 template<
typename TInputMesh,
typename TOutputMesh >
202 using InputCellsContainer =
typename TInputMesh::CellsContainer;
203 using InputCellsContainerConstPointer =
typename InputCellsContainer::ConstPointer;
204 using InputCellsContainerConstIterator =
typename InputCellsContainer::ConstIterator;
205 using InputPolygonCellType =
typename TInputMesh::PolygonCellType;
206 using InputPointIdList =
typename TInputMesh::PointIdList;
207 using InputCellTraits =
typename TInputMesh::CellTraits;
208 using InputPointsIdInternalIterator =
typename InputCellTraits::PointIdInternalIterator;
210 out->SetCellsAllocationMethod(TOutputMesh::CellsAllocatedDynamicallyCellByCell);
212 InputCellsContainerConstPointer inCells = in->GetCells();
216 InputCellsContainerConstIterator cIt = inCells->Begin();
217 InputCellsContainerConstIterator cEnd = inCells->End();
218 while ( cIt != cEnd )
220 auto * pe =
dynamic_cast< InputPolygonCellType *
>( cIt.Value() );
223 InputPointIdList points;
224 InputPointsIdInternalIterator pIt = pe->InternalPointIdsBegin();
225 InputPointsIdInternalIterator pEnd = pe->InternalPointIdsEnd();
227 while ( pIt != pEnd )
229 points.push_back( ( *pIt ) );
232 out->AddFaceWithSecurePointList(points,
false);
240 template<
typename TInputMesh,
typename TOutputMesh >
244 using InputCellsContainer =
typename TInputMesh::CellsContainer;
245 using InputCellsContainerConstPointer =
typename InputCellsContainer::ConstPointer;
246 using InputCellsContainerConstIterator =
typename InputCellsContainer::ConstIterator;
247 using InputEdgeCellType =
typename TInputMesh::EdgeCellType;
249 InputCellsContainerConstPointer inEdgeCells = in->GetEdgeCells();
253 InputCellsContainerConstIterator ecIt = inEdgeCells->Begin();
254 InputCellsContainerConstIterator ecEnd = inEdgeCells->End();
256 while ( ecIt != ecEnd )
258 auto * pe =
dynamic_cast< InputEdgeCellType *
>( ecIt.Value() );
261 out->AddEdgeWithSecurePointList( pe->GetQEGeom()->GetOrigin(),
262 pe->GetQEGeom()->GetDestination() );
270 template<
typename TInputMesh,
typename TOutputMesh >
274 using InputPointsContainerConstPointer =
typename TInputMesh::PointsContainerConstPointer;
275 using InputPointsContainerConstIterator =
typename TInputMesh::PointsContainerConstIterator;
277 using OutputPointsContainer =
typename TOutputMesh::PointsContainer;
278 using OutputPointsContainerPointer =
typename TOutputMesh::PointsContainerPointer;
281 InputPointsContainerConstPointer inPoints = in->GetPoints();
285 InputPointsContainerConstIterator inIt = inPoints->
Begin();
286 InputPointsContainerConstIterator inEnd = inPoints->End();
288 OutputPointsContainerPointer oPoints = out->GetPoints();
289 if( oPoints.IsNull() )
291 oPoints = OutputPointsContainer::New();
292 out->SetPoints( oPoints );
294 OutputPointType pOut;
296 while ( inIt != inEnd )
298 pOut.CastFrom( inIt.Value() );
299 oPoints->InsertElement(inIt.Index(), pOut);
306 #ifndef ITK_MANUAL_INSTANTIATION
307 #include "itkQuadEdgeMeshToQuadEdgeMeshFilter.hxx"
void CopyMeshToMeshCells(const TInputMesh *in, TOutputMesh *out)
typename InputMeshType::CoordRepType InputCoordRepType
typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Light weight base class for most itk classes.
void CopyMeshToMesh(const TInputMesh *in, TOutputMesh *out)
TCellSubdivisionFilter::OutputMeshType OutputMeshType
typename InputMeshType::VectorType InputVectorType
typename InputQEPrimal::IteratorGeom InputQEIterator
typename InputMeshType::CellDataContainer InputCellDataContainer
void CopyMeshToMeshEdgeCells(const TInputMesh *in, TOutputMesh *out)
typename InputMeshType::PointIdentifier InputPointIdentifier
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
typename InputMeshType::ConstPointer InputMeshConstPointer
typename InputMeshType::PolygonCellType InputPolygonCellType
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename InputPointDataContainer::ConstPointer InputPointDataContainerConstPointer
typename OutputMeshType::PointType OutputPointType
typename OutputMeshType::CoordRepType OutputCoordRepType
typename InputMeshType::QEPrimal InputQEPrimal
typename InputMeshType::Pointer InputMeshPointer
typename InputMeshType::PointDataContainer InputPointDataContainer
typename InputCellTraits::PointIdInternalIterator InputPointsIdInternalIterator
typename InputMeshType::PointsContainerConstPointer InputPointsContainerConstPointer
typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
typename InputMeshType::PointType InputPointType
typename OutputMeshType::ConstPointer OutputMeshConstPointer
typename InputMeshType::CellTraits InputCellTraits
void CopyMeshToMeshCellData(const TInputMesh *in, TOutputMesh *out)
void CopyMeshToMeshPointData(const TInputMesh *in, TOutputMesh *out)
Duplicates the content of a Mesh.
typename OutputMeshType::PointsContainerConstPointer OutputPointsContainerConstPointer
typename OutputMeshType::Pointer OutputMeshPointer
typename OutputMeshType::QEPrimal OutputQEPrimal
typename InputMeshType::EdgeCellType InputEdgeCellType
ImageBaseType::PointType PointType
typename OutputMeshType::VectorType OutputVectorType
void CopyMeshToMeshPoints(const TInputMesh *in, TOutputMesh *out)
typename OutputMeshType::PointDataContainer OutputPointDataContainer
typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
typename InputMeshType::CellsContainerConstPointer InputCellsContainerConstPointer
typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
ImageBaseType::SpacingType VectorType
typename OutputMeshType::CellDataContainer OutputCellDataContainer
typename InputMeshType::PointIdList InputPointIdList
typename OutputQEPrimal::IteratorGeom OutputQEIterator