xoreos  0.0.5
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Graphics::Aurora::AnimationThread Class Reference

#include <animationthread.h>

Inheritance diagram for Graphics::Aurora::AnimationThread:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Aurora::AnimationThread:
Collaboration graph
[legend]

Classes

struct  PoolModel
 

Public Member Functions

 AnimationThread ()
 
void pause ()
 
void resume ()
 
void registerModel (Model *model)
 Add a model to the processing pool. More...
 
void unregisterModel (Model *model)
 Remove a model from the processing pool. More...
 
void flush ()
 Apply changes to position and geometry of all models in the processing pool. More...
 
- Public Member Functions inherited from Common::Thread
 Thread ()
 
virtual ~Thread ()
 
bool createThread (const UString &name="")
 
bool destroyThread ()
 

Private Types

typedef std::list< PoolModelModelList
 
typedef std::queue< Model * > ModelQueue
 

Private Member Functions

void threadMethod ()
 
void registerModelInternal (Model *model)
 
void unregisterModelInternal (Model *model)
 
uint8 getNumIterationsToSkip (Model *model) const
 

Private Attributes

ModelList _models
 
ModelQueue _registerQueue
 
boost::atomic< bool > _paused
 
boost::atomic< bool > _flushing
 
Common::Semaphore _modelsSem
 Semaphore protecting access to the model list. More...
 
Common::Semaphore _registerSem
 Semaphore protecting access to the registration queue. More...
 

Additional Inherited Members

- Protected Attributes inherited from Common::Thread
boost::atomic< bool > _killThread
 

Detailed Description

Definition at line 44 of file animationthread.h.

Member Typedef Documentation

◆ ModelList

Definition at line 67 of file animationthread.h.

◆ ModelQueue

Definition at line 68 of file animationthread.h.

Constructor & Destructor Documentation

◆ AnimationThread()

Graphics::Aurora::AnimationThread::AnimationThread ( )

Definition at line 46 of file animationthread.cpp.

Member Function Documentation

◆ flush()

void Graphics::Aurora::AnimationThread::flush ( )

Apply changes to position and geometry of all models in the processing pool.

Definition at line 83 of file animationthread.cpp.

References _flushing, _models, _modelsSem, Common::Semaphore::lock(), and Common::Semaphore::unlock().

Referenced by Graphics::GraphicsManager::renderWorld(), and Graphics::GraphicsManager::renderWorldShader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumIterationsToSkip()

uint8 Graphics::Aurora::AnimationThread::getNumIterationsToSkip ( Model model) const
private

Definition at line 176 of file animationthread.cpp.

References CameraMan, and Graphics::Aurora::Model::getPosition().

Referenced by threadMethod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pause()

void Graphics::Aurora::AnimationThread::pause ( )

Definition at line 53 of file animationthread.cpp.

References _modelsSem, _paused, Common::Semaphore::lock(), and Common::Semaphore::unlock().

Referenced by Graphics::GraphicsManager::deinit(), and Graphics::GraphicsManager::pauseAnimations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerModel()

void Graphics::Aurora::AnimationThread::registerModel ( Model model)

Add a model to the processing pool.

Definition at line 63 of file animationthread.cpp.

References _paused, _registerQueue, _registerSem, Common::Semaphore::lock(), registerModelInternal(), and Common::Semaphore::unlock().

Referenced by Graphics::GraphicsManager::registerAnimatedModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerModelInternal()

void Graphics::Aurora::AnimationThread::registerModelInternal ( Model model)
private

Definition at line 158 of file animationthread.cpp.

References _models.

Referenced by registerModel(), and threadMethod().

Here is the caller graph for this function:

◆ resume()

void Graphics::Aurora::AnimationThread::resume ( )

Definition at line 59 of file animationthread.cpp.

References _paused.

Referenced by Graphics::GraphicsManager::resumeAnimations().

Here is the caller graph for this function:

◆ threadMethod()

void Graphics::Aurora::AnimationThread::threadMethod ( )
privatevirtual

◆ unregisterModel()

void Graphics::Aurora::AnimationThread::unregisterModel ( Model model)

Remove a model from the processing pool.

Definition at line 73 of file animationthread.cpp.

References _modelsSem, _paused, Common::Semaphore::lock(), Common::Semaphore::unlock(), and unregisterModelInternal().

Referenced by Graphics::GraphicsManager::unregisterAnimatedModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unregisterModelInternal()

void Graphics::Aurora::AnimationThread::unregisterModelInternal ( Model model)
private

Definition at line 166 of file animationthread.cpp.

References _models.

Referenced by unregisterModel().

Here is the caller graph for this function:

Member Data Documentation

◆ _flushing

boost::atomic<bool> Graphics::Aurora::AnimationThread::_flushing
private

Definition at line 74 of file animationthread.h.

Referenced by flush(), and threadMethod().

◆ _models

ModelList Graphics::Aurora::AnimationThread::_models
private

◆ _modelsSem

Common::Semaphore Graphics::Aurora::AnimationThread::_modelsSem
private

Semaphore protecting access to the model list.

Definition at line 76 of file animationthread.h.

Referenced by flush(), pause(), threadMethod(), and unregisterModel().

◆ _paused

boost::atomic<bool> Graphics::Aurora::AnimationThread::_paused
private

Definition at line 73 of file animationthread.h.

Referenced by pause(), registerModel(), resume(), threadMethod(), and unregisterModel().

◆ _registerQueue

ModelQueue Graphics::Aurora::AnimationThread::_registerQueue
private

Definition at line 71 of file animationthread.h.

Referenced by registerModel(), and threadMethod().

◆ _registerSem

Common::Semaphore Graphics::Aurora::AnimationThread::_registerSem
private

Semaphore protecting access to the registration queue.

Definition at line 77 of file animationthread.h.

Referenced by registerModel(), and threadMethod().


The documentation for this class was generated from the following files: