*** empty log message ***

This commit is contained in:
asl 2005-06-08 10:45:19 +00:00
parent 70c382acbd
commit a2f0f70d59
51 changed files with 1057 additions and 1003 deletions

View File

@ -33,7 +33,9 @@
#include "SMESH_ControlsDef.hxx"
#include <VTKViewer_ExtractUnstructuredGrid.h>
//#include "QAD_Config.h"
#include "SUIT_Session.h"
#include "SUIT_ResourceMgr.h"
#include <qstringlist.h>
#include <vtkTimeStamp.h>
@ -288,38 +290,38 @@ SMESH_ActorDef::SMESH_ActorDef()
vtkTextProperty* aScalarBarTitleProp = vtkTextProperty::New();
/* if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarTitleColor" ) ) {
QStringList aTColor = QStringList::split( ":", QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleColor" ), false );
aScalarBarTitleProp->SetColor( ( aTColor.count() > 0 ? aTColor[0].toInt()/255. : 1.0 ),
( aTColor.count() > 1 ? aTColor[1].toInt()/255. : 1.0 ),
( aTColor.count() > 2 ? aTColor[2].toInt()/255. : 1.0 ) );
}
else*/
aScalarBarTitleProp->SetColor( 1.0, 1.0, 1.0 );
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( !mgr )
return;
QColor aTColor = mgr->colorValue( "ScalarBarTitleColor", "SMESH", QColor( 255, 255, 255 ) );
aScalarBarTitleProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
aScalarBarTitleProp->SetFontFamilyToArial();
/*if( QAD_CONFIG->hasSetting( "SMESH:ScalarBarTitleFont" ) ){
if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Arial" )
if( mgr->hasValue( "ScalarBarTitleFont", "SMESH" ) ){
QString str = mgr->stringValue( "ScalarBarTitleFont", "SMESH" );
if ( str == "Arial" )
aScalarBarTitleProp->SetFontFamilyToArial();
else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Courier" )
else if ( str == "Courier" )
aScalarBarTitleProp->SetFontFamilyToCourier();
else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Times" )
else if ( str == "Times" )
aScalarBarTitleProp->SetFontFamilyToTimes();
}*/
}
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleBold" ) == "true" )
if ( mgr->stringValue( "ScalarBarTitleBold", "SMESH" ) == "true" )
aScalarBarTitleProp->BoldOn();
else*/
else
aScalarBarTitleProp->BoldOff();
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleItalic" ) == "true" )
if ( mgr->stringValue( "ScalarBarTitleItalic", "SMESH" ) == "true" )
aScalarBarTitleProp->ItalicOn();
else*/
else
aScalarBarTitleProp->ItalicOff();
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleShadow" ) == "true" )
if ( mgr->stringValue( "ScalarBarTitleShadow", "SMESH" ) == "true" )
aScalarBarTitleProp->ShadowOn();
else*/
else
aScalarBarTitleProp->ShadowOff();
myScalarBarActor->SetTitleTextProperty( aScalarBarTitleProp );
@ -327,74 +329,70 @@ SMESH_ActorDef::SMESH_ActorDef()
vtkTextProperty* aScalarBarLabelProp = vtkTextProperty::New();
/*if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarLabelColor" ) ) {
QStringList aTColor = QStringList::split( ":", QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelColor" ), false );
aScalarBarLabelProp->SetColor( ( aTColor.count() > 0 ? aTColor[0].toInt()/255. : 1.0 ),
( aTColor.count() > 1 ? aTColor[1].toInt()/255. : 1.0 ),
( aTColor.count() > 2 ? aTColor[2].toInt()/255. : 1.0 ) );
}
else*/
aScalarBarLabelProp->SetColor( 1.0, 1.0, 1.0 );
aTColor = mgr->colorValue( "ScalarBarLabelColor", "SMESH", QColor( 255, 255, 255 ) );
aScalarBarLabelProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
aScalarBarLabelProp->SetFontFamilyToArial();
/*if( QAD_CONFIG->hasSetting( "SMESH:ScalarBarLabelFont" ) ){
if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Arial" )
if( mgr->hasValue( "ScalarBarLabelFont", "SMESH" ) )
{
QString str = mgr->stringValue( "ScalarBarLabelFont", "SMESH" );
if( str == "Arial" )
aScalarBarLabelProp->SetFontFamilyToArial();
else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Courier" )
else if( str == "Courier" )
aScalarBarLabelProp->SetFontFamilyToCourier();
else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Times" )
else if( str == "Times" )
aScalarBarLabelProp->SetFontFamilyToTimes();
}*/
}
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelBold" ) == "true" )
if( mgr->stringValue( "ScalarBarLabelBold", "SMESH" ) == "true" )
aScalarBarLabelProp->BoldOn();
else*/
else
aScalarBarLabelProp->BoldOff();
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelItalic" ) == "true" )
if ( mgr->stringValue( "ScalarBarLabelItalic", "SMESH" ) == "true" )
aScalarBarLabelProp->ItalicOn();
else*/
else
aScalarBarLabelProp->ItalicOff();
/*if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelShadow" ) == "true" )
if( mgr->stringValue( "ScalarBarLabelShadow", "SMESH" ) == "true" )
aScalarBarLabelProp->ShadowOn();
else*/
else
aScalarBarLabelProp->ShadowOff();
myScalarBarActor->SetLabelTextProperty( aScalarBarLabelProp );
aScalarBarLabelProp->Delete();
/*if ( QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" )
if( mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" )
myScalarBarActor->SetOrientationToHorizontal();
else*/
else
myScalarBarActor->SetOrientationToVertical();
float aXVal = 0.01; //QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.20 : 0.01;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarXPosition" ) )
// aXVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarXPosition" ).toFloat();
float aYVal = 0.1; //QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.01 : 0.1;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarYPosition" ) )
// aYVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarYPosition" ).toFloat();
float aXVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.20 : 0.01;
if( mgr->hasValue( "ScalarBarXPosition", "SMESH" ) )
aXVal = mgr->doubleValue( "ScalarBarXPosition", "SMESH", aXVal );
float aYVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.01 : 0.1;
if( mgr->hasValue( "ScalarBarYPosition", "SMESH" ) )
aYVal = mgr->doubleValue( "ScalarBarYPosition", "SMESH", aYVal );
myScalarBarActor->SetPosition( aXVal, aYVal );
float aWVal = 0.1; //QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.60 : 0.10;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarWidth" ) )
// aWVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarWidth" ).toFloat();
float aWVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.60 : 0.10;
if( mgr->hasValue( "ScalarBarWidth", "SMESH" ) )
aWVal = mgr->doubleValue( "ScalarBarWidth", "SMESH", aWVal );
myScalarBarActor->SetWidth( aWVal );
float aHVal = 0.8; //QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.12 : 0.80;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarHeight" ) )
// aHVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarHeight" ).toFloat();
float aHVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.12 : 0.80;
if( mgr->hasValue( "ScalarBarHeight", "SMESH" ) )
aHVal = mgr->doubleValue( "ScalarBarHeight", "SMESH", aHVal );
myScalarBarActor->SetHeight( aHVal );
int anIntVal = 5;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarNbOfLabels" ) )
// anIntVal = QAD_CONFIG->getSetting("SMESH:ScalarBarNbOfLabels").toInt();
if( mgr->hasValue( "ScalarBarNbOfLabels", "SMESH" ) )
anIntVal = mgr->integerValue( "ScalarBarNbOfLabels", "SMESH", anIntVal );
myScalarBarActor->SetNumberOfLabels( anIntVal == 0 ? 5: anIntVal );
anIntVal = 64;
//if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarNbOfColors" ) )
// anIntVal = QAD_CONFIG->getSetting("SMESH:ScalarBarNbOfColors").toInt();
if( mgr->hasValue( "ScalarBarNbOfColors", "SMESH" ) )
anIntVal = mgr->integerValue( "ScalarBarNbOfColors", "SMESH", anIntVal );
myScalarBarActor->SetMaximumNumberOfColors( anIntVal == 0 ? 64 : anIntVal );
@ -622,8 +620,12 @@ SMESH_ActorDef::
SetControlMode(eControl theMode,
bool theCheckEntityMode)
{
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( !mgr )
return;
myControlMode = eNone;
//theCheckEntityMode &= QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true";
theCheckEntityMode &= mgr->stringValue( "DispayEntity", "SMESH" ) == "true";
my1DActor->GetMapper()->SetScalarVisibility(false);
my2DActor->GetMapper()->SetScalarVisibility(false);
@ -851,9 +853,13 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
//SetIsShrunkable(theGrid->GetNumberOfCells() > 10);
SetIsShrunkable(true);
//QString aMode = QAD_CONFIG->getSetting("SMESH:DisplayMode");
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( !mgr )
return false;
QString aMode = mgr->stringValue( "DisplayMode", "SMESH" );
SetRepresentation(-1);
/*
if(aMode.compare("Wireframe") == 0){
SetRepresentation(eEdge);
}else if(aMode.compare("Shading") == 0){
@ -861,11 +867,11 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
}else if(aMode.compare("Nodes") == 0){
SetRepresentation(ePoint);
}
*/
/*aMode = QAD_CONFIG->getSetting("SMESH:Shrink");
aMode = mgr->stringValue( "Shrink", "SMESH" );
if(aMode == "yes"){
SetShrink();
}*/
}
myTimeStamp->Modified();
Modified();

