Improvement(Add a new preference to GEOM ? default ?Shading/Wireframe? visualization mode).

This commit is contained in:
mzn 2005-07-06 12:42:51 +00:00
parent 7a7535dd1e
commit 144524d7be
4 changed files with 26 additions and 1 deletions

View File

@ -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();

View File

@ -177,6 +177,7 @@ protected:
int myColor;
double myWidth;
bool myToActivate;
int myDisplayMode;
private:
SalomeApp_Study* myStudy;

View File

@ -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"

View File

@ -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<QVariant> anIndexesList;
anIndexesList.append(0);
anIndexesList.append(1);
setPreferenceProperty( dispmode, "strings", aModesList );
setPreferenceProperty( dispmode, "indexes", anIndexesList );
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )