OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
WROI Class Referenceabstract

Superclass for different ROI (region of interest) types. More...

#include <WROI.h>

+ Inheritance diagram for WROI:
+ Collaboration diagram for WROI:

Public Types

typedef osg::ref_ptr< WROIRefPtr
 Ref Pointer type. More...
 

Public Member Functions

virtual ~WROI ()
 Need virtual destructor because of virtual function. More...
 
void setNot (bool isNot=true)
 sets the NOT flag More...
 
bool isNot ()
 getter for NOT flag More...
 
bool active ()
 getter More...
 
void setActive (bool active)
 setter More...
 
void hide ()
 hides the roi in the scene More...
 
void unhide ()
 unhides the roi in the scene More...
 
bool dirty ()
 Getter for modified flag. More...
 
void setDirty ()
 sets the dirty flag More...
 
std::shared_ptr< WPropertiesgetProperties ()
 Getter. More...
 
void addROIChangeNotifier (std::shared_ptr< boost::function< void() > > notifier)
 Add a specified notifier to the list of default notifiers which get connected to each roi. More...
 
void removeROIChangeNotifier (std::shared_ptr< boost::function< void() > > notifier)
 Remove a specified notifier from the list of default notifiers which get connected to each roi. More...
 
WPropBool invertProperty ()
 Invert property. More...
 
WPropBool showProperty ()
 The property for toggling ROI visibility. More...
 
WPropBool activeProperty ()
 The active property. More...
 
WPropString nameProperty ()
 The name property. More...
 

Protected Member Functions

void properties ()
 initializes the roi's properties More...
 
void propertyChanged ()
 callback when a property gets changed More...
 
void signalRoiChange ()
 signals a roi change to all subscribers More...
 

Protected Attributes

osg::ref_ptr< WPickHandlerm_pickHandler
 A pointer to the pick handler used to get gui events for moving the box. More...
 
std::shared_ptr< WPropertiesm_properties
 the property object for the module More...
 
WPropBool m_dirty
 dirty flag, indicating the graphics needs updating, it is no longer used for bitfield updating since these customers get the update notification via callback More...
 
WPropBool m_active
 indicates if the roi is active More...
 
WPropBool m_show
 indicates if the roi is visible in the scene More...
 
WPropBool m_not
 indicates if the roi is negated More...
 
WPropString m_name
 name of the ROI. More...
 
WPropDouble m_threshold
 threshold for an arbitrary roi More...
 
WPropColor m_color
 A color for painting the roi in the scene. More...
 
std::list< std::shared_ptr< boost::function< void() > > > m_changeNotifiers
 The notifiers connected to added rois by default. More...
 
std::shared_mutex m_associatedNotifiersLock
 Lock for associated notifiers set. More...
 

Private Member Functions

virtual void updateGFX ()=0
 updates the graphics More...
 

Detailed Description

Superclass for different ROI (region of interest) types.

Definition at line 44 of file WROI.h.

Member Typedef Documentation

◆ RefPtr

typedef osg::ref_ptr< WROI > WROI::RefPtr

Ref Pointer type.

Definition at line 50 of file WROI.h.

Constructor & Destructor Documentation

◆ ~WROI()

WROI::~WROI ( )
virtual

Need virtual destructor because of virtual function.

Definition at line 38 of file WROI.cpp.

Member Function Documentation

◆ active()

bool WROI::active ( )

getter

Returns
the active flag

Definition at line 108 of file WROI.cpp.

References m_active.

Referenced by setActive().

+ Here is the caller graph for this function:

◆ activeProperty()

WPropBool WROI::activeProperty ( )

The active property.

Returns
the property.

Definition at line 70 of file WROI.cpp.

References m_active.

◆ addROIChangeNotifier()

void WROI::addROIChangeNotifier ( std::shared_ptr< boost::function< void() > >  notifier)

Add a specified notifier to the list of default notifiers which get connected to each roi.

Parameters
notifierthe notifier function

Definition at line 149 of file WROI.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

◆ dirty()

bool WROI::dirty ( )

Getter for modified flag.

Returns
the dirty flag

Definition at line 125 of file WROI.cpp.

References m_dirty.

◆ getProperties()

std::shared_ptr< WProperties > WROI::getProperties ( )

Getter.

Returns
the properties object for this roi

Definition at line 92 of file WROI.cpp.

References m_properties.

Referenced by WRoiProjectFileIO::save().

+ Here is the caller graph for this function:

◆ hide()

void WROI::hide ( )

hides the roi in the scene

Definition at line 130 of file WROI.cpp.

Referenced by propertyChanged().

+ Here is the caller graph for this function:

◆ invertProperty()

WPropBool WROI::invertProperty ( )

Invert property.

Returns
the property

Definition at line 55 of file WROI.cpp.

References m_not.

◆ isNot()

bool WROI::isNot ( )

getter for NOT flag

Returns
the flag

Definition at line 103 of file WROI.cpp.

References m_not.

Referenced by setNot().

+ Here is the caller graph for this function:

◆ nameProperty()

WPropString WROI::nameProperty ( )

The name property.

Returns
the property.

Definition at line 65 of file WROI.cpp.

References m_name.

◆ properties()

void WROI::properties ( )
protected

initializes the roi's properties

