6363#include " Image.h"
6464#include " Libs/Optimize/Domain/Surface.h"
6565#include " Logging.h"
66+ #include " Profiling.h"
6667#include " MeshComputeThickness.h"
6768#include " MeshUtils.h"
6869#include " PreviewMeshQC/FEAreaCoverage.h"
@@ -273,6 +274,7 @@ Mesh& Mesh::coverage(const Mesh& otherMesh, bool allowBackIntersections, double
273274}
274275
275276Mesh& Mesh::smooth (int iterations, double relaxation) {
277+ TIME_SCOPE (" Mesh::smooth" );
276278 auto smoother = vtkSmartPointer<vtkSmoothPolyDataFilter>::New ();
277279
278280 smoother->SetInputData (this ->poly_data_ );
@@ -293,6 +295,7 @@ Mesh& Mesh::smooth(int iterations, double relaxation) {
293295}
294296
295297Mesh& Mesh::smoothSinc (int iterations, double passband) {
298+ TIME_SCOPE (" Mesh::smoothSinc" );
296299 auto smoother = vtkSmartPointer<vtkWindowedSincPolyDataFilter>::New ();
297300 smoother->SetInputData (this ->poly_data_ );
298301 // minimum of 2. See docs of vtkWindowedSincPolyDataFilter for explanation
@@ -316,6 +319,7 @@ Mesh& Mesh::smoothSinc(int iterations, double passband) {
316319}
317320
318321Mesh& Mesh::remesh (int numVertices, double adaptivity) {
322+ TIME_SCOPE (" Mesh::remesh" );
319323 // ACVD is very noisy to std::cout, even with console output set to zero
320324 // setting the failbit on std::cout will silence this until it's cleared below
321325 // std::cout.setstate(std::ios_base::failbit);
@@ -385,6 +389,7 @@ Mesh& Mesh::reflect(const Axis& axis, const Vector3& origin) {
385389}
386390
387391MeshTransform Mesh::createTransform (const Mesh& target, Mesh::AlignmentType align, unsigned iterations) {
392+ TIME_SCOPE (" Mesh::createTransform" );
388393 return createRegistrationTransform (target, align, iterations);
389394}
390395
@@ -413,6 +418,7 @@ Mesh& Mesh::rotate(const double angle, const Axis axis) {
413418}
414419
415420Mesh& Mesh::fillHoles (double hole_size) {
421+ TIME_SCOPE (" Mesh::fillHoles" );
416422 auto filter = vtkSmartPointer<vtkFillHolesFilter>::New ();
417423 filter->SetInputData (this ->poly_data_ );
418424 filter->SetHoleSize (hole_size);
@@ -430,6 +436,7 @@ Mesh& Mesh::fillHoles(double hole_size) {
430436}
431437
432438Mesh& Mesh::clean () {
439+ TIME_SCOPE (" Mesh::clean" );
433440 auto clean = vtkSmartPointer<vtkCleanPolyData>::New ();
434441 clean->ConvertPolysToLinesOff ();
435442 clean->ConvertLinesToPointsOff ();
@@ -669,6 +676,7 @@ bool Mesh::detectTriangular() {
669676}
670677
671678std::vector<Field> Mesh::distance (const Mesh& target, const DistanceMethod method) const {
679+ TIME_SCOPE (" Mesh::distance" );
672680 if (target.numPoints () == 0 || numPoints () == 0 ) {
673681 throw std::invalid_argument (" meshes must have points" );
674682 }
@@ -832,6 +840,7 @@ bool Mesh::isPointInside(const Point3 point) const {
832840}
833841
834842double Mesh::geodesicDistance (int source, int target) const {
843+ TIME_SCOPE (" Mesh::geodesicDistance" );
835844 if (source < 0 || target < 0 || numPoints () < source || numPoints () < target) {
836845 throw std::invalid_argument (" requested point ids outside range of points available in mesh" );
837846 }
@@ -841,6 +850,7 @@ double Mesh::geodesicDistance(int source, int target) const {
841850}
842851
843852Field Mesh::geodesicDistance (const Point3 landmark) const {
853+ TIME_SCOPE (" Mesh::geodesicDistance" );
844854 auto distance = vtkSmartPointer<vtkDoubleArray>::New ();
845855 distance->SetNumberOfComponents (1 );
846856 distance->SetNumberOfTuples (numPoints ());
@@ -856,6 +866,7 @@ Field Mesh::geodesicDistance(const Point3 landmark) const {
856866}
857867
858868Field Mesh::geodesicDistance (const std::vector<Point3> curve) const {
869+ TIME_SCOPE (" Mesh::geodesicDistance" );
859870 auto minDistance = vtkSmartPointer<vtkDoubleArray>::New ();
860871 minDistance->SetNumberOfComponents (1 );
861872 minDistance->SetNumberOfTuples (numPoints ());
@@ -875,6 +886,7 @@ Field Mesh::geodesicDistance(const std::vector<Point3> curve) const {
875886}
876887
877888Field Mesh::curvature (const CurvatureType type) const {
889+ TIME_SCOPE (" Mesh::curvature" );
878890 Eigen::MatrixXd V = points ();
879891 Eigen::MatrixXi F = faces ();
880892
0 commit comments