Commit 3322f3f6 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'master' of cgogn:~jund/CGoGN

parents 9b56e839 c2671a54
...@@ -42,14 +42,14 @@ public: ...@@ -42,14 +42,14 @@ public:
} }
void vertexState(const VEC3& current, CellMarkerMemo<FACE> * memo_cross) ; void vertexState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross) ;
void edgeState(const VEC3& current, CellMarkerMemo<FACE> * memo_cross, Geom::Orientation2D sideOfEdge = Geom::ALIGNED) ; void edgeState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross, Geom::Orientation2D sideOfEdge = Geom::ALIGNED) ;
void faceState(const VEC3& current, CellMarkerMemo<FACE> * memo_cross) ; void faceState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross) ;
void move(const VEC3& goal, CellMarkerMemo<FACE> * memo_cross) ; std::vector<Dart> move(const VEC3& goal) ;
std::vector<Dart> get_memo(const VEC3& goal); std::vector<Dart> move(const VEC3& goal, CellMarkerMemo<FACE>& memo_cross) ;
} ; } ;
#include "particle_cell_2D_memo.hpp" #include "particle_cell_2D_memo.hpp"
......
template <typename PFP> template <typename PFP>
void ParticleCell2DMemo<PFP>::move(const VEC3& goal, CellMarkerMemo<FACE> * memo_cross) std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
{ {
this->crossCell = NO_CROSS ; this->crossCell = NO_CROSS ;
if (!Geom::arePointsEquals(goal, this->getPosition())) if (!Geom::arePointsEquals(goal, this->getPosition()))
{ {
CellMarkerMemo<FACE> memo_cross(this->m);
memo_cross.mark(this->d);
switch (this->getState()) switch (this->getState())
{ {
case VERTEX : case VERTEX :
...@@ -16,28 +19,52 @@ void ParticleCell2DMemo<PFP>::move(const VEC3& goal, CellMarkerMemo<FACE> * memo ...@@ -16,28 +19,52 @@ void ParticleCell2DMemo<PFP>::move(const VEC3& goal, CellMarkerMemo<FACE> * memo
faceState(goal,memo_cross) ; faceState(goal,memo_cross) ;
break ; break ;
} }
return memo_cross.get_markedCells();
} }
else else
this->ParticleBase<PFP>::move(goal) ; this->ParticleBase<PFP>::move(goal) ;
std::vector<Dart> res;
res.push_back(this->d);
return res;
} }
template <typename PFP> template <typename PFP>
std::vector<Dart> ParticleCell2DMemo<PFP>::get_memo(const VEC3& goal) std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal, CellMarkerMemo<FACE>& memo_cross)
{ {
CellMarkerMemo<FACE> memo_cross(this->m);
memo_cross.mark(this->d); memo_cross.mark(this->d);
this->move(goal,&memo_cross);
this->crossCell = NO_CROSS ;
if (!Geom::arePointsEquals(goal, this->getPosition()))
{
switch (this->getState())
{
case VERTEX :
vertexState(goal,memo_cross) ;
break ;
case EDGE :
edgeState(goal,memo_cross) ;
break ;
case FACE :
faceState(goal,memo_cross) ;
break ;
}
}
else
this->ParticleBase<PFP>::move(goal) ;
return memo_cross.get_markedCells(); return memo_cross.get_markedCells();
} }
template <typename PFP> template <typename PFP>
void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FACE> * memo_cross) void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross)
{ {
#ifdef DEBUG #ifdef DEBUG
CGoGNout << "vertexState" << this->d << CGoGNendl ; CGoGNout << "vertexState" << this->d << CGoGNendl ;
#endif #endif
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ; assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
(*memo_cross).mark(this->d); memo_cross.mark(this->d);
this->crossCell = CROSS_OTHER ; this->crossCell = CROSS_OTHER ;
if (Algo::Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current)) if (Algo::Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current))
...@@ -119,7 +146,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA ...@@ -119,7 +146,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
} }
template <typename PFP> template <typename PFP>
void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE>* memo_cross, Geom::Orientation2D sideOfEdge) void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross, Geom::Orientation2D sideOfEdge)
{ {
#ifdef DEBUG #ifdef DEBUG
CGoGNout << "edgeState" << this->d << CGoGNendl ; CGoGNout << "edgeState" << this->d << CGoGNendl ;
...@@ -127,7 +154,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE ...@@ -127,7 +154,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ; assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position)); // assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
(*memo_cross).mark(this->d); memo_cross.mark(this->d);
if (this->crossCell == NO_CROSS) if (this->crossCell == NO_CROSS)
{ {
this->crossCell = CROSS_EDGE ; this->crossCell = CROSS_EDGE ;
...@@ -173,7 +200,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE ...@@ -173,7 +200,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
} }
template <typename PFP> template <typename PFP>
void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE> * memo_cross) void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE>& memo_cross)
{ {
#ifdef DEBUG #ifdef DEBUG
CGoGNout << "faceState" << this->d << CGoGNendl ; CGoGNout << "faceState" << this->d << CGoGNendl ;
...@@ -184,7 +211,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE ...@@ -184,7 +211,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
&& std::isfinite(this->getPosition()[2])) ; && std::isfinite(this->getPosition()[2])) ;
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ; assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
// assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true)); // assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
(*memo_cross).mark(this->d); memo_cross.mark(this->d);
Dart dd = this->d ; Dart dd = this->d ;
float wsoe = this->getOrientationFace(current, this->m.phi1(this->d)) ; float wsoe = this->getOrientationFace(current, this->m.phi1(this->d)) ;
......
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