return mySize->Get();
}
+bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext,
+ const std::shared_ptr<GeomAPI_Shape>& theSubShape,
+ const bool theTemporarily)
+{
+ return false;
+}
+
const std::string Model_AttributeSelectionList::selectionType() const
{
return TCollection_AsciiString(mySelectionType->Get()).ToCString();
/// Returns the number ofselection attributes in the list
MODEL_EXPORT virtual int size();
+ /// Returns true if the object with the shape are in list
+ /// \param theContext object where the sub-shape was selected
+ /// \param theSubShape selected sub-shape (if null, the whole context is selected)
+ /// \returns true if the pair is found in the attirbute
+ MODEL_EXPORT virtual bool isInList(
+ const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
+ const bool theTemporarily = false);
+
/// The type of all elements selection
/// \returns the index of the OCCT enumeration of the type of shape
MODEL_EXPORT virtual const std::string selectionType() const;
/// Returns the number of selection attributes in the list
virtual int size() = 0;
+ /// Returns true if the object with the shape are in list
+ /// \param theContext object where the sub-shape was selected
+ /// \param theSubShape selected sub-shape (if null, the whole context is selected)
+ /// \returns true if the pair is found in the attirbute
+ virtual bool isInList(
+ const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
+ const bool theTemporarily = false) = 0;
+
/// The type of all elements selection
/// \returns the index of the enumeration of the type of shape
virtual const std::string selectionType() const = 0;
if (aType == ModelAPI_AttributeSelectionList::typeId()) {
AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
- //if (!aSelectionListAttr->isInList(aResult, theShape, myIsInValidate))
+ if (!aSelectionListAttr->isInList(aResult, theShape, myIsInValidate))
aSelectionListAttr->append(aResult, theShape, myIsInValidate);
}
else if (aType == ModelAPI_AttributeRefList::typeId()) {
AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
- //if (!aRefListAttr->isInList(theSelectedObject))
+ if (!aRefListAttr->isInList(theSelectedObject))
aRefListAttr->append(theSelectedObject);
}
else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
AttributePtr anAttribute = myWorkshop->module()->findAttribute(theSelectedObject, theShape);
if (anAttribute.get()) {
- //if (!aRefAttrListAttr->isInList(anAttribute))
+ if (!aRefAttrListAttr->isInList(anAttribute))
aRefAttrListAttr->append(anAttribute);
}
else {
- //if (!aRefAttrListAttr->isInList(theSelectedObject))
+ if (!aRefAttrListAttr->isInList(theSelectedObject))
aRefAttrListAttr->append(theSelectedObject);
}
}