Bug fixes.

This commit is contained in:
asv 2005-06-22 06:29:29 +00:00
parent bc805bc164
commit a3dbf9db14
5 changed files with 68 additions and 10 deletions

View 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() )

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

View 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 );
}
}
}

View 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* );

View 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 );
/***************************************************************/