particle_cell_2D_memo.h 1.33 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
4
5
6
7
8
9
10
11
#ifndef PARTCELL2DMEMO_H
#define PARTCELL2DMEMO_H

#include "particle_cell_2D.h"

#include "Algo/Geometry/inclusion.h"
#include "Geometry/intersection.h"
#include "Geometry/orientation.h"
#include <iostream>

/* A particle cell is a particle base within a map, within a precise cell, the displacement function should indicate
David Cazier's avatar
David Cazier committed
12
 after each displacement wherein lies the new position of the particle */
Pierre Kraemer's avatar
Pierre Kraemer committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26

namespace CGoGN
{

namespace Algo
{

namespace MovingObjects
{

template <typename PFP>
class ParticleCell2DMemo : public ParticleCell2D<PFP>
{

David Cazier's avatar
David Cazier committed
27
28
public:
	typedef typename PFP::MAP MAP ;
Pierre Kraemer's avatar
Pierre Kraemer committed
29
	typedef typename PFP::VEC3 VEC3;
David Cazier's avatar
David Cazier committed
30
	typedef VertexAttribute<typename PFP::VEC3> TAB_POS ;
Pierre Kraemer's avatar
Pierre Kraemer committed
31

David Cazier's avatar
David Cazier committed
32
	std::list<Dart> memo_cross ;
David Cazier's avatar
David Cazier committed
33
34
35
	bool detect_vertex ;
	bool detect_edge ;
	bool detect_face ;
Pierre Kraemer's avatar
Pierre Kraemer committed
36

David Cazier's avatar
David Cazier committed
37
private:
David Cazier's avatar
David Cazier committed
38
39
	ParticleCell2DMemo() :
		detect_vertex(false), detect_edge(false), detect_face(true)
David Cazier's avatar
David Cazier committed
40
41
	{
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
42

David Cazier's avatar
David Cazier committed
43
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
44

David Cazier's avatar
David Cazier committed
45
46
47
48
49
	ParticleCell2DMemo(MAP& map, Dart belonging_cell, VEC3 pos, const TAB_POS& tabPos) :
		ParticleCell2D<PFP>(map, belonging_cell, pos, tabPos),
		detect_vertex(false),
		detect_edge(false),
		detect_face(true)
David Cazier's avatar
David Cazier committed
50
51
	{
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
52

David Cazier's avatar
David Cazier committed
53
	void vertexState(const VEC3& current) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
54

David Cazier's avatar
David Cazier committed
55
	void edgeState(const VEC3& current, Geom::Orientation2D sideOfEdge = Geom::ALIGNED) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
56

David Cazier's avatar
David Cazier committed
57
	void faceState(const VEC3& current) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
58

David Cazier's avatar
David Cazier committed
59
60
	void move(const VEC3& goal) ;
} ;
Pierre Kraemer's avatar
Pierre Kraemer committed
61
62
63
64
65
66
67
68
69
70

#include "particle_cell_2D_memo.hpp"

}

}

}

#endif