fw4spl
guiQt::editor::SDynamicView Class Reference

This editor manages tabs containing activities. More...

#include <SDynamicView.hpp>

+ Inheritance diagram for guiQt::editor::SDynamicView:
+ Collaboration diagram for guiQt::editor::SDynamicView:

Public Types

typedef ::fwCom::Signal< void(::fwData::Object::sptr) > ActivitySelectedSignalType
 
typedef ::fwCom::Signal< void() > NothingSelectedSignalType
 
- Public Types inherited from fwServices::IService
enum  AccessType : std::uint8_t { INPUT, OUTPUT, INOUT }
 
typedef ::boost::property_tree::ptree ConfigType
 
typedef std::string IdType
 
typedef std::string KeyType
 
typedef std::map< KeyType, std::weak_ptr< const ::fwData::Object > > InputMapType
 
typedef std::map< KeyType, std::weak_ptr< ::fwData::Object > > InOutMapType
 
typedef std::map< KeyType, std::shared_ptr< ::fwData::Object > > OutputMapType
 
enum  GlobalStatus {
  STARTED, STARTING, SWAPPING, STOPPED,
  STOPPING
}
 Defines all possible global status for a service, including transitions. More...
 
enum  UpdatingStatus { UPDATING, NOTUPDATING }
 Defines all possible status for an update process. More...
 
enum  ConfigurationStatus { CONFIGURING, CONFIGURED, UNCONFIGURED }
 Defines all possible status for a configuration process. More...
 
typedef ::fwCom::Signal< void()> StartedSignalType
 
typedef ::fwCom::Signal< void()> UpdatedSignalType
 
typedef ::fwCom::Signal< void()> StoppedSignalType
 
typedef std::shared_future< void > SharedFutureType
 Slot to call start method.
 
typedef std::packaged_task< void()> PackagedTaskType
 Slot to call start method.
 
typedef std::future< void > UniqueFutureType
 Slot to call start method.
 
typedef ::fwCom::Slot< SharedFutureType()> StartSlotType
 Slot to call start method.
 
typedef ::fwCom::Slot< SharedFutureType()> StopSlotType
 Slot to call start method.
 
typedef ::fwCom::Slot< SharedFutureType()> UpdateSlotType
 Slot to call start method.
 
typedef ::fwCom::Slot< SharedFutureType(::fwData::Object::sptr)> SwapSlotType
 Slot to call start method.
 
typedef ::fwCom::Slot< SharedFutureType(const KeyType &,::fwData::Object::sptr)> SwapKeySlotType
 Slot to call start method.
 
typedef ::fwCom::helper::SigSlotConnection::KeyConnectionsType KeyConnectionsType
 Returns proposals to connect service slots to associated object signals, this method is used for obj/srv auto connection. More...
 
- Public Types inherited from fwCom::HasSlots
typedef std::shared_ptr< HasSlotssptr
 
typedef std::shared_ptr< const HasSlotscsptr
 
- Public Types inherited from fwCom::HasSignals
typedef std::shared_ptr< HasSignalssptr
 
typedef std::shared_ptr< const HasSignalscsptr
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
GUIQT_API SDynamicView () noexcept
 Constructor. Do nothing.
 
virtual GUIQT_API ~SDynamicView () noexcept
 Destructor. Do nothing.
 
- Public Member Functions inherited from fwGui::view::IActivityView
- Public Member Functions inherited from fwGui::IGuiContainerSrv
FWGUI_API std::shared_ptr< ::fwGui::container::fwContainergetContainer ()
 
FWGUI_API void setParent (std::string wid)
 
- Public Member Functions inherited from fwServices::IService
FWSERVICES_API void registerInput (const ::fwData::Object::csptr &obj, const std::string &key, const bool autoConnect=false, const bool optional=false)
 Register an input object for this service. More...
 
FWSERVICES_API void registerInOut (const ::fwData::Object::sptr &obj, const std::string &key, const bool autoConnect=false, const bool optional=false)
 Register an in/out object for this service. More...
 
FWSERVICES_API void setConfiguration (const ::fwRuntime::ConfigurationElement::sptr _cfgElement)
 Affect the configuration, using a generic XML like structure. More...
 
FWSERVICES_API void setConfiguration (const Config &_configuration)
 Set the configuration. More...
 
