From 2478492e4d0a7a12313ff716ee4c43b705140cca Mon Sep 17 00:00:00 2001 From: mzn Date: Tue, 5 Sep 2006 13:06:16 +0000 Subject: [PATCH] Bug PAL12904 (slow display with geompy). UpdateViewer() method implementation. --- src/GEOMGUI/GeometryGUI_Swig.cxx | 19 +++++++++++++++++++ src/GEOMGUI/GeometryGUI_Swig.hxx | 1 + src/GEOMGUI/GeometryGUI_Swig.i | 1 + 3 files changed, 21 insertions(+) diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index 4f563eb13..bd4312435 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -269,6 +269,25 @@ void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) ProcessVoidEvent(new TEventFitAll()); } +void GEOM_Swig::UpdateViewer() +{ + class TEventUpdateViewer: public SALOME_Event + { + public: + TEventUpdateViewer() {} + virtual void Execute() { + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (!app) return; + SalomeApp_Study* ActiveStudy = dynamic_cast(app->activeStudy()); + if (!ActiveStudy) return; + + GEOM_Displayer(ActiveStudy).UpdateViewer(); + } + }; + + ProcessVoidEvent(new TEventUpdateViewer()); +} + int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) { GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen(); diff --git a/src/GEOMGUI/GeometryGUI_Swig.hxx b/src/GEOMGUI/GeometryGUI_Swig.hxx index ceff728c7..45762a73f 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.hxx +++ b/src/GEOMGUI/GeometryGUI_Swig.hxx @@ -52,6 +52,7 @@ public: void createAndDisplayGO(const char* Entry, bool isUpdated = true); void eraseGO(const char* Entry, bool allWindows); void createAndDisplayFitAllGO(const char* Entry); + void UpdateViewer(); void setDisplayMode(const char* Entry, int mode, bool isUpdated = true); void setColor(const char* Entry, int red, int green, int blue, bool isUpdated = true); void setTransparency(const char* Entry, float transp, bool isUpdated = true); diff --git a/src/GEOMGUI/GeometryGUI_Swig.i b/src/GEOMGUI/GeometryGUI_Swig.i index 35c450ff7..d562c0ffc 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.i +++ b/src/GEOMGUI/GeometryGUI_Swig.i @@ -59,6 +59,7 @@ class GEOM_Swig void createAndDisplayGO(const char* Entry, bool isUpdated =true); void eraseGO(const char* Entry, bool allWindows); void createAndDisplayFitAllGO(const char* Entry); + void UpdateViewer(); int getIndexTopology(const char *SubEntry, const char *Entry); const char* getShapeTypeString(const char *Entry);