18 #ifndef itkQuadEdgeMeshToQuadEdgeMeshFilter_h
19 #define itkQuadEdgeMeshToQuadEdgeMeshFilter_h
36 template <
typename TInputMesh,
typename TOutputMesh>
53 #ifndef ITK_FUTURE_LEGACY_REMOVE
54 using InputCoordRepType ITK_FUTURE_DEPRECATED(
55 "ITK 6 discourages using `InputCoordRepType`. Please use `InputCoordinateType` instead!") =
InputCoordinateType;
84 #ifndef ITK_FUTURE_LEGACY_REMOVE
85 using OutputCoordRepType ITK_FUTURE_DEPRECATED(
86 "ITK 6 discourages using `OutputCoordRepType`. Please use `OutputCoordinateType` instead!") =
OutputCoordinateType;
109 CopyInputMeshToOutputMesh();
112 CopyInputMeshToOutputMeshGeometry();
115 CopyInputMeshToOutputMeshPoints();
118 CopyInputMeshToOutputMeshCells();
121 CopyInputMeshToOutputMeshEdgeCells();
124 CopyInputMeshToOutputMeshFieldData();
127 CopyInputMeshToOutputMeshPointData();
130 CopyInputMeshToOutputMeshCellData();
138 template <
typename TInputMesh,
typename TOutputMesh>
150 template <
typename TInputMesh,
typename TOutputMesh>
154 using InputCellDataContainer =
typename TInputMesh::CellDataContainer;
155 using OutputCellDataContainer =
typename TOutputMesh::CellDataContainer;
159 const InputCellDataContainerConstPointer inputCellData = in->GetCellData();
161 if (inputCellData ==
nullptr)
168 outputCellData->Reserve(inputCellData->Size());
171 using InputCellDataContainerConstIterator =
typename InputCellDataContainer::ConstIterator;
172 InputCellDataContainerConstIterator inIt = inputCellData->Begin();
173 while (inIt != inputCellData->End())
175 const typename OutputCellDataContainer::Element
point(inIt.Value());
176 outputCellData->SetElement(inIt.Index(),
point);
180 out->SetCellData(outputCellData);
184 template <
typename TInputMesh,
typename TOutputMesh>
188 using OutputPointDataContainer =
typename TOutputMesh::PointDataContainer;
190 using InputPointDataContainer =
typename TInputMesh::PointDataContainer;
192 const InputPointDataContainer * inputPointData = in->GetPointData();
194 if (inputPointData ==
nullptr)
201 outputPointData->Reserve(inputPointData->Size());
204 using InputPointDataContainerConstIterator =
typename InputPointDataContainer::ConstIterator;
205 InputPointDataContainerConstIterator inIt = inputPointData->Begin();
206 while (inIt != inputPointData->End())
208 const typename OutputPointDataContainer::Element
point(inIt.Value());
209 outputPointData->SetElement(inIt.Index(),
point);
213 out->SetPointData(outputPointData);
217 template <
typename TInputMesh,
typename TOutputMesh>
222 using InputCellsContainer =
typename TInputMesh::CellsContainer;
224 using InputCellsContainerConstIterator =
typename InputCellsContainer::ConstIterator;
225 using InputPolygonCellType =
typename TInputMesh::PolygonCellType;
226 using InputPointIdList =
typename TInputMesh::PointIdList;
227 using InputCellTraits =
typename TInputMesh::CellTraits;
228 using InputPointsIdInternalIterator =
typename InputCellTraits::PointIdInternalIterator;
232 const InputCellsContainerConstPointer inCells = in->GetCells();
234 if (inCells ==
nullptr)
240 InputCellsContainerConstIterator cIt = inCells->Begin();
241 const InputCellsContainerConstIterator cEnd = inCells->End();
244 auto * pe = dynamic_cast<InputPolygonCellType *>(cIt.Value());
247 InputPointIdList points;
248 InputPointsIdInternalIterator pIt = pe->InternalPointIdsBegin();
249 const InputPointsIdInternalIterator pEnd = pe->InternalPointIdsEnd();
253 points.push_back((*pIt));
256 out->AddFaceWithSecurePointList(points,
false);
263 template <
typename TInputMesh,
typename TOutputMesh>
268 using InputCellsContainer =
typename TInputMesh::CellsContainer;
270 using InputCellsContainerConstIterator =
typename InputCellsContainer::ConstIterator;
271 using InputEdgeCellType =
typename TInputMesh::EdgeCellType;
273 const InputCellsContainerConstPointer inEdgeCells = in->GetEdgeCells();
275 if (inEdgeCells ==
nullptr)
281 InputCellsContainerConstIterator ecIt = inEdgeCells->Begin();
282 const InputCellsContainerConstIterator ecEnd = inEdgeCells->End();
284 while (ecIt != ecEnd)
286 auto * pe = dynamic_cast<InputEdgeCellType *>(ecIt.Value());
289 out->AddEdgeWithSecurePointList(pe->GetQEGeom()->GetOrigin(), pe->GetQEGeom()->GetDestination());
296 template <
typename TInputMesh,
typename TOutputMesh>
301 using InputPointsContainerConstPointer =
typename TInputMesh::PointsContainerConstPointer;
302 using InputPointsContainerConstIterator =
typename TInputMesh::PointsContainerConstIterator;
304 using OutputPointsContainer =
typename TOutputMesh::PointsContainer;
305 using OutputPointsContainerPointer =
typename TOutputMesh::PointsContainerPointer;
308 const InputPointsContainerConstPointer inPoints = in->GetPoints();
310 if (inPoints ==
nullptr)
316 InputPointsContainerConstIterator inIt = inPoints->
Begin();
317 const InputPointsContainerConstIterator inEnd = inPoints->End();
319 OutputPointsContainerPointer oPoints = out->GetPoints();
320 if (oPoints ==
nullptr)
323 out->SetPoints(oPoints);
325 OutputPointType pOut;
327 while (inIt != inEnd)
329 pOut.CastFrom(inIt.Value());
330 oPoints->InsertElement(inIt.Index(), pOut);
336 #ifndef ITK_MANUAL_INSTANTIATION
337 # include "itkQuadEdgeMeshToQuadEdgeMeshFilter.hxx"