FWSERVICES_API void setConfiguration (const ConfigType &ptree)
 Affect the configuration, using a boost property tree. More...
 
FWSERVICES_API void configure ()
 Invoke configuring() if m_globalState == STOPPED. Invoke reconfiguring() if m_globalState == STARTED. Does nothing otherwise. More...
 
FWSERVICES_API SharedFutureType start ()
 Invoke starting() if m_globalState == STOPPED. Does nothing otherwise. More...
 
FWSERVICES_API SharedFutureType stop ()
 Invoke stopping() if m_globalState == STARTED. Does nothing otherwise. Stops all observations. More...
 
FWSERVICES_API SharedFutureType update ()
 Invoke updating() if m_globalState == STARTED. Does nothing otherwise. More...
 
FWSERVICES_API SharedFutureType swap (::fwData::Object::sptr _obj)
 Associate the service to another object. More...
 
FWSERVICES_API SharedFutureType swapKey (const KeyType &_key,::fwData::Object::sptr _obj)
 Associate the service to another object. More...
 
FWSERVICES_API GlobalStatus getStatus () const noexcept
 Return the global process status. More...
 
FWSERVICES_API bool isStarted () const noexcept
 Test if the service is started or not. More...
 
FWSERVICES_API bool isStopped () const noexcept
 Test if the service is stopped or not. More...
 
FWSERVICES_API ConfigurationStatus getConfigurationStatus () const noexcept
 Return the configuration process status. More...
 
FWSERVICES_API UpdatingStatus getUpdatingStatus () const noexcept
 Return the update process status. More...
 
FWSERVICES_API::fwRuntime::ConfigurationElement::sptr getConfiguration () const
 Return the configuration, in an xml format read using runtime library. More...
 
FWSERVICES_API ConfigType getConfigTree () const
 Return the configuration, in an boost property tree.
 
FWSERVICES_API::fwData::Object::sptr getObject ()
 Return the object associated to service. More...
 
template<class DATATYPE >
std::shared_ptr< DATATYPE > getObject ()
 Return the object associated to service. The object is casted. More...
 
FWSERVICES_API const InputMapType & getInputs () const
 Return the inputs map associated to service. More...
 
FWSERVICES_API const InOutMapType & getInOuts () const
 Return the inouts map associated to service. More...
 
FWSERVICES_API const OutputMapType & getOutputs () const
 Return the outouts map associated to service. More...
 
FWSERVICES_API std::vector< ::fwData::Object::csptr > getObjects () const
 Return the objects associated to service. More...
 
template<class DATATYPE >
std::shared_ptr< const DATATYPE > getInput (const KeyType &key) const
 Return the input object at the given key. Asserts if the data is not of the right type. More...
 
template<class DATATYPE >
std::shared_ptr< DATATYPE > getInOut (const KeyType &key) const
 Return the inout object at the given key. Asserts if the data is not of the right type. More...
 
template<class DATATYPE >
std::shared_ptr< DATATYPE > getOutput (const KeyType &key) const
 Return the output object at the given key. Asserts if the data is not of the right type. More...
 
template<class DATATYPE >
std::shared_ptr< const DATATYPE > getInput (const KeyType &keybase, size_t index) const
 Return the input object at the given key. Asserts if the data is not of the right type. More...
 
template<class DATATYPE >
std::shared_ptr< DATATYPE > getInOut (const KeyType &keybase, size_t index) const
 Return the inout object at the given key. Asserts if the data is not of the right type. More...
 
template<class DATATYPE >
std::shared_ptr< DATATYPE > getOutput (const KeyType &keybase, size_t index) const
 Return the output object at the given key. Asserts if the data is not of the right type. More...
 
FWSERVICES_API void setOutput (const ::fwServices::IService::KeyType &key, const ::fwData::Object::sptr &object, size_t index=0)
 Register an output object at a given key in the OSR, replacing it if it already exists. More...
 
size_t getKeyGroupSize (const KeyType &keybase) const
 Return the number of key in a group of keys. More...
 
FWSERVICES_API void setWorker (std::shared_ptr< ::fwThread::Worker > worker)
 Initializes m_associatedWorker and associates this worker to all service slots.
 
