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

bug Surface/Volume namespace

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