From 69de88f091ea80fca644cbba09c3e7364b25eb29 Mon Sep 17 00:00:00 2001 From: sln Date: Wed, 11 Apr 2007 12:10:18 +0000 Subject: [PATCH] Following methods are added to have possibility specify display mode for preview int SetDisplayMode( const int ); int GetDisplayMode() const; int UnsetDisplayMode(); (PAL13191: EDF160 GEOM: in Glue Faces, visualize faces existing twice) --- src/GEOMGUI/GEOM_Displayer.cxx | 36 +++++++++++++++++++++++++++++++++- src/GEOMGUI/GEOM_Displayer.h | 5 +++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index f57deb4c9..60fbb31ec 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1075,7 +1075,13 @@ void GEOM_Displayer::AfterDisplay( SALOME_View*, const SALOME_OCCViewType& ) //================================================================= void GEOM_Displayer::SetColor( const int color ) { - myColor = color; + if ( color == -1 ) + UnsetColor(); + else + { + myColor = color; + myShadingColor = Quantity_Color( (Quantity_NameOfColor)color ); + } } int GEOM_Displayer::GetColor() const @@ -1091,6 +1097,10 @@ bool GEOM_Displayer::HasColor() const void GEOM_Displayer::UnsetColor() { myColor = -1; + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) ); + myShadingColor = SalomeApp_Tools::color( col ); } //================================================================= @@ -1183,3 +1193,27 @@ bool GEOM_Displayer::canBeDisplayed( const QString& /*entry*/, const QString& vi { return viewer_type==SOCC_Viewer::Type() || viewer_type==SVTK_Viewer::Type(); } + +int GEOM_Displayer::SetDisplayMode( const int theMode ) +{ + int aPrevMode = myDisplayMode; + if ( theMode != -1 ) + myDisplayMode = theMode; + else + { + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 ); + } + return aPrevMode; +} + +int GEOM_Displayer::GetDisplayMode() const +{ + return myDisplayMode; +} + +int GEOM_Displayer::UnsetDisplayMode() +{ + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 ); +} diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index f477a37e2..786028eb1 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -128,6 +128,11 @@ public: void UnsetWidth(); double GetWidth () const; bool HasWidth () const; + + /* Set display mode shape displaying. If it is equal -1 then display mode is used. */ + int SetDisplayMode( const int ); + int GetDisplayMode() const; + int UnsetDisplayMode(); /* Sets name - for temporary objects only */ -- 2.39.2