Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit 9684ff4c authored by Thomas's avatar Thomas
Browse files

qq correctif mineur

parent 33cc8427
#ifndef EXPORT_POV_H #ifndef EXPORT_POV_H
#define EXPORT_POV #define EXPORT_POV_H
#include "Topology/generic/attributeHandler.h" #include "Topology/generic/attributeHandler.h"
#include "Utils/cgognStream.h" #include "Utils/cgognStream.h"
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*******************************************************************************/ *******************************************************************************/
#include "Algo/Geometry/centroid.h" #include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/tetrahedralization.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -60,7 +61,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const ...@@ -60,7 +61,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
{ {
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
if(map.isVolumeTetrahedron(d)) if(Modelisation::Tetrahedralization::isTetrahedron<PFP>(map,d))
return tetrahedronVolume<PFP>(map,d,position) ; return tetrahedronVolume<PFP>(map,d,position) ;
else else
{ {
......
...@@ -57,8 +57,7 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d) ...@@ -57,8 +57,7 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d)
template <typename PFP> template <typename PFP>
bool isTetrahedron(typename PFP::MAP& the_map, Dart d) bool isTetrahedron(typename PFP::MAP& the_map, Dart d)
{ {
DartMarkerStore mark(*the_map); // Lock a marker DartMarkerStore mark(the_map); // Lock a marker
bool isTetrahedron = true; // Last return value
std::list<Dart> visitedFaces; // Faces that are traversed std::list<Dart> visitedFaces; // Faces that are traversed
visitedFaces.push_back(d); visitedFaces.push_back(d);
...@@ -67,50 +66,38 @@ bool isTetrahedron(typename PFP::MAP& the_map, Dart d) ...@@ -67,50 +66,38 @@ bool isTetrahedron(typename PFP::MAP& the_map, Dart d)
int nbFaces = 0; // Count the faces int nbFaces = 0; // Count the faces
//Test the number of faces end its valency //Test the number of faces end its valency
for(faces = visitedFaces.begin() ; isTetrahedron && faces != visitedFaces.end() ; ++faces) for(faces = visitedFaces.begin() ; faces != visitedFaces.end() ; ++faces)
{ {
Dart dc = *faces; Dart dc = *faces;
//if this dart is not marked //if this dart is not marked
if(!mark.isMarked(dc)) if(!mark.isMarked(dc))
{ {
//increase the number of faces
nbFaces++;
if(nbFaces > 4) //too much faces
return false;
//test the valency of this face //test the valency of this face
if(dc != the_map.phi1(the_map.phi1(the_map.phi1(dc)))) if(dc != the_map.phi1(the_map.phi1(the_map.phi1(dc))))
isTetrahedron = false; return false;
else
//mark the face and push adjacent faces
Dart d1 = dc;
for(unsigned int i = 0; i <3 ; ++i)
{ {
//mark them mark.mark(d1);
mark.markOrbit(DART,dc);
//if phi2 not marked //if phi2 not marked
if(!mark.markOrbit(DART, the_map.phi2(dc))) Dart d2 = the_map.phi2(d1);
visitedFaces.push_back(the_map.phi2(dc)); if(!mark.isMarked(d2))
visitedFaces.push_back(d2);
//increase the number of faces
nbFaces++;
//too much faces d1 = the_map.phi1(dc);
if(nbFaces > 4)
isTetrahedron = false;
// or count the size of the face
else
{
mark.markOrbit(DART, the_map.phi1(dc));
//if phi12 not marked
if(!mark.markOrbit(DART, the_map.phi2(the_map.phi1(dc))))
visitedFaces.push_back(the_map.phi2(the_map.phi1(dc)));
mark.markOrbit(DART, the_map.phi_1(dc));
//if phi_12 not marked
if(!mark.markOrbit(DART, the_map.phi2(the_map.phi_1(dc))))
visitedFaces.push_back(the_map.phi2(the_map.phi_1(dc)));
}
} }
} }
} }
//nettoyage return true;
mark.unmarkAll();
return isTetrahedron;
} }
/************************************************************************************************ /************************************************************************************************
...@@ -272,8 +259,8 @@ void swap4To4(typename PFP::MAP& map, Dart d) ...@@ -272,8 +259,8 @@ void swap4To4(typename PFP::MAP& map, Dart d)
map.unsewVolumes(d); map.unsewVolumes(d);
map.unsewVolumes(map.phi2(map.phi3(dd))); map.unsewVolumes(map.phi2(map.phi3(dd)));
Algo::Modelisation::Tetrahedron::swap2To2<PFP>(map, dd); Algo::Modelisation::Tetrahedralization::swap2To2<PFP>(map, dd);
Algo::Modelisation::Tetrahedron::swap2To2<PFP>(map, e); Algo::Modelisation::Tetrahedralization::swap2To2<PFP>(map, e);
//sew middle darts so that they do not cross //sew middle darts so that they do not cross
map.sewVolumes(d,map.phi2(map.phi3(e))); map.sewVolumes(d,map.phi2(map.phi3(e)));
......
...@@ -34,12 +34,17 @@ class ParticleBase ...@@ -34,12 +34,17 @@ class ParticleBase
/** /**
* @param newPosition new position to reach * @param newPosition new position to reach
*/ */
bool move(VEC3 position) virtual bool move(VEC3 position)
{ {
m_position = position; m_position = position;
return true; return true;
} }
virtual unsigned int getState()
{
return 0;
}
VEC3 getPosition() { return m_position; } VEC3 getPosition() { return m_position; }
}; };
......
...@@ -76,6 +76,11 @@ public : ...@@ -76,6 +76,11 @@ public :
void faceState(const VEC3& current); void faceState(const VEC3& current);
virtual unsigned int getState()
{
return state;
}
void move(const VEC3& newCurrent) void move(const VEC3& newCurrent)
{ {
crossCell = NO_CROSS ; crossCell = NO_CROSS ;
......
...@@ -70,6 +70,11 @@ public : ...@@ -70,6 +70,11 @@ public :
void faceState(VEC3 current); void faceState(VEC3 current);
virtual unsigned int getState()
{
return state;
}
void move(const VEC3& newCurrent) void move(const VEC3& newCurrent)
{ {
crossCell = NO_CROSS ; crossCell = NO_CROSS ;
......
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