Salome HOME
BugID 9168, Changed the way of creation of GEOM_Engine, no it's stored in satatic... BR_3_1_0deb V3_1_0
authorsrn <srn@opencascade.com>
Tue, 20 Dec 2005 08:07:19 +0000 (08:07 +0000)
committersrn <srn@opencascade.com>
Tue, 20 Dec 2005 08:07:19 +0000 (08:07 +0000)
src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx
src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx

index 6e84554125febcf1c2d0c136cdbc3d31ad4b8785..5066277c17f26edd0cc198dd8b12c5ba41e7621f 100644 (file)
@@ -118,8 +118,11 @@ bool GEOM_SelectionFilter::getShape (const GEOM::GEOM_Object_ptr& theObject,
     if ( app )
     {
       SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( app->namingService() );
-      Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
-      GEOM::GEOM_Gen_var geomGen = GEOM::GEOM_Gen::_narrow( comp );
+      static GEOM::GEOM_Gen_var geomGen;
+      if(CORBA::is_nil( geomGen )) {
+       Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
+       geomGen = GEOM::GEOM_Gen::_narrow( comp );
+      }
       if ( !CORBA::is_nil( geomGen ) )
       {
        TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( geomGen, theObject );
index 5292daa070cc222639abcb5a0314cf605e40d9bb..f074982a9ee196ddd82719e15a5b09a50e924061 100644 (file)
@@ -45,8 +45,11 @@ static bool getShape( const GEOM::GEOM_Object_ptr& theObject, TopoDS_Shape& theS
 {
   if ( !CORBA::is_nil( theObject ) )
   {
-    Engines::Component_var comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", "GEOM" );
-    GEOM::GEOM_Gen_var myGeom   = GEOM::GEOM_Gen::_narrow( comp );
+    static GEOM::GEOM_Gen_var myGeom;
+    if(CORBA::is_nil(myGeom) {
+      Engines::Component_var comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", "GEOM" );
+      myGeom = GEOM::GEOM_Gen::_narrow( comp );
+    }
     TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( myGeom, theObject );
         
     if ( !aTopoDSShape.IsNull() )