Commit 3e757ee2 authored by Sylvain Thery's avatar Sylvain Thery

Surface/Volume namespace in particles

parent 074a0cc7
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef PARTBASE_H #ifndef PARTBASE_H
#define PARTBASE_H #define PARTBASE_H
......
...@@ -17,6 +17,9 @@ namespace CGoGN ...@@ -17,6 +17,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MovingObjects namespace MovingObjects
{ {
...@@ -26,7 +29,7 @@ enum ...@@ -26,7 +29,7 @@ enum
} ; } ;
template <typename PFP> template <typename PFP>
class ParticleCell2D : public ParticleBase<PFP> class ParticleCell2D : public MovingObjects::ParticleBase<PFP>
{ {
public: public:
typedef typename PFP::MAP MAP ; typedef typename PFP::MAP MAP ;
...@@ -107,12 +110,11 @@ public: ...@@ -107,12 +110,11 @@ public:
} }
} ; } ;
#include "particle_cell_2D.hpp"
} }
} }
} }
}
#include "particle_cell_2D.hpp"
#endif #endif
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace CGoGN
{
namespace Algo
{
namespace Surface
{
namespace MovingObjects
{
template <typename PFP> template <typename PFP>
void ParticleCell2D<PFP>::display() void ParticleCell2D<PFP>::display()
{ {
...@@ -65,7 +101,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal) ...@@ -65,7 +101,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
crossCell = CROSS_OTHER ; crossCell = CROSS_OTHER ;
if (Algo::Geometry::isPointOnVertex < PFP > (m, d, positionAttribut, goal)) if (Geometry::isPointOnVertex < PFP > (m, d, positionAttribut, goal))
{ {
this->setState(VERTEX) ; this->setState(VERTEX) ;
this->ParticleBase < PFP > ::move(goal) ; this->ParticleBase < PFP > ::move(goal) ;
...@@ -91,7 +127,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal) ...@@ -91,7 +127,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//orbit with 2 edges : point on one edge //orbit with 2 edges : point on one edge
if(m.phi2_1(m.phi2_1(d)) == d) if(m.phi2_1(m.phi2_1(d)) == d)
{ {
if(!Algo::Geometry::isPointOnHalfEdge<PFP>(m,d,positionAttribut,goal)) if(!Geometry::isPointOnHalfEdge<PFP>(m,d,positionAttribut,goal))
d = m.phi2_1(d); d = m.phi2_1(d);
} }
else else
...@@ -99,8 +135,8 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal) ...@@ -99,8 +135,8 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//checking : case with 3 orthogonal darts and point on an edge //checking : case with 3 orthogonal darts and point on an edge
do do
{ {
if(Algo::Geometry::isPointOnHalfEdge<PFP>(m,d,positionAttribut,goal) if(Geometry::isPointOnHalfEdge<PFP>(m,d,positionAttribut,goal)
&& Algo::Geometry::isPointOnHalfEdge<PFP>(m,this->m.phi2(d),positionAttribut,goal) && Geometry::isPointOnHalfEdge<PFP>(m,this->m.phi2(d),positionAttribut,goal)
&& this->getOrientationEdge(goal, this->d) == Geom::ALIGNED) && this->getOrientationEdge(goal, this->d) == Geom::ALIGNED)
{ {
edgeState(goal) ; edgeState(goal) ;
...@@ -129,7 +165,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal) ...@@ -129,7 +165,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//displacement step //displacement step
if (getOrientationEdge(goal, d) == Geom::ALIGNED if (getOrientationEdge(goal, d) == Geom::ALIGNED
&& Algo::Geometry::isPointOnHalfEdge < PFP > (m, d, positionAttribut, goal)) && Geometry::isPointOnHalfEdge < PFP > (m, d, positionAttribut, goal))
edgeState(goal) ; edgeState(goal) ;
else else
{ {
...@@ -147,7 +183,7 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf ...@@ -147,7 +183,7 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
#endif #endif
assert(goal.isFinite()) ; assert(goal.isFinite()) ;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position)); // assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if (crossCell == NO_CROSS) if (crossCell == NO_CROSS)
{ {
...@@ -174,13 +210,13 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf ...@@ -174,13 +210,13 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
break ; break ;
} }
if (!Algo::Geometry::isPointOnHalfEdge < PFP > (m, d, positionAttribut, goal)) if (!Geometry::isPointOnHalfEdge < PFP > (m, d, positionAttribut, goal))
{ {
this->ParticleBase < PFP > ::move(positionAttribut[d]) ; this->ParticleBase < PFP > ::move(positionAttribut[d]) ;
vertexState(goal) ; vertexState(goal) ;
return ; return ;
} }
else if (!Algo::Geometry::isPointOnHalfEdge < PFP > (m, m.phi2(d), positionAttribut, goal)) else if (!Geometry::isPointOnHalfEdge < PFP > (m, m.phi2(d), positionAttribut, goal))
{ {
d = m.phi2(d) ; d = m.phi2(d) ;
this->ParticleBase < PFP > ::move(positionAttribut[d]) ; this->ParticleBase < PFP > ::move(positionAttribut[d]) ;
...@@ -278,7 +314,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal) ...@@ -278,7 +314,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
assert(this->getPosition().isFinite()); assert(this->getPosition().isFinite());
assert(goal.isFinite()) ; assert(goal.isFinite()) ;
// assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true)); // assert(Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
Dart dd = d ; Dart dd = d ;
float wsoe = getOrientationFace(goal, m.phi1(d)) ; float wsoe = getOrientationFace(goal, m.phi1(d)) ;
...@@ -317,7 +353,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal) ...@@ -317,7 +353,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
this->ParticleBase<PFP>::move(goal) ; this->ParticleBase<PFP>::move(goal) ;
this->setState(FACE) ; this->setState(FACE) ;
// m_position = Algo::Geometry::faceCentroid<PFP>(m,d,m_positions); // m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
// d = m.phi1(d); // d = m.phi1(d);
// m_position = pointInFace(d); // m_position = pointInFace(d);
// faceState(current); // faceState(current);
...@@ -403,3 +439,8 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal) ...@@ -403,3 +439,8 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
break ; break ;
} }
} }
}
}
} //namespaces
}
...@@ -17,6 +17,9 @@ namespace CGoGN ...@@ -17,6 +17,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MovingObjects namespace MovingObjects
{ {
...@@ -52,12 +55,11 @@ public: ...@@ -52,12 +55,11 @@ public:
std::vector<Dart> move(const VEC3& goal); std::vector<Dart> move(const VEC3& goal);
} ; } ;
#include "particle_cell_2D_memo.hpp"
} }
} }
} }
}
#include "particle_cell_2D_memo.hpp"
#endif #endif
template <typename PFP> /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace CGoGN
{
namespace Algo
{
namespace Surface
{
namespace MovingObjects
{
template <typename PFP>
std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal) std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
{ {
this->crossCell = NO_CROSS ; this->crossCell = NO_CROSS ;
...@@ -49,7 +84,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA ...@@ -49,7 +84,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
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 (Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current))
{ {
this->setState(VERTEX) ; this->setState(VERTEX) ;
this->ParticleBase<PFP>::move(current) ; this->ParticleBase<PFP>::move(current) ;
...@@ -76,7 +111,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA ...@@ -76,7 +111,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//orbit with 2 edges : point on one edge //orbit with 2 edges : point on one edge
if (this->m.phi2_1(this->m.phi2_1(this->d)) == this->d) if (this->m.phi2_1(this->m.phi2_1(this->d)) == this->d)
{ {
if (!Algo::Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current)) if (!Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current))
this->d = this->m.phi2_1(this->d) ; this->d = this->m.phi2_1(this->d) ;
} }
else else
...@@ -84,8 +119,8 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA ...@@ -84,8 +119,8 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//checking : case with 3 orthogonal darts and point on an edge //checking : case with 3 orthogonal darts and point on an edge
do do
{ {
if(Algo::Geometry::isPointOnHalfEdge<PFP>(this->m,this->d,this->positionAttribut,current) if(Geometry::isPointOnHalfEdge<PFP>(this->m,this->d,this->positionAttribut,current)
&& Algo::Geometry::isPointOnHalfEdge<PFP>(this->m,this->m.phi2(this->d),this->positionAttribut,current) && Geometry::isPointOnHalfEdge<PFP>(this->m,this->m.phi2(this->d),this->positionAttribut,current)
&& this->getOrientationEdge(current, this->d) == Geom::ALIGNED) && this->getOrientationEdge(current, this->d) == Geom::ALIGNED)
{ {
...@@ -116,7 +151,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA ...@@ -116,7 +151,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//displacement step //displacement step
if (this->getOrientationEdge(current, this->d) == Geom::ALIGNED if (this->getOrientationEdge(current, this->d) == Geom::ALIGNED
&& Algo::Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current)) && Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current))
edgeState(current,memo_cross) ; edgeState(current,memo_cross) ;
else else
{ {
...@@ -134,7 +169,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE ...@@ -134,7 +169,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
#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])) ;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position)); // assert(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)
{ {
...@@ -161,14 +196,14 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE ...@@ -161,14 +196,14 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
break ; break ;
} }
if (!Algo::Geometry::isPointOnHalfEdge < PFP if (!Geometry::isPointOnHalfEdge < PFP
> (this->m, this->d, this->positionAttribut, current)) > (this->m, this->d, this->positionAttribut, current))
{ {
this->ParticleBase<PFP>::move(this->positionAttribut[this->d]) ; this->ParticleBase<PFP>::move(this->positionAttribut[this->d]) ;
vertexState(current,memo_cross) ; vertexState(current,memo_cross) ;
return ; return ;
} }
else if (!Algo::Geometry::isPointOnHalfEdge < PFP else if (!Geometry::isPointOnHalfEdge < PFP
> (this->m, this->m.phi2(this->d), this->positionAttribut, current)) > (this->m, this->m.phi2(this->d), this->positionAttribut, current))
{ {
this->d = this->m.phi2(this->d) ; this->d = this->m.phi2(this->d) ;
...@@ -191,7 +226,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE ...@@ -191,7 +226,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
std::isfinite(this->getPosition()[0]) && std::isfinite(this->getPosition()[1]) std::isfinite(this->getPosition()[0]) && std::isfinite(this->getPosition()[1])
&& 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(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)) ;
...@@ -234,7 +269,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE ...@@ -234,7 +269,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
this->ParticleBase<PFP>::move(current); this->ParticleBase<PFP>::move(current);
this->setState(FACE) ; this->setState(FACE) ;
// m_position = Algo::Geometry::faceCentroid<PFP>(m,d,m_positions); // m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
// d = m.phi1(d); // d = m.phi1(d);
// m_position = pointInFace(d); // m_position = pointInFace(d);
// faceState(current); // faceState(current);
...@@ -321,3 +356,8 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE ...@@ -321,3 +356,8 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
} }
} }
}
}
} //namespaces
}
...@@ -17,6 +17,9 @@ namespace CGoGN ...@@ -17,6 +17,9 @@ namespace CGoGN
namespace Algo namespace Algo
{ {
namespace Surface
{
namespace MovingObjects namespace MovingObjects
{ {
...@@ -50,13 +53,16 @@ public: ...@@ -50,13 +53,16 @@ public:
std::vector<Dart> move(const VEC3& goal) ; std::vector<Dart> move(const VEC3& goal) ;
std::vector<Dart> move(const VEC3& goal, CellMarkerMemo<FACE>& memo_cross) ; std::vector<Dart> move(const VEC3& goal, CellMarkerMemo<FACE>& memo_cross) ;
} ; } ;
#include "particle_cell_2D_secured.hpp"
} //MovingObject } //MovingObject
} // Surface
} //Algo } //Algo
} //CGoGN } //CGoGN
#include "particle_cell_2D_secured.hpp"
#endif #endif
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace CGoGN
{
namespace Algo
{
namespace Surface
{
namespace MovingObjects
{
template <typename PFP> template <typename PFP>
std::vector<Dart> ParticleCell2DSecured<PFP>::move(const VEC3& goal) std::vector<Dart> ParticleCell2DSecured<PFP>::move(const VEC3& goal)
{ {
...@@ -48,7 +83,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo ...@@ -48,7 +83,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
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])) ;
this->crossCell = CROSS_OTHER ; this->crossCell = CROSS_OTHER ;
if (Algo::Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current)) if (Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current))
{ {
this->setState(VERTEX) ; this->setState(VERTEX) ;
this->ParticleBase<PFP>::move(current) ; this->ParticleBase<PFP>::move(current) ;
...@@ -75,7 +110,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo ...@@ -75,7 +110,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//orbit with 2 edges : point on one edge //orbit with 2 edges : point on one edge
if (this->m.phi2_1(this->m.phi2_1(this->d)) == this->d) if (this->m.phi2_1(this->m.phi2_1(this->d)) == this->d)
{ {
if (!Algo::Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current)) if (!Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current))
this->d = this->m.phi2_1(this->d) ; this->d = this->m.phi2_1(this->d) ;
} }
else else
...@@ -83,8 +118,8 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo ...@@ -83,8 +118,8 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//checking : case with 3 orthogonal darts and point on an edge //checking : case with 3 orthogonal darts and point on an edge
do do
{ {
if(Algo::Geometry::isPointOnHalfEdge<PFP>(this->m,this->d,this->positionAttribut,current) if(Geometry::isPointOnHalfEdge<PFP>(this->m,this->d,this->positionAttribut,current)
&& Algo::Geometry::isPointOnHalfEdge<PFP>(this->m,this->m.phi2(this->d),this->positionAttribut,current) && Geometry::isPointOnHalfEdge<PFP>(this->m,this->m.phi2(this->d),this->positionAttribut,current)
&& this->getOrientationEdge(current, this->d) == Geom::ALIGNED) && this->getOrientationEdge(current, this->d) == Geom::ALIGNED)
{ {
...@@ -116,7 +151,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo ...@@ -116,7 +151,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//displacement step //displacement step
if (this->getOrientationEdge(current, this->d) == Geom::ALIGNED if (this->getOrientationEdge(current, this->d) == Geom::ALIGNED
&& Algo::Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current)) && Geometry::isPointOnHalfEdge<PFP>(this->m, this->d, this->positionAttribut, current))
edgeState(current,memo_cross) ; edgeState(current,memo_cross) ;
else else
{ {
...@@ -143,7 +178,7 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F ...@@ -143,7 +178,7 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
// else // else
{ {
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(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if (this->crossCell == NO_CROSS) if (this->crossCell == NO_CROSS)
{ {
this->crossCell = CROSS_EDGE ; this->crossCell = CROSS_EDGE ;
...@@ -169,14 +204,14 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F ...@@ -169,14 +204,14 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
break ; break ;
} }
if (!Algo::Geometry::isPointOnHalfEdge < PFP if (!Geometry::isPointOnHalfEdge < PFP
> (this->m, this->d, this->positionAttribut, current)) > (this->m, this->d, this->positionAttribut, current))
{ {
this->ParticleBase<PFP>::move(this->positionAttribut[this->d]) ; this->ParticleBase<PFP>::move(this->positionAttribut[this->d]) ;
vertexState(current,memo_cross) ; vertexState(current,memo_cross) ;
return ; return ;
} }
else if (!Algo::Geometry::isPointOnHalfEdge < PFP else if (!Geometry::isPointOnHalfEdge < PFP
> (this->m, this->m.phi2(this->d), this->positionAttribut, current)) > (this->m, this->m.phi2(this->d), this->positionAttribut, current))
{ {
this->d = this->m.phi2(this->d) ; this->d = this->m.phi2(this->d) ;
...@@ -208,5 +243,9 @@ void ParticleCell2DSecured<PFP>::faceState(const VEC3& current, CellMarkerMemo<F ...@@ -208,5 +243,9 @@ void ParticleCell2DSecured<PFP>::faceState(const VEC3& current, CellMarkerMemo<F
ParticleCell2DMemo<PFP>::faceState(current,memo_cross); ParticleCell2DMemo<PFP>::faceState(current,memo_cross);
} }
}
} }
}
} //namespaces
}
...@@ -18,6 +18,9 @@ namespace CGoGN ...@@ -18,6 +18,9 @@ namespace CGoGN
namespace Algo