Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
All Classes Namespaces Functions Variables Typedefs Enumerator Friends
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Core::StateRangedValue< T > Class Template Reference

#include <StateRangedValue.h>

Inheritance diagram for Core::StateRangedValue< T >:
Core::StateRangedValueBase Core::StateBase

Public Types

typedef T value_type
 
typedef boost::shared_ptr< StateRangedValue< T > > handle_type
 
typedef boost::signals2::signal< void(T, Core::ActionSource) > value_changed_signal_type
 
typedef boost::signals2::signal< void(T, T, Core::ActionSource) > range_changed_signal_type
 This signal is triggered when the range of the state is changed.
 
typedef boost::signals2::signal< void(T, Core::ActionSource) > step_changed_signal_type
 This signal is triggered when the step of the state is changed.
 
- Public Types inherited from Core::StateBase
enum  { DO_NOT_LOAD_E = -1, LOAD_LAST_E = 0, DEFAULT_LOAD_E = 100 }
 
typedef boost::signals2::signal< void() > state_changed_signal_type
 This signal is triggered when the state is changed.
 

Public Member Functions

 StateRangedValue (const std::string &stateid, const T &default_value, const T &min_value, const T &max_value, const T &step_value)
 
virtual std::string export_to_string () const
 Convert the contents of the State into a string.
 
virtual bool import_from_string (const std::string &str, Core::ActionSource source=Core::ActionSource::NONE_E)
 Set the State from a string.
 
void set_range (T min_value, T max_value, Core::ActionSource source=Core::ActionSource::NONE_E)
 
void set_step (T step_value, Core::ActionSource source=Core::ActionSource::NONE_E)
 
get () const
 Get the value of the state variable.
 
bool set (T value, Core::ActionSource source=Core::ActionSource::NONE_E)
 
bool offset (const T &offset_value, ActionSource source=ActionSource::NONE_E)
 Offset the value of the state variable by the specified amount.
 
void get_range (T &min_value, T &max_value)
 Get the range of the variable.
 
void get_step (T &step)
 
- Public Member Functions inherited from Core::StateRangedValueBase
 StateRangedValueBase (const std::string &stateid)
 
- Public Member Functions inherited from Core::StateBase
 StateBase (const std::string &stateid)
 
void set_is_project_data (bool is_project_data)
 Set whether the data is part of the project data.
 
void set_locked (bool locked)
 
bool get_locked () const
 Query whether the variable has been designated as locked.
 
int get_session_priority () const
 Get the priority in which loading sets the states.
 
void set_session_priority (int priority)
 By default the priority is set to DEAFULT_LOAD_E.
 
std::string get_stateid () const
 Get the unique id assigned to the state variable.
 
bool is_project_data () const
 Whether the data is tagged as project data that is saved in a session.
 

Public Attributes

value_changed_signal_type value_changed_signal_
 
range_changed_signal_type range_changed_signal_
 
step_changed_signal_type step_changed_signal_
 
- Public Attributes inherited from Core::StateBase
state_changed_signal_type state_changed_signal_
 

Protected Member Functions

virtual void export_to_variant (Variant &variant) const
 Export the state data to a variant parameter.
 
virtual bool import_from_variant (Variant &variant, Core::ActionSource source=Core::ActionSource::NONE_E)
 Import the state data from a variant parameter.
 
virtual bool import_offset_from_variant (Variant &variant, ActionSource source=ActionSource::NONE_E)
 Import the offset value from the variant and apply it to the current value.
 
virtual bool import_range_from_variant (Variant &variant_min, Variant &variant_max, ActionSource source=ActionSource::NONE_E)
 Import range values from variants.
 
virtual bool validate_variant (Variant &variant, std::string &error)
 
virtual bool validate_value_type_variant (Variant &variant, std::string &error)
 Returns true if the value stored in the variant is a valid offset value, otherwise false.
 
- Protected Member Functions inherited from Core::StateBase
void enable_signals (bool signals_enabled)
 
bool signals_enabled ()
 Check whether signals are enabled.
 
void set_initializing (bool initializing)
 
bool get_initializing () const
 Query whether the state variable and its parent are still being initialized.
 
virtual void invalidate ()
 

Detailed Description

template<class T>
class Core::StateRangedValue< T >

This class is a specification of State that is used to hold a single bound instance of a value.

Member Typedef Documentation

template<class T>
typedef boost::signals2::signal< void( T, Core::ActionSource ) > Core::StateRangedValue< T >::value_changed_signal_type

Signal when the data in the state is changed, the second parameter indicates the source of the change

Member Function Documentation

template<class T>
bool Core::StateRangedValue< T >::set ( value,
Core::ActionSource  source = Core::ActionSource::NONE_E 
)
inline

Set the value of the state variable NOTE: this function by passes the action mechanism and should only be used to enforce a constraint from another action. Normally use the action mechanism to ensure that the action is recorded correctly.

template<class T>
void Core::StateRangedValue< T >::set_range ( min_value,
max_value,
Core::ActionSource  source = Core::ActionSource::NONE_E 
)
inline

Set the range of permissible values for this state variable. This variable normally is represented by a slider and this one records the min and max values so values can be validated correctly

template<class T>
virtual bool Core::StateRangedValue< T >::validate_variant ( Variant variant,
std::string &  error 
)
inlineprotectedvirtual

Validate a variant parameter This function returns false if the parameter is invalid or cannot be converted and in that case error will describe the error.

Implements Core::StateBase.


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