Commit d379ccfd authored by Etienne Schmitt's avatar Etienne Schmitt

added getter method to access to the dart in particuleCell3d

Signed-off-by: Etienne Schmitt's avatarÉtienne Schmitt <etienne.schmitt@inria.fr>
parent 8d7b6f6d
......@@ -26,108 +26,117 @@ namespace MovingObjects
{
enum {
NO_CROSS,
CROSS_FACE,
CROSS_OTHER
NO_CROSS,
CROSS_FACE,
CROSS_OTHER
};
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;
typedef Algo::MovingObjects::ParticleBase<PFP> Inherit;
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
typedef VertexAttribute<VEC3, MAP> TAB_POS;
MAP& m;
MAP& m;
const TAB_POS& position;
const TAB_POS& position;
Dart d;
Dart lastCrossed;
VEC3 m_positionFace;
unsigned int compteur_anti_infinite;
unsigned int crossCell ;
VEC3 m_positionFace;
ParticleCell3D(MAP& map) : m(map)
{}
unsigned int compteur_anti_infinite;
unsigned int crossCell ;
ParticleCell3D(MAP& map, Dart belonging_cell, VEC3 pos, const TAB_POS& tabPos) :
Algo::MovingObjects::ParticleBase<PFP>(pos),
m(map),
position(tabPos),
d(belonging_cell)
{
m_positionFace = pointInFace(d);
this->setState(VOLUME);
}
ParticleCell3D(MAP& map) : m(map)
{}
void display();
ParticleCell3D(MAP& map, Dart belonging_cell, VEC3 pos, const TAB_POS& tabPos) :
Algo::MovingObjects::ParticleBase<PFP>(pos),
m(map),
position(tabPos),
d(belonging_cell)
{
m_positionFace = pointInFace(d);
this->setState(VOLUME);
}
inline Dart getCell() const
{
return d;
}
void display();
inline Dart getCell() const
{
return d;
}
inline void setCell(Dart cell)
{
d = cell;
}
inline VEC3 pointInFace(Dart d);
inline VEC3 pointInFace(Dart d);
inline Geom::Orientation3D isLeftENextVertex(const VEC3& c, Dart d, const VEC3& base);
inline Geom::Orientation3D isLeftENextVertex(const VEC3& c, Dart d, const VEC3& base);
inline bool isRightVertex(const VEC3& c, Dart d, const VEC3& base);
inline bool isRightVertex(const VEC3& c, Dart d, const VEC3& base);
inline Geom::Orientation3D whichSideOfFace(const VEC3& c, Dart d);
inline Geom::Orientation3D whichSideOfFace(const VEC3& c, Dart d);
inline Geom::Orientation3D isLeftL1DVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
inline Geom::Orientation3D isLeftL1DVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
inline Geom::Orientation3D isRightDVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
inline Geom::Orientation3D isRightDVol(const VEC3& c, Dart d, const VEC3& base, const VEC3& top);
inline Geom::Orientation3D isAbove(const VEC3& c, Dart d, const VEC3& top);
inline Geom::Orientation3D isAbove(const VEC3& c, Dart d, const VEC3& top);
inline int isLeftL1DFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
inline int isLeftL1DFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
inline bool isRightDFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
inline bool isRightDFace(const VEC3& c, Dart d, const VEC3& base, const VEC3& normal);
Dart nextDartOfVertexNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
Dart nextDartOfVertexNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
Dart nextNonPlanar(Dart d);
Dart nextNonPlanar(Dart d);
Dart nextFaceNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
Dart nextFaceNotMarked(Dart d, CellMarkerStore<MAP, FACE>& mark);
Geom::Orientation3D whichSideOfEdge(const VEC3& c, Dart d);
Geom::Orientation3D whichSideOfEdge(const VEC3& c, Dart d);
bool isOnHalfEdge(VEC3 c, Dart d);
bool isOnHalfEdge(VEC3 c, Dart d);
void vertexState(const VEC3& current);
void vertexState(const VEC3& current);
void edgeState(const VEC3& current);
void edgeState(const VEC3& current);
void faceState(const VEC3& current, Geom::Orientation3D sideOfFace = Geom::ON);
void faceState(const VEC3& current, Geom::Orientation3D sideOfFace = Geom::ON);
void volumeState(const VEC3& current);
void volumeState(const VEC3& current);
void volumeSpecialCase(const VEC3& current);
void volumeSpecialCase(const VEC3& current);
void reset_positionFace();
void reset_positionFace();
void move(const VEC3& newCurrent)
{
crossCell = NO_CROSS ;
void move(const VEC3& newCurrent)
{
crossCell = NO_CROSS ;
compteur_anti_infinite = 0;
if(!Geom::arePointsEquals(newCurrent, this->getPosition()))
{
switch(this->getState()) {
case VERTEX : vertexState(newCurrent); break;
case EDGE : edgeState(newCurrent); break;
case FACE : faceState(newCurrent); break;
case VOLUME : volumeState(newCurrent); break;
}
display();
}
}
if(!Geom::arePointsEquals(newCurrent, this->getPosition()))
{
switch(this->getState()) {
case VERTEX : vertexState(newCurrent); break;
case EDGE : edgeState(newCurrent); break;
case FACE : faceState(newCurrent); break;
case VOLUME : volumeState(newCurrent); break;
}
display();
}
}
protected:
Dart d;
Dart lastCrossed;
};
} // namespace MovingObjects
......
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