]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Bug fixes.
authorasv <asv@opencascade.com>
Wed, 22 Jun 2005 06:29:29 +0000 (06:29 +0000)
committerasv <asv@opencascade.com>
Wed, 22 Jun 2005 06:29:29 +0000 (06:29 +0000)
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_msg_en.po
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_NameDlg.cxx

index dbc26153bc6d61abdb81eac67c303a6937c479f2..b0a3ead21482a7fa1d10b49a18a1fca8962fcac1 100644 (file)
@@ -53,6 +53,7 @@
 #include <SalomeApp_Application.h>
 #include <SalomeApp_SelectionMgr.h>
 #include <SalomeApp_TypeFilter.h>
+#include <SalomeApp_Tools.h>
 
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOMEDSClient.hxx>
@@ -221,11 +222,9 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* study )
   /* 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
@@ -576,15 +575,13 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
         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() )
index 430772f209b4b7d5268810907b448b32ea602101..de7d79c71ff20a72c0b42c5a97124d9455d4e8bb 100644 (file)
@@ -2875,3 +2875,24 @@ msgstr "Name: "
 
 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"
index 0062e3f0630f24b5ad12c575f5573a736bcdea06..2c5a356e775d88aa4e6c9d922e609df794623627 100644 (file)
@@ -50,6 +50,7 @@
 #include <SalomeApp_SelectionMgr.h>
 #include <SalomeApp_VTKSelector.h>
 #include <SalomeApp_Study.h>
+#include <SalomeApp_Preferences.h>
 #include <SALOME_LifeCycleCORBA.hxx>
 #include <SALOME_ListIO.hxx>
 
@@ -1478,3 +1479,38 @@ void GeometryGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QSt
       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 );
+    }
+  }
+}
index 2303a27604daa6196736479bdbef3c7b57c38430..36d10bbdcd1c97b882b8bc476e56cd2e17b310b1 100644 (file)
@@ -107,6 +107,9 @@ public:
   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* );
index 2bcb291c66d0f7bcb815ccb895489d9b8073f213..f4ac68984368dc762016faf980a29255f839b9ba 100644 (file)
@@ -63,14 +63,15 @@ GEOMToolsGUI_NameDlg::GEOMToolsGUI_NameDlg( QWidget* parent )
   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 );
   /***************************************************************/