From 96478dfdc2bcd46f655b83edcf2ae7c6416808b3 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 11 Jan 2006 13:47:57 +0000 Subject: [PATCH] Merge with OCC_development_generic_2006 --- src/GEOMGUI/GeometryGUI_Swig.cxx | 33 +++++++++++-------- src/GEOMImpl/GEOMImpl_IShapesOperations.cxx | 2 +- src/NMTAlgo/NMTAlgo_Splitter_1.cxx | 36 ++++++++++++++------- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index e257776b2..9a10ef6df 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -42,9 +42,7 @@ #include "OCCViewer_ViewManager.h" #include "SOCC_ViewModel.h" -#include "VTKViewer_ViewWindow.h" -#include "VTKViewer_ViewModel.h" -#include "VTKViewer_RenderWindowInteractor.h" +#include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" #include "SVTK_View.h" @@ -98,7 +96,7 @@ inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){ inline SVTK_ViewWindow* GetSVTKViewWindow(SUIT_Application* theApp){ SUIT_ViewWindow* window = theApp->desktop()->activeWindow(); - if(window && window->getViewManager()->getType() == VTKViewer_Viewer::Type()) + if(window && window->getViewManager()->getType() == SVTK_Viewer::Type()) return dynamic_cast( window ); return 0; @@ -135,19 +133,28 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder(); GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen(); + if (CORBA::is_nil(Geom)) { + GeometryGUI::InitGeomGen(); + Geom = GeometryGUI::GetGeomGen(); + } if (CORBA::is_nil(Geom)) return; string aFatherIOR; _PTR(SComponent) father = aStudy->FindComponent("GEOM"); - aStudyBuilder->DefineComponentInstance - (father, SalomeApp_Application::orb()->object_to_string(Geom)); - father->ComponentIOR(aFatherIOR); + if (!father) + return; + if (!father->ComponentIOR(aFatherIOR)) { + aStudyBuilder->LoadWith(father, SalomeApp_Application::orb()->object_to_string(Geom)); + father->ComponentIOR(aFatherIOR); + } _PTR(SObject) obj = aStudy->FindObjectID(myEntry); - _PTR(GenericAttribute) anAttr; + if (!obj) + return; // Create new actor + _PTR(GenericAttribute) anAttr; if (!obj->FindAttribute(anAttr, "AttributeIOR")) return; _PTR(AttributeIOR) anIOR(anAttr); @@ -155,7 +162,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str()); TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape); - if (obj) { + if (!Shape.IsNull()) { if (obj->FindAttribute(anAttr, "AttributeName")) { _PTR(AttributeName) aName (anAttr); string aNameValue = aName->Value(); @@ -216,17 +223,17 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry) { public: TEventUpdateBrowser() {} - virtual void Execute() { + virtual void Execute() { SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); if (app) { CAM_Module* module = app->module("Geometry"); SalomeApp_Module* appMod = dynamic_cast(module); if (appMod) appMod->updateObjBrowser(true); - } + } } }; - - ProcessVoidEvent(new TEventUpdateBrowser ()); + + ProcessVoidEvent(new TEventUpdateBrowser ()); } diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 39172e1a9..c0bd17527 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -325,7 +325,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShell Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells (list theShapes) { - return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolidShells"); + return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolid"); } //============================================================================= diff --git a/src/NMTAlgo/NMTAlgo_Splitter_1.cxx b/src/NMTAlgo/NMTAlgo_Splitter_1.cxx index 7d25ba4f2..d3cf01381 100644 --- a/src/NMTAlgo/NMTAlgo_Splitter_1.cxx +++ b/src/NMTAlgo/NMTAlgo_Splitter_1.cxx @@ -78,13 +78,11 @@ static void RefineSolids(const TopoDS_Shape& , TopTools_ListOfShape&); -//modified by NIZNHY-PKV Fri Feb 25 17:19:39 2005f XX static void GetPlanes (const TopoDS_Edge& anEx, const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx, const TopoDS_Face& aF1, TopAbs_State& aStPF1); -//modified by NIZNHY-PKV Fri Feb 25 17:19:44 2005t XX //======================================================================= //function : ShellsAndSolids @@ -100,9 +98,8 @@ static myAddedFacesMap.Clear(); bMakeSolids=(myLimit==TopAbs_SHAPE || myLimit