-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMPI_ParticleFactory.cpp
77 lines (61 loc) · 1.88 KB
/
MPI_ParticleFactory.cpp
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
76
77
//
// MPI_ParticleFactory.cpp
//
#include "MPI_ParticleFactory.h"
#include "MPI_RemovalStroke.h"
#include "MPI_PlayheadStroke.h"
MPI_PolyLine* MPI_ParticleFactory::ParticleStrokeState::createPolyLine( void ) const
{
return new MPI_ParticleStroke( particlefactory_.getWorkspace(), particlefactory_.getScheduler() );
}
MPI_PolyLine* MPI_ParticleFactory::RemovalStrokeState::createPolyLine( void ) const
{
return new MPI_RemovalStroke( particlefactory_.getWorkspace(), particlefactory_.getScheduler() );
}
MPI_PolyLine* MPI_ParticleFactory::PlayheadStrokeState::createPolyLine( void ) const
{
return new MPI_PlayheadStroke( particlefactory_.getWorkspace(), particlefactory_.getScheduler() );
}
MPI_ParticleFactory::MPI_ParticleFactory( MPI_Workspace &workspace, MPI_Scheduler &scheduler ) :
workspace_( workspace ),
scheduler_( scheduler ),
state_( NULL ),
particlestrokestate_( *this ),
removalstrokestate_( *this ),
playheadstrokestate_( *this )
{
// empty
}
MPI_PolyLine* MPI_ParticleFactory::createPolyLine( void ) const
{
return state_->createPolyLine();
}
MPI_Workspace& MPI_ParticleFactory::getWorkspace( void ) const
{
return workspace_;
}
MPI_Scheduler& MPI_ParticleFactory::getScheduler( void ) const
{
return scheduler_;
}
void MPI_ParticleFactory::setStateParticleStroke( void )
{
setParticleFactoryState( &particlestrokestate_ );
}
void MPI_ParticleFactory::setStateRemovalStroke( void )
{
setParticleFactoryState( &removalstrokestate_ );
}
void MPI_ParticleFactory::setStatePlayheadStroke( unsigned int strokenum )
{
setParticleFactoryState( &playheadstrokestate_ );
}
MPI_ParticleFactory::ParticleFactoryState* MPI_ParticleFactory::getParticleFactoryState( void )
{
return state_;
}
void MPI_ParticleFactory::setParticleFactoryState( MPI_ParticleFactory::ParticleFactoryState* state )
{
state_ = state;
}
// vim:sw=4:et:cindent: