Commit dfdf4035 authored by Etienne Schmitt's avatar Etienne Schmitt

many small improvements

Signed-off-by: Etienne Schmitt's avatarÉtienne Schmitt <etienne.schmitt@inria.fr>
parent 60d13b2e
......@@ -61,7 +61,7 @@ public:
m_state = state ;
}
unsigned int getState()
unsigned int getState() const
{
return m_state ;
}
......
......@@ -35,6 +35,7 @@ template <typename PFP>
class ParticleCell3D : public Algo::MovingObjects::ParticleBase<PFP>
{
public :
typedef Algo::MovingObjects::ParticleBase<PFP> Inherit;
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
typedef VertexAttribute<VEC3, MAP> TAB_POS;
......@@ -48,8 +49,7 @@ public :
VEC3 m_positionFace;
unsigned int state;
unsigned int compteur_anti_infinite;
unsigned int compteur_anti_infinite;
unsigned int crossCell ;
ParticleCell3D(MAP& map) : m(map)
......@@ -59,33 +59,33 @@ public :
Algo::MovingObjects::ParticleBase<PFP>(pos),
m(map),
position(tabPos),
d(belonging_cell),
state(4)
d(belonging_cell)
{
m_positionFace = pointInFace(d);
this->setState(VOLUME);
}
void display();
Dart getCell() { return d; }
Dart getCell() const { return d; }
VEC3 pointInFace(Dart d);
Geom::Orientation3D isLeftENextVertex(VEC3 c, Dart d, VEC3 base);
inline Geom::Orientation3D isLeftENextVertex(const VEC3& c, Dart d, const VEC3& base);
bool isRightVertex(VEC3 c, Dart d, VEC3 base);
inline bool isRightVertex(const VEC3& c, Dart d, const VEC3& base);
Geom::Orientation3D whichSideOfFace(VEC3 c, Dart d);
inline Geom::Orientation3D whichSideOfFace(const VEC3& c, Dart d);
Geom::Orientation3D isLeftL1DVol(VEC3 c, Dart d, VEC3 base, VEC3 top);
inline Geom::Orientation3D isLeftL1DVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
Geom::Orientation3D isRightDVol(VEC3 c, Dart d, VEC3 base, VEC3 top);
inline Geom::Orientation3D isRightDVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
Geom::Orientation3D isAbove(VEC3 c, Dart d, VEC3 top);
inline Geom::Orientation3D isAbove(const VEC3& c, Dart d, const VEC3& top);
int isLeftL1DFace(VEC3 c, Dart d, VEC3 base, VEC3 normal);
inline int isLeftL1DFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
bool isRightDFace(VEC3 c, Dart d, VEC3 base, VEC3 normal);
inline bool isRightDFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
Dart nextDartOfVertexNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
......@@ -93,7 +93,7 @@ public :
Dart nextFaceNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
Geom::Orientation3D whichSideOfEdge(VEC3 c, Dart d);
Geom::Orientation3D whichSideOfEdge(const VEC3& c, Dart d);
bool isOnHalfEdge(VEC3 c, Dart d);
......@@ -115,7 +115,7 @@ public :
compteur_anti_infinite = 0;
if(!Geom::arePointsEquals(newCurrent, this->getPosition()))
{
switch(state) {
switch(this->getState()) {
case VERTEX : vertexState(newCurrent); break;
case EDGE : edgeState(newCurrent); break;
case FACE : faceState(newCurrent); break;
......
......@@ -44,7 +44,7 @@ std::vector<Dart> ParticleCell3DMemo<PFP>::move(const VEC3& newCurrent)
if(!Geom::arePointsEquals(newCurrent, this->getPosition()))
{
CellMarkerMemo<MAP, VOLUME> memo_cross(this->m);
switch(this->state) {
switch(this->getState()) {
case VERTEX : vertexState(newCurrent,memo_cross); break;
case EDGE : edgeState(newCurrent,memo_cross); break;
case FACE : faceState(newCurrent,memo_cross); break;
......@@ -67,7 +67,7 @@ std::vector<Dart> ParticleCell3DMemo<PFP>::move(const VEC3& newCurrent, CellMark
if(!Geom::arePointsEquals(newCurrent, this->getPosition()))
{
switch(this->state) {
switch(this->getState()) {
case VERTEX : vertexState(newCurrent,memo_cross); break;
case EDGE : edgeState(newCurrent,memo_cross); break;
case FACE : faceState(newCurrent,memo_cross); break;
......@@ -100,7 +100,7 @@ void ParticleCell3DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<MA
if(Geom::arePointsEquals(current, this->m_position)) {
this->m_position = this->m_positionFace = som;
this->state = VERTEX;
this->setState(VERTEX);
return;
}
......@@ -264,7 +264,7 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
if(onEdge) {
if(this->isOnHalfEdge(current,this->d))
if (this->isOnHalfEdge(current,this->m.phi3(this->d))) {
this->state=2;
this->setState(EDGE);
this->m_position = this->m_positionFace = current;
}
else {
......@@ -330,7 +330,7 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
case Geom::OVER : this->d=this->m.phi_1(this->d);
break;
case Geom::ON :this->m_position = current;
this->state = EDGE;
this->setState(EDGE);
return;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(this->m,this->d,this->position);
......@@ -345,7 +345,7 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
} while(this->d!=dd);
this->m_position = this->m_positionFace = current;
this->state = FACE;
this->setState(FACE);
return;
}
}
......@@ -362,7 +362,7 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
this->d=this->m.phi_1(this->d);
break;
case Geom::ON :this->m_position = current;
this->state = EDGE;
this->setState(EDGE);
return;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(this->m,this->d,this->position);
......@@ -375,7 +375,7 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
}while(this->d!=dd);
this->m_position = this->m_positionFace = current;
this->state = FACE;
this->setState(FACE);
return;
}
}
......@@ -384,11 +384,11 @@ void ParticleCell3DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
{
case Geom::OVER :
this->m_position = this->m_positionFace = current;
this->state = FACE;
this->setState(FACE);
break;
case Geom::ON :
this->m_position = this->m_positionFace = current;
this->state = EDGE;
this->setState(EDGE);
break;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(this->m,this->d,this->position);
......@@ -496,12 +496,12 @@ void ParticleCell3DMemo<PFP>::volumeState(const VEC3& current, CellMarkerMemo<MA
if(wsof==Geom::UNDER) {
this->m_position = current;
this->state = VOLUME;
this->setState(VOLUME);
}
else if(wsof==Geom::ON) {
if(this->isAbove(current,this->d,this->m_position)==Geom::UNDER) {
this->m_position = this->m_positionFace = current;
this->state = FACE;
this->setState(FACE);
}
else {
this->m_position = this->m_positionFace = current;
......@@ -613,16 +613,16 @@ void ParticleCell3DMemo<PFP>::volumeSpecialCase(const VEC3& current, CellMarkerM
if(wsof==Geom::UNDER) {
this->m_position = current;
this->state = VOLUME;
this->setState(VOLUME);
}
else if(wsof==Geom::ON) {
if(this->isAbove(current,this->d,this->m_position)==Geom::UNDER) {
this->m_position = current;
this->state = FACE;
this->setState(FACE);
}
else {
this->m_position = current;
this->state = EDGE;
this->setState(EDGE);
}
}
else {
......
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