#include <ModelAPI_Session.h>
#include <ModelAPI_ResultPart.h>
#include <ModelAPI_Tools.h>
+#include <Model_Validator.h>
#include <GeomDataAPI_Point.h>
#include <GeomDataAPI_Point2D.h>
}
}
-#include <Model_Validator.h>
-
std::set<std::string> set_union(const std::set<std::string>& theLeft,
const std::set<std::string>& theRight)
{
if (myTrsf.get()) {
return baseRef()->partDoc();
}
- return data()->document("PartDocument")->value();
+ DocumentPtr aRes = data()->document(DOC_REF())->value();
+ if (!aRes.get() && myIsInLoad) { // trying to get this document from the session
+ aRes = document()->subDocument(data()->name());
+ }
+ return aRes;
}
Model_ResultPart::Model_ResultPart()
{
myIsDisabled = true; // by default it is not initialized and false to be after created
+ myIsInLoad = false;
setIsConcealed(false);
}
std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created
+ myIsInLoad = true;
std::shared_ptr<ModelAPI_Document> aDoc = document()->subDocument(data()->name());
+ myIsInLoad = false;
if (aDoc) {
aDocRef->setValue(aDoc);
}
{
TopoDS_Shape myShape; ///< shape of this part created from bodies (updated only of Part deactivation)
std::shared_ptr<gp_Trsf> myTrsf; ///< if it is just copy of original shape, keep just transformation
+ bool myIsInLoad; ///< true if document of this part is in the loading process, so, it may be already received
public:
/// the reference to the base result document, may be null if this is the root, others make sequence of references