7 #include "uiMedDataQt/widget/ActivityDataView.hpp" 9 #include <fwActivities/IActivityValidator.hpp> 10 #include <fwActivities/IObjectValidator.hpp> 11 #include <fwActivities/IValidator.hpp> 13 #include <fwData/Boolean.hpp> 14 #include <fwData/Composite.hpp> 15 #include <fwData/Float.hpp> 16 #include <fwData/Integer.hpp> 17 #include <fwData/String.hpp> 18 #include <fwData/TransformationMatrix3D.hpp> 19 #include <fwData/Vector.hpp> 21 #include <fwDataCamp/getObject.hpp> 22 #include <fwDataCamp/visitor/CompareObjects.hpp> 24 #include <fwIO/ioTypes.hpp> 26 #include <fwMedData/Patient.hpp> 27 #include <fwMedData/Series.hpp> 28 #include <fwMedData/SeriesDB.hpp> 29 #include <fwMedData/Study.hpp> 31 #include <fwRuntime/Convert.hpp> 33 #include <fwServices/IService.hpp> 34 #include <fwServices/op/Add.hpp> 35 #include <fwServices/registry/ObjectService.hpp> 36 #include <fwServices/registry/ServiceConfig.hpp> 38 #include <QApplication> 40 #include <QHBoxLayout> 41 #include <QInputDialog> 44 #include <QMessageBox> 47 #include <QPushButton> 48 #include <QStandardItem> 49 #include <QTableWidget> 50 #include <QVBoxLayout> 61 ActivityDataView::ActivityDataView(QWidget* parent) :
68 ActivityDataView::~ActivityDataView()
74 void ActivityDataView::clear()
76 m_importedObject.clear();
77 m_treeWidgets.clear();
83 bool ActivityDataView::eventFilter(QObject* obj, QEvent* event)
86 if (event->type() == QEvent::Drop)
88 QDropEvent* dropEvent =
static_cast<QDropEvent*
>(event);
90 size_t index =
static_cast<size_t>(this->currentIndex());
92 QPointer<QTreeWidget> tree = m_treeWidgets[index];
95 const QMimeData* qMimeData = dropEvent->mimeData();
97 QByteArray encoded = qMimeData->data(
"application/x-qabstractitemmodeldatalist");
98 QDataStream stream(&encoded, QIODevice::ReadOnly);
100 QList<QTreeWidgetItem* > itemList;
101 QTreeWidgetItem* item;
104 while (!stream.atEnd())
108 QMap<int, QVariant> roleDataMap;
110 stream >> row >> col >> roleDataMap;
114 item =
new QTreeWidgetItem();
115 itemList.push_back(item);
118 QList<int> keys = roleDataMap.keys();
121 item->setData(col, key, roleDataMap[key]);
126 int nbChild = tree->topLevelItemCount() + itemList.size();
127 if (static_cast<unsigned int>(nbChild) > requirement.
maxOccurs )
129 QMessageBox::warning(
this,
"Drop",
"The maximum number of element is reached.\n" 130 "You must remove one before adding another.");
135 for (QTreeWidgetItem* itemToAdd: itemList)
137 itemToAdd->setFlags(itemToAdd->flags() & ~Qt::ItemIsDropEnabled);
138 std::string uid = itemToAdd->data(
int(ColumnType::NAME), s_UID_ROLE).toString().toStdString();
143 if (obj && obj->isA(requirement.
type))
146 tree->addTopLevelItem(itemToAdd);
153 else if (event->type() == QEvent::KeyPress)
155 QKeyEvent* keyEvent =
static_cast<QKeyEvent*
>(event);
156 if (keyEvent->key() == Qt::Key_Delete)
158 this->removeSelectedObjects();
164 return QObject::eventFilter(obj, event);
170 void ActivityDataView::fillInformation(const ::fwActivities::registry::ActivityInfo& info)
172 namespace ActReg = ::fwActivities::registry;
174 m_activityInfo = info;
177 ActReg::ActivityInfo::RequirementsType reqVect = m_activityInfo.requirements;
178 for(
const ActReg::ActivityRequirement& req : reqVect)
180 QVBoxLayout* layout =
new QVBoxLayout();
181 QWidget* widget =
new QWidget();
182 widget->setLayout(layout);
184 QHBoxLayout* infoLayout =
new QHBoxLayout();
185 layout->addLayout(infoLayout);
187 QVBoxLayout* typeLayout =
new QVBoxLayout();
188 QVBoxLayout* txtLayout =
new QVBoxLayout();
189 infoLayout->addLayout(typeLayout);
190 infoLayout->addSpacerItem(
new QSpacerItem(20, 0));
191 infoLayout->addLayout(txtLayout, 1);
193 ObjectIconMapType::iterator iter = m_objectIcons.find(req.type);
194 if (iter != m_objectIcons.end())
196 QString filename = QString::fromStdString(iter->second);
198 this->addTab(widget, QIcon(filename), QString::fromStdString(req.name));
199 QLabel* icon =
new QLabel();
200 icon->setAlignment(Qt::AlignHCenter);
201 QPixmap pixmap(filename);
202 icon->setPixmap(pixmap.scaled(100, 100));
203 typeLayout->addWidget(icon);
207 this->addTab(widget, QString::fromStdString(req.name));
210 QLabel* type =
new QLabel(QString(
"<small>%1</small>").arg(QString::fromStdString(req.type)));
211 type->setAlignment(Qt::AlignHCenter);
212 typeLayout->addWidget(type);
214 QLabel* name =
new QLabel(QString(
"<h2>%1</h2>").arg(QString::fromStdString(req.name)));
215 name->setStyleSheet(
"QLabel { font: bold; }");
216 txtLayout->addWidget(name);
218 QLabel* description =
new QLabel(QString::fromStdString(req.description));
219 description->setStyleSheet(
"QLabel { font: italic; }");
220 txtLayout->addWidget(description);
222 txtLayout->addStretch();
224 QLabel* nb =
new QLabel();
225 nb->setStyleSheet(
"QLabel { font: bold; }");
226 layout->addWidget(nb);
228 QPointer<QTreeWidget> tree =
new QTreeWidget();
229 m_treeWidgets.push_back(tree);
230 if (req.maxOccurs == 0)
232 nb->setText(
"No object is required, it will be automatically created.");
233 tree->setEnabled(
false);
235 else if (req.minOccurs == 1 && req.maxOccurs == 1)
237 nb->setText(
"One object is required: ");
241 QString nbObj(
"Number of required object");
242 if (req.maxOccurs == std::numeric_limits<unsigned int>::max())
244 nbObj.append(QString(
" >= %1").arg(req.minOccurs));
248 nbObj.append(QString(
": [%1-%2]").arg(req.minOccurs).arg(req.maxOccurs));
253 QHBoxLayout* treeLayout =
new QHBoxLayout();
254 QVBoxLayout* buttonLayout =
new QVBoxLayout();
255 if (req.type ==
"::fwData::String" || req.type ==
"::fwData::Boolean" 256 || req.type ==
"::fwData::Integer" || req.type ==
"::fwData::Float" 257 || req.type ==
"::fwData::TransformationMatrix3D")
259 QPushButton* buttonNew =
new QPushButton(
"New");
260 buttonNew->setToolTip(
"Create a new empty object");
261 buttonLayout->addWidget(buttonNew);
262 QObject::connect(buttonNew, &QPushButton::clicked,
this, &ActivityDataView::createNewObject);
265 QPushButton* buttonAdd =
new QPushButton(
"Load");
266 QPushButton* buttonRemove =
new QPushButton(
"Remove");
267 QPushButton* buttonClear =
new QPushButton(
"Clear");
268 buttonLayout->addWidget(buttonAdd);
269 buttonAdd->setToolTip(QString(
"Load an object of type '%1'.").arg(QString::fromStdString(req.type)));
272 ::fwData::Object::sptr newObject = ::fwData::factory::New(req.type);
273 if (newObject && ::fwMedData::Series::dynamicCast(newObject))
275 QPushButton* buttonAddFromSDB =
new QPushButton(
"Import");
276 buttonLayout->addWidget(buttonAddFromSDB);
277 buttonAddFromSDB->setToolTip(QString(
"Import a SeriesDB and extract the N first objects of type '%1', with " 278 "N the maximum number of required objects.").
279 arg(QString::fromStdString(req.type)));
280 QObject::connect(buttonAddFromSDB, &QPushButton::clicked,
this, &ActivityDataView::importObjectFromSDB);
283 buttonLayout->addWidget(buttonRemove);
284 buttonRemove->setToolTip(QString(
"Remove the selected objects"));
285 buttonLayout->addWidget(buttonClear);
286 buttonClear->setToolTip(QString(
"Remove all the objects"));
287 buttonLayout->addStretch();
288 QObject::connect(buttonAdd, &QPushButton::clicked,
this, &ActivityDataView::importObject);
289 QObject::connect(buttonRemove, &QPushButton::clicked,
this, &ActivityDataView::removeSelectedObjects);
290 QObject::connect(buttonClear, &QPushButton::clicked,
this, &ActivityDataView::clearTree);
291 treeLayout->addLayout(buttonLayout);
294 headers <<
"" <<
"object type" <<
"description" <<
"patient name" <<
"study description" <<
"" <<
"" <<
"" 295 <<
"" <<
"" <<
"" <<
"";
296 tree->setHeaderLabels(headers);
298 treeLayout->addWidget(tree, 1);
299 tree->setAlternatingRowColors(
true);
300 tree->setAcceptDrops(
true);
301 tree->setDragDropMode(QAbstractItemView::DropOnly);
302 tree->viewport()->installEventFilter(
this);
303 tree->installEventFilter(
this);
305 QObject::connect(tree.data(), &QTreeWidget::itemDoubleClicked,
this,
306 &ActivityDataView::onTreeItemDoubleClicked);
307 layout->addLayout(treeLayout, 1);
312 for (
int i = 1; i < this->count(); ++i)
314 this->setTabEnabled(i,
false);
320 void ActivityDataView::fillInformation(const ::fwMedData::ActivitySeries::sptr& activitySeries)
322 namespace ActReg = ::fwActivities::registry;
325 m_activityInfo = info;
327 ::fwData::Composite::sptr data = activitySeries->getData();
329 this->fillInformation(info);
331 for (
size_t i = 0; i < m_activityInfo.requirements.size(); ++i)
342 this->addObjectItem(i, obj);
348 ::fwData::Vector::sptr vector = ::fwData::Vector::dynamicCast(obj);
351 for (
auto subObj : vector->getContainer())
353 this->addObjectItem(i, subObj);
358 SLM_ERROR(
"Object param '" + req.name +
"' must be a '::fwData::Vector'");
363 ::fwData::Composite::sptr composite = ::fwData::Composite::dynamicCast(obj);
366 for (
auto subObj : composite->getContainer())
368 this->addObjectItem(i, subObj.second);
373 SLM_ERROR(
"Object param '" + req.name +
"' must be a '::fwData::Composite'");
378 this->setTabEnabled(
int(i),
true);
384 ::fwData::Object::sptr ActivityDataView::checkData(
size_t index, std::string& errorMsg)
386 ::fwData::Object::sptr data;
389 QPointer<QTreeWidget> tree = m_treeWidgets[index];
396 if (tree->topLevelItemCount() == 1)
398 QTreeWidgetItem* item = tree->topLevelItem(0);
401 item->data(
int(ColumnType::NAME), ActivityDataView::s_UID_ROLE).toString().toStdString();
404 if (obj && obj->isA(req.
type))
411 errorMsg +=
"\n - The parameter '" + req.name +
"' must be a '" + req.
type +
"'.";
418 data = ::fwData::factory::New(req.
type);
423 errorMsg +=
"\n - The parameter '" + req.name +
"' is required but is not defined.";
429 unsigned int nbObj =
static_cast<unsigned int>(tree->topLevelItemCount());
434 errorMsg +=
"\n - The parameter '" + req.name +
"' must contain at least " +
435 std::to_string(req.
minOccurs) +
" elements.";
440 errorMsg +=
"\n - The parameter '" + req.name +
"' must contain at most " +
441 std::to_string(req.
maxOccurs) +
" elements.";
447 ::fwData::Vector::sptr vector = ::fwData::Vector::New();
449 for (
unsigned int i = 0; i < nbObj; ++i)
451 QTreeWidgetItem* itemData = tree->topLevelItem(
int(i));
453 itemData->data(
int(ColumnType::NAME), s_UID_ROLE).toString().toStdString();
456 if (obj && obj->isA(req.
type))
458 vector->getContainer().push_back(obj);
463 errorMsg +=
"\n - The parameter '" + req.name +
"' must be a " + req.
type +
".";
473 ::fwData::Composite::sptr composite = ::fwData::Composite::New();
475 for (
unsigned int i = 0; i < nbObj; ++i)
477 QTreeWidgetItem* itemData = tree->topLevelItem(
int(i));
479 itemData->data(
int(ColumnType::NAME), s_UID_ROLE).toString().toStdString();
482 if (obj && obj->isA(req.
type))
484 std::string key = req.
keys[i].key;
485 std::string path = req.
keys[i].path;
488 (*composite)[key] = obj;
492 (*composite)[key] = ::fwDataCamp::getObject( obj, path );
498 errorMsg +=
"\n - The parameter '" + req.name +
"' must be a " + req.
type +
".";
513 ::fwActivities::IValidator::sptr validator = ::fwActivities::validator::factory::New(req.
validator);
514 ::fwActivities::IObjectValidator::sptr dataValidator = ::fwActivities::IObjectValidator::dynamicCast(validator);
518 if(!validation.first)
520 errorMsg +=
"\n" + validation.second;
530 bool ActivityDataView::checkAndComputeData(const ::fwMedData::ActivitySeries::sptr& actSeries, std::string& errorMsg)
532 namespace ActReg = ::fwActivities::registry;
534 ::fwData::Composite::sptr data = actSeries->getData();
537 errorMsg +=
"The required data are not correct:";
540 for (
size_t i = 0; i < m_activityInfo.requirements.size(); ++i)
544 ::fwData::Object::sptr obj = this->checkData(i, msg);
547 (*data)[req.name] = obj;
556 for (std::string validatotImpl : m_activityInfo.validatorsImpl)
559 ::fwActivities::IValidator::sptr validator = ::fwActivities::validator::factory::New(validatotImpl);
561 ::fwActivities::IActivityValidator::sptr activityValidator =
562 ::fwActivities::IActivityValidator::dynamicCast(validator);
563 SLM_ASSERT(
"Validator '" + validatotImpl +
"' instantiation failed", activityValidator);
566 if(!validation.first)
569 errorMsg +=
"\n" + validation.second;
578 void ActivityDataView::removeSelectedObjects()
580 size_t tabIndex =
static_cast<size_t>(this->currentIndex());
581 QPointer<QTreeWidget> tree = m_treeWidgets[tabIndex];
582 QList<QTreeWidgetItem*> items = tree->selectedItems();
583 for (QTreeWidgetItem* item: items)
587 int itemIndex = tree->indexOfTopLevelItem(item);
588 QTreeWidgetItem* itemToRemove = tree->takeTopLevelItem(itemIndex);
600 void ActivityDataView::clearTree()
602 size_t tabIndex =
static_cast<size_t>(this->currentIndex());
603 QPointer<QTreeWidget> tree = m_treeWidgets[tabIndex];
609 void ActivityDataView::createNewObject()
611 size_t index =
static_cast<size_t>(this->currentIndex());
615 std::string type = req.
type;
617 QPointer<QTreeWidget> tree = m_treeWidgets[index];
619 unsigned int nbItems =
static_cast<unsigned int>(tree->topLevelItemCount());
623 const QString message(
"Can't create more '"+ QString::fromStdString(type) +
624 "', please remove one to create another.");
625 QMessageBox::warning(
this,
"New", message );
628 ::fwData::Object::sptr newObject = ::fwData::factory::New(type);
630 m_importedObject.push_back(newObject);
631 this->addObjectItem(index, newObject);
636 void ActivityDataView::importObject()
638 const size_t index =
static_cast<size_t>(this->currentIndex());
642 const std::string type = req.
type;
644 QPointer<QTreeWidget> tree = m_treeWidgets[index];
646 const unsigned int nbItems =
static_cast<unsigned int>(tree->topLevelItemCount());
650 const QString message(
"Can't load more '"+ QString::fromStdString(type) +
651 "', please remove one to load another.");
652 QMessageBox::warning(
this,
"Import", message );
656 auto obj = this->readObject(type, m_ioSelectorSrvConfig);
659 m_importedObject.push_back(obj);
661 this->addObjectItem(index, obj);
667 void ActivityDataView::importObjectFromSDB()
669 const size_t index =
static_cast<size_t>(this->currentIndex());
673 const std::string type = req.
type;
675 QPointer<QTreeWidget> tree = m_treeWidgets[index];
677 const unsigned int nbItems =
static_cast<unsigned int>(tree->topLevelItemCount());
681 const QString message(
"Can't load more '"+ QString::fromStdString(type) +
682 "', please remove one to load another.");
683 QMessageBox::warning(
this,
"Import from SeriesDB", message );
687 ::fwData::Object::sptr newObject = ::fwData::factory::New(type);
690 OSLM_ERROR_IF(
"Imported object must inherit from 'Series'.", !::fwMedData::Series::dynamicCast(newObject));
693 auto obj = this->readObject(
"::fwMedData::SeriesDB", m_sdbIoSelectorSrvConfig);
694 auto seriesDB = ::fwMedData::SeriesDB::dynamicCast(obj);
697 unsigned int nbImportedObj = 0;
698 for (const ::fwMedData::Series::sptr& series : *seriesDB)
700 if (series->isA(type))
703 m_importedObject.push_back(series);
705 this->addObjectItem(index, series);
717 std::string msg =
"Can not create object '" + type +
"'";
719 QMessageBox messageBox(QMessageBox::Warning,
"Error", QString::fromStdString(msg), QMessageBox::Ok);
725 ::fwData::Object::sptr ActivityDataView::readObject(
const std::string&
classname,
726 const std::string& ioSelectorSrvConfig)
728 ::fwData::Object::sptr obj;
729 ::fwServices::IService::sptr ioSelectorSrv;
730 ioSelectorSrv = ::fwServices::add(
"::uiIO::editor::SIOSelector");
731 ioSelectorSrv->setObjectId(::fwIO::s_DATA_KEY,
"objRead");
733 ::fwRuntime::ConfigurationElement::csptr ioCfg;
735 "::uiIO::editor::SIOSelector");
737 auto ioConfig = ::fwRuntime::Convert::toPropertyTree(ioCfg);
738 auto srvConfig = ioConfig.get_child(
"config");
739 srvConfig.add(
"type.<xmlattr>.class", classname);
743 ioSelectorSrv->setConfiguration(srvConfig);
744 ioSelectorSrv->configure();
745 ioSelectorSrv->start();
746 ioSelectorSrv->update();
748 ioSelectorSrv->stop();
749 ::fwServices::OSR::unregisterService( ioSelectorSrv );
751 catch(std::exception& e)
753 std::stringstream msg;
754 msg <<
"The object can not be imported: " << e.what();
757 QMessageBox messageBox(QMessageBox::Warning,
"Error", QString::fromStdString(msg.str()), QMessageBox::Ok);
758 if (ioSelectorSrv->isStarted())
760 ioSelectorSrv->stop();
762 ::fwServices::OSR::unregisterService( ioSelectorSrv );
769 void ActivityDataView::addObjectItem(
size_t index, const ::fwData::Object::csptr& obj)
771 QPointer<QTreeWidget> tree = m_treeWidgets[index];
773 QTreeWidgetItem* newItem =
new QTreeWidgetItem();
774 newItem->setFlags(newItem->flags() & ~Qt::ItemIsDropEnabled);
775 newItem->setData(
int(ColumnType::NAME), s_UID_ROLE, QVariant(QString::fromStdString(obj->getID())));
776 newItem->setText(
int(ColumnType::TYPE), QString::fromStdString(obj->getClassname()));
779 ::fwMedData::Series::csptr series = ::fwMedData::Series::dynamicCast(obj);
780 ::fwData::String::csptr strObj = ::fwData::String::dynamicCast(obj);
781 ::fwData::Integer::csptr intObj = ::fwData::Integer::dynamicCast(obj);
782 ::fwData::Float::csptr floatObj = ::fwData::Float::dynamicCast(obj);
783 ::fwData::Boolean::csptr boolObj = ::fwData::Boolean::dynamicCast(obj);
784 ::fwData::TransformationMatrix3D::csptr trf = ::fwData::TransformationMatrix3D::dynamicCast(obj);
787 newItem->setText(
int(ColumnType::NAME), QString::fromStdString(series->getModality()));
788 newItem->setText(
int(ColumnType::DESC), QString::fromStdString(series->getDescription()));
789 newItem->setText(
int(ColumnType::PATIENT), QString::fromStdString(series->getPatient()->getName()));
790 newItem->setText(
int(ColumnType::STUDY), QString::fromStdString(series->getStudy()->getDescription()));
794 newItem->setText(
int(ColumnType::DESC), QString::fromStdString(strObj->value()));
798 newItem->setText(
int(ColumnType::DESC), QString(
"%1").arg(intObj->value()));
802 newItem->setText(
int(ColumnType::DESC), QString(
"%1").arg(floatObj->value()));
806 newItem->setText(
int(ColumnType::DESC), boolObj->value() ?
"true" :
"false");
810 std::stringstream str;
812 newItem->setText(
int(ColumnType::DESC), QString::fromStdString(str.str()));
816 ObjectIconMapType::iterator iter = m_objectIcons.find(obj->getClassname());
817 if (iter != m_objectIcons.end())
819 newItem->setIcon(
int(ColumnType::NAME), QIcon(QString::fromStdString(iter->second)));
822 tree->addTopLevelItem(newItem);
823 for (
int i = 0; i < tree->columnCount(); ++i)
825 tree->resizeColumnToContents(i);
831 void ActivityDataView::onTreeItemDoubleClicked(QTreeWidgetItem* item,
int)
835 std::string uid = item->data(
int(ColumnType::NAME), s_UID_ROLE).toString().toStdString();
841 if (obj->isA(
"::fwData::String"))
843 ::fwData::String::sptr str = ::fwData::String::dynamicCast(obj);
844 bool isOkClicked =
false;
845 QString value = QInputDialog::getText(
846 this,
"Edition",
"Enter the String value:",
847 QLineEdit::Normal, QString::fromStdString(str->value()), &isOkClicked);
851 str->value() = value.toStdString();
852 item->setText(
int(ColumnType::DESC), value);
855 else if (obj->isA(
"::fwData::Integer"))
857 ::fwData::Integer::sptr intObj = ::fwData::Integer::dynamicCast(obj);
859 bool isOkClicked =
false;
860 int value = QInputDialog::getInt(
861 this,
"Edition",
"Enter the Integer value:", intObj->value(), std::numeric_limits<int>::min(),
862 std::numeric_limits<int>::max(), 1, &isOkClicked);
865 intObj->value() = value;
866 item->setText(
int(ColumnType::DESC), QString(
"%1").arg(value));
869 else if (obj->isA(
"::fwData::Float"))
871 ::fwData::Float::sptr floatObj = ::fwData::Float::dynamicCast(obj);
873 bool isOkClicked =
false;
874 double value = QInputDialog::getDouble(
875 this,
"Edition",
"Enter the Integer value:", floatObj->value(), std::numeric_limits<int>::min(),
876 std::numeric_limits<int>::max(), 3, &isOkClicked);
879 floatObj->value() =
static_cast<float>(value);
880 item->setText(
int(ColumnType::DESC), QString(
"%1").arg(value));
883 else if (obj->isA(
"::fwData::Boolean"))
885 ::fwData::Boolean::sptr boolObj = ::fwData::Boolean::dynamicCast(obj);
886 QMessageBox::StandardButton button = QMessageBox::question(
887 this,
"Edition",
"Defines the Boolean value");
888 boolObj->value() = (button == QMessageBox::Yes);
889 item->setText(
int(ColumnType::DESC), boolObj->value() ?
"true" :
"false" );
891 else if (obj->isA(
"::fwData::TransformationMatrix3D"))
893 ::fwData::TransformationMatrix3D::sptr trf = ::fwData::TransformationMatrix3D::dynamicCast(obj);
894 std::stringstream str;
897 bool isOkClicked =
false;
898 QString value = QInputDialog::getMultiLineText(
899 this,
"Edition",
"Enter the Matrix coefficient (separated by a space):",
900 QString::fromStdString(str.str()), &isOkClicked);
902 QStringList coeffList = value.trimmed().split(QRegularExpression(
"\\s+"));
903 if (isOkClicked && coeffList.size() == 16)
905 ::fwData::TransformationMatrix3D::TMCoefArray coeffs;
907 bool conversionOK =
false;
908 for (
int i = 0; i < 16; ++i)
910 coeffs[size_t(i)] = coeffList[i].toDouble(&conversionOK);
913 QMessageBox::warning(
this,
"ERROR",
914 "This values cannot be converted to matrix coefficients");
918 trf->setCoefficients(coeffs);
919 item->setText(
int(ColumnType::DESC), value.trimmed() );
921 else if (isOkClicked)
923 QMessageBox::warning(
this,
"ERROR",
924 "This values cannot be converted to matrix coefficients. It must contain " 931 SLM_DEBUG(
"Object of type '" + obj->classname() +
"' can not yet be editted");
The namespace uiMedDataQt contains editors for medical data.
std::pair< bool, std::string > ValidationType
Defines validation result of an activity. First element tells if the activity is validated or not by ...
Holds Activities configuration.
unsigned int maxOccurs
minimum number of data required
static FWACTIVITIES_API Activities::sptr getDefault()
Return the default global instance of Activities.
static const std::string & classname()
return object's classname without its namespace, i.e. BaseObject
#define SLM_DEBUG(message)
std::string validator
parameter description
std::string type
parameter name
#define SLM_ERROR(message)
#define OSLM_ERROR(message)
KeyType keys
True if the data must be created if it is not present (only if minOccurs = 0 and maxOccurs = 1) ...
unsigned int minOccurs
Implementation of data validator.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Base class for each data object.
std::string container
parameter type (ie. fwMedData::ImageSeries)
static FWSERVICES_API ServiceConfig::sptr getDefault()
Return the default global instance of ServiceConfig.
bool create
maximum number of data required
#define OSLM_ERROR_IF(message, cond)