particle_base.h 790 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
private:
David Cazier's avatar
David Cazier committed
21
22
	typename PFP::VEC3 m_position ;
	unsigned int m_state ;
23

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

David Cazier's avatar
David Cazier committed
30
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(const typename PFP::VEC3& position)
41
	{
David Cazier's avatar
David Cazier committed
42
43
		m_position = position ;
		return true ;
44
45
	}

David Cazier's avatar
David Cazier committed
46
47
48
49
50
	const typename PFP::VEC3& getPosition()
	{
		return m_position ;
	}
} ;
Pierre Kraemer's avatar
Pierre Kraemer committed
51

52
} // namespace MovingObjects
Pierre Kraemer's avatar
Pierre Kraemer committed
53

54
} // namespace Algo
Pierre Kraemer's avatar
Pierre Kraemer committed
55

56
} // namespace CGoGN
Pierre Kraemer's avatar
Pierre Kraemer committed
57
58

#endif