FWSERVICES_API std::shared_ptr< ::fwThread::WorkergetWorker () const
 Returns associate worker.
 
virtual FWSERVICES_API KeyConnectionsType getObjSrvConnections () const
 Returns proposals to connect service slots to associated object signals, this method is used for obj/srv auto connection. More...
 
FWSERVICES_API bool hasObjectId (const KeyType &_key) const
 Return true if the object with the given key has an identifier. More...
 
FWSERVICES_API IdType getObjectId (const KeyType &_key) const
 Return the id of the object, throw if it is not found.
 
FWSERVICES_API void setObjectId (const KeyType &_key, const IdType &_id)
 Set the id of an object key.
 
- Public Member Functions inherited from fwTools::Object
- Public Member Functions inherited from fwCore::BaseObject
- Public Member Functions inherited from fwCom::HasSlots
std::shared_ptr< SlotBaseslot (const Slots::SlotKeyType &key) const
 
template<typename SlotType >
std::shared_ptr< SlotType > slot (const Slots::SlotKeyType &key) const
 
template<typename F , typename A >
std::shared_ptr< Slot< typename::fwCom::util::convert_function_type< F >::type > > newSlot (const Slots::SlotKeyType &key, F f, A a)
 
- Public Member Functions inherited from fwCom::HasSignals
std::shared_ptr< SignalBasesignal (const Signals::SignalKeyType &key) const
 
template<typename SignalType >
std::shared_ptr< SignalType > signal (const Signals::SignalKeyType &key) const
 
template<typename SignalType >
std::shared_ptr< SignalType > newSignal (const Signals::SignalKeyType &key)
 

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwGui::view::IActivityView
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwGui::IGuiContainerSrv
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 
- Static Public Member Functions inherited from fwServices::IService
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 
- Static Public Member Functions inherited from fwTools::Object
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Static Public Attributes

static GUIQT_APIconst::fwCom::Signals::SignalKeyType s_ACTIVITY_SELECTED_SIG
 
static GUIQT_APIconst::fwCom::Signals::SignalKeyType s_NOTHING_SELECTED_SIG
 
- Static Public Attributes inherited from fwGui::view::IActivityView
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_LAUNCH_ACTIVITY_SLOT = "launchActivity"
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_LAUNCH_ACTIVITY_SERIES_SLOT = "launchActivitySeries"
 
- Static Public Attributes inherited from fwServices::IService
static FWSERVICES_API const std::string s_DEFAULT_OBJECT = "defaultObject"
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_STARTED_SIG = "started"
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_UPDATED_SIG = "updated"
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_STOPPED_SIG = "stopped"
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_START_SLOT = "start"
 Slot to call start method.
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_STOP_SLOT = "stop"
 Slot to call start method.
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_SLOT = "update"
 Slot to call start method.
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_SWAP_SLOT = "swap"
 Slot to call start method.
 
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_SWAPKEY_SLOT = "swapKey"
 Slot to call start method.
 

Protected Slots

void closeTabSignal (int index)
 Called when the tab close button is clicked: close the tab if it is "closable".
 
void changedTab (int index)
 Called when the current tab selection changed.
 

Protected Member Functions

virtual void starting () override
 Install the container.
 
virtual void stopping () override
 Destroy the container.
 
virtual void updating () override
 Update.
 
virtual void swapping () override
 Swap. More...
 
virtual void configuring () override
 Configure the view. More...
 
virtual void info (std::ostream &_sstream) override
 Write information in a stream. More...
 
- Protected Member Functions inherited from fwGui::view::IActivityView
FWGUI_API IActivityView ()
 Constructor. Do nothing.
 
virtual FWGUI_API ~IActivityView ()
 Destructor. Do nothing.
 
virtual FWGUI_API void launchActivitySeries (::fwMedData::Series::sptr series)
 Slot: Launch the given activity in a new tab. More...
 
virtual FWGUI_API bool validateActivity (::fwMedData::ActivitySeries::sptr activitySeries) const
 Check if the activity is valid by calling the activity validator. More...
 
virtual FWGUI_API::fwMedData::ActivitySeries::sptr createMainActivity () const
 Create the activity series given in 'mainActivity' configuration.
 
virtual FWGUI_API void translateParameters (::fwData::Object::sptr sourceObj, const ParametersType &parameters, ReplaceMapType &replaceMap)
 Translate parameters from source object. More...
 