View File

@ -20,7 +20,9 @@
#include "SMESH_ActorUtils.h"
//#include "QAD_Config.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "utilities.h"
#include <vtkUnstructuredGrid.h>
@ -34,12 +36,28 @@ static int MYDEBUG = 0;
namespace SMESH{
float GetFloat(const QString& theValue, float theDefault){
if(theValue.isEmpty()) return theDefault;
//QString aValue = QAD_CONFIG->getSetting(theValue);
//if(aValue.isEmpty())
return theDefault;
//return aValue.toFloat();
float GetFloat( const QString& theValue, float theDefault )
{
int pos = theValue.find( ":" );
float val = theDefault;
if( pos>=0 )
{
QString val = theValue.right( theValue.length()-pos-1 ),
sect = theValue.left( pos );
if( !val.isEmpty() && !sect.isEmpty() )
val = GetFloat( val, sect, theDefault );
}
return val;
}
float GetFloat( const QString& theValue, const QString& theSection, float theDefault )
{
float val = theDefault;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( mgr )
val = (float) mgr->doubleValue( theValue, theSection, theDefault );
return val;
}
void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName){

View File

@ -27,6 +27,7 @@ class vtkUnstructuredGrid;
namespace SMESH{
float GetFloat( const QString& theValue, float theDefault = 0 );
float GetFloat( const QString& theName, const QString& theSection, float theDefault = 0 );
void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName);

View File

@ -395,7 +395,7 @@ namespace{
}
case 1133:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
new SMESHGUI_TransparencyDlg( SMESHGUI::desktop(), "", false );
new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI(), "", false );
return;
}}
SALOME_ListIteratorOfListIO It( selected );
@ -455,7 +455,7 @@ namespace{
float Shrink = anActor->GetShrinkFactor();
SMESHGUI_Preferences_ColorDlg *aDlg =
new SMESHGUI_Preferences_ColorDlg(SMESHGUI::desktop(),"");
new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
aDlg->SetColor(1, c);
aDlg->SetColor(2, e);
aDlg->SetColor(3, n);
@ -511,7 +511,7 @@ namespace{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
SMESHGUI_Preferences_ColorDlg *aDlg =
new SMESHGUI_Preferences_ColorDlg(SMESHGUI::desktop(), "");
new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
QColor color = mgr->colorValue( "SMESH", "SettingsFillColor", QColor(0, 170, 255) );
aDlg->SetColor(1, color);
@ -793,8 +793,7 @@ namespace{
aStudyBuilder->CommitCommand();
/* Clear any previous selection */
SALOME_ListIO selected1;
aSel->setSelectedObjects( selected1 );
aSel->setSelectedObjects( SALOME_ListIO() );
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
}
@ -1149,12 +1148,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
case 201:
{
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected;
if( aSel )
aSel->selectedObjects( selected );
SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties( desktop(), aSel );
SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties( this );
break;
}
@ -1210,8 +1204,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
}
}
SALOME_ListIO selected1;
aSel->setSelectedObjects( selected1 );
aSel->setSelectedObjects( SALOME_ListIO() );
break;
}
@ -1674,7 +1667,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
else if ( theCommandID == 811 ) aMode = SMESHGUI_GroupOpDlg::INTERSECT;
else aMode = SMESHGUI_GroupOpDlg::CUT;
( new SMESHGUI_GroupOpDlg( desktop(), SMESHGUI::selectionMgr(), aMode ) )->show();
( new SMESHGUI_GroupOpDlg( this, aMode ) )->show();
break;
}
@ -1728,13 +1721,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
IOs.Clear();
IOs.Append( It.Value() );
aSel->setSelectedObjects( IOs );
new SMESHGUI_StandardMeshInfosDlg(desktop(), "", false);
new SMESHGUI_StandardMeshInfosDlg( this, "", false);
}
// restore selection
aSel->setSelectedObjects( selected );
}
else
new SMESHGUI_StandardMeshInfosDlg(desktop(), "", false);
new SMESHGUI_StandardMeshInfosDlg( this, "", false);
break;
}
@ -1759,13 +1752,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case 1005:
{
SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences( desktop() );
SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences( this );
break;
}
case 10070:
{
( new SMESHGUI_PrecisionDlg( desktop() ) )->exec();
( new SMESHGUI_PrecisionDlg( this ) )->exec();
break;
}
@ -1782,7 +1775,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case 1006:
{
SMESHGUI_Preferences_SelectionDlg* aDlg =
new SMESHGUI_Preferences_SelectionDlg(desktop());
new SMESHGUI_Preferences_SelectionDlg( this );
QColor aColor = mgr->colorValue( "SMESH", "SettingsPreSelectColor", Qt::cyan );
aDlg->SetColor(1, aColor);
@ -1944,8 +1937,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
Handle(SALOME_InteractiveObject) IObject = It.Value();
SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
}
SALOME_ListIO selected1;
aSel->setSelectedObjects( selected1 );
aSel->setSelectedObjects( SALOME_ListIO() );
updateObjBrowser();
break;
}
@ -2034,7 +2026,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
new SMESHGUI_RenumberingDlg(desktop(), "", selectionMgr(), 0);
new SMESHGUI_RenumberingDlg( this, "", 0);
}
else
{
@ -2049,7 +2041,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
new SMESHGUI_RenumberingDlg(desktop(), "", selectionMgr(), 1);
new SMESHGUI_RenumberingDlg( this, "", 1);
}
else
{

View File

@ -268,8 +268,8 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(elemName));
QString grBoxTitle = tr(QString("SMESH_ADD_%1").arg(elemName));
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", iconName));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_AddMeshElementDlg");