Definition at line 42 of file WROI.cpp.

References m_active, m_dirty, m_name, m_not, m_properties, m_show, and propertyChanged().

+ Here is the call graph for this function:

◆ propertyChanged()

void WROI::propertyChanged ( )
protected

callback when a property gets changed

Definition at line 75 of file WROI.cpp.

References hide(), m_show, setDirty(), and unhide().

Referenced by properties().

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

◆ removeROIChangeNotifier()

void WROI::removeROIChangeNotifier ( std::shared_ptr< boost::function< void() > >  notifier)

Remove a specified notifier from the list of default notifiers which get connected to each roi.

Parameters
notifierthe notifier function

Definition at line 157 of file WROI.cpp.

References m_associatedNotifiersLock, and m_changeNotifiers.

◆ setActive()

void WROI::setActive ( bool  active)

setter

Parameters
active

Definition at line 113 of file WROI.cpp.

References active(), m_active, and setDirty().

+ Here is the call graph for this function:

◆ setDirty()

void WROI::setDirty ( )

sets the dirty flag

Definition at line 119 of file WROI.cpp.

References m_dirty, and signalRoiChange().

Referenced by propertyChanged(), WROIArbitrary::propertyChanged(), setActive(), setNot(), WROIArbitrary::setThreshold(), WROIBox::updateGFX(), WROIArbitrary::WROIArbitrary(), and WROIBox::WROIBox().

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

◆ setNot()

void WROI::setNot ( bool  isNot = true)

sets the NOT flag

Parameters
isNot

Definition at line 97 of file WROI.cpp.

References isNot(), m_not, and setDirty().

+ Here is the call graph for this function:

◆ showProperty()

WPropBool WROI::showProperty ( )

The property for toggling ROI visibility.

Returns
the property

Definition at line 60 of file WROI.cpp.

References m_show.

◆ signalRoiChange()

void WROI::signalRoiChange ( )
protected

signals a roi change to all subscribers

Definition at line 140 of file WROI.cpp.

References m_changeNotifiers.

Referenced by setDirty(), and WROISphere::updateGFX().

+ Here is the caller graph for this function:

◆ unhide()

void WROI::unhide ( )

unhides the roi in the scene

Definition at line 135 of file WROI.cpp.

Referenced by propertyChanged().

+ Here is the caller graph for this function:

◆ updateGFX()

virtual void WROI::updateGFX ( )
privatepure virtual

updates the graphics

Implemented in WROISphere, WROIBox, and WROIArbitrary.

Member Data Documentation

◆ m_active

WPropBool WROI::m_active
protected

indicates if the roi is active

Definition at line 188 of file WROI.h.

Referenced by active(), activeProperty(), properties(), and setActive().

◆ m_associatedNotifiersLock

std::shared_mutex WROI::m_associatedNotifiersLock
protected

Lock for associated notifiers set.

Definition at line 224 of file WROI.h.

Referenced by addROIChangeNotifier(), and removeROIChangeNotifier().

◆ m_changeNotifiers

std::list< std::shared_ptr< boost::function< void() > > > WROI::m_changeNotifiers
protected

The notifiers connected to added rois by default.

Definition at line 218 of file WROI.h.

Referenced by addROIChangeNotifier(), removeROIChangeNotifier(), and signalRoiChange().

◆ m_color

WPropColor WROI::m_color
protected

A color for painting the roi in the scene.

Definition at line 213 of file WROI.h.

◆ m_dirty

WPropBool WROI::m_dirty
protected

dirty flag, indicating the graphics needs updating, it is no longer used for bitfield updating since these customers get the update notification via callback

Definition at line 183 of file WROI.h.

Referenced by dirty(), properties(), setDirty(), WROISphere::setPosition(), WROISphere::setX(), WROISphere::setY(), WROISphere::setZ(), WROIArbitrary::updateGFX(), WROIBox::updateGFX(), WROISphere::updateGFX(), and WROISphere::WROISphere().

◆ m_name

WPropString WROI::m_name
protected

name of the ROI.

Definition at line 203 of file WROI.h.

Referenced by nameProperty(), and properties().

◆ m_not

WPropBool WROI::m_not
protected

indicates if the roi is negated

Definition at line 198 of file WROI.h.

Referenced by invertProperty(), isNot(), properties(), setNot(), WROIBox::updateGFX(), and WROIBox::WROIBox().

◆ m_pickHandler

osg::ref_ptr< WPickHandler > WROI::m_pickHandler
protected

A pointer to the pick handler used to get gui events for moving the box.

Definition at line 172 of file WROI.h.

Referenced by WROIBox::WROIBox(), and WROISphere::WROISphere().

◆ m_properties

std::shared_ptr< WProperties > WROI::m_properties
protected

the property object for the module

Definition at line 177 of file WROI.h.

Referenced by getProperties(), properties(), WROIArbitrary::properties(), and WROIBox::WROIBox().

◆ m_show

WPropBool WROI::m_show
protected

indicates if the roi is visible in the scene

Definition at line 193 of file WROI.h.

Referenced by properties(), propertyChanged(), and showProperty().

◆ m_threshold

WPropDouble WROI::m_threshold
protected

threshold for an arbitrary roi

Definition at line 208 of file WROI.h.


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