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.
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
Seg3D::ToolManager Class Reference
Inheritance diagram for Seg3D::ToolManager:
Core::StateHandler Core::RecursiveLockable Core::ConnectionHandler

Public Types

typedef boost::signals2::signal< void(ToolHandle) > tool_signal_type
 
typedef std::map< std::string, ToolHandle > tool_list_type
 
- Public Types inherited from Core::RecursiveLockable
typedef boost::recursive_mutex mutex_type
 
typedef boost::unique_lock< mutex_type > lock_type
 

Public Member Functions

tool_list_type tool_list ()
 
std::string active_toolid ()
 
ToolHandle get_active_tool ()
 
void get_tool_names (std::vector< ToolIDNamePair > &tool_names)
 
void open_default_tools ()
 
virtual int get_session_priority ()
 
ToolHandle get_tool (const std::string &toolid)
 
- Public Member Functions inherited from Core::StateHandler
 StateHandler (const std::string &type_str, bool auto_id)
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const T &default_value)
 Add a local state variable with default value.
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const T &default_value, const T &min_value, const T &max_value, const T &step)
 Add a local state variable with default value and min and max.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state)
 Add a local state variable without default value.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::string &option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::vector< std::string > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::vector< OptionLabelPair > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::vector< std::string > &default_options, const std::vector< OptionLabelPair > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::vector< std::string > &default_options, const std::string &option_list)
 Add a local state variable with option list.
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const std::vector< T > &default_value)
 Add a local state variable without default value.
 
void invalidate ()
 this function is called when you need to delete something from the state engine, but may have More...
 
bool is_valid ()
 returns true if the function hasn't been invalidated
 
void mark_as_project_data ()
 Mask the states that are added to this state handler as project data.
 
void do_not_save_id_number ()
 The id number of the statehandler will not be saved.
 
void set_initializing (bool initializing)
 
bool load_states (const StateIO &state_io)
 Load the states into the StateIO variable.
 
bool save_states (StateIO &state_io)
 Save the states into the StateIO variable.
 
const std::string & get_statehandler_id () const
 The id of the handler that will be the prefix of the state variables.
 
const std::string & get_statehandler_id_base () const
 The id of the handler that will be the prefix of the state variables.
 
size_t get_statehandler_id_number () const
 The id number of the handler that will be at the end of the prefix.
 
- Public Member Functions inherited from Core::RecursiveLockable
mutex_type & get_mutex () const
 

Public Attributes

tool_signal_type open_tool_signal_
 
tool_signal_type close_tool_signal_
 
tool_signal_type activate_tool_signal_
 
Core::StateLabeledOptionHandle active_tool_state_
 
Core::StateBoolHandle disable_tools_state_
 

Protected Member Functions

bool open_tool (const std::string &toolid, std::string &new_toolid)
 
void close_tool (const std::string &toolid)
 
void activate_tool (const std::string &toolid)
 
virtual bool pre_save_states (Core::StateIO &state_io)
 
virtual bool post_save_states (Core::StateIO &state_io)
 
virtual bool pre_load_states (const Core::StateIO &state_io)
 
virtual bool post_load_states (const Core::StateIO &state_io)
 
- Protected Member Functions inherited from Core::StateHandler
virtual void clean_up ()
 This function is called by invalidate to clean up stuff in the statehandler subclasses.
 
void enable_signals (bool enabled)
 This function enables/disables signals in the state variables.
 
virtual void state_changed ()
 
virtual int get_version ()
 Get the version number of this class, this one is used for versioning of session files.
 
int get_loaded_version ()
 Get the version number of the data that was loaded.
 
void set_loaded_version (int loaded_version)
 Set the version number of the data that was loaded.
 
- Protected Member Functions inherited from Core::ConnectionHandler
void add_connection (const boost::signals2::connection &connection)
 
void add_connection (const ConnectionHandlerConnectionHandle &connection)
 
void disconnect_all ()
 

Friends

class ActionOpenTool
 
class ActionCloseTool
 
class ActionActivateTool
 
class ToolManagerPrivate
 

Member Function Documentation

void Seg3D::ToolManager::activate_tool ( const std::string &  toolid)
protected

ACTIVATE_TOOL (accessed through Action): Set which tool is currently highlighted The active tool has access to the viewer

std::string Seg3D::ToolManager::active_toolid ( )

ACTIVE_TOOLID: Get the active toolid

void Seg3D::ToolManager::close_tool ( const std::string &  toolid)
protected

CLOSE_TOOL (accessed through Action): Close tool in current collection of active tools

ToolHandle Seg3D::ToolManager::get_active_tool ( )

GET_ACTIVE_TOOL: function that returns a handle to the active tool

int Seg3D::ToolManager::get_session_priority ( )
virtual

Returns the session priority of the state handler. State handlers with higher priorities gets loaded earlier than those with lower priorities. By default this functions returns -1, which means that the state handler won't be saved/loaded by the state engine.

Reimplemented from Core::StateHandler.

void Seg3D::ToolManager::get_tool_names ( std::vector< ToolIDNamePair > &  tool_names)

GET_TOOL_NAMES: function that populates a passed vector of pairs with the tool names

void Seg3D::ToolManager::open_default_tools ( )

OPEN_DEFAULT_TOOLS: Open the startup tools chosen by the user.

bool Seg3D::ToolManager::open_tool ( const std::string &  toolid,
std::string &  new_toolid 
)
protected

OPEN_TOOL (accessed through Action): Open a new tool into the current collection of active tools

bool Seg3D::ToolManager::post_load_states ( const Core::StateIO state_io)
protectedvirtual

This virtual function can be implemented in the StateHandlers and will be called after its states are loaded. If it doesn't succeed it needs to return false.

Reimplemented from Core::StateHandler.

bool Seg3D::ToolManager::post_save_states ( Core::StateIO state_io)
protectedvirtual

This virtual function can be implemented in the StateHandlers and will be called after its states are saved. If it doesn't succeed it needs to return false.

Reimplemented from Core::StateHandler.

bool Seg3D::ToolManager::pre_load_states ( const Core::StateIO state_io)
protectedvirtual

This virtual function can be implemented in the StateHandlers and will be called before its states are loaded. If it doesn't succeed it needs to return false.

Reimplemented from Core::StateHandler.

bool Seg3D::ToolManager::pre_save_states ( Core::StateIO state_io)
protectedvirtual

This virtual function can be implemented in the StateHandlers and will be called before its states are saved. If it doesn't succeed it needs to return false.

Reimplemented from Core::StateHandler.

ToolManager::tool_list_type Seg3D::ToolManager::tool_list ( )

TOOL_LIST: Get the current open tool list

Friends And Related Function Documentation

friend class ActionOpenTool
friend

GET_TOOL: This is an internal private function for retrieving the handle to a tool by passing its id ToolHandle get_tool( const std::string& toolid );

Member Data Documentation

tool_signal_type Seg3D::ToolManager::activate_tool_signal_

ACTIVATE_TOOL_SIGNAL: This signal is triggered after a tool is activated

tool_signal_type Seg3D::ToolManager::close_tool_signal_

CLOSE_TOOL_SIGNAL: This signal is triggered after a tool is closed

tool_signal_type Seg3D::ToolManager::open_tool_signal_

OPEN_TOOL_SIGNAL: This signal is triggered after a tool has been opened


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