View File

@ -94,7 +94,7 @@ SMESHGUI_AddSubMeshDlg::SMESHGUI_AddSubMeshDlg( SMESHGUI* theModule, const char*
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_AddSubMeshDlg");
setCaption(tr("SMESH_ADD_SUBMESH"));

View File

@ -287,7 +287,7 @@ void SMESHGUI_CreateHypothesesDlg::InitAlgoDefinition()
parentItem = new QListViewItem(ListAlgoDefinition, aHypData->PluginName);
parentItem->setOpen(true);
QListViewItem* aItem = new QListViewItem(parentItem, aHypData->Label, HypList[i]);
QPixmap aPixMap (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr(aHypData->IconId)));
QPixmap aPixMap (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr(aHypData->IconId)));
if (!aPixMap.isNull())
aItem->setPixmap(0, aPixMap);
}

View File

@ -113,10 +113,10 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
//=======================================================================
QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent)
{
QPixmap iconSlct (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap icon2d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
QPixmap icon3d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
QPixmap iconSample2d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent);
aMainGrp->setFrameStyle(QFrame::NoFrame);

View File

@ -52,7 +52,7 @@ class SMESHGUI_DeleteGroupDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule);
SMESHGUI_DeleteGroupDlg( SMESHGUI* );
virtual ~SMESHGUI_DeleteGroupDlg();
void Init ();

View File

