18 #ifndef itkSimplexMeshAdaptTopologyFilter_h
19 #define itkSimplexMeshAdaptTopologyFilter_h
28 #include "vxl_version.h"
29 #include "vnl/vnl_cross.h"
44 template <
typename TInputMesh,
typename TOutputMesh>
130 typename InputPolygonType::PointIdIterator it = poly->
PointIdsBegin();
132 double meanCurvature = 0;
134 double val = mesh->GetMeanCurvature(*it++);
138 val = mesh->GetMeanCurvature(*it++);
148 area += ComputeArea(refPoint, id1, id2);
150 val = mesh->GetMeanCurvature(*it);
156 meanCurvature /= static_cast<double>(cnt);
158 totalCurvature += meanCurvature;
160 areaMap->InsertElement(cellId, area);
161 curvatureMap->InsertElement(cellId, meanCurvature);
163 if (area > maxCellSize)
167 if (area < minCellSize)
171 if (meanCurvature > maxCurvature)
173 maxCurvature = meanCurvature;
175 if (meanCurvature < minCurvature)
177 minCurvature = meanCurvature;
188 mesh->GetPoint(p1, &v1);
189 mesh->GetPoint(p2, &v2);
190 mesh->GetPoint(p3, &v3);
191 return itk::Math::abs(vnl_cross_3d((v2 - v1).GetVnlVector(), (v3 - v1).GetVnlVector()).two_norm() / 2.0);
215 return totalCurvature / (curvatureMap->Size());
244 using SimplexVisitorInterfaceType =
251 itkSetMacro(Threshold,
double);
252 itkGetConstMacro(Threshold,
double);
254 itkSetMacro(SelectionMethod,
int);
255 itkGetConstMacro(SelectionMethod,
int);
257 itkGetConstMacro(ModifiedCount,
int);
264 PrintSelf(std::ostream & os,
Indent indent)
const override;
267 GenerateData()
override;
281 ComputeCellParameters();
285 CopyInputMeshToOutputMeshGeometryData();
310 double m_Threshold{ 0.5 };
315 int m_SelectionMethod{ 0 };
321 int m_ModifiedCount{ 0 };
333 #ifndef ITK_MANUAL_INSTANTIATION
334 # include "itkSimplexMeshAdaptTopologyFilter.hxx"
337 #endif // itkSimplexMeshAdaptTopologyFilter_h