#include <ModelAPI_ResultBody.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeSelectionList.h>
void Model_ResultPart::initAttributes()
{
// append the color attribute. It is empty, the attribute will be filled by a request
data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId());
data()->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
void Model_ResultPart::initAttributes()
{
// append the color attribute. It is empty, the attribute will be filled by a request
data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId());
data()->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
- return data()->document("PartDocument")->value();
-}
-
-std::shared_ptr<ModelAPI_Feature> Model_ResultPart::owner()
-{
- return std::shared_ptr<ModelAPI_Feature>(); // return empty pointer
+ if (myTrsf.get()) {
+ return baseRef()->partDoc();
+ }
+ 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;
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
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
std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
return aDocRef->value().get() != NULL;
}
std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
return aDocRef->value().get() != NULL;
}
if (!myTrsf.get()) { // disable of base result part
DocumentPtr aDoc = Model_ResultPart::partDoc();
if (aDoc.get() && aDoc->isOpened()) {
if (!myTrsf.get()) { // disable of base result part
DocumentPtr aDoc = Model_ResultPart::partDoc();
if (aDoc.get() && aDoc->isOpened()) {
aDoc->setCurrentFeature(aLastFeature, false);
if (theFlag) { // disable, so make all features disabled too
// update the shape just before the deactivation: it will be used outside of part
aDoc->setCurrentFeature(aLastFeature, false);
if (theFlag) { // disable, so make all features disabled too
// update the shape just before the deactivation: it will be used outside of part
{
std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
if (myTrsf.get()) { // get shape of the base result and apply the transformation
{
std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
if (myTrsf.get()) { // get shape of the base result and apply the transformation
std::shared_ptr<GeomAPI_Shape> anOrigShape = anOrigResult->shape();
if (anOrigShape.get()) {
TopoDS_Shape aShape = anOrigShape->impl<TopoDS_Shape>();
std::shared_ptr<GeomAPI_Shape> anOrigShape = anOrigResult->shape();
if (anOrigShape.get()) {
TopoDS_Shape aShape = anOrigShape->impl<TopoDS_Shape>();
theIndex = 0; // not initialized
if (myTrsf.get()) { // if this is moved copy of part => return the name of original shape
theIndex = 0; // not initialized
if (myTrsf.get()) { // if this is moved copy of part => return the name of original shape
// searching in the origin the shape equal to the given but with myTrsf
TopoDS_Shape aSelection = theShape->impl<TopoDS_Shape>();
gp_Trsf aSelTrsf = aSelection.Location().Transformation();
// searching in the origin the shape equal to the given but with myTrsf
TopoDS_Shape aSelection = theShape->impl<TopoDS_Shape>();
gp_Trsf aSelTrsf = aSelection.Location().Transformation();