+ if (aCont.get()) {
+ theContext = std::dynamic_pointer_cast<Model_Data>(aCont->data())->label();
+ }
+ return true;
+}
+
+bool Model_AttributeSelection::isLater(
+ const TDF_Label theResult1, const TDF_Label theResult2) const
+{
+ std::shared_ptr<Model_Document> aDoc = myRestoreDocument.get() ? myRestoreDocument :
+ std::dynamic_pointer_cast<Model_Document>(owner()->document());
+ FeaturePtr aFeat1 = aDoc->featureByLab(theResult1);
+ if (!aFeat1.get())
+ return false;
+ FeaturePtr aFeat2 = aDoc->featureByLab(theResult2);
+ if (!aFeat2.get())
+ return false;
+ return aDoc->isLaterByDep(aFeat1, aFeat2);
+}
+
+ResultPtr Model_AttributeSelection::newestContext(
+ const ResultPtr theCurrent, const GeomShapePtr theValue)
+{
+ ResultPtr aResult = theCurrent;
+ GeomShapePtr aSelectedShape = theValue.get() ? theValue : theCurrent->shape();
+ std::shared_ptr<Model_Document> aDoc =
+ std::dynamic_pointer_cast<Model_Document>(owner()->document());