virtual FWGUI_API void translateParameters (const ParametersType &parameters, ReplaceMapType &replaceMap)
 Create the replace map from the parameters. More...
 
- Protected Member Functions inherited from fwGui::IGuiContainerSrv
FWGUI_API void initialize ()
 Initialize managers. More...
 
FWGUI_API void create ()
 Creates view, sub-views and toolbar containers. Manages sub-views and toobar services. More...
 
FWGUI_API void destroy ()
 Stops sub-views and toobar services. Destroys view, sub-views and toolbar containers.
 
FWGUI_API void setEnabled (bool isEnabled)
 SLOT: enable/disable the container.
 
FWGUI_API void enable ()
 SLOT: enable the container.
 
FWGUI_API void disable ()
 SLOT: disable the container.
 
FWGUI_API void setVisible (bool isVisible)
 SLOT: show/hide the container.
 
FWGUI_API void show ()
 SLOT: show the container.
 
FWGUI_API void hide ()
 SLOT: hide the container.
 
- Protected Member Functions inherited from fwServices::IService
FWSERVICES_API IService ()
 IService constructor. More...
 
virtual FWSERVICES_API ~IService ()
 IService desctructor. More...
 
virtual void swapping (const KeyType &key)
 Swap the service from an associated object to another object. The key in parameter indicates allows to retrieve the new data with getInput(), getInOut() or getOutput(). If you need the old object, you need to keep a shared pointer on it inside your service implementation. More...
 
virtual FWSERVICES_API void reconfiguring ()
 Reconfigure the service activity when is started. More...
 
virtual FWSERVICES_API KeyConnectionsMap getAutoConnections () const
 Returns proposals to connect service slots to associated objects signals, this method is used for obj/srv auto connection.
 
- Protected Member Functions inherited from fwTools::fwID
FWTOOLS_API bool hasID () const
 Return true if the object has an id set. More...
 
FWTOOLS_API IDType getID (Policy policy=GENERATE) const
 Returns the id of the object. If it is not set and the policy value is. More...
 
virtual FWTOOLS_API void setID (IDType newID)
 Set a newID for the object, (newID must not exist in fwID), the oldest one is released. More...
 
FWTOOLS_API void resetID ()
 Release the id for the object. More...
 
 fwID ()
 Constructor : does nothing.
 
- Protected Member Functions inherited from fwCom::HasSlots
 HasSlots (const HasSlots &)
 Copy constructor forbidden.
 
HasSlotsoperator= (const HasSlots &)
 Copy operator forbidden.
 
- Protected Member Functions inherited from fwCom::HasSignals
 HasSignals (const HasSignals &)
 Copy constructor forbidden.
 
HasSignalsoperator= (const HasSignals &)
 Copy operator forbidden.
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Additional Inherited Members

- Protected Types inherited from fwGui::view::IActivityView
typedef ::fwActivities::registry::ActivityAppConfigParam ParameterType
 
typedef ::fwActivities::registry::ActivityAppConfig::ActivityAppConfigParamsType ParametersType
 
typedef std::map< std::string, std::string > ReplaceMapType
 
- Protected Types inherited from fwGui::IGuiContainerSrv
typedef ::fwRuntime::ConfigurationElement::sptr ConfigurationType
 
- Protected Types inherited from fwTools::fwID
enum  Policy { EMPTY = 1, GENERATE, MUST_EXIST }
 
typedef std::string IDType
 
- Static Protected Member Functions inherited from fwTools::fwID
static bool isTypeOf (const std::string &type)
 
static FWTOOLS_API bool exist (IDType _id)
 
static FWTOOLS_API std::shared_ptr< ::fwTools::ObjectgetObject (IDType requestID)
 Retrieve the object attached to the given id. Return a null sptr if no correspondence exist. More...
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 
- Protected Attributes inherited from fwGui::view::IActivityView
std::string m_mainActivityId
 configuration id of the main activity
 
ParametersType m_parameters
 parameters given in configuration
 
- Protected Attributes inherited from fwServices::IService
::fwRuntime::ConfigurationElement::sptr m_configuration
 Configuration element used to configure service internal state using a generic XML like structure TODO Make this const, we are not supposed to edit that !
 
