#include <SalomeApp_Application.h>
#include <SalomeApp_SelectionMgr.h>
#include <SalomeApp_TypeFilter.h>
+#include <SalomeApp_Tools.h>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOMEDSClient.hxx>
/* Shading Color */
SUIT_Session* session = SUIT_Session::session();
SUIT_ResourceMgr* resMgr = session->resourceMgr();
- QColor col = resMgr->colorValue( "Geometry", "SettingsShadingColor", QColor( "goldenrod" ) );
-// TO DO: make some utility method to convert QColor into Quantity_Color
-// myShadingColor = SUIT_Tools::color( col );
- myShadingColor = Quantity_NOC_RED;
+ QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
+ myShadingColor = SalomeApp_Tools::color( col );
myColor = -1;
// This color is used for shape displaying. If it is equal -1 then
AISShape->SetShadingColor( myShadingColor );
if ( HasColor() )
{
+ AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
if ( myShape.ShapeType() == TopAbs_VERTEX )
{
- AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
AISShape->Attributes()->SetPointAspect( anAspect );
}
- else
- AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
}
if ( HasWidth() )
msgid "GEOM_ERR_GET_ENGINE"
msgstr "Failed to obtain GEOM Engine component. Reload Geometry module and try again."
+
+msgid "PREF_GROUP_OCCVIEWER"
+msgstr "OCC Viewer 3d"
+
+msgid "PREF_GROUP_GENERAL"
+msgstr "General"
+
+msgid "PREF_ISOS_U"
+msgstr "Number of isolines along U"
+
+msgid "PREF_ISOS_V"
+msgstr "Number of isolines along V"
+
+msgid "PREF_SHADING_COLOR"
+msgstr "Default shading color"
+
+msgid "PREF_STEP_VALUE"
+msgstr "Step value for spin boxes"
+
+msgid "PREF_TAB_SETTINGS"
+msgstr "Settings"
#include <SalomeApp_SelectionMgr.h>
#include <SalomeApp_VTKSelector.h>
#include <SalomeApp_Study.h>
+#include <SalomeApp_Preferences.h>
#include <SALOME_LifeCycleCORBA.hxx>
#include <SALOME_ListIO.hxx>
title = QString( obj->GetName().c_str() );
}
}
+
+void GeometryGUI::createPreferences()
+{
+ int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
+
+ int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
+ addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
+ SalomeApp_Preferences::Color, "Geometry", "shading_color" );
+ //addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
+ // SalomeApp_Preferences::IntSpin, "GEOM", "SettingsGeomStep" );
+
+ int occGroup = addPreference( tr( "PREF_GROUP_OCCVIEWER" ), tabId );
+ setPreferenceProperty( occGroup, "columns", 1 );
+ addPreference( tr( "PREF_ISOS_U" ), occGroup,
+ SalomeApp_Preferences::IntSpin, "Geometry", "isos_u" );
+ addPreference( tr( "PREF_ISOS_V" ), occGroup,
+ SalomeApp_Preferences::IntSpin, "Geometry", "isos_v" );
+}
+
+void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
+{
+ //printf( "\n-------------> %s , %s\n", section.latin1(), param.latin1() );
+ if ( section == QString( "Geometry" ) &&
+ ( param == QString( "isos_u" ) || param == QString( "isos_v" ) ) )
+ {
+ QPtrList<SUIT_ViewManager> lst;
+ application()->viewManagers( OCCViewer_Viewer::Type(), lst );
+ const int u = application()->resourceMgr()->integerValue( section, "isos_u" );
+ const int v = application()->resourceMgr()->integerValue( section, "isos_v" );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
+ {
+ ((OCCViewer_Viewer*)it.current())->setIsos( u, v );
+ }
+ }
+}
virtual void viewManagers( QStringList& ) const;
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
+ virtual void createPreferences();
+ virtual void preferencesChanged( const QString&, const QString& );
+
public slots:
virtual bool deactivateModule( SUIT_Study* );
GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
myButtonOk = new QPushButton( GroupButtons, "buttonOk" );
- myButtonOk->setText( tr( "BUT_OK" ) );
- myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
+ myButtonOk->setText( tr( "GEOM_BUT_OK" ) );
+ myButtonOk->setAutoDefault( TRUE );
+ myButtonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( myButtonOk );
GroupButtonsLayout->addStretch();
myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" );
- myButtonCancel->setText( tr( "BUT_CANCEL" ) );
+ myButtonCancel->setText( tr( "GEOM_BUT_CANCEL" ) );
myButtonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( myButtonCancel );
/***************************************************************/