particle_base.h 759 Bytes
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
#ifndef PARTBASE_H
#define PARTBASE_H

David Cazier's avatar
-    
David Cazier committed
4
//#include "Geometry/vector_gen.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
5
6
7
8
9
10
11
12
13
14
15
16

namespace CGoGN
{

namespace Algo
{

namespace MovingObjects
{

/* A particle base defines a position with a displacement function */

David Cazier's avatar
-    
David Cazier committed
17
template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
18
19
class ParticleBase
{
David Cazier's avatar
-    
David Cazier committed
20
21
22
private:
	typename PFP::VEC3 m_position;
	unsigned int m_state;
23

David Cazier's avatar
-    
David Cazier committed
24
25
26
27
public :
	ParticleBase(typename PFP::VEC3 position) :
		m_position(position),
		m_state(FACE)
28
29
30
	{
	}

David Cazier's avatar
-    
David Cazier committed
31
32
	void setState(unsigned int state) {
		m_state = state;
33
34
	}

David Cazier's avatar
-    
David Cazier committed
35
	unsigned int getState()
36
	{
David Cazier's avatar
-    
David Cazier committed
37
		return m_state;
38
39
	}

David Cazier's avatar
-    
David Cazier committed
40
	bool move(typename PFP::VEC3 position)
41
42
43
44
45
	{
		m_position = position;
		return true;
	}

David Cazier's avatar
-    
David Cazier committed
46
	typename PFP::VEC3 getPosition() { return m_position; }
Pierre Kraemer's avatar
Pierre Kraemer committed
47
48
};

49
} // namespace MovingObjects
Pierre Kraemer's avatar
Pierre Kraemer committed
50

51
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
52

53
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
54
55

#endif