::fwData::Object::wptr m_associatedObject
 associated object of service More...
 
StartSlotType::sptr m_slotStart
 Slot to call start method.
 
StopSlotType::sptr m_slotStop
 Slot to call stop method.
 
UpdateSlotType::sptr m_slotUpdate
 Slot to call update method.
 
SwapSlotType::sptr m_slotSwap
 Slot to call swap method.
 
SwapKeySlotType::sptr m_slotSwapKey
 Slot to call swap method.
 
std::shared_ptr< ::fwThread::Workerm_associatedWorker
 Associated worker.
 
- Protected Attributes inherited from fwTools::Object
std::shared_ptr< ::fwTools::UUIDm_uuid
 UUID used to identify the object, notably for serialization.
 
- Protected Attributes inherited from fwCom::HasSlots
Slots m_slots
 
- Protected Attributes inherited from fwCom::HasSignals
Signals m_signals
 
- Static Protected Attributes inherited from fwGui::IGuiContainerSrv
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_SET_ENABLED_SLOT = "setEnabled"
 Slot to enable/disable the action.
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_ENABLE_SLOT = "enable"
 Slot to enable the container.
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_DISABLE_SLOT = "disable"
 Slot to disable the container.
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_SET_VISIBLE_SLOT = "setVisible"
 Slot to show/hide the container.
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_SHOW_SLOT = "show"
 Slot to show the container.
 
static FWGUI_APIconst::fwCom::Slots::SlotKeyType s_HIDE_SLOT = "hide"
 Slot to hide the container.
 

Detailed Description

This editor manages tabs containing activities.

This service should received signals containing ActivitySeries connected to the slot launchActivity. It will launch the activity in a new tab.

Note
The same activitySeries cannot be launch in two different tabs.

Signal

  • activitySelected( ::fwData::object::sptr ): this signal is emitted when the current tab selection changed, it contains the associated ActivitySeries. The activity series is send as a fwData::Object in order to connect this signal to slots receiving a fwData::Object.
  • nothingSelected(): This signal is emitted when no tab are selected.

Slots

  • launchActivity( ::fwMedData::ActivitySeries::sptr ): This slot allows to create a tab with the given activity series.
  • launchActivitySeries( ::fwMedData::Series::sptr ): This slot allows to create a tab with the given activity series.
  • createTab( ::fwActivities::registry::ActivityMsg ): This slot allows to create a tab with the given activity information.

XML Configuration

1 <service type="::guiQt::editor::SDynamicView" autoConnect="yes" >
2  <mainActivity id="SDBActivity" closable="false" />
3  <parameters>
4  <parameter replace="SERIESDB" by="medicalData" />
5  <parameter replace="ICON_PATH" by="media-0.1/icons/app.ico" />
6  </parameters>
7 </service>
  • mainActivity (optional): information about the main activity (first tab). The activity series will be generated. This activity must not have requirement.
    • id : identifier of the activity
    • closable (optional, default 'no') : defines if the user can close this tab.
  • parameters (optional) : additional parameters used to launch the activities
    • parameter: defines a parameter
      • replace: name of the parameter as defined in the AppConfig
      • by: defines the string that will replace the parameter name. It should be a simple string (ex. frontal) or define a camp path (ex. @values.myImage). The root object of the sesh@ path if the composite contained in the ActivitySeries.

Definition at line 88 of file SDynamicView.hpp.

Member Function Documentation

void guiQt::editor::SDynamicView::configuring ( )
overrideprotectedvirtual

Configure the view.

See also
fwGui::IGuiContainerSrv::initialize()

Reimplemented from fwGui::view::IActivityView.

Definition at line 72 of file SDynamicView.cpp.

References fwGui::view::IActivityView::configuring(), fwServices::IService::m_configuration, and SLM_ASSERT.

+ Here is the call graph for this function:

void guiQt::editor::SDynamicView::info ( std::ostream &  _sstream)
overrideprotectedvirtual

Write information in a stream.

This method is used by operator<<(std::ostream & _sstream, IService& _service) to avoid declaration of << by all services.

Reimplemented from fwServices::IService.

Definition at line 258 of file SDynamicView.cpp.

Referenced by changedTab(), and swapping().

+ Here is the caller graph for this function:


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