Commit 18e13d41 authored by Thery Sylvain's avatar Thery Sylvain

bug Surface/Volume namespace

parent 79dc9e80
......@@ -86,7 +86,7 @@ public:
bool operator()(Dart d)
{
typename PFP::REAL alpha = 0;
Algo::Geometry::intersectionSphereEdge<PFP>(this->m_map, center, radius, d, position, alpha);
Geometry::intersectionSphereEdge<PFP>(this->m_map, center, radius, d, position, alpha);
sum += (1 - alpha) * attr[d] + alpha * attr[this->m_map.phi1(d)] ;
++count ;
return false ;
......
......@@ -31,6 +31,9 @@ namespace CGoGN
namespace Algo
{
namespace Surface
{
namespace Geometry
{
......@@ -83,6 +86,8 @@ bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center,
} // namespace Geometry
} // surface
} // namespace Algo
} // namespace CGoGN
......
......@@ -37,6 +37,9 @@ namespace CGoGN
namespace Algo
{
namespace Surface
{
namespace Geometry
{
......@@ -249,6 +252,8 @@ bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center,
} // namespace Geometry
} // Surface
} // namespace Algo
} // namespace CGoGN
......@@ -41,6 +41,9 @@ namespace CGoGN
namespace Algo
{
namespace Surface
{
namespace Selection
{
......@@ -458,9 +461,8 @@ private :
} // namespace Selection
} // surface
} // namespace Algo
} // namespace CGoGN
#include "Algo/Selection/collector.hpp"
......
......@@ -32,6 +32,9 @@ namespace CGoGN
namespace Algo
{
namespace Surface
{
namespace Selection
{
......@@ -258,7 +261,7 @@ void Collector_WithinSphere<PFP>::computeArea()
typename PFP::VEC3 centerPosition = this->position[this->centerDart];
for (std::vector<Dart>::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it)
area += Algo::Geometry::triangleArea<PFP>(this->map, *it, this->position);
area += Geometry::triangleArea<PFP>(this->map, *it, this->position);
for (std::vector<Dart>::const_iterator it = this->border.begin(); it != this->border.end(); ++it)
{
......@@ -267,16 +270,16 @@ void Collector_WithinSphere<PFP>::computeArea()
if (Geom::isPointInSphere(this->position[g], centerPosition, this->radius))
{ // only f is outside
typename PFP::REAL alpha, beta;
Algo::Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, *it, this->position, alpha);
Algo::Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, this->map.phi2(f), this->position, beta);
area += (alpha+beta - alpha*beta) * Algo::Geometry::triangleArea<PFP>(this->map, *it, this->position);
Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, *it, this->position, alpha);
Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, this->map.phi2(f), this->position, beta);
area += (alpha+beta - alpha*beta) * Geometry::triangleArea<PFP>(this->map, *it, this->position);
}
else
{ // f and g are outside
typename PFP::REAL alpha, beta;
Algo::Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, *it, this->position, alpha);
Algo::Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, this->map.phi2(g), this->position, beta);
area += alpha * beta * Algo::Geometry::triangleArea<PFP>(this->map, *it, this->position);
Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, *it, this->position, alpha);
Geometry::intersectionSphereEdge<PFP>(this->map, centerPosition, this->radius, this->map.phi2(g), this->position, beta);
area += alpha * beta * Geometry::triangleArea<PFP>(this->map, *it, this->position);
}
}
}
......@@ -1135,13 +1138,15 @@ void Collector_Dijkstra<PFP>::collectBorder(Dart dinit)
template <typename PFP>
inline float Collector_Dijkstra<PFP>::edgeLength (Dart d)
{
typename PFP::VEC3 v = Algo::Geometry::vectorOutOfDart<PFP>(this->map, d, this->position);
typename PFP::VEC3 v = Geometry::vectorOutOfDart<PFP>(this->map, d, this->position);
return v.norm();
}
} // namespace Selection
} // Surface
} // namespace Algo
} // namespace CGoGN
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment