From 79263e107d1055d375cb62d857613942682c6af2 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 15 Jun 2005 11:50:44 +0000 Subject: [PATCH] BugID IPAL9186: Added a static method InitGeomGen for initialization of myComponentGeom static variable from geompy.py Python script. --- src/GEOMGUI/GeometryGUI.cxx | 9 ++++++++- src/GEOMGUI/GeometryGUI.h | 2 ++ src/GEOMGUI/GeometryGUI_Swig.cxx | 7 +++++++ src/GEOMGUI/GeometryGUI_Swig.hxx | 2 ++ src/GEOMGUI/GeometryGUI_Swig.i | 2 ++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 8dfea14e7..667cf2eb0 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -74,6 +74,13 @@ extern "C" { GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil(); +bool GeometryGUI::InitGeomGen() +{ + GeometryGUI aGG; + if( CORBA::is_nil( myComponentGeom ) ) return false; + return true; +} + //================================================================================= // class : CustomItem // purpose : Set Font to a text. @@ -122,7 +129,7 @@ GeometryGUI::GeometryGUI() : Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" ); myComponentGeom = GEOM::GEOM_Gen::_narrow( comp ); } - + myState = -1; myActiveDialogBox = 0; myFatherior = ""; diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index a8e20117f..2303a2760 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -65,6 +65,8 @@ public: virtual void initialize( CAM_Application* ); virtual QString engineIOR() const; + static bool InitGeomGen(); //BugID IPAL9186: SRN: To be called by Python scripts + static GEOM::GEOM_Gen_var GetGeomGen() { return myComponentGeom; } GEOM_Client& GetShapeReader() { return myShapeReader; } diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index e639b789e..fb2b0e1e0 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -261,6 +261,7 @@ int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) Exp.Next(); } } + return -1; } @@ -480,3 +481,9 @@ void GEOM_Swig::setTransparency(const char* theEntry, float transp) ProcessVoidEvent(new TEvent(app,anIO,transp)); } + + +bool GEOM_Swig::initGeomGen() +{ + return GeometryGUI::InitGeomGen(); +} diff --git a/src/GEOMGUI/GeometryGUI_Swig.hxx b/src/GEOMGUI/GeometryGUI_Swig.hxx index 862abbc23..baaf41eae 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.hxx +++ b/src/GEOMGUI/GeometryGUI_Swig.hxx @@ -51,6 +51,8 @@ public: int getIndexTopology(const char *SubEntry, const char *Entry); const char* getShapeTypeString(const char *Entry); const char* getShapeTypeIcon(const char *Ior); + + bool initGeomGen(); }; diff --git a/src/GEOMGUI/GeometryGUI_Swig.i b/src/GEOMGUI/GeometryGUI_Swig.i index 187133111..d8be6b738 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.i +++ b/src/GEOMGUI/GeometryGUI_Swig.i @@ -44,4 +44,6 @@ class GEOM_Swig void setColor(const char* Entry, int red, int green, int blue); void setTransparency(const char* Entry, float transp); const char* getShapeTypeIcon(const char *Ior); + + bool initGeomGen(); }; -- 2.39.2