1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_WidgetMultiSelector.cpp
6 * Created on: Aug 28, 2014
10 #include <ModuleBase_WidgetMultiSelector.h>
11 #include <ModuleBase_WidgetShapeSelector.h>
12 #include <ModuleBase_ISelection.h>
13 #include <ModuleBase_IWorkshop.h>
14 #include <ModuleBase_IViewer.h>
15 #include <ModuleBase_Tools.h>
16 #include <ModuleBase_Definitions.h>
17 #include <ModuleBase_IModule.h>
19 #include <ModelAPI_Data.h>
20 #include <ModelAPI_Object.h>
21 #include <ModelAPI_AttributeSelectionList.h>
22 #include <ModelAPI_AttributeRefList.h>
23 #include <ModelAPI_AttributeRefAttrList.h>
25 #include <Config_WidgetAPI.h>
27 #include <QGridLayout>
29 #include <QListWidget>
35 #include <QApplication>
42 const int ATTRIBUTE_SELECTION_INDEX_ROLE = Qt::UserRole + 1;
45 * Customization of a List Widget to make it to be placed on full width of container
47 class CustomListWidget : public QListWidget
51 /// \param theParent a parent widget
52 CustomListWidget( QWidget* theParent )
53 : QListWidget( theParent )
57 /// Redefinition of virtual method
58 virtual QSize sizeHint() const
60 int aHeight = 2*QFontMetrics( font() ).height();
61 QSize aSize = QListWidget::sizeHint();
62 return QSize( aSize.width(), aHeight );
65 /// Redefinition of virtual method
66 virtual QSize minimumSizeHint() const
68 int aHeight = 4/*2*/*QFontMetrics( font() ).height();
69 QSize aSize = QListWidget::minimumSizeHint();
70 return QSize( aSize.width(), aHeight );
74 // The code is necessary only for Linux because
75 //it can not update viewport on widget resize
77 void resizeEvent(QResizeEvent* theEvent)
79 QListWidget::resizeEvent(theEvent);
80 QTimer::singleShot(5, viewport(), SLOT(repaint()));
85 ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent,
86 ModuleBase_IWorkshop* theWorkshop,
87 const Config_WidgetAPI* theData,
88 const std::string& theParentId)
89 : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId),
92 QGridLayout* aMainLay = new QGridLayout(this);
93 ModuleBase_Tools::adjustMargins(aMainLay);
95 QLabel* aTypeLabel = new QLabel(tr("Type"), this);
96 aMainLay->addWidget(aTypeLabel, 0, 0);
98 myTypeCombo = new QComboBox(this);
99 // There is no sense to parameterize list of types while we can not parameterize selection mode
101 std::string aPropertyTypes = theData->getProperty("type_choice");
102 QString aTypesStr = aPropertyTypes.c_str();
103 QStringList aShapeTypes = aTypesStr.split(' ', QString::SkipEmptyParts);
105 myIsUseChoice = theData->getBooleanAttribute("use_choice", true);
107 if (!aShapeTypes.empty())
108 myTypeCombo->addItems(aShapeTypes);
109 aMainLay->addWidget(myTypeCombo, 0, 1);
110 // if the xml definition contains one type, the controls to select a type should not be shown
111 if (aShapeTypes.size() <= 1 || !myIsUseChoice) {
112 aTypeLabel->setVisible(false);
113 myTypeCombo->setVisible(false);
116 std::string aLabelText = theData->getProperty("label");
117 QLabel* aListLabel = new QLabel(!aLabelText.empty() ? aLabelText.c_str()
118 : tr("Selected objects:"), this);
119 aMainLay->addWidget(aListLabel, 1, 0);
120 // if the xml definition contains one type, an information label should be shown near to the latest
121 if (aShapeTypes.size() <= 1) {
122 QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
123 if (!aLabelIcon.isEmpty()) {
124 QLabel* aSelectedLabel = new QLabel("", this);
125 aSelectedLabel->setPixmap(QPixmap(aLabelIcon));
126 aMainLay->addWidget(aSelectedLabel, 1, 1);
128 aMainLay->setColumnStretch(2, 1);
131 QString aToolTip = QString::fromStdString(theData->widgetTooltip());
132 myListControl = new CustomListWidget(this);
133 QString anObjName = QString::fromStdString(attributeID());
134 myListControl->setObjectName(anObjName);
135 myListControl->setToolTip(aToolTip);
136 myListControl->setSelectionMode(QAbstractItemView::ExtendedSelection);
138 aMainLay->addWidget(myListControl, 2, 0, 1, -1);
139 aMainLay->setRowStretch(2, 1);
140 //aMainLay->addWidget(new QLabel(this)); //FIXME(sbh)???
141 //aMainLay->setRowMinimumHeight(3, 20);
142 //this->setLayout(aMainLay);
143 connect(myTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onSelectionTypeChanged()));
145 myCopyAction = new QAction(QIcon(":pictures/copy.png"), tr("Copy"), this);
146 myCopyAction->setShortcut(QKeySequence::Copy);
147 myCopyAction->setEnabled(false);
148 connect(myCopyAction, SIGNAL(triggered(bool)), SLOT(onCopyItem()));
149 myListControl->addAction(myCopyAction);
151 myDeleteAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);
152 myDeleteAction->setEnabled(false);
153 connect(myDeleteAction, SIGNAL(triggered(bool)), SLOT(onDeleteItem()));
154 myListControl->addAction(myDeleteAction);
156 myListControl->setContextMenuPolicy(Qt::ActionsContextMenu);
157 connect(myListControl, SIGNAL(itemSelectionChanged()), SLOT(onListSelection()));
160 ModuleBase_WidgetMultiSelector::~ModuleBase_WidgetMultiSelector()
164 //********************************************************************
165 void ModuleBase_WidgetMultiSelector::activateCustom()
167 ModuleBase_WidgetSelector::activateCustom();
169 myWorkshop->module()->activateCustomPrs(myFeature,
170 ModuleBase_IModule::CustomizeHighlightedObjects, true);
173 //********************************************************************
174 void ModuleBase_WidgetMultiSelector::deactivate()
176 ModuleBase_WidgetSelector::deactivate();
178 myWorkshop->module()->deactivateCustomPrs(ModuleBase_IModule::CustomizeHighlightedObjects, true);
181 //********************************************************************
182 bool ModuleBase_WidgetMultiSelector::storeValueCustom() const
184 // the value is stored on the selection changed signal processing
185 // A rare case when plugin was not loaded.
189 AttributePtr anAttribute = myFeature->data()->attribute(attributeID());
190 std::string aType = anAttribute->attributeType();
191 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
192 AttributeSelectionListPtr aSelectionListAttr = myFeature->data()->selectionList(attributeID());
193 aSelectionListAttr->setSelectionType(myTypeCombo->currentText().toStdString());
198 //********************************************************************
199 bool ModuleBase_WidgetMultiSelector::restoreValueCustom()
201 // A rare case when plugin was not loaded.
205 AttributePtr anAttribute = myFeature->data()->attribute(attributeID());
206 std::string aType = anAttribute->attributeType();
207 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
208 AttributeSelectionListPtr aSelectionListAttr = myFeature->data()->selectionList(attributeID());
209 // Restore shape type
210 setCurrentShapeType(ModuleBase_Tools::shapeType(aSelectionListAttr->selectionType().c_str()));
212 updateSelectionList();
216 //********************************************************************
217 void ModuleBase_WidgetMultiSelector::storeAttributeValue()
219 ModuleBase_WidgetValidated::storeAttributeValue();
221 DataPtr aData = myFeature->data();
222 AttributePtr anAttribute = aData->attribute(attributeID());
223 std::string aType = anAttribute->attributeType();
224 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
225 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
226 mySelectionType = aSelectionListAttr->selectionType();
227 mySelectionCount = aSelectionListAttr->size();
229 else if (aType == ModelAPI_AttributeRefList::typeId()) {
230 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
231 mySelectionCount = aRefListAttr->size();
233 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
234 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
235 mySelectionCount = aRefAttrListAttr->size();
239 //********************************************************************
240 void ModuleBase_WidgetMultiSelector::restoreAttributeValue(bool theValid)
242 ModuleBase_WidgetValidated::restoreAttributeValue(theValid);
244 DataPtr aData = myFeature->data();
245 AttributePtr anAttribute = aData->attribute(attributeID());
246 std::string aType = anAttribute->attributeType();
247 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
248 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
249 aSelectionListAttr->setSelectionType(mySelectionType);
251 // restore selection in the attribute. Indeed there is only one stored object
252 int aCountAppened = aSelectionListAttr->size() - mySelectionCount;
253 for (int i = 0; i < aCountAppened; i++)
254 aSelectionListAttr->removeLast();
256 else if (aType == ModelAPI_AttributeRefList::typeId()) {
257 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
258 // restore objects in the attribute. Indeed there is only one stored object
259 int aCountAppened = aRefListAttr->size() - mySelectionCount;
260 for (int i = 0; i < aCountAppened; i++)
261 aRefListAttr->removeLast();
263 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
264 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
265 // restore objects in the attribute. Indeed there is only one stored object
266 int aCountAppened = aRefAttrListAttr->size() - mySelectionCount;
267 for (int i = 0; i < aCountAppened; i++)
268 aRefAttrListAttr->removeLast();
272 //********************************************************************
273 void ModuleBase_WidgetMultiSelector::clearAttribute()
275 DataPtr aData = myFeature->data();
276 AttributePtr anAttribute = aData->attribute(attributeID());
277 std::string aType = anAttribute->attributeType();
278 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
279 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
280 aSelectionListAttr->clear();
282 else if (aType == ModelAPI_AttributeRefList::typeId()) {
283 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
284 aRefListAttr->clear();
286 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
287 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
288 aRefAttrListAttr->clear();
292 //********************************************************************
293 void ModuleBase_WidgetMultiSelector::setObject(ObjectPtr theSelectedObject,
294 GeomShapePtr theShape)
296 DataPtr aData = myFeature->data();
297 AttributePtr anAttribute = aData->attribute(attributeID());
298 std::string aType = anAttribute->attributeType();
299 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
300 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
301 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
302 aSelectionListAttr->append(aResult, theShape, myIsInValidate);
304 else if (aType == ModelAPI_AttributeRefList::typeId()) {
305 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
306 aRefListAttr->append(theSelectedObject);
308 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
309 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
311 AttributePtr anAttribute = myWorkshop->module()->findAttribute(theSelectedObject, theShape);
312 if (anAttribute.get())
313 aRefAttrListAttr->append(anAttribute);
315 aRefAttrListAttr->append(theSelectedObject);
319 //********************************************************************
320 bool ModuleBase_WidgetMultiSelector::setSelection(QList<ModuleBase_ViewerPrs>& theValues,
321 const bool theToValidate)
323 QList<ModuleBase_ViewerPrs> aSkippedValues;
325 QList<ModuleBase_ViewerPrs>::const_iterator anIt = theValues.begin(), aLast = theValues.end();
327 for (; anIt != aLast; anIt++) {
328 ModuleBase_ViewerPrs aValue = *anIt;
329 bool aProcessed = false;
330 if (!theToValidate || isValidInFilters(aValue)) {
331 aProcessed = setSelectionCustom(aValue);
334 aSkippedValues.append(aValue);
335 // if there is at least one set, the result is true
336 isDone = isDone || aProcessed;
338 // updateObject - to update/redisplay feature
339 // it is commented in order to perfom it outside the method
341 //updateObject(myFeature);
342 // this emit is necessary to call store/restore method an restore type of selection
343 //emit valuesChanged();
346 if (!aSkippedValues.empty())
347 theValues.append(aSkippedValues);
352 //********************************************************************
353 void ModuleBase_WidgetMultiSelector::getHighlighted(QList<ModuleBase_ViewerPrs>& theValues)
355 std::set<int> anAttributeIds;
356 getSelectedAttributeIndices(anAttributeIds);
357 if (!anAttributeIds.empty())
358 convertIndicesToViewerSelection(anAttributeIds, theValues);
361 //********************************************************************
362 bool ModuleBase_WidgetMultiSelector::isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs)
364 bool aValid = ModuleBase_WidgetSelector::isValidSelectionCustom(thePrs);
366 ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
367 aValid = aResult.get() != NULL;
370 // We can not select a result of our feature
371 const std::list<ResultPtr>& aResList = myFeature->results();
372 std::list<ResultPtr>::const_iterator aIt;
373 bool isSkipSelf = false;
374 for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
375 if ((*aIt) == aResult) {
388 //********************************************************************
389 bool ModuleBase_WidgetMultiSelector::processDelete()
391 // find attribute indices to delete
392 std::set<int> anAttributeIds;
393 getSelectedAttributeIndices(anAttributeIds);
395 // refill attribute by the items which indices are not in the list of ids
397 DataPtr aData = myFeature->data();
398 AttributePtr anAttribute = aData->attribute(attributeID());
399 std::string aType = anAttribute->attributeType();
400 aDone = !anAttributeIds.empty();
401 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
402 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
403 aSelectionListAttr->remove(anAttributeIds);
406 else if (aType == ModelAPI_AttributeRefList::typeId()) {
407 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
408 aRefListAttr->remove(anAttributeIds);
410 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
411 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
412 aRefAttrListAttr->remove(anAttributeIds);
416 // update object is necessary to flush update signal. It leads to objects references map update
417 // and the operation presentation will not contain deleted items visualized as parameters of
419 updateObject(myFeature);
422 myWorkshop->setSelected(getAttributeSelection());
427 //********************************************************************
428 QList<QWidget*> ModuleBase_WidgetMultiSelector::getControls() const
430 QList<QWidget*> result;
431 //result << myTypeCombo;
432 result << myListControl;
436 //********************************************************************
437 void ModuleBase_WidgetMultiSelector::onSelectionTypeChanged()
439 activateSelectionAndFilters(true);
440 QList<ModuleBase_ViewerPrs> anEmptyList;
441 // This method will call Selection changed event which will call onSelectionChanged
442 // To clear mySelection, myListControl and storeValue()
443 // So, we don't need to call it
444 myWorkshop->setSelected(anEmptyList);
447 void ModuleBase_WidgetMultiSelector::updateFocus()
449 // Set focus to List control in order to make possible
450 // to use Tab key for transfer the focus to next widgets
451 myListControl->setCurrentRow(myListControl->model()->rowCount() - 1);
452 ModuleBase_Tools::setFocus(myListControl,
453 "ModuleBase_WidgetMultiSelector::onSelectionTypeChanged()");
456 //********************************************************************
457 void ModuleBase_WidgetMultiSelector::updateSelectionName()
461 //********************************************************************
462 QIntList ModuleBase_WidgetMultiSelector::getShapeTypes() const
464 QIntList aShapeTypes;
466 if (myTypeCombo->count() > 1 && myIsUseChoice) {
467 aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCombo->currentText()));
470 for (int i = 0, aCount = myTypeCombo->count(); i < aCount; i++) {
471 TopAbs_ShapeEnum aType = ModuleBase_Tools::shapeType(myTypeCombo->itemText(i));
472 aShapeTypes.append(aType);
473 if (aType == TopAbs_SOLID)
474 aShapeTypes.append(TopAbs_COMPSOLID);
480 //********************************************************************
481 void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const TopAbs_ShapeEnum theShapeType)
483 QString aShapeTypeName;
485 for (int idx = 0; idx < myTypeCombo->count(); ++idx) {
486 aShapeTypeName = myTypeCombo->itemText(idx);
487 TopAbs_ShapeEnum aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
488 if(aRefType == theShapeType && idx != myTypeCombo->currentIndex()) {
489 activateSelectionAndFilters(false);
490 bool isBlocked = myTypeCombo->blockSignals(true);
491 myTypeCombo->setCurrentIndex(idx);
492 myTypeCombo->blockSignals(isBlocked);
494 activateSelectionAndFilters(true);
500 QList<ModuleBase_ViewerPrs> ModuleBase_WidgetMultiSelector::getAttributeSelection() const
502 QList<ModuleBase_ViewerPrs> aSelected;
503 convertIndicesToViewerSelection(std::set<int>(), aSelected);
507 //********************************************************************
508 void ModuleBase_WidgetMultiSelector::updateSelectionList()
510 myListControl->clear();
512 DataPtr aData = myFeature->data();
513 AttributePtr anAttribute = aData->attribute(attributeID());
514 std::string aType = anAttribute->attributeType();
515 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
516 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
517 for (int i = 0; i < aSelectionListAttr->size(); i++) {
518 AttributeSelectionPtr aAttr = aSelectionListAttr->value(i);
519 QListWidgetItem* anItem = new QListWidgetItem(aAttr->namingName().c_str(), myListControl);
520 anItem->setData(ATTRIBUTE_SELECTION_INDEX_ROLE, i);
521 myListControl->addItem(anItem);
524 else if (aType == ModelAPI_AttributeRefList::typeId()) {
525 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
526 for (int i = 0; i < aRefListAttr->size(); i++) {
527 ObjectPtr anObject = aRefListAttr->object(i);
528 if (anObject.get()) {
529 QListWidgetItem* anItem = new QListWidgetItem(anObject->data()->name().c_str(),
531 anItem->setData(ATTRIBUTE_SELECTION_INDEX_ROLE, i);
532 myListControl->addItem(anItem);
536 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
537 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
538 for (int i = 0; i < aRefAttrListAttr->size(); i++) {
539 AttributePtr anAttribute = aRefAttrListAttr->attribute(i);
541 if (anAttribute.get()) {
542 std::string anAttrName = generateName(anAttribute, myWorkshop);
543 aName = QString::fromStdString(anAttrName);
546 ObjectPtr anObject = aRefAttrListAttr->object(i);
547 if (anObject.get()) {
548 aName = anObject->data()->name().c_str();
551 QListWidgetItem* anItem = new QListWidgetItem(aName, myListControl);
552 anItem->setData(ATTRIBUTE_SELECTION_INDEX_ROLE, i);
553 myListControl->addItem(anItem);
557 // We have to call repaint because sometimes the List control is not updated
558 myListControl->repaint();
561 //********************************************************************
562 std::string ModuleBase_WidgetMultiSelector::validatorType(const QString& theType) const
566 if (theType == "Vertices")
568 else if (theType == "Edges")
570 else if (theType == "Faces")
572 else if (theType == "Solids")
578 //********************************************************************
579 void ModuleBase_WidgetMultiSelector::onCopyItem()
581 QList<QListWidgetItem*> aItems = myListControl->selectedItems();
583 foreach(QListWidgetItem* aItem, aItems) {
586 aRes += aItem->text();
588 if (!aRes.isEmpty()) {
589 QClipboard *clipboard = QApplication::clipboard();
590 clipboard->setText(aRes);
594 //********************************************************************
595 void ModuleBase_WidgetMultiSelector::onDeleteItem()
600 //********************************************************************
601 void ModuleBase_WidgetMultiSelector::onListSelection()
603 QList<QListWidgetItem*> aItems = myListControl->selectedItems();
604 myCopyAction->setEnabled(!aItems.isEmpty());
605 myDeleteAction->setEnabled(!aItems.isEmpty());
607 myWorkshop->module()->customizeObject(myFeature, ModuleBase_IModule::CustomizeHighlightedObjects,
611 //********************************************************************
612 void ModuleBase_WidgetMultiSelector::getSelectedAttributeIndices(std::set<int>& theAttributeIds)
614 QList<QListWidgetItem*> aItems = myListControl->selectedItems();
615 foreach(QListWidgetItem* anItem, aItems) {
616 int anIndex = anItem->data(ATTRIBUTE_SELECTION_INDEX_ROLE).toInt();
617 if (theAttributeIds.find(anIndex) == theAttributeIds.end())
618 theAttributeIds.insert(anIndex);
622 void ModuleBase_WidgetMultiSelector::convertIndicesToViewerSelection(std::set<int> theAttributeIds,
623 QList<ModuleBase_ViewerPrs>& theValues) const
625 if(myFeature.get() == NULL)
628 DataPtr aData = myFeature->data();
629 AttributePtr anAttribute = aData->attribute(attributeID());
630 std::string aType = anAttribute->attributeType();
631 if (aType == ModelAPI_AttributeSelectionList::typeId()) {
632 AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
633 for (int i = 0; i < aSelectionListAttr->size(); i++) {
634 // filter by attribute indices only if the container is not empty otherwise return all items
635 if (!theAttributeIds.empty() && theAttributeIds.find(i) == theAttributeIds.end())
637 AttributeSelectionPtr anAttr = aSelectionListAttr->value(i);
638 ResultPtr anObject = anAttr->context();
639 if (anObject.get()) {
641 std::shared_ptr<GeomAPI_Shape> aShapePtr = anAttr->value();
642 if (aShapePtr.get()) {
643 aShape = aShapePtr->impl<TopoDS_Shape>();
645 theValues.append(ModuleBase_ViewerPrs(anObject, aShape, NULL));
649 else if (aType == ModelAPI_AttributeRefList::typeId()) {
650 AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
651 for (int i = 0; i < aRefListAttr->size(); i++) {
652 // filter by attribute indices only if the container is not empty otherwise return all items
653 if (!theAttributeIds.empty() && theAttributeIds.find(i) == theAttributeIds.end())
655 ObjectPtr anObject = aRefListAttr->object(i);
656 if (anObject.get()) {
657 theValues.append(ModuleBase_ViewerPrs(anObject, TopoDS_Shape(), NULL));
661 else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
662 AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
663 for (int i = 0; i < aRefAttrListAttr->size(); i++) {
664 // filter by attribute indices only if the container is not empty otherwise return all items
665 if (!theAttributeIds.empty() && theAttributeIds.find(i) == theAttributeIds.end())
667 ObjectPtr anObject = aRefAttrListAttr->object(i);
671 AttributePtr anAttribute = aRefAttrListAttr->attribute(i);
672 if (anAttribute.get()) {
673 GeomShapePtr aGeomShape = myWorkshop->module()->findShape(anAttribute);
674 if (aGeomShape.get()) {
675 aShape = aGeomShape->impl<TopoDS_Shape>();
677 theValues.append(ModuleBase_ViewerPrs(anObject, aShape, NULL));