mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-09 09:07:27 +05:00
Bug fixes.
This commit is contained in:
parent
bc805bc164
commit
a3dbf9db14
@ -53,6 +53,7 @@
|
|||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_SelectionMgr.h>
|
#include <SalomeApp_SelectionMgr.h>
|
||||||
#include <SalomeApp_TypeFilter.h>
|
#include <SalomeApp_TypeFilter.h>
|
||||||
|
#include <SalomeApp_Tools.h>
|
||||||
|
|
||||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||||
#include <SALOMEDSClient.hxx>
|
#include <SALOMEDSClient.hxx>
|
||||||
@ -221,11 +222,9 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* study )
|
|||||||
/* Shading Color */
|
/* Shading Color */
|
||||||
SUIT_Session* session = SUIT_Session::session();
|
SUIT_Session* session = SUIT_Session::session();
|
||||||
SUIT_ResourceMgr* resMgr = session->resourceMgr();
|
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
|
QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
|
||||||
// myShadingColor = SUIT_Tools::color( col );
|
myShadingColor = SalomeApp_Tools::color( col );
|
||||||
myShadingColor = Quantity_NOC_RED;
|
|
||||||
|
|
||||||
myColor = -1;
|
myColor = -1;
|
||||||
// This color is used for shape displaying. If it is equal -1 then
|
// 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 );
|
AISShape->SetShadingColor( myShadingColor );
|
||||||
if ( HasColor() )
|
if ( HasColor() )
|
||||||
{
|
{
|
||||||
|
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
|
||||||
if ( myShape.ShapeType() == TopAbs_VERTEX )
|
if ( myShape.ShapeType() == TopAbs_VERTEX )
|
||||||
{
|
{
|
||||||
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
|
|
||||||
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
|
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
|
||||||
anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
|
anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
|
||||||
AISShape->Attributes()->SetPointAspect( anAspect );
|
AISShape->Attributes()->SetPointAspect( anAspect );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( HasWidth() )
|
if ( HasWidth() )
|
||||||
|
@ -2875,3 +2875,24 @@ msgstr "Name: "
|
|||||||
|
|
||||||
msgid "GEOM_ERR_GET_ENGINE"
|
msgid "GEOM_ERR_GET_ENGINE"
|
||||||
msgstr "Failed to obtain GEOM Engine component. Reload Geometry module and try again."
|
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"
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include <SalomeApp_SelectionMgr.h>
|
#include <SalomeApp_SelectionMgr.h>
|
||||||
#include <SalomeApp_VTKSelector.h>
|
#include <SalomeApp_VTKSelector.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
|
#include <SalomeApp_Preferences.h>
|
||||||
#include <SALOME_LifeCycleCORBA.hxx>
|
#include <SALOME_LifeCycleCORBA.hxx>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
@ -1478,3 +1479,38 @@ void GeometryGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QSt
|
|||||||
title = QString( obj->GetName().c_str() );
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -107,6 +107,9 @@ public:
|
|||||||
virtual void viewManagers( QStringList& ) const;
|
virtual void viewManagers( QStringList& ) const;
|
||||||
|
|
||||||
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
||||||
|
virtual void createPreferences();
|
||||||
|
virtual void preferencesChanged( const QString&, const QString& );
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual bool deactivateModule( SUIT_Study* );
|
virtual bool deactivateModule( SUIT_Study* );
|
||||||
|
@ -63,14 +63,15 @@ GEOMToolsGUI_NameDlg::GEOMToolsGUI_NameDlg( QWidget* parent )
|
|||||||
GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
|
GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 );
|
||||||
|
|
||||||
myButtonOk = new QPushButton( GroupButtons, "buttonOk" );
|
myButtonOk = new QPushButton( GroupButtons, "buttonOk" );
|
||||||
myButtonOk->setText( tr( "BUT_OK" ) );
|
myButtonOk->setText( tr( "GEOM_BUT_OK" ) );
|
||||||
myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
|
myButtonOk->setAutoDefault( TRUE );
|
||||||
|
myButtonOk->setDefault( TRUE );
|
||||||
GroupButtonsLayout->addWidget( myButtonOk );
|
GroupButtonsLayout->addWidget( myButtonOk );
|
||||||
|
|
||||||
GroupButtonsLayout->addStretch();
|
GroupButtonsLayout->addStretch();
|
||||||
|
|
||||||
myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" );
|
myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" );
|
||||||
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
|
myButtonCancel->setText( tr( "GEOM_BUT_CANCEL" ) );
|
||||||
myButtonCancel->setAutoDefault( TRUE );
|
myButtonCancel->setAutoDefault( TRUE );
|
||||||
GroupButtonsLayout->addWidget( myButtonCancel );
|
GroupButtonsLayout->addWidget( myButtonCancel );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user