@ -115,7 +115,7 @@ SMESHGUI_EditHypothesesDlg::SMESHGUI_EditHypothesesDlg (SMESHGUI* theModule, con
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_EditHypothesesDlg");
setCaption(tr("SMESH_EDIT_HYPOTHESES"));

View File

@ -101,11 +101,12 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap edgeImage (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap faceImage (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap selectImage (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap addImage (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_APPEND")));
QPixmap removeImage (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_REMOVE")));
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap faceImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap selectImage ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap addImage ( mgr->loadPixmap("SMESH", tr("ICON_APPEND")));
QPixmap removeImage ( mgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
myType = -1;

View File

@ -92,9 +92,9 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
resize(303, 185);
setCaption(tr("EXTRUSION_ALONG_LINE"));

View File

@ -2190,7 +2190,7 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType)
aCriteria->length(n);
long aPrecision = -1;
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) {
QString aStr = mgr->stringValue("SMESH", "ControlsPrecision");

View File

@ -149,7 +149,7 @@ void SMESHGUI_GroupDlg::initDialog(bool create)
myCreate = create;
myCurrentLineEdit = 0;
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (create)
setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
@ -744,7 +744,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
myElements->clear();
if (aNbSel == 0 ) {
if (aNbSel != 1 ) {
myGroup = SMESH::SMESH_Group::_nil();
myMesh = SMESH::SMESH_Mesh::_nil();
myIsBusy = false;
@ -805,7 +805,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
return;
} else if (myCurrentLineEdit == myGeomGroupLine) {
if (aNbSel == 0) {
if (aNbSel != 1) {
myGeomGroup = GEOM::GEOM_Object::_nil();
myIsBusy = false;
return;

View File

@ -29,6 +29,7 @@
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESH_TypeFilter.hxx"
@ -37,6 +38,8 @@
#include "SalomeApp_SelectionMgr.h"
#include "SVTK_Selection.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_Selector.h"
#include "SALOME_ListIO.hxx"
// QT Includes
@ -61,11 +64,13 @@
// name : SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg
// Purpose : Constructor
//=======================================================================
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg (QWidget* theParent,
SalomeApp_SelectionMgr* theSelection,
const int theMode)
: QDialog(theParent, "SMESHGUI_GroupOpDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode )
: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
myMode = theMode;
@ -83,7 +88,7 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg (QWidget* theParent,
aDlgLay->setStretchFactor(aMainFrame, 1);
Init(theSelection);
Init();
}
//=======================================================================
@ -115,7 +120,7 @@ QFrame* SMESHGUI_GroupOpDlg::createMainFrame (QWidget* theParent)
myEdit1->setReadOnly(true);
myEdit2->setReadOnly(true);
QPixmap aPix (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
myBtn1->setPixmap(aPix);
myBtn2->setPixmap(aPix);
@ -164,11 +169,9 @@ SMESHGUI_GroupOpDlg::~SMESHGUI_GroupOpDlg()
// name : SMESHGUI_GroupOpDlg::Init
// Purpose : Init dialog fields, connect signals and slots, show dialog
//=======================================================================
void SMESHGUI_GroupOpDlg::Init (SalomeApp_SelectionMgr* theSelection)
void SMESHGUI_GroupOpDlg::Init()
{
mySelectionMgr = theSelection;
SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
aSMESHGUI->SetActiveDialogBox((QDialog*)this);
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myFocusWg = myEdit1;
myGroup1 = SMESH::SMESH_GroupBase::_nil();
@ -176,23 +179,19 @@ void SMESHGUI_GroupOpDlg::Init (SalomeApp_SelectionMgr* theSelection)
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(aSMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(aSMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose()));
connect(myBtn1, SIGNAL(clicked()), this, SLOT(onFocusChanged()));
connect(myBtn2, SIGNAL(clicked()), this, SLOT(onFocusChanged()));
int x, y;
aSMESHGUI->DefineDlgPosition(this, x, y);
mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
// set selection mode
#ifdef NEW_GUI
mySelectionMgr->setSelectionModes(ActorSelection, true);
#else
mySelectionMgr->setSelectionModes(ActorSelection);
#endif
myViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
return;
@ -247,7 +246,7 @@ bool SMESHGUI_GroupOpDlg::isValid()
//=======================================================================
bool SMESHGUI_GroupOpDlg::onApply()
{
if (!isValid() || SMESHGUI::GetSMESHGUI()->isActiveStudyLocked())
if (!isValid() || mySMESHGUI->isActiveStudyLocked())
return false;
SMESH::SMESH_Mesh_ptr aMesh = myGroup1->GetMesh();
@ -259,7 +258,7 @@ bool SMESHGUI_GroupOpDlg::onApply()
else aNewGrp = aMesh->CutGroups(myGroup1, myGroup2, aName.latin1());
if (!aNewGrp->_is_nil()) {
SMESHGUI::GetSMESHGUI()->updateObjBrowser(true);
mySMESHGUI->updateObjBrowser(true);
reset();
return true;
} else {
@ -285,10 +284,10 @@ void SMESHGUI_GroupOpDlg::onOk()
//=======================================================================
void SMESHGUI_GroupOpDlg::onClose()
{
mySelectionMgr->setSelectionModes(ActorSelection);
myViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
SMESHGUI::GetSMESHGUI()->ResetState();
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
mySelectionMgr->clearFilters();
reject();
}
@ -342,13 +341,9 @@ void SMESHGUI_GroupOpDlg::onDeactivate()
//=======================================================================
void SMESHGUI_GroupOpDlg::enterEvent (QEvent*)
{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
#ifdef NEW_GUI
mySelectionMgr->setSelectionModes(ActorSelection, true);
#else
mySelectionMgr->setSelectionModes(ActorSelection);
#endif
myViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
}

View File

@ -38,6 +38,9 @@ class QFrame;
class QPushButton;
class SalomeApp_SelectionMgr;
class QLineEdit;
class SMESHGUI;
class SVTK_ViewWindow;
class SVTK_Selector;
/*
Class : SMESHGUI_GroupOpDlg
@ -52,10 +55,10 @@ public:
enum { UNION, INTERSECT, CUT };
public:
SMESHGUI_GroupOpDlg( QWidget*, SalomeApp_SelectionMgr*, const int );
SMESHGUI_GroupOpDlg( SMESHGUI*, const int );
virtual ~SMESHGUI_GroupOpDlg();
void Init( SalomeApp_SelectionMgr* ) ;
void Init();
private:
@ -91,8 +94,11 @@ private:
QPushButton* myBtn1;
QPushButton* myBtn2;
SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr;
int myMode;
SVTK_ViewWindow* myViewWindow;
SVTK_Selector* mySelector;
QLineEdit* myFocusWg;

View File

@ -99,7 +99,7 @@ SMESHGUI_InitMeshDlg::SMESHGUI_InitMeshDlg (SMESHGUI* theModule, const char* nam
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_InitMeshDlg");

View File

@ -83,8 +83,8 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_MergeNodesDlg");
@ -247,7 +247,6 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
myActor = 0;
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);

View File

@ -86,7 +86,7 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule,
aTopLayout->setSpacing(6); aTopLayout->setMargin(11);
// select button & label
QPixmap image0(SMESHGUI::resourceMgr()->loadPixmap("SMESH",tr("ICON_SELECT")));
QPixmap image0(SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH",tr("ICON_SELECT")));
mySelectBtn = new QPushButton(this, "mySelectBtn");
mySelectBtn->setPixmap(image0);
mySelectBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));

View File

@ -136,13 +136,14 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
//=======================================================================
QFrame* SMESHGUI_MeshPatternDlg::createMainFrame (QWidget* theParent)
{
QPixmap iconSlct (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap icon2d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
QPixmap icon3d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
QPixmap iconOpen (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_FILE_OPEN")));
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap icon2d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
QPixmap icon3d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
QPixmap iconOpen ( mgr->loadPixmap("SMESH", tr("ICON_FILE_OPEN")));
QPixmap iconSample2d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
QPixmap iconSample3d (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_3D")));
QPixmap iconSample2d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
QPixmap iconSample3d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_3D")));
QGroupBox* aMainGrp = new QGroupBox (1, Qt::Horizontal, theParent);
aMainGrp->setFrameStyle(QFrame::NoFrame);
@ -413,7 +414,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
bool toCreatePolyedrs = myCreatePolyedrsChk->isChecked();
if ( myPattern->MakeMesh( myMesh, toCreatePolygons, toCreatePolyedrs ) ) {
mySelectionMgr->clearSelected();
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
bool autoUpdate = false;
if (mgr && mgr->stringValue("SMESH", "AutomaticUpdate").compare("true") == 0)
autoUpdate = true;

View File

@ -153,8 +153,8 @@ QFrame* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
{
QFrame* aFrame = new QFrame(theParent);
QPixmap iconMoveNode (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
QPixmap iconSelect (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap iconMoveNode (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
QPixmap iconSelect (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_NODE"), aFrame);
aPixGrp->setExclusive(TRUE);

View File

@ -141,7 +141,7 @@ QFrame* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool t
aMainGrp->setFrameStyle(QFrame::NoFrame);
aMainGrp->setInsideMargin(0);
QPixmap aPix (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
// "Selected cells" group
mySelGrp = new QGroupBox(1, Qt::Horizontal, aMainGrp);

View File

@ -237,7 +237,7 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
{
mySimulation = new SMESH::TNodeSimulation(myViewWindow);
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
if (!name)
setName("SMESHGUI_NodesDlg");
resize(303, 185);

View File

@ -29,7 +29,9 @@
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_Utils.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include <qgroupbox.h>
@ -53,9 +55,10 @@
// name : SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg
// Purpose : Constructor
//=======================================================================
SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg (QWidget* theParent)
: QDialog(theParent, "SMESHGUI_PrecisionDlg", true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg ( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_PrecisionDlg", true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule )
{
setCaption(tr("CAPTION"));
@ -129,7 +132,7 @@ void SMESHGUI_PrecisionDlg::Init()
{
bool isOk = false;
int aVal = DEFAULT_VAL;
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) {
QString aStr = mgr->stringValue("SMESH", "ControlsPrecision");
aVal = aStr.toInt(&isOk);
@ -140,9 +143,8 @@ void SMESHGUI_PrecisionDlg::Init()
onNotUse();
SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
aSMESHGUI->SetActiveDialogBox((QDialog*)this);
connect(aSMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
}
//=======================================================================
@ -151,7 +153,7 @@ void SMESHGUI_PrecisionDlg::Init()
//=======================================================================
void SMESHGUI_PrecisionDlg::onOk()
{
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (myNotUseChk->isChecked()) {
if (mgr) {
mgr->remove("SMESH", "ControlsPrecision");
@ -166,8 +168,8 @@ void SMESHGUI_PrecisionDlg::onOk()
SMESH::SetControlsPrecision(aVal);
}
disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
SMESHGUI::GetSMESHGUI()->ResetState() ;
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState() ;
accept();
}
@ -177,7 +179,7 @@ void SMESHGUI_PrecisionDlg::onOk()
//=======================================================================
void SMESHGUI_PrecisionDlg::onClose()
{
disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
disconnect( mySMESHGUI, 0, this, 0);
reject();
}

View File

@ -35,6 +35,7 @@ class QSpinBox;
class QPushButton;
class QCheckBox;
class QFrame;
class SMESHGUI;
/*
Class : SMESHGUI_PrecisionDlg
@ -46,7 +47,7 @@ class SMESHGUI_PrecisionDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_PrecisionDlg( QWidget* parent );
SMESHGUI_PrecisionDlg( SMESHGUI* );
virtual ~SMESHGUI_PrecisionDlg();
@ -65,7 +66,7 @@ private:
void closeEvent( QCloseEvent* );
private:
SMESHGUI* mySMESHGUI;
QSpinBox* mySpinBox;
QPushButton* myOKBtn;
QPushButton* myCancelBtn;

View File

@ -28,6 +28,7 @@
#include "SMESHGUI_Preferences_ColorDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "utilities.h"
@ -44,6 +45,8 @@
#include <qspinbox.h>
#include <qcolor.h>
#include "SUIT_Desktop.h"
using namespace std;
//=================================================================================
@ -53,10 +56,10 @@ using namespace std;
// The dialog will by default be modeless, unless you
// set'modal' to TRUE to construct a modal dialog.
//=================================================================================
SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg (QWidget* parent,
const char* name)
: QDialog(parent, name, true, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModule, const char* name)
: QDialog( SMESH::GetDesktop( theModule ), name, true, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule )
{
if (!name)
setName("SMESHGUI_Preferences_ColorDlg");
@ -182,7 +185,6 @@ SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg()
//=================================================================================
void SMESHGUI_Preferences_ColorDlg::Init()
{
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
/* signals and slots connections */

View File

@ -53,7 +53,7 @@ class SMESHGUI_Preferences_ColorDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_Preferences_ColorDlg( QWidget* parent = 0, const char* name = 0 );
SMESHGUI_Preferences_ColorDlg( SMESHGUI*, const char* name = 0 );
~SMESHGUI_Preferences_ColorDlg();
void SetColor(int type, QColor color);

View File

@ -30,9 +30,11 @@
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_Utils.h"
#include "SMESH_Actor.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include "SalomeApp_SelectionMgr.h"
@ -83,11 +85,10 @@ SMESHGUI_Preferences_ScalarBarDlg* SMESHGUI_Preferences_ScalarBarDlg::myDlg = 0;
* Gets the only instance of "Scalar Bar Properties" dialog box
*/
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties (QWidget* parent,
SalomeApp_SelectionMgr* Sel)
void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties( SMESHGUI* theModule )
{
if (!myDlg) {
myDlg = new SMESHGUI_Preferences_ScalarBarDlg (parent, Sel, false);
myDlg = new SMESHGUI_Preferences_ScalarBarDlg( theModule, false);
myDlg->show();
} else {
myDlg->show();
@ -104,10 +105,10 @@ void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties (QWidget* parent,
* Opens "Scalar Bar Preferences" dialog box
*/
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences (QWidget* parent)
void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences( SMESHGUI* theModule )
{
SMESHGUI_Preferences_ScalarBarDlg* aDlg =
new SMESHGUI_Preferences_ScalarBarDlg (parent, 0, true);
new SMESHGUI_Preferences_ScalarBarDlg( theModule, true);
aDlg->exec();
}
@ -118,17 +119,16 @@ void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences (QWidget* parent)
* Constructor
*/
//=================================================================================================
SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg (QWidget* parent,
SalomeApp_SelectionMgr* Sel,
bool modal)
: QDialog(parent, 0, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose)
SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* theModule, bool property, bool modal )
: QDialog( SMESH::GetDesktop( theModule ), 0, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
mySMESHGUI( theModule ),
mySelectionMgr( property ? SMESH::GetSelectionMgr( theModule ) : 0 )
{
setName("SMESHGUI_Preferences_ScalarBarDlg");
setCaption(Sel ? tr("SMESH_PROPERTIES_SCALARBAR") : tr("SMESH_PREFERENCES_SCALARBAR"));
setCaption( property ? tr("SMESH_PROPERTIES_SCALARBAR") : tr("SMESH_PREFERENCES_SCALARBAR"));
setSizeGripEnabled(TRUE);
mySelectionMgr = Sel;
myActor = 0;
/******************************************************************************/
@ -326,7 +326,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg (QWidget* p
/***************************************************************/
// Init
// --> first init from preferences
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QColor titleColor (255, 255, 255);
if (mgr && mgr->hasValue("SMESH", "ScalarBarTitleColor")) {
@ -429,7 +429,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg (QWidget* p
connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
}
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) ) ;
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) ) ;
}
//=================================================================================================
@ -517,7 +517,7 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
SMESH::RepaintCurrentView();
} else {
// Scalar Bar preferences
SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (!mgr) return false;
QColor titleColor = myTitleColorBtn->paletteBackgroundColor();

View File

@ -41,6 +41,7 @@ class QPushButton;
class QToolButton;
class QRadioButton;
class QSpinBox;
class SMESHGUI;
class QtxDblSpinBox;
@ -54,11 +55,11 @@ class SMESHGUI_Preferences_ScalarBarDlg : public QDialog
public:
~SMESHGUI_Preferences_ScalarBarDlg();
static void ScalarBarPreferences( QWidget* parent );
static void ScalarBarProperties ( QWidget* parent, SalomeApp_SelectionMgr* Sel );
static void ScalarBarPreferences( SMESHGUI* );
static void ScalarBarProperties ( SMESHGUI* );
protected:
SMESHGUI_Preferences_ScalarBarDlg( QWidget* parent = 0, SalomeApp_SelectionMgr* Sel = 0, bool modal = FALSE );
SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*, bool, bool modal = FALSE );
static SMESHGUI_Preferences_ScalarBarDlg* myDlg;
void closeEvent( QCloseEvent* e );
void setOriginAndSize( const double x, const double y, const double w, const double h );
@ -74,6 +75,7 @@ protected slots:
void onOrientationChanged();
private:
SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr;
SMESH_Actor* myActor;
double myIniX, myIniY, myIniW, myIniH;

View File

@ -29,6 +29,10 @@
#include "SMESHGUI_Preferences_SelectionDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SUIT_Desktop.h"
#include <qgroupbox.h>
#include <qlayout.h>
#include <qlabel.h>
@ -105,8 +109,9 @@ void SMESHGUI_DoubleValidator::fixup(QString& theText) const
// class : SMESHGUI_Preferences_SelectionDlg()
// purpose :
//=================================================================================
SMESHGUI_Preferences_SelectionDlg::SMESHGUI_Preferences_SelectionDlg( QWidget* parent, const char* name )
: QDialog( parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
SMESHGUI_Preferences_SelectionDlg::SMESHGUI_Preferences_SelectionDlg( SMESHGUI* theModule, const char* name )
: QDialog( SMESH::GetDesktop( theModule ), name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule )
{
if ( !name ) setName( "SMESHGUI_Preferences_SelectionDlg" );
setCaption( tr( "SMESH_PREF_SELECTION" ) );
@ -203,7 +208,7 @@ SMESHGUI_Preferences_SelectionDlg::SMESHGUI_Preferences_SelectionDlg( QWidget* p
/* Move widget on the botton right corner of main widget */
int x, y ;
SMESHGUI::GetSMESHGUI()->DefineDlgPosition(this, x, y);
mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
}

View File

@ -38,6 +38,7 @@
class QPushButton;
class QSpinBox;
class QColor;
class SMESHGUI;
class SMESHGUI_LineEdit : public QLineEdit
{
@ -72,7 +73,7 @@ class SMESHGUI_Preferences_SelectionDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_Preferences_SelectionDlg( QWidget* parent = 0, const char* name = 0 );
SMESHGUI_Preferences_SelectionDlg( SMESHGUI*, const char* name = 0 );
~SMESHGUI_Preferences_SelectionDlg();
void SetColor(int type, QColor color);
@ -89,6 +90,7 @@ private slots:
void onSelectColor();
private:
SMESHGUI* mySMESHGUI;
QPushButton* myColor[3];
QSpinBox* myWidth[2];
QLineEdit* myPrecision[2];

View File

@ -86,8 +86,8 @@ SMESHGUI_RemoveElementsDlg
mySMESHGUI(theModule),
myBusy(false)
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_RemoveElementsDlg");

View File

@ -86,8 +86,8 @@ SMESHGUI_RemoveNodesDlg
mySMESHGUI(theModule),
myBusy(false)
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_REM_NODE")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_NODE")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_RemoveNodesDlg");

View File

@ -36,6 +36,7 @@
#include "SMESH_TypeFilter.hxx"
#include "SMDS_Mesh.hxx"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SALOME_ListIO.hxx"
@ -59,11 +60,12 @@ using namespace std;
// class : SMESHGUI_RenumberingDlg()
// purpose :
//=================================================================================
SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg (QWidget* parent, const char* name,
SalomeApp_SelectionMgr* Sel,
SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const char* name,
const int unit, bool modal, WFlags fl)
: QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose)
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
myUnit = unit;
@ -170,7 +172,7 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg (QWidget* parent, const char* n
GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
SMESHGUI_RenumberingDlgLayout->addWidget(GroupMesh, 1, 0);
Init(Sel); /* Initialisations */
Init(); /* Initialisations */
}
//=================================================================================
@ -186,13 +188,11 @@ SMESHGUI_RenumberingDlg::~SMESHGUI_RenumberingDlg()
// function : Init()
// purpose :
//=================================================================================
void SMESHGUI_RenumberingDlg::Init (SalomeApp_SelectionMgr* Sel)
void SMESHGUI_RenumberingDlg::Init()
{
GroupMesh->show();
myConstructorId = 0;
Constructor1->setChecked(TRUE);
mySelectionMgr = Sel;
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myMesh = SMESH::SMESH_Mesh::_nil();

View File

@ -60,17 +60,15 @@ class SMESHGUI_RenumberingDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_RenumberingDlg (QWidget* parent = 0,
SMESHGUI_RenumberingDlg( SMESHGUI*,
const char* name = 0,
SalomeApp_SelectionMgr* Sel = 0,
const int unit = 0,
bool modal = FALSE,
WFlags fl = 0);
~SMESHGUI_RenumberingDlg();
private:
void Init( SalomeApp_SelectionMgr* Sel ) ;
void Init();
void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
void hideEvent ( QHideEvent * ); /* ESC key */

View File

@ -87,9 +87,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_RevolutionDlg");

View File

@ -86,8 +86,8 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_RotationDlg");

View File

@ -79,11 +79,12 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_CONFORM_FREEBORDERS")));
QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_BORDERTOSIDE")));
QPixmap image3 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_SIDEELEMENTS")));
QPixmap image4 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
QPixmap image1 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_CONFORM_FREEBORDERS")));
QPixmap image2 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_BORDERTOSIDE")));
QPixmap image3 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_SIDEELEMENTS")));
QPixmap image4 (mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_SewingDlg");

View File

@ -137,7 +137,7 @@ QFrame* SMESHGUI_SingleEditDlg::createMainFrame (QWidget* theParent)
{
QGroupBox* aMainGrp = new QGroupBox(1, Qt::Vertical, tr("EDGE_BETWEEN"), theParent);
QPixmap aPix (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
new QLabel(tr("SMESH_EDGE"), aMainGrp);
(new QPushButton(aMainGrp))->setPixmap(aPix);

View File

@ -93,8 +93,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_SmoothingDlg");

View File

@ -38,6 +38,7 @@
#include "SALOMEDSClient_Study.hxx"
#include "SALOMEDSClient_SObject.hxx"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_OverrideCursor.h"
@ -71,10 +72,12 @@ using namespace std;
* Constructor
*/
//=================================================================================
SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg (QWidget* parent, const char* name,
SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModule, const char* name,
bool modal, WFlags fl)
: QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose)
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
if (!name)
setName("SMESHGUI_StandardMeshInfosDlg");
@ -150,20 +153,19 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg (QWidget* parent, c
aDlgLayout->addWidget(myButtonsGroup, 2, 0);
mySelectionMgr = SMESHGUI::selectionMgr();
SMESHGUI::GetSMESHGUI()->SetActiveDialogBox(this);
mySMESHGUI->SetActiveDialogBox(this);
// connect signals
connect( myOkBtn, SIGNAL(clicked()), this, SLOT(close()));
connect( mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection()));
connect(SMESHGUI::GetSMESHGUI(), SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
connect(SMESHGUI::GetSMESHGUI(), SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
// resize and move dialog, then show
this->setMinimumSize(270, 428);
int x, y;
SMESHGUI::GetSMESHGUI()->DefineDlgPosition(this, x, y);
mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
@ -394,7 +396,7 @@ void SMESHGUI_StandardMeshInfosDlg::onSelectionChanged()
void SMESHGUI_StandardMeshInfosDlg::closeEvent (QCloseEvent* e)
{
mySelectionMgr->clearFilters();
SMESHGUI::GetSMESHGUI()->ResetState();
mySMESHGUI->ResetState();
QDialog::closeEvent(e);
}
@ -426,7 +428,7 @@ void SMESHGUI_StandardMeshInfosDlg::DeactivateActiveDialog()
void SMESHGUI_StandardMeshInfosDlg::ActivateThisDialog()
{
/* Emit a signal to deactivate any active dialog */
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
mySMESHGUI->EmitSignalDeactivateDialog();
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
}

View File

@ -41,13 +41,15 @@ class QPushButton;
class QLineEdit;
class QTextBrowser;
class SalomeApp_SelectionMgr;
class SMESHGUI;
class SMESHGUI_StandardMeshInfosDlg : public QDialog
{
Q_OBJECT
public:
SMESHGUI_StandardMeshInfosDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
SMESHGUI_StandardMeshInfosDlg( SMESHGUI*, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~SMESHGUI_StandardMeshInfosDlg();
protected:
@ -62,6 +64,7 @@ private slots:
void onStartSelection();
private:
SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr;
bool myStartSelection;
bool myIsActiveWindow;

View File

@ -86,10 +86,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_PLANE")));
QPixmap image3 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_PLANE")));
QPixmap image3 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_SymmetryDlg");

View File

@ -87,9 +87,9 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
myViewWindow( SMESH::GetViewWindow( theModule ) ),
mySelector( myViewWindow->GetSelector() )
{
QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if (!name)
setName("SMESHGUI_TranslationDlg");

View File

@ -30,9 +30,10 @@
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_Utils.h"
#include "SMESH_Actor.h"
#include "SUIT_Desktop.h"
#include "SUIT_OverrideCursor.h"
#include "SALOME_ListIO.hxx"
@ -58,12 +59,15 @@ using namespace std;
// purpose :
//
//=================================================================================
SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg (QWidget* parent,
SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule,
const char* name,
bool modal,
WFlags fl)
: QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose)
: QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myViewWindow( SMESH::GetViewWindow( theModule ) )
{
if (!name)
setName("SMESHGUI_TransparencyDlg");
@ -132,8 +136,6 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg (QWidget* parent,
SMESHGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
SMESHGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
mySelectionMgr = SMESHGUI::selectionMgr();
// Initial state
this->onSelectionChanged();
@ -141,12 +143,12 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg (QWidget* parent,
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency()));
connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged()));
connect(SMESHGUI::GetSMESHGUI(), SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
/* Move widget on the botton right corner of main widget */
int x, y;
SMESHGUI::GetSMESHGUI()->DefineDlgPosition(this, x, y);
mySMESHGUI->DefineDlgPosition(this, x, y);
this->move(x, y);
this->show();
}
@ -176,7 +178,7 @@ void SMESHGUI_TransparencyDlg::ClickOnOk()
//=================================================================================
void SMESHGUI_TransparencyDlg::SetTransparency()
{
if (SVTK_ViewWindow* aVTKViewWindow = SMESH::GetCurrentVtkView()) {
if( myViewWindow ) {
SUIT_OverrideCursor wc;
float opacity = this->Slider1->value() / 100.;
@ -190,7 +192,7 @@ void SMESHGUI_TransparencyDlg::SetTransparency()
if (anActor)
anActor->SetOpacity(opacity);
}
aVTKViewWindow->Repaint();
myViewWindow->Repaint();
}
ValueHasChanged();
}
@ -210,7 +212,7 @@ void SMESHGUI_TransparencyDlg::ValueHasChanged()
//=================================================================================
void SMESHGUI_TransparencyDlg::onSelectionChanged()
{
if (SVTK_ViewWindow* aVTKViewWindow = SMESH::GetCurrentVtkView()) {
if( myViewWindow ) {
int opacity = 100;
SALOME_ListIO aList;

View File

@ -36,6 +36,9 @@ class QLabel;
class QPushButton;
class QSlider;
class SalomeApp_SelectionMgr;
class SVTK_Selector;
class SVTK_ViewWindow;
class SMESHGUI;
//=================================================================================
// class : SMESHGUI_TransparencyDlg
@ -46,7 +49,7 @@ class SMESHGUI_TransparencyDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_TransparencyDlg( QWidget* parent = 0,
SMESHGUI_TransparencyDlg( SMESHGUI*,
const char* name = 0,
bool modal = false,
WFlags fl = 0 );
@ -55,7 +58,9 @@ public:
private :
SMESHGUI* mySMESHGUI;
SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
QPushButton* buttonOk;
QLabel* TextLabelOpaque;

View File

@ -56,6 +56,11 @@ namespace SMESH{
return theModule->getApp()->selectionMgr();
}
SUIT_ResourceMgr*
GetResourceMgr( const SalomeApp_Module* )
{
return SUIT_Session::session()->resourceMgr();
}
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy)

View File

@ -31,6 +31,7 @@ class QString;
class SUIT_ViewWindow;
class SUIT_Desktop;
class SUIT_Study;
class SUIT_ResourceMgr;
class CAM_Module;
@ -52,6 +53,9 @@ namespace SMESH {
SalomeApp_Study*
GetAppStudy(const CAM_Module* theModule);
SUIT_ResourceMgr*
GetResourceMgr( const SalomeApp_Module* );
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy);

View File

@ -30,6 +30,7 @@
#include "SMESHGUI_aParameter.h"
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_Utils.h"
#include "SUIT_Tools.h"
#include "SUIT_Desktop.h"
@ -53,13 +54,14 @@ using namespace std;
//
//======================================================================================
SMESHGUI_aParameterDlg::SMESHGUI_aParameterDlg
(std::list<SMESHGUI_aParameterPtr> params,
QWidget* parent,
( SMESHGUI* theModule,
std::list<SMESHGUI_aParameterPtr> params,
QString title,
bool modal)
: QDialog(parent, "MyParameterDialog", modal, WStyle_Customize |
: QDialog( SMESH::GetDesktop( theModule ), "MyParameterDialog", modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myParamList(params)
myParamList(params),
mySMESHGUI(theModule)
{
/* creating widgets */
init();
@ -67,7 +69,7 @@ SMESHGUI_aParameterDlg::SMESHGUI_aParameterDlg
setCaption(title);
/* Move widget on the botton right corner of main widget */
SUIT_Tools::centerWidget(this, parent);
SUIT_Tools::centerWidget(this, SMESH::GetDesktop( theModule ) );
}
//======================================================================================
@ -159,9 +161,6 @@ void SMESHGUI_aParameterDlg::init()
/* signals and slots connections */
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(myButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
/* Retrieve SMESHGUI */
mySMESHGUI = SMESHGUI::GetSMESHGUI();
}
//======================================================================================
@ -194,12 +193,13 @@ void SMESHGUI_aParameterDlg::ClickOnOk()
// function : Parameters()
// purpose : return a list of parameters from a dialog box
//=======================================================================
bool SMESHGUI_aParameterDlg::Parameters (list<SMESHGUI_aParameterPtr> params,
bool SMESHGUI_aParameterDlg::Parameters( SMESHGUI* theModule,
list<SMESHGUI_aParameterPtr> params,
const char *aTitle)
{
if (!params.empty()) {
SMESHGUI_aParameterDlg *Dialog =
new SMESHGUI_aParameterDlg(params, SMESHGUI::desktop(), aTitle, TRUE);
new SMESHGUI_aParameterDlg( theModule, params, aTitle, TRUE);
return (Dialog->exec() == QDialog::Accepted);
}
return false;

View File

@ -49,15 +49,15 @@ class SMESHGUI_aParameterDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_aParameterDlg (std::list<SMESHGUI_aParameterPtr> params,
QWidget* parent = 0,
SMESHGUI_aParameterDlg( SMESHGUI*,
std::list<SMESHGUI_aParameterPtr> params,
QString title = QString::null,
bool modal = TRUE);
~SMESHGUI_aParameterDlg();
/* Parameter function */
static bool Parameters (std::list<SMESHGUI_aParameterPtr> params, const char *aTitle);
static bool Parameters( SMESHGUI*, std::list<SMESHGUI_aParameterPtr> params, const char *aTitle);
protected:
void init();

View File

@ -121,7 +121,7 @@ void StdMeshersGUI_HypothesisCreator::EditHypothesis
StdMeshersGUI_Parameters::GetParameters( theHyp, paramList );
bool modified = false;
if ( SMESHGUI_aParameterDlg::Parameters( paramList, QObject::tr("SMESH_VALUE")) )
if ( SMESHGUI_aParameterDlg::Parameters( SMESHGUI::GetSMESHGUI(), paramList, QObject::tr("SMESH_VALUE")) )
modified = StdMeshersGUI_Parameters::SetParameters( theHyp, paramList );
if ( modified ) {