20 #ifndef MIRTK_SurfaceRemeshing_H 21 #define MIRTK_SurfaceRemeshing_H 23 #include "mirtk/SurfaceFilter.h" 25 #include "mirtk/Point.h" 26 #include "mirtk/OrderedSet.h" 27 #include "mirtk/PointSetExport.h" 29 #include "vtkPriorityQueue.h" 100 Array<double> _CategoricalPointDataCache;
116 double _MinEdgeLengthSquared;
120 double _MaxEdgeLengthSquared;
223 void GetPoint(vtkIdType,
double [3])
const;
226 void GetNormal(vtkIdType,
double [3])
const;
229 double ComputeArea(vtkIdType)
const;
232 void MiddlePoint(vtkIdType, vtkIdType,
double [3])
const;
235 Point MiddlePoint(vtkIdType, vtkIdType)
const;
238 int NodeConnectivity(vtkIdType)
const;
241 void DeleteCell(vtkIdType);
244 void DeleteCells(vtkIdList *);
247 void ReplaceCellPoint(vtkIdType, vtkIdType, vtkIdType);
250 vtkIdType GetCellEdgeNeighbor(vtkIdType, vtkIdType, vtkIdType)
const;
253 bool IsBoundaryPoint(vtkIdType)
const;
256 bool IsBoundaryEdge(vtkIdType, vtkIdType)
const;
259 bool IsBoundaryCell(vtkIdType)
const;
262 void GetCellPointNeighbors(vtkIdType, vtkIdType, vtkIdList *)
const;
275 vtkIdType GetCellEdgeNeighborPoint(vtkIdType, vtkIdType, vtkIdType,
bool =
false);
278 double MeltingPriority(vtkIdType)
const;
281 void InterpolatePointData(vtkPointData *, vtkIdType, vtkIdType, vtkIdType);
284 void InterpolatePointData(vtkPointData *, vtkIdType, vtkIdList *,
double *);
287 double SquaredMinEdgeLength(vtkIdType, vtkIdType)
const;
290 double SquaredMaxEdgeLength(vtkIdType, vtkIdType)
const;
297 bool MeltEdge(vtkIdType, vtkIdType, vtkIdType, vtkIdList *);
315 void Bisect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *);
318 void Trisect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *);
321 void Quadsect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *);
379 return _NumberOfMeltedNodes + _NumberOfMeltedEdges + _NumberOfMeltedCells;
385 return _NumberOfBisections + _NumberOfTrisections + _NumberOfQuadsections;
396 #endif // MIRTK_SurfaceRemeshing_H int NumberOfChanges() const
Number of local remeshing operations.
double MinEdgeLength(vtkSmartPointer< vtkPoints > points, const EdgeTable &edgeTable)
int NumberOfMeltings() const
Number of melting operations.
void MeltingOfNodes()
Replace triangles adjacent to node with connectivity three by single triangle.
mirtkAttributeMacro(vtkSmartPointer< vtkPolyData >, Surface)
Shallow copy of input surface with additional internal point data.
void InversionOfTrianglesToIncreaseMinHeight()
Invert triangles when minimum height over this edge increases.
void Trisect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *)
Trisect triangle.
virtual ~SurfaceRemeshing()
Destructor.
void Melting()
Perform first pass: melt edges or triangles if one or more edges are too short.
double _MinFeatureAngleCos
1 - cos(_MinFeatureAngle)
void CopyAttributes(const SurfaceRemeshing &)
Copy attributes of this class from another instance.
void InitializeEdgeLengthRange()
Initialize edge length range for each node.
void InitializeMask()
Initialize point mask.
void Quadsect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *)
Quadsect triangle.
void Subdivision()
Perform third pass: subdivide triangles with remaining long edges.
void Inversion()
Perform second pass: inversion of triangles sharing a long edge.
mirtkPublicAggregateMacro(const class Transformation, Transformation)
Optional input transformation used to determine edge length and triangle area.
double _MaxFeatureAngleCos
1 - cos(_MaxFeatureAngle)
void Bisect(vtkIdType, vtkIdType, vtkIdType, vtkIdType, vtkPolyData *)
Bisect triangle.
bool MeltEdge(vtkIdType, vtkIdType, vtkIdType, vtkIdList *)
Collapse single short edge of two adjacent triangles.
int NumberOfSubdivisions() const
Number of subdivision operations.
mirtkPublicAttributeMacro(vtkSmartPointer< vtkDataArray >, PointMask)
void MeltingOfCells()
Melt edges or triangle if one or more edge is too short.
mirtkOnOffMacro(MeltNodes)
Enable/disable melting of nodes with connectivity three.
virtual void Execute()
Perform local remeshing passes.
SurfaceRemeshing()
Default constructor.
void InversionOfTrianglesSharingOneLongEdge()
Invert triangles which share one too long edge.
static MIRTK_PointSet_EXPORT const char *const MAX_EDGE_LENGTH
Name of maximum edge length point data array.
double MaxEdgeLength(vtkSmartPointer< vtkPoints > points, const EdgeTable &edgeTable)
virtual void Initialize()
Initialize filter after input and parameters are set.
mirtkReadOnlyAttributeMacro(int, NumberOfMeltedNodes)
Number of melted nodes with connectivity 3.
Order
Enumeration of cell order in which melting is performed.
bool MeltTriangle(vtkIdType, vtkIdList *)
Collapse entire triangle with more than one too short edges.
virtual void Finalize()
Finalize filter execution.
static MIRTK_PointSet_EXPORT const char *const MIN_EDGE_LENGTH
Name of minimum edge length point data array.
SurfaceRemeshing & operator=(const SurfaceRemeshing &)
Assignment operator.