- bool isDone = false;
-
- ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
-
- // It should be checked by corresponded validator
- //ObjectPtr aObject = thePrs.object();
- //ObjectPtr aCurrentObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID()));
- /*
- if ((!aCurrentObject) && (!aObject))
- return false;*/
-
- // It should be checked by corresponded validator
- // Check that the selected object is result (others can not be accepted)
- //ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObject);
- //if (!aRes)
- // return false;
- /*if (myFeature) {
- // We can not select a result of our feature
- const std::list<std::shared_ptr<ModelAPI_Result>>& aResList = myFeature->results();
- std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aIt;
- for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
- if ((*aIt) == aRes)
- return false;
- }
- }
- */
- // It should be checked by corresponded validator
- /*
- // Check that object belongs to active document or PartSet
- DocumentPtr aDoc = aRes->document();
- SessionPtr aMgr = ModelAPI_Session::get();
- if (!(aDoc == aMgr->activeDocument()) && !(aDoc == aMgr->moduleDocument()))
- return false;*/
-
-#ifdef DEBUG_SHAPE_VALIDATION_PREVIOUS
- // It should be checked by corresponded validator
- // Check that the result has a shape
- GeomShapePtr aShape = ModelAPI_Tools::shape(aRes);
- if (!aShape)
- return false;
-
- // Get sub-shapes from local selection
- if (!thePrs.shape().IsNull()) {
- aShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
- aShape->setImpl(new TopoDS_Shape(thePrs.shape()));
- }
-
- // Check that the selection corresponds to selection type
- TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
- if (!acceptSubShape(aTopoShape))
- return false;
-#else
- // the difference is that the next method returns an empty shape if the result has the same shape
- // to be checked for all cases and uncommented
- GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
-#endif