Skip to content
Snippets Groups Projects
Commit dfe02d3d authored by Karsten Rink's avatar Karsten Rink
Browse files

fixed comments and indentation

parent 45314197
No related branches found
No related tags found
No related merge requests found
...@@ -169,8 +169,8 @@ bool lineSegmentIntersect( ...@@ -169,8 +169,8 @@ bool lineSegmentIntersect(
} }
bool lineSegmentsIntersect(const GeoLib::Polyline* ply, bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
size_t &idx0, size_t &idx0,
size_t &idx1, size_t &idx1,
GeoLib::Point& intersection_pnt) GeoLib::Point& intersection_pnt)
{ {
size_t n_segs(ply->getNumberOfPoints() - 1); size_t n_segs(ply->getNumberOfPoints() - 1);
...@@ -198,9 +198,10 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply, ...@@ -198,9 +198,10 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
} }
bool isPointInTriangle(GeoLib::Point const& p, bool isPointInTriangle(GeoLib::Point const& p,
GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
double eps_pnt_out_of_plane, double eps_pnt_out_of_tri, double eps_pnt_out_of_plane,
GeoLib::TriangleTest algorithm) double eps_pnt_out_of_tri,
GeoLib::TriangleTest algorithm)
{ {
switch (algorithm) switch (algorithm)
{ {
...@@ -213,11 +214,9 @@ bool isPointInTriangle(GeoLib::Point const& p, ...@@ -213,11 +214,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
} }
bool gaussPointInTriangle(GeoLib::Point const& q, bool gaussPointInTriangle(GeoLib::Point const& q,
GeoLib::Point const& a, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
GeoLib::Point const& b, double eps_pnt_out_of_plane,
GeoLib::Point const& c, double eps_pnt_out_of_tri)
double eps_pnt_out_of_plane,
double eps_pnt_out_of_tri)
{ {
MathLib::Vector3 const v(a, b); MathLib::Vector3 const v(a, b);
MathLib::Vector3 const w(a, c); MathLib::Vector3 const w(a, c);
...@@ -253,8 +252,9 @@ bool gaussPointInTriangle(GeoLib::Point const& q, ...@@ -253,8 +252,9 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
} }
bool barycentricPointInTriangle(GeoLib::Point const& p, bool barycentricPointInTriangle(GeoLib::Point const& p,
GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
double eps_pnt_out_of_plane, double eps_pnt_out_of_tri) double eps_pnt_out_of_plane,
double eps_pnt_out_of_tri)
{ {
if (std::abs(orientation3d(p, a, b, c)) > eps_pnt_out_of_plane) if (std::abs(orientation3d(p, a, b, c)) > eps_pnt_out_of_plane)
return false; return false;
......
...@@ -121,7 +121,6 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x ...@@ -121,7 +121,6 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c. * Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle * Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle
* as well as an 'epsilon' outside the triangles plane. * as well as an 'epsilon' outside the triangles plane.
* Algorithm based on "Fundamentals of Computer Graphics" by Peter Shirley.
* @param p test point * @param p test point
* @param a edge node of triangle * @param a edge node of triangle
* @param b edge node of triangle * @param b edge node of triangle
...@@ -132,14 +131,15 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x ...@@ -132,14 +131,15 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/ */
bool isPointInTriangle(GeoLib::Point const& p, bool isPointInTriangle(GeoLib::Point const& p,
GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(), double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon(), double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon(),
GeoLib::TriangleTest algorithm = GeoLib::GAUSS); GeoLib::TriangleTest algorithm = GeoLib::GAUSS);
/** /**
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c. * Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Using the eps it is possible to test a 'epsilon' neighbourhood around the triangle. * Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle
* as well as an 'epsilon' outside the triangles plane.
* @param p test point * @param p test point
* @param a edge node of triangle * @param a edge node of triangle
* @param b edge node of triangle * @param b edge node of triangle
...@@ -150,9 +150,9 @@ bool isPointInTriangle(GeoLib::Point const& p, ...@@ -150,9 +150,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/ */
bool gaussPointInTriangle(GeoLib::Point const& p, bool gaussPointInTriangle(GeoLib::Point const& p,
GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(), double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon()); double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon());
/** /**
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c. * Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
...@@ -168,9 +168,9 @@ bool gaussPointInTriangle(GeoLib::Point const& p, ...@@ -168,9 +168,9 @@ bool gaussPointInTriangle(GeoLib::Point const& p,
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/ */
bool barycentricPointInTriangle(GeoLib::Point const& p, bool barycentricPointInTriangle(GeoLib::Point const& p,
GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c, GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c,
double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(), double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon()); double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon());
/** /**
* Tests if the given point p is located within a tetrahedron spanned by points a, b, c, d. * Tests if the given point p is located within a tetrahedron spanned by points a, b, c, d.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment