particle_cell_2D_secured.cpp 1.68 KB
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#ifndef PARTCELL2DMEMOSECURED_H
#define PARTCELL2DMEMOSECURED_H

//#define DEBUG

#include "Algo/MovingObjects/particle_cell_2D_memo.h"

#include "Algo/Geometry/inclusion.h"
#include "Geometry/intersection.h"
#include "Geometry/orientation.h"

#include <iostream>

/* A particle cell secured : version of particle cell-memo where particles might go outside the navigation map
 * this class should be used for debug mode only */

namespace CGoGN
{

namespace Algo
{

namespace Surface
{

namespace MovingObjects
{

template <typename PFP>
class ParticleCell2DSecured : public ParticleCell2DMemo<PFP>
{
	typedef typename PFP::MAP MAP ;
	typedef typename PFP::VEC3 VEC3;
	typedef VertexAttribute<VEC3, MAP> TAB_POS ;

private:
	ParticleCell2DSecured()
	{
		std::cout << "Particle Secured : for debugging (unoptimized)" << std::endl;
	}

public:

	ParticleCell2DSecured(MAP& map, Dart belonging_cell, VEC3 pos, const TAB_POS& tabPos) :
		ParticleCell2DMemo<PFP>(map, belonging_cell, pos, tabPos)
	{
//		std::cout << "Particle Memo : for debugging (unoptimized)" << std::endl;
	}

	~ParticleCell2DSecured()
	{
	}

	virtual void vertexState(const VEC3& current, CellMarkerMemo<MAP, FACE>& memo_cross) ;

	virtual void edgeState(const VEC3& current, CellMarkerMemo<MAP, FACE>& memo_cross, Geom::Orientation2D sideOfEdge = Geom::ALIGNED) ;

	virtual void faceState(const VEC3& current, CellMarkerMemo<MAP, FACE>& memo_cross) ;

	std::vector<Dart> move(const VEC3& goal) ;

	std::vector<Dart> move(const VEC3& goal, CellMarkerMemo<MAP, FACE>& memo_cross) ;
} ;

} // namespace MovingObjects

} // namespace Surface

} // namespace Algo

} // namespace CGoGN

#include "Algo/MovingObjects/particle_cell_2D_secured.hpp"

#endif