mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-13 02:00:35 +05:00
PAL10385: CreateAndDisplayGO does not work properly when reopening a study
This commit is contained in:
parent
49cd48980d
commit
5977e705e1
@ -133,19 +133,28 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
|||||||
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
|
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
|
||||||
|
|
||||||
GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen();
|
GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen();
|
||||||
|
if (CORBA::is_nil(Geom)) {
|
||||||
|
GeometryGUI::InitGeomGen();
|
||||||
|
Geom = GeometryGUI::GetGeomGen();
|
||||||
|
}
|
||||||
if (CORBA::is_nil(Geom))
|
if (CORBA::is_nil(Geom))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string aFatherIOR;
|
string aFatherIOR;
|
||||||
_PTR(SComponent) father = aStudy->FindComponent("GEOM");
|
_PTR(SComponent) father = aStudy->FindComponent("GEOM");
|
||||||
aStudyBuilder->DefineComponentInstance
|
if (!father)
|
||||||
(father, SalomeApp_Application::orb()->object_to_string(Geom));
|
return;
|
||||||
|
if (!father->ComponentIOR(aFatherIOR)) {
|
||||||
|
aStudyBuilder->LoadWith(father, SalomeApp_Application::orb()->object_to_string(Geom));
|
||||||
father->ComponentIOR(aFatherIOR);
|
father->ComponentIOR(aFatherIOR);
|
||||||
|
}
|
||||||
|
|
||||||
_PTR(SObject) obj = aStudy->FindObjectID(myEntry);
|
_PTR(SObject) obj = aStudy->FindObjectID(myEntry);
|
||||||
_PTR(GenericAttribute) anAttr;
|
if (!obj)
|
||||||
|
return;
|
||||||
|
|
||||||
// Create new actor
|
// Create new actor
|
||||||
|
_PTR(GenericAttribute) anAttr;
|
||||||
if (!obj->FindAttribute(anAttr, "AttributeIOR"))
|
if (!obj->FindAttribute(anAttr, "AttributeIOR"))
|
||||||
return;
|
return;
|
||||||
_PTR(AttributeIOR) anIOR(anAttr);
|
_PTR(AttributeIOR) anIOR(anAttr);
|
||||||
@ -153,7 +162,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str());
|
GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str());
|
||||||
TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape);
|
TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape);
|
||||||
if (obj) {
|
if (!Shape.IsNull()) {
|
||||||
if (obj->FindAttribute(anAttr, "AttributeName")) {
|
if (obj->FindAttribute(anAttr, "AttributeName")) {
|
||||||
_PTR(AttributeName) aName (anAttr);
|
_PTR(AttributeName) aName (anAttr);
|
||||||
string aNameValue = aName->Value();
|
string aNameValue = aName->Value();
|
||||||
@ -186,7 +195,6 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
|||||||
aRenderInter->Display(GActor);
|
aRenderInter->Display(GActor);
|
||||||
}
|
}
|
||||||
aRenderInter->Update();
|
aRenderInter->Update();
|
||||||
cout << 8.2 << endl;
|
|
||||||
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
|
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
|
||||||
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
|
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
|
||||||
Handle(GEOM_AISShape) aSh =
|
Handle(GEOM_AISShape) aSh =
|
||||||
|
Loading…
Reference in New Issue
Block a user