mirror of https://github.com/CGAL/cgal
Re-united some function bodies with their declaration
This commit is contained in:
parent
9881f814a1
commit
f3671d45e1
|
|
@ -310,44 +310,8 @@ private:
|
||||||
/// Computes the coordinates of the vertices of a triangle
|
/// Computes the coordinates of the vertices of a triangle
|
||||||
/// in a local 2D orthonormal basis of the triangle's plane.
|
/// in a local 2D orthonormal basis of the triangle's plane.
|
||||||
void project_triangle(const Point_3& p0, const Point_3& p1, const Point_3& p2, // in
|
void project_triangle(const Point_3& p0, const Point_3& p1, const Point_3& p2, // in
|
||||||
Point_2& z0, Point_2& z1, Point_2& z2) const; // out
|
|
||||||
|
|
||||||
/// Create two lines in the linear system per triangle (one for u, one for v).
|
|
||||||
///
|
|
||||||
/// \pre vertices must be indexed.
|
|
||||||
template <typename VertexIndexMap >
|
|
||||||
Error_code setup_triangle_relations(LeastSquaresSolver& solver,
|
|
||||||
const TriangleMesh& mesh,
|
|
||||||
face_descriptor facet,
|
|
||||||
VertexIndexMap vimap) const;
|
|
||||||
|
|
||||||
// Private accessors
|
|
||||||
private:
|
|
||||||
/// Get the object that maps the surface's border onto a 2D space.
|
|
||||||
Border_parameterizer& get_border_parameterizer() { return m_borderParameterizer; }
|
|
||||||
|
|
||||||
/// Get the sparse linear algebra (traits object to access the linear system).
|
|
||||||
Solver_traits& get_linear_algebra_traits() { return m_linearAlgebra; }
|
|
||||||
|
|
||||||
// Fields
|
|
||||||
private:
|
|
||||||
/// %Object that maps (at least two) border vertices onto a 2D space
|
|
||||||
Border_parameterizer m_borderParameterizer;
|
|
||||||
|
|
||||||
/// Traits object to solve a sparse linear system
|
|
||||||
Solver_traits m_linearAlgebra;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Utility for setup_triangle_relations():
|
|
||||||
// Computes the coordinates of the vertices of a triangle
|
|
||||||
// in a local 2D orthonormal basis of the triangle's plane.
|
|
||||||
template<class TriangleMesh, class Border_param, class Sparse_LA>
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
LSCM_parameterizer_3<TriangleMesh, Border_param, Sparse_LA>::
|
|
||||||
project_triangle(const Point_3& p0, const Point_3& p1, const Point_3& p2, // in
|
|
||||||
Point_2& z0, Point_2& z1, Point_2& z2) const // out
|
Point_2& z0, Point_2& z1, Point_2& z2) const // out
|
||||||
{
|
{
|
||||||
Vector_3 X = p1 - p0;
|
Vector_3 X = p1 - p0;
|
||||||
NT X_norm = std::sqrt(X * X);
|
NT X_norm = std::sqrt(X * X);
|
||||||
if(X_norm != 0.0)
|
if(X_norm != 0.0)
|
||||||
|
|
@ -372,27 +336,23 @@ project_triangle(const Point_3& p0, const Point_3& p1, const Point_3& p2, // i
|
||||||
z0 = Point_2(x0, y0);
|
z0 = Point_2(x0, y0);
|
||||||
z1 = Point_2(x1, y1);
|
z1 = Point_2(x1, y1);
|
||||||
z2 = Point_2(x2, y2);
|
z2 = Point_2(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create two lines in the linear system per triangle (one for u, one for v).
|
/// Create two lines in the linear system per triangle (one for u, one for v).
|
||||||
///
|
///
|
||||||
/// \pre vertices of `mesh` must be indexed.
|
/// \pre vertices of `mesh` must be indexed.
|
||||||
// Implementation note: LSCM equation is:
|
// Implementation note: LSCM equation is:
|
||||||
// (Z1 - Z0)(U2 - U0) = (Z2 - Z0)(U1 - U0)
|
// (Z1 - Z0)(U2 - U0) = (Z2 - Z0)(U1 - U0)
|
||||||
// where Uk = uk + i.v_k is the complex number corresponding to (u,v) coords
|
// where Uk = uk + i.v_k is the complex number corresponding to (u,v) coords
|
||||||
// Zk = xk + i.yk is the complex number corresponding to local (x,y) coords
|
// Zk = xk + i.yk is the complex number corresponding to local (x,y) coords
|
||||||
// cool: no divide with this expression; makes it more numerically stable
|
// cool: no divide with this expression; makes it more numerically stable
|
||||||
// in presence of degenerate triangles
|
// in presence of degenerate triangles
|
||||||
template<class TriangleMesh, class Border_param, class Sparse_LA>
|
template <typename VertexIndexMap >
|
||||||
template <typename VertexIndexMap>
|
Error_code setup_triangle_relations(LeastSquaresSolver& solver,
|
||||||
inline
|
|
||||||
Error_code
|
|
||||||
LSCM_parameterizer_3<TriangleMesh, Border_param, Sparse_LA>::
|
|
||||||
setup_triangle_relations(LeastSquaresSolver& solver,
|
|
||||||
const TriangleMesh& mesh,
|
const TriangleMesh& mesh,
|
||||||
face_descriptor facet,
|
face_descriptor facet,
|
||||||
VertexIndexMap vimap) const
|
VertexIndexMap vimap) const
|
||||||
{
|
{
|
||||||
const PPM ppmap = get(vertex_point, mesh);
|
const PPM ppmap = get(vertex_point, mesh);
|
||||||
|
|
||||||
// Get the 3 vertices of the triangle
|
// Get the 3 vertices of the triangle
|
||||||
|
|
@ -463,9 +423,26 @@ setup_triangle_relations(LeastSquaresSolver& solver,
|
||||||
solver.end_row();
|
solver.end_row();
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
// Private accessors
|
||||||
|
private:
|
||||||
|
/// Get the object that maps the surface's border onto a 2D space.
|
||||||
|
Border_parameterizer& get_border_parameterizer() { return m_borderParameterizer; }
|
||||||
|
|
||||||
|
/// Get the sparse linear algebra (traits object to access the linear system).
|
||||||
|
Solver_traits& get_linear_algebra_traits() { return m_linearAlgebra; }
|
||||||
|
|
||||||
|
// Fields
|
||||||
|
private:
|
||||||
|
/// %Object that maps (at least two) border vertices onto a 2D space
|
||||||
|
Border_parameterizer m_borderParameterizer;
|
||||||
|
|
||||||
|
/// Traits object to solve a sparse linear system
|
||||||
|
Solver_traits m_linearAlgebra;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Surface_mesh_parameterization
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue