From: mzn Date: Wed, 6 Jul 2005 12:42:51 +0000 (+0000) Subject: Improvement(Add a new preference to GEOM ? default ?Shading/Wireframe? visualization... X-Git-Tag: V3_0_1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=144524d7be0c8389b25a57b7fcf831f0724e9e22;p=modules%2Fgeom.git Improvement(Add a new preference to GEOM ? default ?Shading/Wireframe? visualization mode). --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index b0a3ead21..451dd9165 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -226,6 +226,8 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* study ) QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) ); myShadingColor = SalomeApp_Tools::color( col ); + myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0); + myColor = -1; // This color is used for shape displaying. If it is equal -1 then // default color is used. @@ -572,7 +574,9 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX ); // Setup shape properties here ..., e.g. display mode, color, transparency, etc + AISShape->SetDisplayMode( myDisplayMode ); AISShape->SetShadingColor( myShadingColor ); + if ( HasColor() ) { AISShape->SetColor( (Quantity_NameOfColor)GetColor() ); @@ -691,7 +695,7 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) vtkActor* anActor = (vtkActor*)theActors->GetNextActor(); vtkProperty* aProp = 0; - + if ( HasColor() || HasWidth() ) { aProp = vtkProperty::New(); diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 40f4a7d23..13a1c65fe 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -177,6 +177,7 @@ protected: int myColor; double myWidth; bool myToActivate; + int myDisplayMode; private: SalomeApp_Study* myStudy; diff --git a/src/GEOMGUI/GEOM_msg_en.po b/src/GEOMGUI/GEOM_msg_en.po index c904053eb..15268a4ef 100644 --- a/src/GEOMGUI/GEOM_msg_en.po +++ b/src/GEOMGUI/GEOM_msg_en.po @@ -2741,6 +2741,9 @@ msgstr "Shading" msgid "MEN_SHADING" msgstr "Shading" +msgid "MEN_WIREFRAME" +msgstr "Wireframe" + msgid "STB_SHADING" msgstr "Shading" @@ -2888,5 +2891,8 @@ msgstr "Default shading color" msgid "PREF_STEP_VALUE" msgstr "Step value for spin boxes" +msgid "PREF_DISPLAY_MODE" +msgstr "Default display mode" + msgid "PREF_TAB_SETTINGS" msgstr "Settings" diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 62293bb7d..c7f9dc355 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -1488,12 +1488,26 @@ void GeometryGUI::createPreferences() SalomeApp_Preferences::Color, "Geometry", "shading_color" ); int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup, SalomeApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" ); + int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup, + SalomeApp_Preferences::Selector, "Geometry", "display_mode" ); setPreferenceProperty( genGroup, "columns", 1 ); setPreferenceProperty( step, "min", 0.001 ); setPreferenceProperty( step, "max", 10000 ); setPreferenceProperty( step, "precision", 3 ); + + // Set property for default display mode + QStringList aModesList; + aModesList.append( tr("MEN_WIREFRAME") ); + aModesList.append( tr("MEN_SHADING") ); + + QValueList anIndexesList; + anIndexesList.append(0); + anIndexesList.append(1); + + setPreferenceProperty( dispmode, "strings", aModesList ); + setPreferenceProperty( dispmode, "indexes", anIndexesList ); } void GeometryGUI::preferencesChanged( const QString& section, const QString& param )