OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes
WCreateColorArraysThread Class Reference

implements a thread that updates the fiber selection bit field More...

#include <WCreateColorArraysThread.h>

+ Inheritance diagram for WCreateColorArraysThread:

List of all members.

Public Member Functions

 WCreateColorArraysThread (int left, int right, boost::shared_ptr< std::vector< float > >vertices, boost::shared_ptr< std::vector< size_t > > lineStartIndexes, boost::shared_ptr< std::vector< size_t > > lineLengths, boost::shared_ptr< std::vector< float > > globalColors, boost::shared_ptr< std::vector< float > > localColors, boost::shared_ptr< std::vector< float > > tangents)
 default constructor
virtual ~WCreateColorArraysThread ()
 destructor
virtual void threadMain ()
 entry for the run command
bool isFinished ()
 Return the value of the finished flag.
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor.
virtual ~WThreadedRunner ()
 Destructor.
virtual void run ()
 Run thread.
void run (THREADFUNCTION f)
 Run thread.
void wait (bool requestFinish=false)
 Wait for the thread to be finished.
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it.

Private Attributes

bool m_myThreadFinished
 Has the thread finished?
int m_left
 left boundary
int m_right
 right boundary
boost::shared_ptr< std::vector
< float > > 
m_vertices
 Point vector for all fibers.
boost::shared_ptr< std::vector
< float > > 
m_tangents
 Point vector for tangents at each vertex, used for fake tubes.
boost::shared_ptr< std::vector
< float > > 
m_globalColors
 Storing the global color value of the fibers for each point.
boost::shared_ptr< std::vector
< float > > 
m_localColors
 Storing the local color value of the fibers for each point.
boost::shared_ptr< std::vector
< size_t > > 
m_lineStartIndexes
 Line vector that contains the start index of its first point for each line.
boost::shared_ptr< std::vector
< size_t > > 
m_lineLengths
 Line vector that contains the number of vertices for each line.

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions.
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped.
void yield () const
 Give remaining execution timeslice to another thread.
void sleep (const int32_t t) const
 Sets thread asleep.
void msleep (const int32_t t) const
 Sets thread asleep.
void waitForStop ()
 Let the thread sleep until a stop request was given.
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance.
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit.

Detailed Description

implements a thread that updates the fiber selection bit field

Definition at line 36 of file WCreateColorArraysThread.h.


Constructor & Destructor Documentation

WCreateColorArraysThread::WCreateColorArraysThread ( int  left,
int  right,
boost::shared_ptr< std::vector< float > >  vertices,
boost::shared_ptr< std::vector< size_t > >  lineStartIndexes,
boost::shared_ptr< std::vector< size_t > >  lineLengths,
boost::shared_ptr< std::vector< float > >  globalColors,
boost::shared_ptr< std::vector< float > >  localColors,
boost::shared_ptr< std::vector< float > >  tangents 
)

default constructor

Parameters:
left
right
vertices
lineStartIndexes
lineLengths
globalColors
localColors
tangents

Definition at line 30 of file WCreateColorArraysThread.cpp.

WCreateColorArraysThread::~WCreateColorArraysThread ( )
virtual

destructor

Definition at line 49 of file WCreateColorArraysThread.cpp.


Member Function Documentation

bool WCreateColorArraysThread::isFinished ( )
inline

Return the value of the finished flag.

Returns:
true if finished

Definition at line 144 of file WCreateColorArraysThread.cpp.

References m_myThreadFinished.

void WCreateColorArraysThread::threadMain ( )
virtual

entry for the run command

Reimplemented from WThreadedRunner.

Definition at line 53 of file WCreateColorArraysThread.cpp.

References m_globalColors, m_left, m_lineLengths, m_lineStartIndexes, m_localColors, m_myThreadFinished, m_right, m_tangents, and m_vertices.


Member Data Documentation

boost::shared_ptr< std::vector< float > > WCreateColorArraysThread::m_globalColors
private

Storing the global color value of the fibers for each point.

Definition at line 97 of file WCreateColorArraysThread.h.

Referenced by threadMain().

int WCreateColorArraysThread::m_left
private

left boundary

Definition at line 80 of file WCreateColorArraysThread.h.

Referenced by threadMain().

boost::shared_ptr< std::vector< size_t > > WCreateColorArraysThread::m_lineLengths
private

Line vector that contains the number of vertices for each line.

Definition at line 115 of file WCreateColorArraysThread.h.

Referenced by threadMain().

boost::shared_ptr< std::vector< size_t > > WCreateColorArraysThread::m_lineStartIndexes
private

Line vector that contains the start index of its first point for each line.

Warning:
The index returned cannot be used in the vertices array until the number of components for each point is multiplied.

Definition at line 110 of file WCreateColorArraysThread.h.

Referenced by threadMain().

boost::shared_ptr< std::vector< float > > WCreateColorArraysThread::m_localColors
mutableprivate

Storing the local color value of the fibers for each point.

Notes:
it is mutable to allow getLocalColors creating it on demand.

Definition at line 103 of file WCreateColorArraysThread.h.

Referenced by threadMain().

bool WCreateColorArraysThread::m_myThreadFinished
private

Has the thread finished?

Definition at line 78 of file WCreateColorArraysThread.h.

Referenced by isFinished(), and threadMain().

int WCreateColorArraysThread::m_right
private

right boundary

Definition at line 82 of file WCreateColorArraysThread.h.

Referenced by threadMain().

boost::shared_ptr< std::vector< float > > WCreateColorArraysThread::m_tangents
private

Point vector for tangents at each vertex, used for fake tubes.

Definition at line 92 of file WCreateColorArraysThread.h.

Referenced by threadMain().

boost::shared_ptr< std::vector< float > > WCreateColorArraysThread::m_vertices
private

Point vector for all fibers.

Definition at line 87 of file WCreateColorArraysThread.h.

Referenced by threadMain().


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