Commit d69b68dc authored by pitiot's avatar pitiot
Browse files

up

parent 68c88362
...@@ -94,6 +94,8 @@ inline Dart ImplicitHierarchicalMap3::newDart() ...@@ -94,6 +94,8 @@ inline Dart ImplicitHierarchicalMap3::newDart()
inline Dart ImplicitHierarchicalMap3::phi1(Dart d) const inline Dart ImplicitHierarchicalMap3::phi1(Dart d) const
{ {
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
bool finished = false ; bool finished = false ;
unsigned int edgeId = m_edgeId[d] ; unsigned int edgeId = m_edgeId[d] ;
......
...@@ -70,8 +70,6 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, VertexAttribute<type ...@@ -70,8 +70,6 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, VertexAttribute<type
template <typename PFP>
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP> template <typename PFP>
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ; void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position) ;
......
...@@ -125,7 +125,7 @@ Geom::Orientation3D ParticleCell3D<PFP>::isAbove(VEC3 c, Dart d, VEC3 top) ...@@ -125,7 +125,7 @@ Geom::Orientation3D ParticleCell3D<PFP>::isAbove(VEC3 c, Dart d, VEC3 top)
} }
template <typename PFP> template <typename PFP>
int ParticleCell3D<PFP>::isLeftL1DFace(VEC3 c, Dart d, VEC3 base, VEC3 normal) int ParticleCell3D<PFP>::isLeftL1DFace(VEC3 c, Dart d, VEC3 base, VEC3 normal) // orientation par rapport au plan de gauche de l'arete visée
{ {
VEC3 p2 = position[d]; VEC3 p2 = position[d];
...@@ -139,7 +139,7 @@ int ParticleCell3D<PFP>::isLeftL1DFace(VEC3 c, Dart d, VEC3 base, VEC3 normal) ...@@ -139,7 +139,7 @@ int ParticleCell3D<PFP>::isLeftL1DFace(VEC3 c, Dart d, VEC3 base, VEC3 normal)
} }
template <typename PFP> template <typename PFP>
bool ParticleCell3D<PFP>::isRightDFace(VEC3 c, Dart d, VEC3 base, VEC3 normal) bool ParticleCell3D<PFP>::isRightDFace(VEC3 c, Dart d, VEC3 base, VEC3 normal) // orientation par rapport au plan de droite de l'arete visée
{ {
VEC3 p1 = position[m.phi1(d)]; VEC3 p1 = position[m.phi1(d)];
...@@ -320,7 +320,7 @@ Dart ParticleCell3D<PFP>::nextFaceNotMarked(Dart d, CellMarkerStore<MAP, FACE>& ...@@ -320,7 +320,7 @@ Dart ParticleCell3D<PFP>::nextFaceNotMarked(Dart d, CellMarkerStore<MAP, FACE>&
} }
template <typename PFP> template <typename PFP>
Geom::Orientation3D ParticleCell3D<PFP>::whichSideOfEdge(VEC3 c, Dart d) Geom::Orientation3D ParticleCell3D<PFP>::whichSideOfEdge(VEC3 c, Dart d) // orientation par rapport au plan orthogonal a la face passant par l'arete visée
{ {
VEC3 p1 = position[m.phi1(d)]; VEC3 p1 = position[m.phi1(d)];
VEC3 p2 = position[d]; VEC3 p2 = position[d];
...@@ -329,13 +329,13 @@ Geom::Orientation3D ParticleCell3D<PFP>::whichSideOfEdge(VEC3 c, Dart d) ...@@ -329,13 +329,13 @@ Geom::Orientation3D ParticleCell3D<PFP>::whichSideOfEdge(VEC3 c, Dart d)
VEC3 norm = pl.normal(); VEC3 norm = pl.normal();
VEC3 n2 = norm ^ VEC3(p2-p1); VEC3 n2 = norm ^ VEC3(p2-p1);
Geom::Plane3D<typename PFP::REAL> pl2(n2,p1*n2); Geom::Plane3D<typename PFP::REAL> pl2(n2,p1*n2);
return pl2.orient(c); return pl2.orient(c);
} }
template <typename PFP> template <typename PFP>
bool ParticleCell3D<PFP>::isOnHalfEdge(VEC3 c, Dart d) bool ParticleCell3D<PFP>::isOnHalfEdge(VEC3 c, Dart d) // booleen : vrai si on est sur l'arete mais pas sur le sommet
{ {
VEC3 p1 = position[d]; VEC3 p1 = position[d];
VEC3 p2 = position[m.phi1(d)]; VEC3 p2 = position[m.phi1(d)];
...@@ -362,8 +362,12 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current) ...@@ -362,8 +362,12 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current)
VEC3 som = position[d]; VEC3 som = position[d];
if(Geom::arePointsEquals(current, this->m_position)) { if(Geom::arePointsEquals(current, som)) {
this->m_position = this->m_positionFace = som; #ifdef DEBUG
std::cout << "points equal vrai :" << current << " || "<<this->m_position<<" || "<<d<<" || "<<position[d]<< std::endl;
#endif
// this->m_position = som;
this->m_positionFace = som;
state = VERTEX; state = VERTEX;
return; return;
} }
...@@ -473,23 +477,23 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current) ...@@ -473,23 +477,23 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
crossCell = CROSS_OTHER ; crossCell = CROSS_OTHER ;
bool onEdge=false; bool onEdge=false;
Dart dd=d; Dart dd=d; // dd = arete visée
Geom::Orientation3D wsof = whichSideOfFace(current,m.alpha2(d)); Geom::Orientation3D wsof = whichSideOfFace(current,m.alpha2(d)); // on toruve l'orientation apr rapport a la face adjacente dans le meme volume
if(wsof!=Geom::UNDER) { if(wsof!=Geom::UNDER) { // si on est dessus ou sur
do { do { // on tourne tant qu'on est pas dessous ou sur
d = m.alpha2(d); d = m.alpha2(d);
wsof = whichSideOfFace(current,m.alpha2(d)); wsof = whichSideOfFace(current,m.alpha2(d));
}while(wsof!=1 && dd!=d); }while(wsof!=Geom::OVER && dd!=d);
if(d==dd) if(d==dd) // si on est de retour a la face de départ, c'est qu'on est sur l'arête
onEdge = true; onEdge = true;
if(wsof==Geom::ON) { if(wsof==Geom::ON) { // si on est sur une face
switch(whichSideOfEdge(current,d)) { switch(whichSideOfEdge(current,d)) { // teste pour savoir de quel coté de l'arete visée on se trouve
case Geom::ON : case Geom::ON : // si on est sur l'arête on le marque
onEdge=true; onEdge=true;
break; break;
case Geom::UNDER : case Geom::UNDER : // si on est de l'autre coté , .... ?
d = m.phi2(d); d = m.phi2(d);
break; break;
default : default :
...@@ -497,9 +501,9 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current) ...@@ -497,9 +501,9 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
} }
} }
wsof = whichSideOfFace(current,d); wsof = whichSideOfFace(current,d); // wsof = maintenant on compare avec l'autre face du camembert
} }
else { else { // sinon on tourne dans l'autre sens
wsof = whichSideOfFace(current,d); wsof = whichSideOfFace(current,d);
while(wsof==Geom::UNDER && dd != m.alpha_2(d)) { while(wsof==Geom::UNDER && dd != m.alpha_2(d)) {
...@@ -507,15 +511,13 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current) ...@@ -507,15 +511,13 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
wsof = whichSideOfFace(current,d); wsof = whichSideOfFace(current,d);
} }
switch(whichSideOfEdge(current,d)) { if(whichSideOfEdge(current,d)==Geom::ON) // si on est sur l'arete on le note
case Geom::ON : onEdge=true; {
break; onEdge=true;
default :
break;
} }
} }
if(wsof==-1) { if(wsof==Geom::OVER) { // on a trouvé le camembert et on est dans le volume
this->m_position = pointInFace(d); this->m_position = pointInFace(d);
d = nextNonPlanar(m.phi1(d)); d = nextNonPlanar(m.phi1(d));
...@@ -524,21 +526,24 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current) ...@@ -524,21 +526,24 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
return; return;
} }
else { else {
if(onEdge) { if(onEdge) { // on est sur l'arete visée
if(isOnHalfEdge(current,d)) if(isOnHalfEdge(current,d)) //
if (isOnHalfEdge(current,m.phi3(d))) { {
state=2; if (isOnHalfEdge(current,m.phi3(d))) { // sur l'arete
this->m_position = this->m_positionFace = current; state=EDGE;
this->m_position = this->m_positionFace = current;
} }
else { else { // sur le sommet de l'arete
d=m.phi1(d); this->m_position = position[2];
vertexState(current); vertexState(current);
} }
else { }
else { // sur l'autre sommet de l'arete
d=m.phi1(d);
vertexState(current); vertexState(current);
} }
} }
else { else { // on est sur la face
this->m_positionFace = this->m_position; this->m_positionFace = this->m_position;
d=m.phi1(d); d=m.phi1(d);
faceState(current,wsof); faceState(current,wsof);
......
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