OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WCreateColorArraysThread Class Reference

Thread for computing directional color coding of fibers. More...

#include <WCreateColorArraysThread.h>

+ Inheritance diagram for WCreateColorArraysThread:
+ Collaboration diagram for WCreateColorArraysThread:

Public Member Functions

 WCreateColorArraysThread (int left, int right, std::shared_ptr< std::vector< float > >vertices, std::shared_ptr< std::vector< size_t > > lineLengths, std::shared_ptr< std::vector< float > > globalColors, std::shared_ptr< std::vector< float > > localColors, std::shared_ptr< std::vector< float > > tangents)
 default constructor More...
 
virtual ~WCreateColorArraysThread ()
 destructor More...
 
virtual void threadMain ()
 entry for the run command More...
 
bool isFinished ()
 Return the value of the finished flag. More...
 
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor. More...
 
virtual ~WThreadedRunner ()
 Destructor. More...
 
virtual void run ()
 Run thread. More...
 
void run (THREADFUNCTION f)
 Run thread. More...
 
void wait (bool requestFinish=false)
 Wait for the thread to be finished. More...
 
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it. More...
 
virtual boost::signals2::connection subscribeSignal (THREAD_SIGNAL signal, t_ThreadErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this thread instance is offering. More...
 
const WBoolFlagisCrashed () const
 Checks whether this thread has been crashed. More...
 
const std::string & getCrashMessage () const
 Get the message of the exception finally causing the crash. More...
 
void setThreadName (std::string name)
 Set the name of the thread. More...
 
std::string getThreadName () const
 Returns the current thread name. More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef std::shared_ptr< WThreadedRunnerSPtr
 Abbreviation to a shared_ptr to this type. More...
 
typedef std::shared_ptr< const WThreadedRunnerConstSPtr
 Abbreviation to a const shared_ptr to this type. More...
 
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions. More...
 
- Static Public Member Functions inherited from WThreadedRunner
static void setThisThreadName (std::string name)
 Static function to set the name of the calling thread. More...
 
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped. More...
 
void yield () const
 Give remaining execution timeslice to another thread. More...
 
void sleep (const int32_t t) const
 Sets thread asleep. More...
 
void msleep (const int32_t t) const
 Sets thread asleep. More...
 
void waitForStop ()
 Let the thread sleep until a stop request was given. More...
 
virtual void onThreadException (const WException &e)
 This method is called if an exception was caught, which came from the custom thread code. More...
 
void handleDeadlyException (const WException &e, std::string sender="WThreadedRunner")
 Handle the specified exception which was not caught in the thread, which basically means the thread has crashed. More...
 
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance. More...
 
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit. More...
 
WBoolFlag m_isCrashed
 True whenever an exception is thrown during threadMain. More...
 
std::string m_crashMessage
 The crash message. More...
 

Detailed Description

Thread for computing directional color coding of fibers.

Definition at line 36 of file WCreateColorArraysThread.h.

Constructor & Destructor Documentation

◆ WCreateColorArraysThread()

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

default constructor

Parameters
leftstart position of the first line to comput colors for
rightlast line for which the color is computed
verticesvertices of all lines
lineLengthsline length in vertex array
globalColorswhere to write global coloring
localColorswhere to write local coloring
tangents

Definition at line 32 of file WCreateColorArraysThread.cpp.

◆ ~WCreateColorArraysThread()

WCreateColorArraysThread::~WCreateColorArraysThread ( )
virtual

destructor

Definition at line 49 of file WCreateColorArraysThread.cpp.

Member Function Documentation

◆ isFinished()

bool WCreateColorArraysThread::isFinished ( )
inline

Return the value of the finished flag.

Returns
true if finished

Definition at line 145 of file WCreateColorArraysThread.cpp.

References m_myThreadFinished.

◆ threadMain()

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_localColors, m_myThreadFinished, m_right, m_tangents, and m_vertices.

Member Data Documentation

◆ m_globalColors

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

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

Definition at line 94 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_left

int WCreateColorArraysThread::m_left
private

left boundary

Definition at line 77 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_lineLengths

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

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

Definition at line 105 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_localColors

std::shared_ptr< std::vector< float > > WCreateColorArraysThread::m_localColors
private

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

Note
it is mutable to allow getLocalColors creating it on demand.

Definition at line 100 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_myThreadFinished

bool WCreateColorArraysThread::m_myThreadFinished
private

Has the thread finished?

Definition at line 75 of file WCreateColorArraysThread.h.

Referenced by isFinished(), and threadMain().

◆ m_right

int WCreateColorArraysThread::m_right
private

right boundary

Definition at line 79 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_tangents

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

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

Definition at line 89 of file WCreateColorArraysThread.h.

Referenced by threadMain().

◆ m_vertices

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

Point vector for all fibers.

Definition at line 84 of file WCreateColorArraysThread.h.

Referenced by threadMain().


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