fw4spl
SActivityLauncher.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "activities/action/SActivityLauncher.hpp"
8 
9 #include <fwActivities/IActivityValidator.hpp>
10 #include <fwActivities/IBuilder.hpp>
11 #include <fwActivities/IValidator.hpp>
12 
13 #include <fwCom/Signal.hpp>
14 #include <fwCom/Signal.hxx>
15 #include <fwCom/Slot.hpp>
16 #include <fwCom/Slots.hpp>
17 #include <fwCom/Slots.hxx>
18 
19 #include <fwData/Composite.hpp>
20 #include <fwData/String.hpp>
21 #include <fwData/Vector.hpp>
22 
23 #include <fwDataCamp/getObject.hpp>
24 
25 #include <fwGui/dialog/MessageDialog.hpp>
26 #include <fwGui/dialog/SelectorDialog.hpp>
27 
28 #include <fwMedData/ActivitySeries.hpp>
29 
30 #include <fwRuntime/Bundle.hpp>
31 #include <fwRuntime/Convert.hpp>
32 #include <fwRuntime/operations.hpp>
33 
34 #include <fwServices/IAppConfigManager.hpp>
35 #include <fwServices/macros.hpp>
36 #include <fwServices/registry/ActiveWorkers.hpp>
37 #include <fwServices/registry/AppConfig.hpp>
38 
39 #include <fwTools/UUID.hpp>
40 
41 #include <boost/foreach.hpp>
42 
43 #include <QApplication>
44 #include <QDialog>
45 #include <QHBoxLayout>
46 #include <QListWidget>
47 #include <QPushButton>
48 #include <QStandardItemModel>
49 #include <QVBoxLayout>
50 
51 Q_DECLARE_METATYPE(::fwActivities::registry::ActivityInfo)
52 
53 namespace activities
54 {
55 namespace action
56 {
57 
58 //------------------------------------------------------------------------------
59 
61 
62 //------------------------------------------------------------------------------
63 
64 const ::fwCom::Slots::SlotKeyType SActivityLauncher::s_LAUNCH_SERIES_SLOT = "launchSeries";
65 const ::fwCom::Slots::SlotKeyType SActivityLauncher::s_LAUNCH_ACTIVITY_SERIES_SLOT = "launchActivitySeries";
66 const ::fwCom::Slots::SlotKeyType SActivityLauncher::s_UPDATE_STATE_SLOT = "updateState";
67 const ::fwCom::Signals::SignalKeyType SActivityLauncher::s_ACTIVITY_LAUNCHED_SIG = "activityLaunched";
68 
69 static const ::fwServices::IService::KeyType s_SERIES_INPUT = "series";
70 
71 //------------------------------------------------------------------------------
72 
73 SActivityLauncher::SActivityLauncher() noexcept :
74  m_mode("message")
75 {
76  m_sigActivityLaunched = newSignal< ActivityLaunchedSignalType >(s_ACTIVITY_LAUNCHED_SIG);
77 
78  newSlot(s_LAUNCH_SERIES_SLOT, &SActivityLauncher::launchSeries, this);
79  newSlot(s_LAUNCH_ACTIVITY_SERIES_SLOT, &SActivityLauncher::launchActivitySeries, this);
80  newSlot(s_UPDATE_STATE_SLOT, &SActivityLauncher::updateState, this);
81 }
82 
83 //------------------------------------------------------------------------------
84 
85 SActivityLauncher::~SActivityLauncher() noexcept
86 {
87 }
88 
89 //------------------------------------------------------------------------------
90 
91 void SActivityLauncher::starting()
92 {
93  this->actionServiceStarting();
94  this->updateState();
95 }
96 
97 //------------------------------------------------------------------------------
98 
99 void SActivityLauncher::stopping()
100 {
101  SLM_TRACE_FUNC();
102  this->actionServiceStopping();
103 }
104 
105 //------------------------------------------------------------------------------
106 
107 void SActivityLauncher::configuring()
108 {
110  typedef ::fwServices::IService::ConfigType ConfigType;
111 
112  m_parameters.clear();
113  if(this->getConfigTree().count("config") > 0)
114  {
115  SLM_ASSERT("There must be one (and only one) <config/> element.",
116  this->getConfigTree().count("config") == 1 );
117 
118  const ::fwServices::IService::ConfigType srvconfig = this->getConfigTree();
119  const ::fwServices::IService::ConfigType& config = srvconfig.get_child("config");
120 
121  m_mode = config.get_optional<std::string>("mode").get_value_or("message");
122  SLM_ASSERT("SActivityLauncher mode must be either 'immediate' or 'message'",
123  "message" == m_mode || "immediate" == m_mode);
124 
125  if(config.count("parameters") == 1 )
126  {
127  const ::fwServices::IService::ConfigType& configParameters = config.get_child("parameters");
128  BOOST_FOREACH( const ConfigType::value_type& v, configParameters.equal_range("parameter") )
129  {
130  ParametersType::value_type parameter( v.second );
131  m_parameters.push_back( parameter );
132  }
133  }
134  OSLM_ASSERT("A maximum of 1 <parameters> tag is allowed", config.count("parameters") < 2);
135 
136  if(config.count("filter") == 1 )
137  {
138  const ::fwServices::IService::ConfigType& configFilter = config.get_child("filter");
139  OSLM_ASSERT("A maximum of 1 <mode> tag is allowed", configFilter.count("mode") < 2);
140 
141  const std::string mode = configFilter.get< std::string >("mode");
142  OSLM_ASSERT("'" << mode << "' value for <mode> tag isn't valid. Allowed values are : 'include', 'exclude'.",
143  mode == "include" || mode == "exclude");
144  m_filterMode = mode;
145 
146  BOOST_FOREACH( const ConfigType::value_type& v, configFilter.equal_range("id") )
147  {
148  m_keys.push_back(v.second.get<std::string>(""));
149  }
150  }
151  OSLM_ASSERT("A maximum of 1 <filter> tag is allowed", config.count("filter") < 2);
152 
153  if(config.count("quickLaunch") == 1 )
154  {
155  m_quickLaunch.clear();
156  const ::fwServices::IService::ConfigType& configQuickLaunch = config.get_child("quickLaunch");
157  BOOST_FOREACH( const ConfigType::value_type& v, configQuickLaunch.equal_range("association") )
158  {
159  const ::fwServices::IService::ConfigType& association = v.second;
160  const ::fwServices::IService::ConfigType xmlattr = association.get_child("<xmlattr>");
161 
162  SLM_FATAL_IF( "The attribute \"type\" is missing", xmlattr.count("type") != 1 );
163  SLM_FATAL_IF( "The attribute \"id\" is missing", xmlattr.count("id") != 1 );
164 
165  std::string type = xmlattr.get<std::string>("type");
166  std::string id = xmlattr.get<std::string>("id");
167 
168  m_quickLaunch[type] = id;
169  }
170  }
171  SLM_ASSERT("A maximum of 1 <quickLaunch> tag is allowed", config.count("quickLaunch") < 2);
172  }
173 }
174 
175 //------------------------------------------------------------------------------
176 
177 ::fwActivities::registry::ActivityInfo SActivityLauncher::show( const ActivityInfoContainer& infos )
178 {
179  QWidget* parent = qApp->activeWindow();
180 
181  QDialog* dialog = new QDialog(parent);
182  dialog->setWindowTitle(QString::fromStdString("Choose an activity"));
183 
184  QStandardItemModel* model = new QStandardItemModel(dialog);
185  for( ::fwActivities::registry::ActivityInfo info : infos)
186  {
187  std::string text;
188  if(info.title.empty())
189  {
190  text = info.id;
191  }
192  else
193  {
194  text = info.title + (info.description.empty() ? "" : "\n" + info.description);
195  }
196 
197  QStandardItem* item = new QStandardItem(QIcon(info.icon.c_str()), QString::fromStdString(text));
198  item->setData(QVariant::fromValue(info));
199  item->setEditable(false);
200  model->appendRow(item);
201  }
202 
203  QListView* selectionList = new QListView();
204  selectionList->setIconSize(QSize(100, 100));
205  selectionList->setUniformItemSizes(true);
206  selectionList->setModel(model);
207 
208  QModelIndex index = model->index( 0, 0 );
209  if ( index.isValid() )
210  {
211  selectionList->selectionModel()->select( index, QItemSelectionModel::Select );
212  }
213 
214  QPushButton* okButton = new QPushButton("Ok");
215  QPushButton* cancelButton = new QPushButton("Cancel");
216 
217  QHBoxLayout* hLayout = new QHBoxLayout();
218  hLayout->addWidget(okButton);
219  hLayout->addWidget(cancelButton);
220 
221  QVBoxLayout* vLayout = new QVBoxLayout();
222  vLayout->addWidget(selectionList);
223  vLayout->addLayout(hLayout);
224 
225  dialog->setLayout(vLayout);
226  QObject::connect(okButton, SIGNAL(clicked()), dialog, SLOT(accept()));
227  QObject::connect(cancelButton, SIGNAL(clicked()), dialog, SLOT(reject()));
228  QObject::connect(selectionList, SIGNAL(doubleClicked(const QModelIndex&)), dialog, SLOT(accept()));
229 
231  if(dialog->exec())
232  {
233  QModelIndex currentIndex = selectionList->selectionModel()->currentIndex();
234  QStandardItem* item = model->itemFromIndex( currentIndex );
235  QVariant var = item->data();
236  info = var.value< ::fwActivities::registry::ActivityInfo >();
237  }
238 
239  return info;
240 }
241 
242 //------------------------------------------------------------------------------
243 
244 SActivityLauncher::ActivityInfoContainer SActivityLauncher::getEnabledActivities(const ActivityInfoContainer& infos)
245 {
246  ActivityInfoContainer configs;
247 
248  if(m_filterMode == "include" || m_filterMode == "exclude")
249  {
250  const bool isIncludeMode = m_filterMode == "include";
251 
252  for(ActivityInfoContainer::const_iterator iter = infos.begin(); iter != infos.end(); ++iter)
253  {
254  KeysType::iterator keyIt = std::find(m_keys.begin(), m_keys.end(), iter->id);
255 
256  if(keyIt != m_keys.end() && isIncludeMode)
257  {
258  configs.push_back(*iter);
259  }
260  else if(keyIt == m_keys.end() && !isIncludeMode)
261  {
262  configs.push_back(*iter);
263  }
264  }
265  }
266  else
267  {
268  configs = infos;
269  }
270 
271  return configs;
272 }
273 
274 //------------------------------------------------------------------------------
275 
276 void SActivityLauncher::updating()
277 {
278  ::fwData::Vector::csptr selection = this->getInput< ::fwData::Vector >(s_SERIES_INPUT);
279  if (!selection)
280  {
281  FW_DEPRECATED_KEY(s_SERIES_INPUT, "in", "18.0");
282  selection = this->getObject< ::fwData::Vector >();
283  }
284 
285  bool launchAS = this->launchAS(selection);
286  if (!launchAS)
287  {
288  ActivityInfoContainer infos = ::fwActivities::registry::Activities::getDefault()->getInfos(selection);
289  infos = this->getEnabledActivities(infos);
290 
291  if ( !infos.empty())
292  {
294  if((m_keys.size() == 1 && m_filterMode == "include") || (infos.size() == 1))
295  {
296  info = infos[0];
297  }
298  else
299  {
300  info = this->show( infos );
301  }
302 
303  if( !info.id.empty() )
304  {
305  this->sendConfig( info );
306  }
307  }
308  else
309  {
311  "Not available activity for the current selection.",
312  ::fwGui::dialog::MessageDialog::WARNING);
313  }
314  }
315 }
316 
317 //------------------------------------------------------------------------------
318 
319 void SActivityLauncher::updateState()
320 {
321  ::fwData::Vector::csptr selection = this->getInput< ::fwData::Vector >(s_SERIES_INPUT);
322  if (!selection)
323  {
324  FW_DEPRECATED_KEY(s_SERIES_INPUT, "in", "18.0");
325  selection = this->getObject< ::fwData::Vector >();
326  }
327 
328  bool isExecutable = false;
329 
330  if(selection->size() == 1 && ::fwMedData::ActivitySeries::dynamicCast((*selection)[0]))
331  {
332  ::fwMedData::ActivitySeries::sptr as = ::fwMedData::ActivitySeries::dynamicCast((*selection)[0]);
333 
334  if(m_filterMode == "include" || m_filterMode == "exclude")
335  {
336  const bool isIncludeMode = m_filterMode == "include";
337 
338  KeysType::iterator keyIt = std::find(m_keys.begin(), m_keys.end(), as->getActivityConfigId());
339 
340  if(keyIt != m_keys.end() && isIncludeMode)
341  {
342  isExecutable = true;
343  }
344  else if(keyIt == m_keys.end() && !isIncludeMode)
345  {
346  isExecutable = true;
347  }
348  isExecutable &= ::fwActivities::registry::Activities::getDefault()->hasInfo(
349  as->getActivityConfigId());
350  }
351  else
352  {
353  isExecutable = ::fwActivities::registry::Activities::getDefault()->hasInfo(
354  as->getActivityConfigId());
355  }
356  }
357  else
358  {
359  ::fwActivities::registry::ActivityInfo::DataCountType dataCount;
360  dataCount = ::fwActivities::registry::Activities::getDefault()->getDataCount(selection);
361  if(m_filterMode.empty() && dataCount.size() == 1)
362  {
363  ::fwData::Object::sptr obj = selection->front();
364  if (::fwMedData::ActivitySeries::dynamicCast(obj))
365  {
366  isExecutable = true;
367  }
368  }
369 
370  ActivityInfoContainer infos = ::fwActivities::registry::Activities::getDefault()->getInfos(selection);
371  infos = this->getEnabledActivities(infos);
372 
373  isExecutable |= !infos.empty();
374  }
375 
376  this->setIsExecutable(isExecutable);
377 }
378 
379 //------------------------------------------------------------------------------
380 
381 void SActivityLauncher::buildActivity(const ::fwActivities::registry::ActivityInfo& info,
382  const ::fwData::Vector::csptr& selection)
383 {
384  ::fwData::Composite::sptr replaceMap = ::fwData::Composite::New();
385  ::fwActivities::IBuilder::sptr builder;
386  builder = ::fwActivities::builder::factory::New(info.builderImpl);
387  OSLM_ASSERT(info.builderImpl << " instantiation failed", builder);
388 
389  ::fwMedData::ActivitySeries::sptr actSeries;
390  actSeries = builder->buildData(info, selection);
391 
392  if( !actSeries )
393  {
394  std::string msg = "The activity <" + info.title + "> can't be launched. Builder <" + info.builderImpl +
395  "> failed.";
396  ::fwGui::dialog::MessageDialog::showMessageDialog( "Activity can not be launched", msg,
397  ::fwGui::dialog::IMessageDialog::WARNING);
398  OSLM_ERROR(msg);
399  return;
400  }
401 
402  // Applies activity validator on activity series to check the data
403  if (!info.validatorsImpl.empty())
404  {
405  for (std::string validatorImpl : info.validatorsImpl)
406  {
408  ::fwActivities::IValidator::sptr validator = ::fwActivities::validator::factory::New(validatorImpl);
409 
410  ::fwActivities::IActivityValidator::sptr activityValidator =
411  ::fwActivities::IActivityValidator::dynamicCast(validator);
412 
413  if (activityValidator)
414  {
415  ::fwActivities::IValidator::ValidationType validation = activityValidator->validate(actSeries);
416  if(!validation.first)
417  {
418  std::string message = "The activity '" + info.title + "' can not be launched:\n" +
419  validation.second;
421  message,
422  ::fwGui::dialog::IMessageDialog::CRITICAL);
423  return;
424  }
425  }
426  }
427  }
428 
429  ParametersType parameters = this->translateParameters(m_parameters);
431 
432  if( m_mode == "message" )
433  {
434  m_sigActivityLaunched->asyncEmit(msg);
435  }
436  else
437  {
438  ::fwGui::LockAction lock(this->getSptr());
439 
440  std::string viewConfigID = msg.getAppConfigID();
441  ::fwActivities::registry::ActivityMsg::ReplaceMapType replaceMap = msg.getReplaceMap();
442  replaceMap["GENERIC_UID"] =
444 
445  ::fwServices::IAppConfigManager::sptr helper = ::fwServices::IAppConfigManager::New();
446  helper->setConfig( viewConfigID, replaceMap );
447  helper->launch();
448  helper->stopAndDestroy();
449  }
450 }
451 
452 //------------------------------------------------------------------------------
453 
454 void SActivityLauncher::sendConfig( const ::fwActivities::registry::ActivityInfo& info )
455 {
456  // Start Bundle containing the activity if it is not started
457  std::shared_ptr< ::fwRuntime::Bundle > bundle = ::fwRuntime::findBundle(info.bundleId, info.bundleVersion);
458  SLM_WARN_IF("Bundle '" + info.bundleId + "' used by activity '" + info.id + "' is already started.",
459  bundle->isStarted());
460  if (!bundle->isStarted())
461  {
462  SLM_DEBUG("Start bundle '" + info.bundleId + "' used by activity '" + info.id + "'");
463  bundle->start();
464  }
465 
466  ::fwData::Vector::csptr selection = this->getInput< ::fwData::Vector >(s_SERIES_INPUT);
467  if (!selection)
468  {
469  FW_DEPRECATED_KEY(s_SERIES_INPUT, "in", "18.0");
470  selection = this->getObject< ::fwData::Vector >();
471  }
472 
474  validation.first = true;
475 
476  for(auto const& validatorImpl : info.validatorsImpl)
477  {
478  ::fwActivities::IValidator::sptr validator = ::fwActivities::validator::factory::New(validatorImpl);
479  OSLM_ASSERT(validatorImpl << " instantiation failed", validator);
480 
481  ::fwActivities::IValidator::ValidationType valid = validator->validate(info, selection);
482  validation.first &= valid.first;
483  if(!valid.first)
484  {
485  validation.second += "\n" + valid.second;
486  }
487  }
488 
489  if(!validation.first)
490  {
492  "Activity can not be launched",
493  "The activity " + info.title + " can't be launched. Reason : " + validation.second,
494  ::fwGui::dialog::IMessageDialog::WARNING
495  );
496  }
497  else
498  {
499  this->buildActivity(info, selection);
500  }
501 }
502 
503 //------------------------------------------------------------------------------
504 
505 bool SActivityLauncher::launchAS(const ::fwData::Vector::csptr& selection)
506 {
507  bool launchAS = false;
508  ::fwActivities::registry::ActivityInfo::DataCountType dataCount;
509  dataCount = ::fwActivities::registry::Activities::getDefault()->getDataCount(selection);
510  if(dataCount.size() == 1)
511  {
512  for(::fwData::Object::sptr obj : *selection)
513  {
514  ::fwMedData::ActivitySeries::sptr as = ::fwMedData::ActivitySeries::dynamicCast(obj);
515  if (!as)
516  {
517  launchAS = false;
518  break;
519  }
520  else
521  {
522  this->launchActivitySeries(as);
523  launchAS = true;
524  }
525  }
526  }
527  return launchAS;
528 }
529 
530 //------------------------------------------------------------------------------
531 
532 void SActivityLauncher::launchSeries(::fwMedData::Series::sptr series)
533 {
534  ::fwMedData::ActivitySeries::sptr as = ::fwMedData::ActivitySeries::dynamicCast(series);
535  if (as)
536  {
537  this->launchActivitySeries(as);
538  }
539  else
540  {
541  ::fwData::Vector::sptr selection = ::fwData::Vector::New();
542  selection->getContainer().push_back(series);
543  ActivityInfoContainer infos = ::fwActivities::registry::Activities::getDefault()->getInfos(selection);
544 
545  if( m_quickLaunch.find( series->getClassname() ) != m_quickLaunch.end() )
546  {
547  std::string activityId = m_quickLaunch[ series->getClassname() ];
548  SLM_ASSERT("Activity information not found for" + activityId,
549  ::fwActivities::registry::Activities::getDefault()->hasInfo(activityId) );
550  this->sendConfig( ::fwActivities::registry::Activities::getDefault()->getInfo(activityId) );
551  }
552  else if ( !infos.empty() )
553  {
554  this->sendConfig( infos.front() );
555  }
556  else
557  {
559  "Not available activity for the current selection.",
560  ::fwGui::dialog::MessageDialog::WARNING);
561  }
562  }
563 }
564 
565 //------------------------------------------------------------------------------
566 
567 void SActivityLauncher::launchActivitySeries(::fwMedData::ActivitySeries::sptr series)
568 {
570  info = ::fwActivities::registry::Activities::getDefault()->getInfo(series->getActivityConfigId());
571 
572  // Applies activity validator on activity series to check the data
573  if (!info.validatorsImpl.empty())
574  {
575  for (std::string validatorImpl : info.validatorsImpl)
576  {
578  ::fwActivities::IValidator::sptr validator = ::fwActivities::validator::factory::New(validatorImpl);
579 
580  ::fwActivities::IActivityValidator::sptr activityValidator =
581  ::fwActivities::IActivityValidator::dynamicCast(validator);
582 
583  if (activityValidator)
584  {
585  ::fwActivities::IValidator::ValidationType validation = activityValidator->validate(series);
586  if(!validation.first)
587  {
588  std::string message = "The activity '" + info.title + "' can not be launched:\n" +
589  validation.second;
591  message,
592  ::fwGui::dialog::IMessageDialog::CRITICAL);
593  return;
594  }
595  }
596  }
597  }
598 
599  ParametersType parameters = this->translateParameters(m_parameters);
601 
602  m_sigActivityLaunched->asyncEmit(msg);
603 }
604 
605 //------------------------------------------------------------------------------
606 
607 SActivityLauncher::ParametersType SActivityLauncher::translateParameters( const ParametersType& parameters )
608 {
609  ParametersType transParams = parameters;
610  ::fwData::Object::csptr workingObj = this->getInput< ::fwData::Object >(s_SERIES_INPUT);
611  if (!workingObj)
612  {
613  FW_DEPRECATED_KEY(s_SERIES_INPUT, "in", "18.0");
614  workingObj = this->getObject();
615  }
616  for(ParametersType::value_type& param : transParams)
617  {
618  if(param.isSeshat())
619  {
620  std::string parameterToReplace = param.by;
621  if (parameterToReplace.substr(0, 1) == "!")
622  {
623  parameterToReplace.replace(0, 1, "@");
624  }
625 
626  ::fwData::Object::sptr obj = ::fwDataCamp::getObject(workingObj, parameterToReplace);
627  OSLM_ASSERT("Invalid seshat path : '"<<param.by<<"'", obj);
628 
629  ::fwData::String::sptr stringParameter = ::fwData::String::dynamicCast(obj);
630 
631  std::string parameterValue = obj->getID();
632 
633  if(stringParameter && param.by.substr(0, 1) == "!")
634  {
635  parameterValue = stringParameter->getValue();
636  }
637  param.by = parameterValue;
638  }
639  }
640  return transParams;
641 }
642 
643 //------------------------------------------------------------------------------
644 
645 ::fwServices::IService::KeyConnectionsType SActivityLauncher::getObjSrvConnections() const
646 {
647  KeyConnectionsType connections;
648  connections.push_back( std::make_pair( ::fwData::Vector::s_ADDED_OBJECTS_SIG, s_UPDATE_STATE_SLOT ) );
649  connections.push_back( std::make_pair( ::fwData::Vector::s_REMOVED_OBJECTS_SIG, s_UPDATE_STATE_SLOT ) );
650 
651  return connections;
652 }
653 
654 //------------------------------------------------------------------------------
655 
656 ::fwServices::IService::KeyConnectionsMap SActivityLauncher::getAutoConnections() const
657 {
658  KeyConnectionsMap connections;
659 
660  // FIXME hack to support the use of the deprecated getObject() and getObjSrvConnections()
661  if (this->getInput< ::fwData::Object >(s_SERIES_INPUT))
662  {
663  connections.push(s_SERIES_INPUT, ::fwData::Vector::s_ADDED_OBJECTS_SIG, s_UPDATE_STATE_SLOT );
664  connections.push(s_SERIES_INPUT, ::fwData::Vector::s_REMOVED_OBJECTS_SIG, s_UPDATE_STATE_SLOT );
665  }
666 
667  return connections;
668 }
669 
670 //------------------------------------------------------------------------------
671 
672 }
673 }
#define FW_DEPRECATED_KEY(newKey, access, version)
Use this macro when deprecating a service key to warn the developer.
Definition: spyLog.hpp:366
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
std::pair< bool, std::string > ValidationType
Defines validation result of an activity. First element tells if the activity is validated or not by ...
Definition: IValidator.hpp:39
const ReplaceMapType & getReplaceMap() const
Return the map of the string association to replace in config.
Definition: ActivityMsg.hpp:91
Holds Activities configuration.
Definition: Activities.hpp:175
#define OSLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:310
#define SLM_TRACE_FUNC()
Trace contextual function signature.
Definition: spyLog.hpp:329
static FWGUI_API IMessageDialog::Buttons showMessageDialog(const std::string &title, const std::string &message,::fwGui::dialog::IMessageDialog::Icons icon=INFO)
static FWACTIVITIES_API Activities::sptr getDefault()
Return the default global instance of Activities.
Definition: Activities.cpp:226
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_ADDED_OBJECTS_SIG
Type of signal when objects are added.
#define SLM_DEBUG(message)
Definition: spyLog.hpp:239
Defines the service interface managing the menu items.
Definition: IActionSrv.hpp:24
This class defines a vector of objects.
Activity information sent by signal to launch new activities in a tab.
Definition: ActivityMsg.hpp:25
const std::string & getAppConfigID() const
Return appConfig identifier.
Definition: ActivityMsg.hpp:61
#define OSLM_ERROR(message)
Definition: spyLog.hpp:274
This action launchs an activity according to the selected data.
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
FWGUI_API void initialize()
Initialize the action.
Definition: IActionSrv.cpp:69
The namespace activities contains helpers and services allowing to launch activities.
::fwCom::helper::SigSlotConnection::KeyConnectionsType KeyConnectionsType
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
Definition: IService.hpp:449
#define SLM_FATAL_IF(message, cond)
Definition: spyLog.hpp:287
static FWSERVICES_API std::shared_ptr< IAppConfigManager > New()
static FWSERVICES_API std::string getUniqueIdentifier(const std::string &serviceUid="")
Create an unique identifier.
Definition: AppConfig.cpp:269
std::vector< std::string > validatorsImpl
Validator implementations.
Definition: Activities.hpp:201
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_REMOVED_OBJECTS_SIG
Type of signal when objects are added.
#define SLM_WARN_IF(message, cond)
Definition: spyLog.hpp:265