#pragma once #include "SurfaceMeshModel.h" #include "FaceBarycenterHelper.h" #include "NanoKdTree.h" #include "../CustomDrawObjects.h" typedef QPair HalfedgeTime; typedef QMap DistanceHalfedge; struct BoundaryFitting{ BoundaryFitting( SurfaceMeshModel * mesh = NULL, int numSegments = 20, int numSegmentsV = -1); void doFit(); std::vector collectRings( SurfaceMesh::Vertex v, size_t min_nb, bool isBoundary = false ); QVector boundaryVerts(); void normalize( SurfaceMesh::ScalarVertexProperty & vprop ); void gradientFaces( ScalarVertexProperty & functionVal, bool isSmooth = true, bool isNormalizeNegateGradient = true ); QVector neighbours( int start, int range, QVector all ); SurfaceMesh::Halfedge get_halfedge(SurfaceMesh::Vertex start, SurfaceMesh::Vertex end); SurfaceMesh::Halfedge getBestEdge(Vector3d prevPoint, Vector3d direction, Face f, double & bestTime); SurfaceMesh::Face getBestFace( Vector3d & point, Vertex guess ); std::vector geodesicPath(Vector3d fromPoint, Vector3d toPoint); std::vector< std::vector > geodesicPaths( std::vector fromPoints, std::vector toPoints, int segments = -1 ); std::vector trianglePoints( Face f ); std::vector triangleVertices( Face f ); SurfaceMesh::SurfaceMeshModel * part; int segments, segmentsV; SurfaceMesh::ScalarVertexProperty vals; SurfaceMesh::ScalarVertexProperty boundaryCurv; SurfaceMesh::ScalarVertexProperty dists; SurfaceMesh::Vector3VertexProperty vgradient; SurfaceMesh::Vector3FaceProperty fgradient; SurfaceMesh::Vector3VertexProperty vdirection; SurfaceMesh::Vector3VertexProperty normals; SurfaceMesh::Vector3VertexProperty points; NanoKdTree tree; // output std::vector< std::vector > lines; std::vector debugPoints, debugPoints2; std::vector corners; std::vector< std::vector > main_edges; LineSegments ls; };