This commit is contained in:
eap 2009-10-01 06:28:20 +00:00
parent fe22993f88
commit 7af78cc3d0
67 changed files with 2881 additions and 2881 deletions

File diff suppressed because it is too large Load Diff

View File

@ -186,11 +186,11 @@ namespace SMESH
vtkIdList *anIds = vtkIdList::New();
if(aConn)
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[aConn[i]]);
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[aConn[i]]);
else
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
anIds->Delete();
@ -212,8 +212,8 @@ namespace SMESH
~TElementSimulation()
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
@ -237,7 +237,7 @@ namespace SMESH
//=================================================================================
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
SMDSAbs_ElementType ElementType,
int nbNodes )
int nbNodes )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
@ -466,9 +466,9 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
case SMDSAbs_Face: {
if(myIsPoly)
aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
else
aMeshEditor->AddFace(anArrayOfIndices.inout());
aMeshEditor->AddFace(anArrayOfIndices.inout());
break;
}
case SMDSAbs_Volume:
@ -536,10 +536,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -571,12 +571,12 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
bool allOk = true;
for (int i = 0; i < aListId.count(); i++) {
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
{
newIndices.Add( n->GetID() );
myNbOkNodes++;
}
{
newIndices.Add( n->GetID() );
myNbOkNodes++;
}
else
allOk = false;
allOk = false;
}
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
@ -587,10 +587,10 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
if (myIsPoly)
{
if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
myNbOkNodes = 0;
else
myNbOkNodes = aListId.count();
if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
myNbOkNodes = 0;
else
myNbOkNodes = aListId.count();
}
}

View File

@ -221,7 +221,7 @@ namespace SMESH
void SetPosition (SMESH_Actor* theActor,
const int theType,
TVTKIds& theIds,
const int theMode,
const int theMode,
const bool theReverse)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
@ -311,8 +311,8 @@ namespace SMESH
~TElementSimulation()
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
myVTKViewWindow->RemoveActor(myPreviewActor);
myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
@ -411,7 +411,7 @@ QWidget* IdEditItem::createEditor() const
// purpose : constructor
//=================================================================================
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
const int theType )
const int theType )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
@ -766,10 +766,10 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -797,12 +797,12 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
for (int i = 0; i < aListId.count(); i++) {
if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
{
newIndices.Add( n->GetID() );
newIndices.Add( n->GetID() );
}
else
{
allOk = false;
break;
allOk = false;
break;
}
}
@ -914,16 +914,16 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
else
{
for ( int row = 0; row < myNbCorners; row++ )
anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
for ( int row = 0; row < myTable->rowCount(); row++ )
{
anID = myTable->item(row, 1)->text().toInt(&ok);
if (!ok) {
anID = myTable->item(row, 0)->text().toInt();
aDisplayMode = VTK_WIREFRAME;
}
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
anID = myTable->item(row, 1)->text().toInt(&ok);
if (!ok) {
anID = myTable->item(row, 0)->text().toInt();
aDisplayMode = VTK_WIREFRAME;
}
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
}
}
@ -1117,7 +1117,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
// clear table
for ( int row = 0; row < myTable->rowCount(); row++ )
for ( int col = 0; col < myTable->columnCount(); col++ )
if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
myTable->setEnabled( false );
}

View File

@ -292,22 +292,22 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
if (!myMesh->_is_nil()) {
QStringList aParameters;
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
try {
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes
SMESH::SMESH_Mesh_var aCompoundMesh;
if(CheckBoxCommon->isChecked())
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
!(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
!(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
else
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
!(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
!(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
@ -360,10 +360,10 @@ void SMESHGUI_BuildCompoundDlg::ClickOnHelp()
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(myHelpFileName));
}
}

View File

@ -264,31 +264,31 @@ void SMESHGUI_ClippingDlg::AddPlane (SMESH_Actor* theActor,
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
{aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
{aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
aPnt[1] - aDelta[0][1] - aDelta[1][1],
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
aPnt[1] - aDelta[0][1] - aDelta[1][1],
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
aPnt01[1] + aNormal[1],
aPnt01[2] + aNormal[2]};
aPnt01[1] + aNormal[1],
aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
aPnt[1] - aDelta[0][1] + aDelta[1][1],
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
aPnt[1] - aDelta[0][1] + aDelta[1][1],
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
aPnt11[1] + aNormal[1],
aPnt11[2] + aNormal[2]};
aPnt11[1] + aNormal[1],
aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
aPnt[1] + aDelta[0][1] - aDelta[1][1],
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
aPnt[1] + aDelta[0][1] - aDelta[1][1],
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
aPnt21[1] + aNormal[1],
aPnt21[2] + aNormal[2]};
aPnt21[1] + aNormal[1],
aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
@ -555,17 +555,17 @@ void SMESHGUI_ClippingDlg::ClickOnHelp()
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
QString platform;
#ifdef WIN32
platform = "winapplication";
platform = "winapplication";
#else
platform = "application";
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -581,24 +581,24 @@ void SMESHGUI_ClippingDlg::onSelectionChanged()
Handle(SALOME_InteractiveObject) IOS = aList.First();
myActor = SMESH::FindActorByEntry(IOS->getEntry());
if (myActor) {
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
for ( ; anId < anEnd; anId++) {
if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
anOrientedPlane->Delete();
aTVTKPlane->ShallowCopy(aPlane);
myPlanes.push_back(aTVTKPlane);
}
}
}
vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
for ( ; anId < anEnd; anId++) {
if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
anOrientedPlane->Delete();
aTVTKPlane->ShallowCopy(aPlane);
myPlanes.push_back(aTVTKPlane);
}
}
}
std::for_each(myPlanes.begin(),myPlanes.end(),
TSetVisiblity(PreviewCheckBox->isChecked()));
std::for_each(myPlanes.begin(),myPlanes.end(),
TSetVisiblity(PreviewCheckBox->isChecked()));
}
}
SMESH::RenderViewWindow(aViewWindow);
@ -840,31 +840,31 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
{aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
{aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
aPnt[1] - aDelta[0][1] - aDelta[1][1],
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
aPnt[1] - aDelta[0][1] - aDelta[1][1],
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
aPnt01[1] + aNormal[1],
aPnt01[2] + aNormal[2]};
aPnt01[1] + aNormal[1],
aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
aPnt[1] - aDelta[0][1] + aDelta[1][1],
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
aPnt[1] - aDelta[0][1] + aDelta[1][1],
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
aPnt11[1] + aNormal[1],
aPnt11[2] + aNormal[2]};
aPnt11[1] + aNormal[1],
aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
aPnt[1] + aDelta[0][1] - aDelta[1][1],
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
aPnt[1] + aDelta[0][1] - aDelta[1][1],
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
aPnt21[1] + aNormal[1],
aPnt21[2] + aNormal[2]};
aPnt21[1] + aNormal[1],
aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;

View File

@ -82,16 +82,16 @@ public:
// used in SMESHGUI::restoreVisualParameters() to avoid
// declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
static void AddPlane (SMESH_Actor* theActor,
SVTK_ViewWindow* theViewWindow,
SMESH::Orientation theOrientation,
double theDistance,
vtkFloatingPointType theAngle[2]);
SVTK_ViewWindow* theViewWindow,
SMESH::Orientation theOrientation,
double theDistance,
vtkFloatingPointType theAngle[2]);
static void GetPlaneParam (SMESH_Actor* theActor,
int thePlaneIndex,
SMESH::Orientation& theOrientation,
double& theDistance,
vtkFloatingPointType* theAngle);
int thePlaneIndex,
SMESH::Orientation& theOrientation,
double& theDistance,
vtkFloatingPointType* theAngle);
protected:
void keyPressEvent( QKeyEvent* );

View File

@ -185,7 +185,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
{
dlg()->show();
SUIT_MessageBox::warning( myDlg,
tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
return false;
}
@ -196,7 +196,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
if( CORBA::is_nil(mesh) )
{
SUIT_MessageBox::warning( myDlg,
tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
return false;
}
@ -210,7 +210,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
{
bool aParam = true;
if( myDlg->IsEnabledCheck() )
aParam = myDlg->IsMediumNdsOnGeom();
aParam = myDlg->IsMediumNdsOnGeom();
aEditor->ConvertToQuadratic( aParam );
aResult = true;

View File

@ -193,11 +193,11 @@ QWidget* SMESHGUI_CreatePatternDlg::createMainFrame( QWidget* theParent )
// Connect signals and slots
connect( myTypeGrp, SIGNAL( buttonClicked( int ) ),
this, SLOT( onTypeChanged( int ) ) );
this, SLOT( onTypeChanged( int ) ) );
connect( myProjectChk, SIGNAL( toggled( bool ) ),
this, SLOT( onProject( bool ) ) );
this, SLOT( onProject( bool ) ) );
connect( aSelBtn, SIGNAL( clicked() ),
this, SLOT( onSelBtnClicked() ) );
this, SLOT( onSelBtnClicked() ) );
return aMainGrp;
}
@ -274,11 +274,11 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType )
// selection and SMESHGUI
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
this, SLOT( onSelectionDone() ) );
this, SLOT( onSelectionDone() ) );
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
this, SLOT( onDeactivate() ) );
this, SLOT( onDeactivate() ) );
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
this, SLOT( onClose() ) );
this, SLOT( onClose() ) );
mySwitch2d->setEnabled( theType == Type_2d );
mySwitch3d->setEnabled( theType == Type_3d );
@ -342,8 +342,8 @@ bool SMESHGUI_CreatePatternDlg::isValid()
{
if ( myGeomObj->_is_nil() ) {
SUIT_MessageBox::information( this,
tr( "SMESH_INSUFFICIENT_DATA" ),
tr( "SMESHGUI_INVALID_PARAMETERS" ) );
tr( "SMESH_INSUFFICIENT_DATA" ),
tr( "SMESHGUI_INVALID_PARAMETERS" ) );
return false;
}
return true;
@ -406,13 +406,13 @@ void SMESHGUI_CreatePatternDlg::onSave()
if ( aWritten != aLen ) {
SUIT_MessageBox::information( this,
tr( "SMESH_ERROR" ),
tr( "ERROR_OF_SAVING" ) );
tr( "SMESH_ERROR" ),
tr( "ERROR_OF_SAVING" ) );
}
else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( ActorSelection );
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
@ -465,7 +465,7 @@ void SMESHGUI_CreatePatternDlg::onOk()
else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( ActorSelection );
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
@ -512,11 +512,11 @@ void SMESHGUI_CreatePatternDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning( this,
tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ).
arg( myHelpFileName ) );
tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ).
arg( myHelpFileName ) );
}
}
@ -754,20 +754,20 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
if ( myType == Type_2d ) {
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
TopAbs_SHAPE,
-1,
TopAbs_FACE ) );
TopAbs_SHAPE,
-1,
TopAbs_FACE ) );
}
else {
TColStd_MapOfInteger aTypes;
aTypes.Add( TopAbs_SHELL );
aTypes.Add( TopAbs_SOLID );
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
TopAbs_FACE,
6,
aTypes,
GEOM::GEOM_Object::_nil(),
true ) );
TopAbs_FACE,
6,
aTypes,
GEOM::GEOM_Object::_nil(),
true ) );
}
}

View File

@ -129,9 +129,9 @@ namespace SMESH
typedef std::vector<vtkIdType> TVTKIds;
void SetPosition(SMESH_Actor* theActor,
vtkIdType theType,
const TVTKIds& theIds,
bool theReset=true)
vtkIdType theType,
const TVTKIds& theIds,
bool theReset=true)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
@ -141,14 +141,14 @@ namespace SMESH
vtkIdList *anIds = vtkIdList::New();
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
if(theIds.size()!=0){
myGrid->InsertNextCell(theType,anIds);
myGrid->Modified();
myGrid->InsertNextCell(theType,anIds);
myGrid->Modified();
}
anIds->Delete();
SetVisibility(true);
@ -167,7 +167,7 @@ namespace SMESH
~TPolySimulation(){
if( myViewWindow )
myViewWindow->RemoveActor(myPreviewActor);
myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
@ -358,42 +358,42 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
{
case 0 :
{
if ( myActor ){
if ( myActor ){
myActor->SetPointRepresentation(true);
}
}
else
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
AddButton->setEnabled(false);
RemoveButton->setEnabled(false);
TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
myFacesByNodesLabel->show();
myFacesByNodes->clear();
myFacesByNodes->show();
AddButton->show();
RemoveButton->show();
Preview->show();
break;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
AddButton->setEnabled(false);
RemoveButton->setEnabled(false);
TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
myFacesByNodesLabel->show();
myFacesByNodes->clear();
myFacesByNodes->show();
AddButton->show();
RemoveButton->show();
Preview->show();
break;
}
case 1 :
{
if( myActor ){
myActor->SetPointRepresentation(false);
} else {
SMESH::SetPointRepresentation(false);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
myFacesByNodesLabel->hide();
myFacesByNodes->hide();
AddButton->hide();
RemoveButton->hide();
Preview->show();
break;
if( myActor ){
myActor->SetPointRepresentation(false);
} else {
SMESH::SetPointRepresentation(false);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
myFacesByNodesLabel->hide();
myFacesByNodes->hide();
AddButton->hide();
RemoveButton->hide();
Preview->show();
break;
}
}
@ -425,71 +425,71 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
if(checkEditLine(false) == -1) {return;}
busy = true;
if (GetConstructorId() == 0)
{
SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
SMESH::long_array_var aQuantities = new SMESH::long_array;
{
SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
SMESH::long_array_var aQuantities = new SMESH::long_array;
aQuantities->length( myFacesByNodes->count() );
aQuantities->length( myFacesByNodes->count() );
TColStd_ListOfInteger aNodesIds;
TColStd_ListOfInteger aNodesIds;
int aNbQuantities = 0;
for (int i = 0; i < myFacesByNodes->count(); i++ ) {
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
aNodesIds.Append( (*it).toInt() );
int aNbQuantities = 0;
for (int i = 0; i < myFacesByNodes->count(); i++ ) {
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
aNodesIds.Append( (*it).toInt() );
aQuantities[aNbQuantities++] = anIds.count();
}
aQuantities[aNbQuantities++] = anIds.count();
}
anIdsOfNodes->length(aNodesIds.Extent());
anIdsOfNodes->length(aNodesIds.Extent());
int aNbIdsOfNodes = 0;
TColStd_ListIteratorOfListOfInteger It;
It.Initialize(aNodesIds);
for( ;It.More();It.Next())
anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what());
}catch(...){
INFOS("Unknown exception was cought !!!");
}
}
int aNbIdsOfNodes = 0;
TColStd_ListIteratorOfListOfInteger It;
It.Initialize(aNodesIds);
for( ;It.More();It.Next())
anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what());
}catch(...){
INFOS("Unknown exception was cought !!!");
}
}
else if (GetConstructorId() == 1)
{
SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
anIdsOfFaces->length(aListId.count());
for ( int i = 0; i < aListId.count(); i++ )
anIdsOfFaces[i] = aListId[i].toInt();
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what());
}catch(...){
INFOS("Unknown exception was cought !!!");
}
}
{
SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
anIdsOfFaces->length(aListId.count());
for ( int i = 0; i < aListId.count(); i++ )
anIdsOfFaces[i] = aListId[i].toInt();
try{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
}catch(SALOME::SALOME_Exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
}catch(std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what());
}catch(...){
INFOS("Unknown exception was cought !!!");
}
}
//SALOME_ListIO aList;
//mySelectionMgr->setSelectedObjects( aList );
SMESH::UpdateView();
if( myActor ){
unsigned int anEntityMode = myActor->GetEntityMode();
myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
unsigned int anEntityMode = myActor->GetEntityMode();
myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
}
//ConstructorsClicked( GetConstructorId() );
busy = false;
@ -507,7 +507,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk()
ClickOnCancel();
}
//=================================================================================
// function : ClickOnCancel()
// purpose :
@ -543,10 +543,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -570,67 +570,67 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
if (GetConstructorId() == 0)
{
if ( aMesh ) {
TColStd_MapOfInteger newIndices;
TColStd_MapOfInteger newIndices;
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
if ( n ) {
newIndices.Add(n->GetID());
myNbOkElements++;
}
}
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
if ( n ) {
newIndices.Add(n->GetID());
myNbOkElements++;
}
}
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( myNbOkElements>0 && aListId.count()>=3)
AddButton->setEnabled(true);
else
AddButton->setEnabled(false);
if ( myNbOkElements>0 && aListId.count()>=3)
AddButton->setEnabled(true);
else
AddButton->setEnabled(false);
displaySimulation();
displaySimulation();
}
} else if (GetConstructorId() == 1)
{
myNbOkElements = 0;
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
myNbOkElements = 0;
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
// check entered ids of faces and hilight them
QStringList aListId;
if ( aMesh ) {
TColStd_MapOfInteger newIndices;
// check entered ids of faces and hilight them
QStringList aListId;
if ( aMesh ) {
TColStd_MapOfInteger newIndices;
aListId = theNewText.split( " ", QString::SkipEmptyParts );
aListId = theNewText.split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
if ( e ) {
newIndices.Add(e->GetID());
myNbOkElements++;
}
}
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
if ( e ) {
newIndices.Add(e->GetID());
myNbOkElements++;
}
}
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( myNbOkElements ) {
if (aListId.count()>1){
buttonOk->setEnabled( true );
buttonApply->setEnabled( true );
}
else{
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
}
if(aListId.count()>1)
displaySimulation();
}
}
if ( myNbOkElements ) {
if (aListId.count()>1){
buttonOk->setEnabled( true );
buttonApply->setEnabled( true );
}
else{
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
}
if(aListId.count()>1)
displaySimulation();
}
}
}
busy = false;
}
@ -749,13 +749,13 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
case 0:{ // nodes
const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() );
if( !aNode ){
SUIT_MessageBox::warning(this,
tr("SMESH_POLYEDRE_CREATE_ERROR"),
tr("The incorrect indices of nodes!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
return -1;
SUIT_MessageBox::warning(this,
tr("SMESH_POLYEDRE_CREATE_ERROR"),
tr("The incorrect indices of nodes!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
return -1;
}
break;
@ -764,24 +764,24 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
bool aElemIsOK = true;
const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() );
if (!aElem)
{
aElemIsOK = false;
}
{
aElemIsOK = false;
}
else
{
SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
if (aType != SMDSAbs_Face){
aElemIsOK = false;
}
}
{
SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
if (aType != SMDSAbs_Face){
aElemIsOK = false;
}
}
if (!aElemIsOK){
SUIT_MessageBox::warning(this,
tr("SMESH_POLYEDRE_CREATE_ERROR"),
tr("The incorrect indices of faces!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
return -1;
SUIT_MessageBox::warning(this,
tr("SMESH_POLYEDRE_CREATE_ERROR"),
tr("The incorrect indices of faces!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
return -1;
}
break;
}
@ -804,66 +804,66 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation()
vtkIdType aType = VTK_CONVEX_POINT_SET;
SMDS_Mesh* aMesh = 0;
if ( myActor ){
aMesh = myActor->GetObject()->GetMesh();
aMesh = myActor->GetObject()->GetMesh();
}
if (GetConstructorId() == 0 && aMesh){
if (!AddButton->isEnabled()){
mySimulation->ResetGrid(true);
for (int i = 0; i < myFacesByNodes->count(); i++) {
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
if (!aNode) continue;
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
aVTKIds.push_back(aId);
aVTKIds_faces.push_back(aId);
}
if(!Preview->isChecked()){
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
}
}
if(myFacesByNodes->count() == 0){
mySimulation->SetVisibility(false);
} else {
mySimulation->SetVisibility(true);
}
if(Preview->isChecked()){
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
} else {
// add ids from edit line
QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < anEditIds.count(); i++ )
aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
if (!AddButton->isEnabled()){
mySimulation->ResetGrid(true);
for (int i = 0; i < myFacesByNodes->count(); i++) {
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
if (!aNode) continue;
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
aVTKIds.push_back(aId);
aVTKIds_faces.push_back(aId);
}
if(!Preview->isChecked()){
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
}
}
if(myFacesByNodes->count() == 0){
mySimulation->SetVisibility(false);
} else {
mySimulation->SetVisibility(true);
}
if(Preview->isChecked()){
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
} else {
// add ids from edit line
QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < anEditIds.count(); i++ )
aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
}else if(GetConstructorId() == 1 && aMesh){
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ )
{
const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
if ( !anElem ) continue;
SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
if (aFaceType != SMDSAbs_Face) continue;
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
while( anIter->more() )
if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
aVTKIds.push_back(aId);
aVTKIds_faces.push_back(aId);
}
if(!Preview->isChecked()){
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
}
}
if(Preview->isChecked())
mySimulation->SetPosition(myActor, aType, aVTKIds);
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ )
{
const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
if ( !anElem ) continue;
SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
if (aFaceType != SMDSAbs_Face) continue;
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
while( anIter->more() )
if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
aVTKIds.push_back(aId);
aVTKIds_faces.push_back(aId);
}
if(!Preview->isChecked()){
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
}
}
if(Preview->isChecked())
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
SMESH::UpdateView();
}

View File

@ -189,7 +189,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid()
{
if (myListBox->count() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("NO_SELECTED_GROUPS"));
tr("NO_SELECTED_GROUPS"));
return false;
}
@ -266,10 +266,10 @@ void SMESHGUI_DeleteGroupDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}

View File

@ -59,16 +59,16 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
if( !anActor )
anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
if( anActor )
{
SMESH::DisplayActor( wnd, anActor );
SMESH::DisplayActor( wnd, anActor );
prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
}
if( prs )
UpdatePrs( prs );
UpdatePrs( prs );
else if( anActor )
SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
}
}

View File

@ -169,7 +169,7 @@ namespace SMESH
}
void SetPointsData ( SMDS_Mesh* theMesh,
TColStd_MapOfInteger & theNodesIdMap )
TColStd_MapOfInteger & theNodesIdMap )
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
@ -177,9 +177,9 @@ namespace SMESH
TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
myIDs.push_back(idIter.Key());
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
myIDs.push_back(idIter.Key());
}
myIdGrid->SetPoints(aPoints);
@ -190,7 +190,7 @@ namespace SMESH
}
void SetElemsData( TColStd_MapOfInteger & theElemsIdMap,
std::list<gp_XYZ> & aGrCentersXYZ )
std::list<gp_XYZ> & aGrCentersXYZ )
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
@ -198,14 +198,14 @@ namespace SMESH
TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
for( ; idIter.More(); idIter.Next() ) {
myIDs.push_back(idIter.Key());
myIDs.push_back(idIter.Key());
}
gp_XYZ aXYZ;
std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
aXYZ = *coordIt;
aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
aXYZ = *coordIt;
aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
}
myIdGrid->SetPoints(aPoints);
aPoints->Delete();
@ -234,20 +234,20 @@ namespace SMESH
myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
if ( myIsPointsLabeled ) {
myPointsNumDataSet->ShallowCopy(myIdGrid);
vtkDataSet *aDataSet = myPointsNumDataSet;
int aNbElem = myIDs.size();
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues( aNbElem );
for ( int i = 0; i < aNbElem; i++ )
anArray->SetValue( i, myIDs[i] );
aDataSet->GetPointData()->SetScalars( anArray );
anArray->Delete();
myPtsMaskPoints->SetInput( aDataSet );
myPointLabels->SetVisibility( theIsActorVisible );
myPointsNumDataSet->ShallowCopy(myIdGrid);
vtkDataSet *aDataSet = myPointsNumDataSet;
int aNbElem = myIDs.size();
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues( aNbElem );
for ( int i = 0; i < aNbElem; i++ )
anArray->SetValue( i, myIDs[i] );
aDataSet->GetPointData()->SetScalars( anArray );
anArray->Delete();
myPtsMaskPoints->SetInput( aDataSet );
myPointLabels->SetVisibility( theIsActorVisible );
}
else {
myPointLabels->SetVisibility( false );
myPointLabels->SetVisibility( false );
}
}
@ -270,7 +270,7 @@ namespace SMESH
//myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsSelectVisiblePoints->Delete();
//myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
//myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsMaskPoints->Delete();
myPointLabels->Delete();
@ -282,8 +282,8 @@ namespace SMESH
static const char * IconFirst[] = {
"18 10 2 1",
" g None",
". g #000000",
" g None",
". g #000000",
" . . ",
" .. .. .. ",
" .. ... ... ",
@ -300,7 +300,7 @@ static const char * IconFirst[] = {
// purpose :
//=================================================================================
SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
int theAction)
int theAction)
: QDialog(SMESH::GetDesktop(theModule)),
mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
@ -327,9 +327,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
/***************************************************************/
GroupConstructors = new QGroupBox(myAction == 1 ?
tr("SMESH_MERGE_ELEMENTS") :
tr("SMESH_MERGE_NODES"),
this);
tr("SMESH_MERGE_ELEMENTS") :
tr("SMESH_MERGE_NODES"),
this);
QButtonGroup* ButtonGroup = new QButtonGroup(this);
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
@ -362,9 +362,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
/***************************************************************/
// Controls for coincident elements detecting
GroupCoincident = new QGroupBox(myAction == 1 ?
tr("COINCIDENT_ELEMENTS") :
tr("COINCIDENT_NODES"),
this);
tr("COINCIDENT_ELEMENTS") :
tr("COINCIDENT_NODES"),
this);
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
GroupCoincidentLayout->setSpacing(SPACING);
@ -542,7 +542,7 @@ void SMESHGUI_EditMeshDlg::Init()
// purpose :
//=================================================================================
void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
std::list< gp_XYZ > & theGrCentersXYZ)
std::list< gp_XYZ > & theGrCentersXYZ)
{
if (!myActor)
return;
@ -659,10 +659,10 @@ void SMESHGUI_EditMeshDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -722,15 +722,15 @@ void SMESHGUI_EditMeshDlg::onDetect()
switch (myAction) {
case 0 :
if(!mySubMeshOrGroup->_is_nil())
aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
else
aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
break;
case 1 :
if(!mySubMeshOrGroup->_is_nil())
aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
else
aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
break;
}
@ -739,7 +739,7 @@ void SMESHGUI_EditMeshDlg::onDetect()
QStringList anIDs;
for (int j = 0; j < aGroup.length(); j++)
anIDs.append(QString::number(aGroup[j]));
anIDs.append(QString::number(aGroup[j]));
ListCoincident->addItem(anIDs.join(" "));
}
@ -1044,11 +1044,11 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
if (myAction == 0) {
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
aViewWindow->SetSelectionMode(NodeSelection);
}
else
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
aViewWindow->SetSelectionMode(CellSelection);
}
}

View File

@ -354,9 +354,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
SLOT(onTextChange(const QString&)));
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
SLOT(onTextChange(const QString&)));
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
@ -440,19 +440,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (type == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
if (type == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
}
}
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@ -492,16 +492,16 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
bool bOk;
int j = 0;
for (int i = 0; i < aListElementsId.count(); i++) {
long ind = aListElementsId[ i ].toLong(&bOk);
if (bOk) {
const SMDS_MeshElement* e = aMesh->FindElement(ind);
if (e) {
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
if (typeMatch)
anElementsId[ j++ ] = ind;
}
}
long ind = aListElementsId[ i ].toLong(&bOk);
if (bOk) {
const SMDS_MeshElement* e = aMesh->FindElement(ind);
if (e) {
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
if (typeMatch)
anElementsId[ j++ ] = ind;
}
}
}
anElementsId->length(j);
}
@ -559,44 +559,44 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
/*
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( MeshCheck->isChecked() ) {
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
}
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal);
}
else {
if( MeshCheck->isChecked() ) {
if( GetConstructorId() == 0 )
retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
else
retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
if( GetConstructorId() == 0 )
retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
else
retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
}
else
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint);
}
*/
@ -606,17 +606,17 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
ElemType = SMESH::EDGE;
if( !MeshCheck->isChecked() ) {
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
anAngles, LinearAnglesCheck->isChecked(),
BasePointGrp->isChecked(), aBasePoint,
NeedGroups, ElemType, retVal);
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
anAngles, LinearAnglesCheck->isChecked(),
BasePointGrp->isChecked(), aBasePoint,
NeedGroups, ElemType, retVal);
}
else {
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
anAngles, LinearAnglesCheck->isChecked(),
BasePointGrp->isChecked(), aBasePoint,
NeedGroups, ElemType, retVal);
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
anAngles, LinearAnglesCheck->isChecked(),
BasePointGrp->isChecked(), aBasePoint,
NeedGroups, ElemType, retVal);
}
@ -628,33 +628,33 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
switch (retVal) {
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("NO_ELEMENTS_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_ELEMENTS_SELECTED"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("SELECTED_PATH_IS_NOT_EDGE"));
tr("SMESH_ERROR"),
tr("SELECTED_PATH_IS_NOT_EDGE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("BAD_SHAPE_TYPE"));
tr("SMESH_ERROR"),
tr("BAD_SHAPE_TYPE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("EXTR_BAD_STARTING_NODE"));
tr("SMESH_ERROR"),
tr("EXTR_BAD_STARTING_NODE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("WRONG_ANGLES_NUMBER"));
tr("SMESH_ERROR"),
tr("WRONG_ANGLES_NUMBER"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
SUIT_MessageBox::warning(this,
tr("SMESH_ERROR"),
tr("CANT_GET_TANGENT"));
tr("SMESH_ERROR"),
tr("CANT_GET_TANGENT"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_OK:
break;
@ -700,10 +700,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -762,21 +762,21 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
long ind = aListId[ i ].toLong(&bOk);
if (bOk) {
const SMDS_MeshElement* e = aMesh->FindElement(ind);
if (e) {
// check also type of element
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
if (typeMatch)
newIndices.Add(e->GetID());
}
}
long ind = aListId[ i ].toLong(&bOk);
if (bOk) {
const SMDS_MeshElement* e = aMesh->FindElement(ind);
if (e) {
// check also type of element
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
if (typeMatch)
newIndices.Add(e->GetID());
}
}
}
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
aViewWindow->highlight( anIO, true, true );
}
}
else if (send == StartPointLineEdit &&
@ -785,27 +785,27 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
SMDS_Mesh* aMesh = 0;
if (aPathActor)
aMesh = aPathActor->GetObject()->GetMesh();
aMesh = aPathActor->GetObject()->GetMesh();
if (aMesh) {
//mySelectionMgr->clearSelected();
//mySelectionMgr->AddIObject(aPathActor->getIO());
//mySelectionMgr->clearSelected();
//mySelectionMgr->AddIObject(aPathActor->getIO());
SALOME_ListIO aList;
aList.Append(aPathActor->getIO());
mySelectionMgr->setSelectedObjects(aList, false);
bool bOk;
long ind = theNewText.toLong(&bOk);
if (bOk) {
const SMDS_MeshNode* n = aMesh->FindNode(ind);
if (n) {
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
bool bOk;
long ind = theNewText.toLong(&bOk);
if (bOk) {
const SMDS_MeshNode* n = aMesh->FindNode(ind);
if (n) {
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
TColStd_MapOfInteger newIndices;
newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( aPathActor->getIO(), true, true );
}
}
newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( aPathActor->getIO(), true, true );
}
}
}
}
}
@ -929,10 +929,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
TopoDS_Vertex aVertex;
if (!aGeomObj->_is_nil()) {
if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
XSpin->SetValue(aPnt.X());
YSpin->SetValue(aPnt.Y());
ZSpin->SetValue(aPnt.Z());
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
XSpin->SetValue(aPnt.X());
YSpin->SetValue(aPnt.Y());
ZSpin->SetValue(aPnt.Z());
}
return;
}
@ -997,19 +997,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (Elements1dRB->isChecked())
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (Elements2dRB->isChecked())
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
}
} else if (button == SelectPathMeshButton) {
myEditCurrentArgument = PathMeshLineEdit;
@ -1024,10 +1024,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
if (!myPath->_is_nil()) {
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
if (aPathActor) {
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SMESH::SetPickable(aPathActor);
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
SMESH::SetPickable(aPathActor);
}
}
}
@ -1172,21 +1172,21 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
QKeyEvent* ke = (QKeyEvent*)event;
if (object == AnglesList) {
if (ke->key() == Qt::Key_Delete)
OnAngleRemoved();
OnAngleRemoved();
}
}
else if (event->type() == QEvent::FocusIn) {
if (object == ElementsLineEdit) {
if (myEditCurrentArgument != ElementsLineEdit)
SetEditCurrentArgument(SelectElementsButton);
SetEditCurrentArgument(SelectElementsButton);
}
else if (object == StartPointLineEdit) {
if (myEditCurrentArgument != StartPointLineEdit)
SetEditCurrentArgument(SelectStartPointButton);
SetEditCurrentArgument(SelectStartPointButton);
}
else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
if (myEditCurrentArgument != XSpin)
SetEditCurrentArgument(SelectBasePointButton);
SetEditCurrentArgument(SelectBasePointButton);
}
}
return QDialog::eventFilter(object, event);
@ -1216,8 +1216,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
@ -1270,7 +1270,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
enableLinear = false;
anItem->text().toDouble(&enableLinear);
if( !enableLinear )
break;
break;
}
}
if( !enableLinear )

View File

@ -400,24 +400,24 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
{
GroupArguments->setTitle(tr("EXTRUSION_1D"));
if (!CheckBoxMesh->isChecked())
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
break;
}
case 1:
{
GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked())
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
break;
}
}
@ -509,8 +509,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
aParameters << SpinBox_Dz->text();
} else if ( RadioButton4->isChecked() ) {
gp_XYZ aNormale(SpinBox_Vx->GetValue(),
SpinBox_Vy->GetValue(),
SpinBox_Vz->GetValue());
SpinBox_Vy->GetValue(),
SpinBox_Vz->GetValue());
aNormale /= aNormale.Modulus();
@ -536,26 +536,26 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
}
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
}
else
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
}
else {
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
else
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
}
else
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
else
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
}
else
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
@ -611,10 +611,10 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -666,7 +666,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
myElementsId->length( myNbOkElements = newIndices.Extent() );
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myIO, true, true );
aViewWindow->highlight( myIO, true, true );
}
}
@ -744,7 +744,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
aNbElements = aMapIndex.Extent();
if (aNbElements < 1)
return;
return;
myElementsId = new SMESH::long_array;
myElementsId->length( aNbElements );
@ -802,20 +802,20 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
myEditCurrentArgument = (QWidget*)LineEditElements;
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
}
}
else if (send == SelectVectorButton){
@ -930,13 +930,13 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false);
@ -983,8 +983,8 @@ void SMESHGUI_ExtrusionDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -210,7 +210,7 @@ bool SMESHGUI_FilterTable::AdditionalWidget::IsValid (const bool theMsg) const
if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
if (theMsg)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SMESHGUI_INVALID_PARAMETERS"));
tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
}
@ -423,13 +423,13 @@ public:
~ComboDelegate();
QWidget* createEditor( QWidget*, const QStyleOptionViewItem&,
const QModelIndex& ) const;
const QModelIndex& ) const;
void setEditorData( QWidget*, const QModelIndex& ) const;
void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&,
const QModelIndex& ) const;
const QModelIndex& ) const;
private:
QTableWidget* myTable;
};
@ -445,8 +445,8 @@ SMESHGUI_FilterTable::ComboDelegate::~ComboDelegate()
}
QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index ) const
const QStyleOptionViewItem& option,
const QModelIndex& index ) const
{
QStringList l = index.data( Qt::UserRole ).toStringList();
if ( !l.isEmpty() ) {
@ -459,7 +459,7 @@ QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
}
void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
const QModelIndex& index ) const
const QModelIndex& index ) const
{
QString value = index.model()->data( index, Qt::DisplayRole ).toString();
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
@ -475,8 +475,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
}
void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
QAbstractItemModel* model,
const QModelIndex& index) const
QAbstractItemModel* model,
const QModelIndex& index) const
{
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
@ -484,8 +484,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
}
void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor,
const QStyleOptionViewItem& option,
const QModelIndex& index ) const
const QStyleOptionViewItem& option,
const QModelIndex& index ) const
{
editor->setGeometry( option.rect );
}
@ -597,8 +597,8 @@ bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const
void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
{
setEditTriggers( on ?
QAbstractItemView::NoEditTriggers :
QAbstractItemView::AllEditTriggers );
QAbstractItemView::NoEditTriggers :
QAbstractItemView::AllEditTriggers );
}
bool SMESHGUI_FilterTable::Table::isReadOnly() const
@ -1031,10 +1031,10 @@ void SMESHGUI_FilterTable::GetCriterion (const int theRow,
theCriterion.Threshold = (double)((ComboItem*)aTable->item(theRow, 2))->value();
else if ( aCriterionType != SMESH::FT_RangeOfIds &&
aCriterionType != SMESH::FT_BelongToGeom &&
aCriterionType != SMESH::FT_BelongToPlane &&
aCriterionType != SMESH::FT_BelongToCylinder &&
aCriterionType != SMESH::FT_BelongToGenSurface &&
aCriterionType != SMESH::FT_LyingOnGeom)
aCriterionType != SMESH::FT_BelongToPlane &&
aCriterionType != SMESH::FT_BelongToCylinder &&
aCriterionType != SMESH::FT_BelongToGenSurface &&
aCriterionType != SMESH::FT_LyingOnGeom)
{
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
@ -1462,9 +1462,9 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
aText.toDouble(&isOk);
aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
if (!aTable->isEditable(row, 1))
aTable->setEditable(true, row, 1);
aTable->setEditable(true, row, 1);
if (!aTable->isEditable(row, 2))
aTable->setEditable(true, row, 2);
aTable->setEditable(true, row, 2);
}
}
@ -1781,7 +1781,7 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
}
static int aLenCr = qAbs( aMaxLenCr -
aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
QString aCrStr;
aCrStr.fill(' ', aLenCr);
@ -1811,10 +1811,10 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
connect(aTable, SIGNAL(cellChanged(int, int)),
this, SLOT(onCriterionChanged(int, int)));
this, SLOT(onCriterionChanged(int, int)));
connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
this, SLOT(onCurrentChanged(int, int)));
this, SLOT(onCurrentChanged(int, int)));
return aTable;
}
@ -1844,15 +1844,15 @@ void SMESHGUI_FilterTable::SetEditable (const bool isEditable)
Table* aTable = anIter.value();
for (int i = 0, n = aTable->rowCount(); i < n; i++)
for (int j = 0, m = aTable->columnCount(); j < m; j++)
{
QTableWidgetItem* anItem = aTable->item(i, j);
if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
Qt::ItemFlags f = anItem->flags();
if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
else f = f | Qt::ItemIsUserCheckable;
anItem->setFlags( f );
}
}
{
QTableWidgetItem* anItem = aTable->item(i, j);
if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
Qt::ItemFlags f = anItem->flags();
if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
else f = f | Qt::ItemIsUserCheckable;
anItem->setFlags( f );
}
}
//end of IPAL19974
if (isEditable)
@ -2037,8 +2037,8 @@ void SMESHGUI_FilterTable::SetID( const int theRow,
// Purpose : Get text and internal value from cell of ID value
//=======================================================================
bool SMESHGUI_FilterTable::GetID( const int theRow,
QString& theText,
const int theEntityType )
QString& theText,
const int theEntityType )
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
QTableWidgetItem* anItem = aTable->item( theRow, 5 );
@ -2335,8 +2335,8 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes)
mySetInViewer->setChecked(true);
mySourceGrp->button(myApplyToState.contains(theTypes.first()) ?
myApplyToState[ theTypes.first() ] :
Selection)->setChecked(true);
myApplyToState[ theTypes.first() ] :
Selection)->setChecked(true);
}
//=======================================================================
@ -2410,10 +2410,10 @@ void SMESHGUI_FilterDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -2568,7 +2568,7 @@ bool SMESHGUI_FilterDlg::isValid() const
SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
if (aList.size() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("BAD_SHAPE_NAME").arg(aName));
tr("BAD_SHAPE_NAME").arg(aName));
return false;
}
@ -2584,26 +2584,26 @@ bool SMESHGUI_FilterDlg::isValid() const
aFace.IsNull() ||
aFace.ShapeType() != TopAbs_FACE) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SHAPE_IS_NOT_A_FACE").arg(aName));
tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
if (aSurf.IsNull()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SHAPE_IS_NOT_A_FACE").arg(aName));
tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
return false;
}
if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
return false;
}
}

View File

@ -123,12 +123,12 @@ public:
const int = -1 );
void SetID( const int,
const QString&,
const int = -1 );
const QString&,
const int = -1 );
bool GetID( const int,
QString&,
const int = -1 );
QString&,
const int = -1 );
void Update();

View File

@ -226,7 +226,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
connect(myListBox, SIGNAL(itemSelectionChanged()),
this, SLOT(onFilterChanged()));
this, SLOT(onFilterChanged()));
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
@ -423,7 +423,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
tr("LIBRARY_IS_NOT_LOADED"));
tr("LIBRARY_IS_NOT_LOADED"));
return false;
}
@ -437,11 +437,11 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
} else if (myMode == EDIT || myMode == ADD_TO) {
SMESH::Filter_var aFilter = createFilter();
if (!myListBox->selectedItems().empty() &&
!myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter.in())) {
!myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter.in())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_EDITING"));
tr("ERROR_OF_EDITING"));
aResult = false;
}
else
@ -457,7 +457,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
delete aFileName;
} else if (myMode != COPY_FROM) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_SAVING"));
tr("ERROR_OF_SAVING"));
} else {
}
@ -507,10 +507,10 @@ void SMESHGUI_FilterLibraryDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -674,7 +674,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary()
if (myLibrary->_is_nil()) {
if (myMode == COPY_FROM) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_LOAD"));
tr("ERROR_LOAD"));
return;
} else {
myLibrary = aFilterMgr->CreateLibrary();
@ -730,7 +730,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
if (aCurrName.isEmpty()) {
if (theMess)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("EMPTY_FILTER_NAME"));
tr("EMPTY_FILTER_NAME"));
return false;
}
@ -739,7 +739,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
if (theMess)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("ERROR_FILTER_NAME"));
tr("ERROR_FILTER_NAME"));
return false;
}
}
@ -787,7 +787,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly)
if (!isWritable) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
tr("NO_PERMISSION"));
tr("NO_PERMISSION"));
return false;
}
@ -831,8 +831,8 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged()
SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter);
myName->text().toLatin1().constData(),
aFilter);
}
// Fill table with filter parameters
@ -938,8 +938,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed()
SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter);
myName->text().toLatin1().constData(),
aFilter);
}
myTable->Clear(myTable->GetType());
@ -955,7 +955,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
{
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
tr("LIBRARY_IS_NOT_LOADED"));
tr("LIBRARY_IS_NOT_LOADED"));
return;
}
@ -979,7 +979,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
if (!aResult) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_ADDING"));
tr("ERROR_OF_ADDING"));
}
updateList();
@ -989,7 +989,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
if (theName != aName)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
}
//=======================================================================
@ -1089,7 +1089,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
{
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
tr("LIBRARY_IS_NOT_LOADED"));
tr("LIBRARY_IS_NOT_LOADED"));
return;
}
@ -1097,7 +1097,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_DELETING"));
tr("ERROR_OF_DELETING"));
} else {
myCurrFilterName = "";
myCurrFilter = -1;
@ -1188,8 +1188,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation()
{
SMESH::Filter_var aFilter = createFilter(myTable->GetType());
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter);
myName->text().toLatin1().constData(),
aFilter);
}
}
}

View File

@ -64,7 +64,7 @@ namespace SMESH
SMESH::SMESH_subMesh_var aSubmesh =
SObjectToInterface<SMESH::SMESH_subMesh>( theMeshOrSubmesh );
if ( !aSubmesh->_is_nil() )
return aSubmesh->GetSubShape();
return aSubmesh->GetSubShape();
}
}
return GEOM::GEOM_Object::_nil();
@ -89,7 +89,7 @@ namespace SMESH
SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
} else {
SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
}

View File

@ -103,7 +103,7 @@
// purpose :
//=================================================================================
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
SMESH::SMESH_Mesh_ptr theMesh )
SMESH::SMESH_Mesh_ptr theMesh )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
@ -129,7 +129,7 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
// purpose :
//=================================================================================
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
SMESH::SMESH_GroupBase_ptr theGroup,
SMESH::SMESH_GroupBase_ptr theGroup,
const bool theIsConvert )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
@ -330,7 +330,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
myColorBtn = new QtxColorButton(aColorBox);
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
myColorBtn->sizePolicy().verticalPolicy() );
myColorBtn->sizePolicy().verticalPolicy() );
aColorBoxLayout->addWidget(aColorLab);
aColorBoxLayout->addWidget(myColorBtn);
@ -693,36 +693,36 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
switch (theMode) {
case 0:
if (myActor)
myActor->SetPointRepresentation(true);
else
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
break;
myActor->SetPointRepresentation(true);
else
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
break;
case 1:
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
break;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
break;
case 2:
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
break;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
break;
default:
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(VolumeSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(VolumeSelection);
}
} else {
if (theMode == 4)
mySelectionMgr->installFilter(mySubMeshFilter);
mySelectionMgr->installFilter(mySubMeshFilter);
else if (theMode == 5)
mySelectionMgr->installFilter(myGroupFilter);
mySelectionMgr->installFilter(myGroupFilter);
else if (theMode == 6)
mySelectionMgr->installFilter(myMeshFilter);
mySelectionMgr->installFilter(myMeshFilter);
else if (theMode == 7)
mySelectionMgr->installFilter(myGeomFilter);
mySelectionMgr->installFilter(myGeomFilter);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
}
mySelectionMode = theMode;
}
@ -752,7 +752,7 @@ bool SMESHGUI_GroupDlg::onApply()
if (myMesh->_is_nil())
return false;
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
// nullify pointer, because object become dead
// nullify pointer, because object become dead
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
}
}
@ -773,7 +773,7 @@ bool SMESHGUI_GroupDlg::onApply()
int i, k = myElements->count();
anIdList->length(k);
for (i = 0; i < k; i++) {
anIdList[i] = myElements->item(i)->text().toInt();
anIdList[i] = myElements->item(i)->text().toInt();
}
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
@ -800,46 +800,46 @@ bool SMESHGUI_GroupDlg::onApply()
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
anActor->setName(myName->text().toLatin1().data());
switch ( myTypeId ) {
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
case 2:
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
}
anActor->setName(myName->text().toLatin1().data());
switch ( myTypeId ) {
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
case 2:
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
}
}
QList<int> aAddList;
int i, total = myElements->count();
for (i = 0; i < total; i++) {
int anId = myElements->item(i)->text().toInt();
int idx = myIdList.indexOf(anId);
if ( idx == -1 )
aAddList.append(anId);
else
myIdList.removeAt(idx);
int anId = myElements->item(i)->text().toInt();
int idx = myIdList.indexOf(anId);
if ( idx == -1 )
aAddList.append(anId);
else
myIdList.removeAt(idx);
}
if (!aAddList.empty()) {
SMESH::long_array_var anIdList = new SMESH::long_array;
int added = aAddList.count();
anIdList->length(added);
for (i = 0; i < added; i++)
anIdList[i] = aAddList[i];
myGroup->Add(anIdList.inout());
SMESH::long_array_var anIdList = new SMESH::long_array;
int added = aAddList.count();
anIdList->length(added);
for (i = 0; i < added; i++)
anIdList[i] = aAddList[i];
myGroup->Add(anIdList.inout());
}
if (!myIdList.empty()) {
SMESH::long_array_var anIdList = new SMESH::long_array;
int removed = myIdList.count();
anIdList->length(removed);
for (i = 0; i < removed; i++)
anIdList[i] = myIdList[i];
myGroup->Remove(anIdList.inout());
SMESH::long_array_var anIdList = new SMESH::long_array;
int removed = myIdList.count();
anIdList->length(removed);
for (i = 0; i < removed; i++)
anIdList[i] = myIdList[i];
myGroup->Remove(anIdList.inout());
}
/* init for next operation */
myIdList.clear();
for (i = 0; i < total; i++) {
myIdList.append(myElements->item(i)->text().toInt());
myIdList.append(myElements->item(i)->text().toInt());
}
}
@ -863,12 +863,12 @@ bool SMESHGUI_GroupDlg::onApply()
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
GEOM::GEOM_IGroupOperations_var aGroupOp =
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
if (myGeomObjects->length() == 1) {
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
myName->text().toLatin1().data(),
myGeomObjects[0]);
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
myName->text().toLatin1().data(),
myGeomObjects[0]);
}
else {
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
@ -910,12 +910,12 @@ bool SMESHGUI_GroupDlg::onApply()
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
aNewGeomGroupName.toLatin1().data(), aMeshShape);
aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
myName->text().toLatin1().data(),
aGroupVar);
myName->text().toLatin1().data(),
aGroupVar);
}
SALOMEDS::Color aColor = getGroupColor();
@ -938,13 +938,13 @@ bool SMESHGUI_GroupDlg::onApply()
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
anActor->setName(myName->text().toLatin1().data());
switch ( myTypeId ) {
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
case 2:
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
}
anActor->setName(myName->text().toLatin1().data());
switch ( myTypeId ) {
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
case 2:
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
}
}
}
@ -1026,7 +1026,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
myGeomObjects->length(0);
if (myGeomGroupBtn->isChecked())
myGeomGroupBtn->setChecked(false);
myGeomGroupBtn->setChecked(false);
if (!myCreate)
myName->setText( "" );
@ -1045,16 +1045,16 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
Handle(SALOME_InteractiveObject) IO = aList.First();
if (myCreate) {
restoreShowEntityMode();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
restoreShowEntityMode();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
setShowEntityMode();
updateGeomPopup();
if (myMesh->_is_nil())
{
{
updateButtons();
myIsBusy = false;
return;
}
myIsBusy = false;
return;
}
myGroup = SMESH::SMESH_Group::_nil();
// NPAL19389: create a group with a selection in another group
@ -1075,15 +1075,15 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
else {
SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
if (aGroup->_is_nil())
{
myIsBusy = false;
{
myIsBusy = false;
return;
}
}
myIsBusy = false;
myCurrentLineEdit = 0;
myGroup = SMESH::SMESH_Group::_nil();
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
myGroup = SMESH::SMESH_Group::_nil();
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
init(aGroup);
myIsBusy = true;
@ -1097,13 +1097,13 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
if (myGrpTypeId == 0)
{
if (myTypeId == -1)
onTypeChanged(0);
else
{
myElements->clear();
setSelectionMode(myTypeId);
}
if (myTypeId == -1)
onTypeChanged(0);
else
{
myElements->clear();
setSelectionMode(myTypeId);
}
}
myIsBusy = false;
@ -1119,10 +1119,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
if (aNbSel == 0 || !aMeshSO)
{
myGeomObjects->length(0);
updateButtons();
myIsBusy = false;
return;
myGeomObjects->length(0);
updateButtons();
myIsBusy = false;
return;
}
myGeomObjects->length(aNbSel);
@ -1181,10 +1181,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
myGeomObjects->length(i);
if ( i == 0 )
{
myIsBusy = false;
return;
}
{
myIsBusy = false;
return;
}
aNbSel = i;
}
@ -1258,26 +1258,26 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
QString aListStr = "";
int aNbItems = 0;
if (myTypeId == 0) {
aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
} else {
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
}
if (aNbItems > 0) {
QListWidgetItem* anItem;
QList<QListWidgetItem*> listItemsToSel;
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
QListWidgetItem* anItem;
QList<QListWidgetItem*> listItemsToSel;
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
}
}
}
@ -1413,8 +1413,8 @@ void SMESHGUI_GroupDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
@ -1511,18 +1511,18 @@ void SMESHGUI_GroupDlg::onAdd()
if (aNbItems > 0) {
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(*it);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(*it);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
@ -1542,8 +1542,8 @@ void SMESHGUI_GroupDlg::onAdd()
SMESH::SMESH_subMesh_var aSubMesh =
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
// check if mesh is the same
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
// check if mesh is the same
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
int k = anElements->length();
@ -1553,21 +1553,21 @@ void SMESHGUI_GroupDlg::onAdd()
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
@ -1589,32 +1589,32 @@ void SMESHGUI_GroupDlg::onAdd()
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
if (!aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
}
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
foreach(anItem, listItemsToSel) anItem->setSelected(true);
myElements->blockSignals(blocked);
onListSelectionChanged();
listItemsToSel.clear();
}
}
}
mySelectGroup->setChecked(false);
@ -1652,19 +1652,19 @@ void SMESHGUI_GroupDlg::onAdd()
int k = anElements->length();
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
QString aText = QString::number(anElements[i]);
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
else {
foreach(anItem, found)
if (!anItem->isSelected())
listItemsToSel.push_back(anItem);
}
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
@ -1717,42 +1717,42 @@ void SMESHGUI_GroupDlg::onRemove()
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
// check if mesh is the same
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
if (aType == SMESH::NODE) {
try {
SMESH::long_array_var anElements = aSubMesh->GetNodesId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
}
}
else {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
}
}
}
}
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
// check if mesh is the same
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
if (aType == SMESH::NODE) {
try {
SMESH::long_array_var anElements = aSubMesh->GetNodesId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
}
}
else {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
}
}
}
}
}
}
else if (myCurrentLineEdit == myGroupLine) {
@ -1763,20 +1763,20 @@ void SMESHGUI_GroupDlg::onRemove()
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
if (aRes && !aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
}
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
if (aRes && !aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, found) delete anItem;
}
}
}
}
}
}
@ -1804,7 +1804,7 @@ void SMESHGUI_GroupDlg::onSort()
int id = myElements->item(i)->text().toInt();
anArray[i] = id;
if (myElements->item(i)->isSelected())
aSelected.append(id);
aSelected.append(id);
}
// sort & update list
std::sort(anArray.begin(), anArray.end());
@ -1816,7 +1816,7 @@ void SMESHGUI_GroupDlg::onSort()
anItem = new QListWidgetItem(QString::number(anArray[i]));
myElements->addItem(anItem);
if (aSelected.contains(anArray[i]))
listItemsToSel.push_back(anItem);
listItemsToSel.push_back(anItem);
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
@ -1875,10 +1875,10 @@ void SMESHGUI_GroupDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg(app->resourceMgr()->stringValue( "ExternalBrowser",
platform)).
arg(myHelpFileName));
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg(app->resourceMgr()->stringValue( "ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -1979,7 +1979,7 @@ void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn)
myCurrentLineEdit = myGeomGroupLine;
QAction* a = myGeomPopup->exec( QCursor::pos() );
if (!a || myActions[a] == DIRECT_GEOM_INDEX)
setSelectionMode(7);
setSelectionMode(7);
}
else if (!isBtnOn)
{
@ -1999,17 +1999,17 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a )
{
mySelectionMode = -1;
if ( !myShapeByMeshOp ) {
myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
}
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
if ( !myMesh->_is_nil() ) {
myIsBusy = true;
myIsBusy = true;
hide(); // stop processing selection
myIsBusy = false;
myIsBusy = false;
myShapeByMeshOp->setModule( mySMESHGUI );
myShapeByMeshOp->setStudy( 0 ); // it's really necessary
myShapeByMeshOp->SetMesh( myMesh );
@ -2036,12 +2036,12 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
QString ID = aGeomVar->GetStudyEntry();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
SALOME_ListIO anIOList;
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
anIOList.Append( anIO );
mySelectionMgr->setSelectedObjects( anIOList, false );
onObjectSelectionChanged();
SALOME_ListIO anIOList;
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
anIOList.Append( anIO );
mySelectionMgr->setSelectedObjects( anIOList, false );
onObjectSelectionChanged();
}
}
}
@ -2069,8 +2069,8 @@ void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op)
void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor )
{
QColor aQColor( (int)( theColor.R * 255.0 ),
(int)( theColor.G * 255.0 ),
(int)( theColor.B * 255.0 ) );
(int)( theColor.G * 255.0 ),
(int)( theColor.B * 255.0 ) );
setGroupQColor( aQColor );
}
@ -2141,8 +2141,8 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor()
SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
aQColor.setRgb( (int)( aColor.R * 255.0 ),
(int)( aColor.G * 255.0 ),
(int)( aColor.B * 255.0 ) );
(int)( aColor.G * 255.0 ),
(int)( aColor.B * 255.0 ) );
}

View File

@ -131,7 +131,7 @@ QWidget* SMESHGUI_GroupOpDlg::createMainFrame( QWidget* theParent )
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
myColorBtn = new QtxColorButton(aColorBox);
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
myColorBtn->sizePolicy().verticalPolicy() );
myColorBtn->sizePolicy().verticalPolicy() );
aColorBoxLayout->addWidget(aColorLab);
aColorBoxLayout->addWidget(myColorBtn);
@ -242,7 +242,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
if ( theListGrp.isEmpty() )
{
SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"),
tr("INCORRECT_ARGUMENTS") );
tr("INCORRECT_ARGUMENTS") );
return false;
}
@ -289,14 +289,14 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
if ( aMeshId == -1 )
{
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
tr("DIFF_MESHES"));
tr("DIFF_MESHES"));
return false;
}
if ( aGrpType == -1 )
{
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
tr("DIFF_TYPES"));
tr("DIFF_TYPES"));
return false;
}
@ -343,10 +343,10 @@ void SMESHGUI_GroupOpDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -610,7 +610,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
tr("SMESH_OPERATION_FAILED"));
tr("SMESH_OPERATION_FAILED"));
return false;
}
}
@ -712,7 +712,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
tr("SMESH_OPERATION_FAILED"));
tr("SMESH_OPERATION_FAILED"));
return false;
}
}
@ -878,7 +878,7 @@ bool SMESHGUI_CutGroupsDlg::onApply()
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
tr("SMESH_OPERATION_FAILED"));
tr("SMESH_OPERATION_FAILED"));
return false;
}
}
@ -1029,7 +1029,7 @@ bool SMESHGUI_DimGroupDlg::onApply()
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
tr("SMESH_OPERATION_FAILED"));
tr("SMESH_OPERATION_FAILED"));
return false;
}
}

View File

@ -35,13 +35,13 @@
namespace SMESH
{
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
SMESH::ElementType theType,
const QString& theGroupName )
SMESH::ElementType theType,
const QString& theGroupName )
{
SMESH::SMESH_Group_var aGroup;
try {
if ( !theMesh->_is_nil() )
aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
}
catch( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex );

View File

@ -40,8 +40,8 @@ namespace SMESH
{
SMESHGUI_EXPORT
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
SMESH::ElementType,
const QString& );
SMESH::ElementType,
const QString& );
}
#endif // SMESHGUI_GROUPUTILS_H

View File

@ -68,7 +68,7 @@ void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hyp
}
void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
const QString& theHypName,
const QString& theHypName,
QWidget* parent, QObject* obj, const QString& slot )
{
MESSAGE( "Creation of hypothesis with initial params" );
@ -77,8 +77,8 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init
}
void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
{
MESSAGE( "Creation of hypothesis" );
@ -97,8 +97,8 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
}
void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
{
if( CORBA::is_nil( theHypothesis ) )
return;
@ -111,8 +111,8 @@ void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHyp
}
void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h,
const QString& theHypName,
QWidget* theParent,
const QString& theHypName,
QWidget* theParent,
QObject* obj, const QString& slot )
{
myHypName = theHypName;
@ -173,7 +173,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
case QVariant::Int:
{
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toInt() );
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
@ -183,7 +183,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
case QVariant::Double:
{
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName );
sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toDouble() );
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
@ -275,13 +275,13 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
if( listSOmesh.size() > 0 )
for( int i = 0; i < listSOmesh.size(); i++ )
{
_PTR(SObject) submSO = listSOmesh[i];
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
if( !aSubMesh->_is_nil() )
aMesh = aSubMesh->GetFather();
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
_PTR(SObject) submSO = listSOmesh[i];
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
if( !aSubMesh->_is_nil() )
aMesh = aSubMesh->GetFather();
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
}
}
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
@ -630,10 +630,10 @@ void SMESHGUI_HypothesisDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -648,18 +648,18 @@ void SMESHGUI_HypothesisDlg::setType( const QString& t )
}
HypothesisData::HypothesisData( const QString& theTypeName,
const QString& thePluginName,
const QString& theServerLibName,
const QString& theClientLibName,
const QString& theLabel,
const QString& theIconId,
const QList<int>& theDim,
const bool theIsAux,
const QStringList& theNeededHypos,
const QStringList& theOptionalHypos,
const QStringList& theInputTypes,
const QStringList& theOutputTypes,
const bool theIsNeedGeometry,
const QString& thePluginName,
const QString& theServerLibName,
const QString& theClientLibName,
const QString& theLabel,
const QString& theIconId,
const QList<int>& theDim,
const bool theIsAux,
const QStringList& theNeededHypos,
const QStringList& theOptionalHypos,
const QStringList& theInputTypes,
const QStringList& theOutputTypes,
const bool theIsNeedGeometry,
const bool supportSub)
: TypeName( theTypeName ),
PluginName( thePluginName ),
@ -685,8 +685,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName )
}
HypothesesSet::HypothesesSet( const QString& theSetName,
const QStringList& theHypoList,
const QStringList& theAlgoList )
const QStringList& theHypoList,
const QStringList& theAlgoList )
: myHypoSetName( theSetName ),
myHypoList( theHypoList ),
myAlgoList( theAlgoList ),

View File

@ -52,7 +52,7 @@ public:
virtual ~SMESHGUI_GenericHypothesisCreator();
void create( SMESH::SMESH_Hypothesis_ptr,
const QString&, QWidget*, QObject*, const QString& );
const QString&, QWidget*, QObject*, const QString& );
void create( bool, const QString&, QWidget*, QObject*, const QString& );
void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
@ -105,7 +105,7 @@ protected:
static QString stdParamValues( const ListOfStdParams& );
virtual void attuneStdWidget( QWidget*, const int ) const;
virtual QWidget* getCustomWidget( const StdParam&,
QWidget*, const int ) const;
QWidget*, const int ) const;
virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
virtual void valueChanged( QWidget* );
virtual QString caption() const;
@ -166,7 +166,7 @@ public:
const QList<int>&, const bool,
const QStringList&, const QStringList&,
const QStringList&, const QStringList&,
const bool=true, const bool supportSub=false );
const bool=true, const bool supportSub=false );
QString TypeName; //!< hypothesis type name
QString PluginName; //!< plugin name

View File

@ -89,39 +89,39 @@ namespace SMESH
QList<HypothesesSet*> myListOfHypothesesSets;
void processHypothesisStatus(const int theHypStatus,
SMESH::SMESH_Hypothesis_ptr theHyp,
const bool theIsAddition)
SMESH::SMESH_Hypothesis_ptr theHyp,
const bool theIsAddition)
{
if (theHypStatus > SMESH::HYP_OK) {
// get Hyp name
QString aHypName ("NULL Hypothesis");
if (!CORBA::is_nil(theHyp)) {
_PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
if (Shyp)
// name in study
aHypName = Shyp->GetName().c_str();
else
// label in xml file
aHypName = GetHypothesisData(theHyp->GetName())->Label;
_PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
if (Shyp)
// name in study
aHypName = Shyp->GetName().c_str();
else
// label in xml file
aHypName = GetHypothesisData(theHyp->GetName())->Label;
}
// message
bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL);
QString aMsg;
if (theIsAddition)
aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
else
aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN");
aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN");
aMsg = QObject::tr(aMsg.toLatin1().data()).arg(aHypName) +
QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501
aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
SUIT_MessageBox::warning(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
aMsg);
QObject::tr("SMESH_WRN_WARNING"),
aMsg);
}
}
@ -138,73 +138,73 @@ namespace SMESH
QString HypsXml;
char* cenv = getenv("SMESH_MeshersList");
if (cenv)
HypsXml.sprintf("%s", cenv);
HypsXml.sprintf("%s", cenv);
QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
if (HypsXmlList.count() == 0) {
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("MESHERS_FILE_NO_VARIABLE"));
return;
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("MESHERS_FILE_NO_VARIABLE"));
return;
}
// loop on files in HypsXml
QString aNoAccessFiles;
for (int i = 0; i < HypsXmlList.count(); i++) {
QString HypsXml = HypsXmlList[ i ];
QString HypsXml = HypsXmlList[ i ];
// Find full path to the resource XML file
QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
// Find full path to the resource XML file
QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
if ( xmlFile.isEmpty() ) // try PLUGIN resources
xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
QFile file (xmlFile);
if (file.exists() && file.open(QIODevice::ReadOnly)) {
file.close();
QFile file (xmlFile);
if (file.exists() && file.open(QIODevice::ReadOnly)) {
file.close();
SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
ASSERT(aXmlHandler);
SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
ASSERT(aXmlHandler);
QXmlInputSource source (&file);
QXmlSimpleReader reader;
reader.setContentHandler(aXmlHandler);
reader.setErrorHandler(aXmlHandler);
bool ok = reader.parse(source);
file.close();
if (ok) {
myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
QXmlInputSource source (&file);
QXmlSimpleReader reader;
reader.setContentHandler(aXmlHandler);
reader.setErrorHandler(aXmlHandler);
bool ok = reader.parse(source);
file.close();
if (ok) {
myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
for ( it = aXmlHandler->myListOfHypothesesSets.begin();
it != aXmlHandler->myListOfHypothesesSets.end();
++it ) {
myListOfHypothesesSets.insert( pos, *it );
}
}
else {
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("INF_PARSE_ERROR"),
QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
}
QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
for ( it = aXmlHandler->myListOfHypothesesSets.begin();
it != aXmlHandler->myListOfHypothesesSets.end();
++it ) {
myListOfHypothesesSets.insert( pos, *it );
}
}
else {
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("INF_PARSE_ERROR"),
QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
}
delete aXmlHandler;
}
else {
if (aNoAccessFiles.isEmpty())
aNoAccessFiles = xmlFile;
else
aNoAccessFiles += ", " + xmlFile;
}
}
else {
if (aNoAccessFiles.isEmpty())
aNoAccessFiles = xmlFile;
else
aNoAccessFiles += ", " + xmlFile;
}
} // end loop
if (!aNoAccessFiles.isEmpty()) {
QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
wc.suspend();
SUIT_MessageBox::warning(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
aMess);
wc.resume();
QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
wc.suspend();
SUIT_MessageBox::warning(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
aMess);
wc.resume();
}
}
}
@ -226,13 +226,13 @@ namespace SMESH
for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
HypothesisData* aData = anIter.value();
if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
if (checkGeometry) {
if (aData->IsNeedGeometry == isNeedGeometry)
aHypList.append(anIter.key());
}
else {
aHypList.append(anIter.key());
}
if (checkGeometry) {
if (aData->IsNeedGeometry == isNeedGeometry)
aHypList.append(anIter.key());
}
else {
aHypList.append(anIter.key());
}
}
}
return aHypList;
@ -248,11 +248,11 @@ namespace SMESH
QList<HypothesesSet*>::iterator hypoSet;
for ( hypoSet = myListOfHypothesesSets.begin();
hypoSet != myListOfHypothesesSets.end();
++hypoSet ) {
hypoSet != myListOfHypothesesSets.end();
++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
if ( aSet && aSet->count( true ) ) {
aSetNameList.append( aSet->name() );
aSetNameList.append( aSet->name() );
}
}
@ -263,11 +263,11 @@ namespace SMESH
{
QList<HypothesesSet*>::iterator hypoSet;
for ( hypoSet = myListOfHypothesesSets.begin();
hypoSet != myListOfHypothesesSets.end();
++hypoSet ) {
hypoSet != myListOfHypothesesSets.end();
++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
if ( aSet && aSet->name() == theSetName )
return aSet;
return aSet;
}
return 0;
}
@ -347,48 +347,48 @@ namespace SMESH
// 3. Load Client Plugin Library
try {
// load plugin library
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
if (!libHandle) {
// report any error, if occured
if ( MYDEBUG ) {
// load plugin library
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
if (!libHandle) {
// report any error, if occured
if ( MYDEBUG ) {
#ifdef WIN32
const char* anError = "Can't load client meshers plugin library";
const char* anError = "Can't load client meshers plugin library";
#else
const char* anError = dlerror();
const char* anError = dlerror();
#endif
MESSAGE(anError);
}
}
else {
// get method, returning hypothesis creator
if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
( const QString& );
GetHypothesisCreator procHandle =
(GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
if (!procHandle) {
if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
UnLoadLib(libHandle);
}
else {
// get hypothesis creator
if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
aCreator = procHandle( aHypType );
if (!aCreator) {
if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
}
else {
// map hypothesis creator to a hypothesis name
MESSAGE(anError);
}
}
else {
// get method, returning hypothesis creator
if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
( const QString& );
GetHypothesisCreator procHandle =
(GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
if (!procHandle) {
if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
UnLoadLib(libHandle);
}
else {
// get hypothesis creator
if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
aCreator = procHandle( aHypType );
if (!aCreator) {
if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
}
else {
// map hypothesis creator to a hypothesis name
// BUG 0020378
//myHypCreatorMap[aHypType] = aCreator;
}
}
}
//myHypCreatorMap[aHypType] = aCreator;
}
}
}
}
catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
SalomeApp_Tools::QtCatchCorbaException(S_ex);
}
}
@ -397,25 +397,25 @@ namespace SMESH
SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType,
const QString& aHypName,
const bool isAlgo)
const QString& aHypName,
const bool isAlgo)
{
if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
" with name " << aHypName.toLatin1().data());
" with name " << aHypName.toLatin1().data());
HypothesisData* aHypData = GetHypothesisData(aHypType);
QString aServLib = aHypData->ServerLibName;
try {
SMESH::SMESH_Hypothesis_var aHypothesis;
aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
aServLib.toLatin1().data());
aServLib.toLatin1().data());
if (!aHypothesis->_is_nil()) {
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
if (aHypSObject) {
if (!aHypName.isEmpty())
SMESH::SetName(aHypSObject, aHypName);
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
return aHypothesis._retn();
}
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
if (aHypSObject) {
if (!aHypName.isEmpty())
SMESH::SetName(aHypSObject, aHypName);
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
return aHypothesis._retn();
}
}
} catch (const SALOME::SALOME_Exception & S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
@ -435,23 +435,23 @@ namespace SMESH
_PTR(SObject) SM = SMESH::FindSObject(aMesh);
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM);
try {
res = aMesh->AddHypothesis(aShapeObject, aHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) aSH = SMESH::FindSObject(aHyp);
if (SM && aSH) {
SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
}
}
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus(res, aHyp, true);
wc.resume();
}
res = aMesh->AddHypothesis(aShapeObject, aHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) aSH = SMESH::FindSObject(aHyp);
if (SM && aSH) {
SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
}
}
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus(res, aHyp, true);
wc.resume();
}
}
catch(const SALOME::SALOME_Exception& S_ex) {
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
}
}
return res < SMESH::HYP_UNKNOWN_FATAL;
@ -466,33 +466,33 @@ namespace SMESH
if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
try {
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
_PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
res = aMesh->AddHypothesis(aShapeObject, aHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
_PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
res = aMesh->AddHypothesis(aShapeObject, aHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
if (meshSO)
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
}
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus(res, aHyp, true);
wc.resume();
}
}
else {
SCRUTE(aHyp->_is_nil());
SCRUTE(aMesh->_is_nil());
SCRUTE(!SsubM);
SCRUTE(aShapeObject->_is_nil());
}
}
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus(res, aHyp, true);
wc.resume();
}
}
else {
SCRUTE(aHyp->_is_nil());
SCRUTE(aMesh->_is_nil());
SCRUTE(!SsubM);
SCRUTE(aShapeObject->_is_nil());
}
}
catch(const SALOME::SALOME_Exception& S_ex) {
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
}
}
else {
@ -511,28 +511,28 @@ namespace SMESH
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
if( aHypObj )
{
_PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
_PTR(SObject) aRealHypo;
if( aHypObj->ReferencedObject( aRealHypo ) )
{
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
}
else
{
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
for( int i = 0; i < meshList.size(); i++ )
RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
}
}
{
_PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
_PTR(SObject) aRealHypo;
if( aHypObj->ReferencedObject( aRealHypo ) )
{
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
}
else
{
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
for( int i = 0; i < meshList.size(); i++ )
RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
}
}
}
catch(const SALOME::SALOME_Exception& S_ex)
{
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
}
return res < SMESH::HYP_UNKNOWN_FATAL;
}
@ -566,7 +566,7 @@ namespace SMESH
}
else if(!aMesh->HasShapeToMesh()){
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
if (res < SMESH::HYP_UNKNOWN_FATAL) {
if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
if (meshSO)
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
@ -579,9 +579,9 @@ namespace SMESH
}
}
} catch(const SALOME::SALOME_Exception& S_ex) {
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
res = SMESH::HYP_UNKNOWN_FATAL;
}
}
return res < SMESH::HYP_UNKNOWN_FATAL;
@ -596,25 +596,25 @@ namespace SMESH
if (!AlgoOrHyp->_is_nil()) {
_PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
if (SO_Hypothesis) {
SObjectList listSO =
SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
SObjectList listSO =
SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
for (unsigned int i = 0; i < listSO.size(); i++) {
_PTR(SObject) SO = listSO[i];
if (SO) {
_PTR(SObject) aFather = SO->GetFather();
if (aFather) {
_PTR(SObject) SOfatherFather = aFather->GetFather();
if (SOfatherFather) {
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
index++;
listSOmesh.resize(index);
listSOmesh[index - 1] = SOfatherFather;
}
}
}
}
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
for (unsigned int i = 0; i < listSO.size(); i++) {
_PTR(SObject) SO = listSO[i];
if (SO) {
_PTR(SObject) aFather = SO->GetFather();
if (aFather) {
_PTR(SObject) SOfatherFather = aFather->GetFather();
if (SOfatherFather) {
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
index++;
listSOmesh.resize(index);
listSOmesh[index - 1] = SOfatherFather;
}
}
}
}
}
}
if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed");

View File

@ -65,7 +65,7 @@ namespace SMESH
QStringList GetAvailableHypotheses( const bool,
const int = -1,
const bool = false,
const bool = true);
const bool = true);
SMESHGUI_EXPORT
QStringList GetHypothesesSets();
@ -77,12 +77,12 @@ namespace SMESH
SMESHGUI_EXPORT
bool IsAvailableHypothesis( const HypothesisData*,
const QString&,
bool& );
const QString&,
bool& );
SMESHGUI_EXPORT
bool IsCompatibleAlgorithm( const HypothesisData*,
const HypothesisData* );
const HypothesisData* );
SMESHGUI_EXPORT
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
@ -103,7 +103,7 @@ namespace SMESH
SMESHGUI_EXPORT
bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
SMESH::SMESH_Hypothesis_ptr );
SMESH::SMESH_Hypothesis_ptr );
typedef std::vector<_PTR(SObject)> SObjectList;
SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );

View File

@ -47,15 +47,15 @@ public:
// truncate extra ids
int ind = 0, nbId = 0;
while ( ind < input.length() ) {
if ( input.at( ind ) != ' ' ) {
if ( ++nbId > myMaxNbId ) {
input.truncate( ind );
break;
}
ind = input.indexOf( ' ', ind );
if ( ind < 0 ) break;
}
ind++;
if ( input.at( ind ) != ' ' ) {
if ( ++nbId > myMaxNbId ) {
input.truncate( ind );
break;
}
ind = input.indexOf( ' ', ind );
if ( ind < 0 ) break;
}
ind++;
}
}
if ( pos > input.length() )

View File

@ -189,8 +189,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
int nbSel = selected.Extent();
if (nbSel != 1) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
@ -199,8 +199,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
myMesh = SMESH::GetMeshByIO(anIO);
if (myMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
@ -214,8 +214,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
if (!compute2DMesh()) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_COMPUTE_FAILED"));
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_COMPUTE_FAILED"));
onCancel();
return;
}

View File

@ -381,7 +381,7 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh
myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
myHypoSetButton->setEnabled( false );
myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding,
myHypoSetButton->sizePolicy().verticalPolicy() );
myHypoSetButton->sizePolicy().verticalPolicy() );
// Fill layout
QGridLayout* aLay = new QGridLayout( mainFrame() );
@ -542,14 +542,14 @@ void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
}
}
else {
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
if ( myGeomPopup ) {
delete myGeomPopup;
myGeomPopup = 0;
delete myGeomPopup;
myGeomPopup = 0;
}
}
}

View File

@ -358,52 +358,52 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
// edges
myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
theInfo[SMDSEntity_Quad_Edge] ));
theInfo[SMDSEntity_Quad_Edge] ));
myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
// faces
myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
theInfo[SMDSEntity_Quad_Triangle] +
theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Quad_Quadrangle] +
theInfo[SMDSEntity_Polygon] ));
theInfo[SMDSEntity_Quad_Triangle] +
theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Quad_Quadrangle] +
theInfo[SMDSEntity_Polygon] ));
myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Polygon] ));
theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Polygon] ));
myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
theInfo[SMDSEntity_Quad_Quadrangle] ));
theInfo[SMDSEntity_Quad_Quadrangle] ));
// volumes
myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
theInfo[SMDSEntity_Quad_Tetra] +
theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Quad_Pyramid] +
theInfo[SMDSEntity_Hexa] +
theInfo[SMDSEntity_Quad_Hexa] +
theInfo[SMDSEntity_Penta] +
theInfo[SMDSEntity_Quad_Penta] +
theInfo[SMDSEntity_Polyhedra] ));
theInfo[SMDSEntity_Quad_Tetra] +
theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Quad_Pyramid] +
theInfo[SMDSEntity_Hexa] +
theInfo[SMDSEntity_Quad_Hexa] +
theInfo[SMDSEntity_Penta] +
theInfo[SMDSEntity_Quad_Penta] +
theInfo[SMDSEntity_Polyhedra] ));
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Hexa] +
theInfo[SMDSEntity_Penta] +
theInfo[SMDSEntity_Polyhedra] ));
theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Hexa] +
theInfo[SMDSEntity_Penta] +
theInfo[SMDSEntity_Polyhedra] ));
myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
theInfo[SMDSEntity_Quad_Pyramid] +
theInfo[SMDSEntity_Quad_Hexa] +
theInfo[SMDSEntity_Quad_Penta] ));
theInfo[SMDSEntity_Quad_Pyramid] +
theInfo[SMDSEntity_Quad_Hexa] +
theInfo[SMDSEntity_Quad_Penta] ));
if ( myFull )
{
// triangles
myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
theInfo[SMDSEntity_Quad_Triangle] ));
theInfo[SMDSEntity_Quad_Triangle] ));
myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
// quadrangles
myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Quad_Quadrangle] ));
theInfo[SMDSEntity_Quad_Quadrangle] ));
myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
// poligones
@ -411,22 +411,22 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
// tetras
myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
theInfo[SMDSEntity_Quad_Tetra] ));
theInfo[SMDSEntity_Quad_Tetra] ));
myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
// hexas
myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
theInfo[SMDSEntity_Quad_Hexa] ));
theInfo[SMDSEntity_Quad_Hexa] ));
myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
// pyras
myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
theInfo[SMDSEntity_Quad_Pyramid] ));
theInfo[SMDSEntity_Quad_Pyramid] ));
myNbLinPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] ));
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
// prisms
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
theInfo[SMDSEntity_Quad_Penta] ));
theInfo[SMDSEntity_Quad_Penta] ));
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
// polyedres

View File

@ -198,17 +198,17 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos()
//CORBA::Object_var anObject = aSO->GetObject();
CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
if (!CORBA::is_nil(anObject)) {
SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
if (!anIDSource->_is_nil()) {
myWGStack->setCurrentWidget(myMeshWidget);
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
myMeshName->setText(aSO->GetName().c_str());
SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
if (!anIDSource->_is_nil()) {
myWGStack->setCurrentWidget(myMeshWidget);
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
myMeshName->setText(aSO->GetName().c_str());
SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
myMeshInfoBox->SetMeshInfo( aMeshInfo );
SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
myMeshInfoBox->SetMeshInfo( aMeshInfo );
return;
}
return;
}
}
}
}
@ -297,10 +297,10 @@ void SMESHGUI_MeshInfosDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}

View File

@ -576,11 +576,11 @@ void SMESHGUI_MeshOp::selectionDone()
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
bool editSubmesh = ( !sm->_is_nil() &&
SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
tr( "EDIT_SUBMESH_QUESTION"),
SUIT_MessageBox::Yes |
SUIT_MessageBox::No,
SUIT_MessageBox::No )
== SUIT_MessageBox::Yes );
tr( "EDIT_SUBMESH_QUESTION"),
SUIT_MessageBox::Yes |
SUIT_MessageBox::No,
SUIT_MessageBox::No )
== SUIT_MessageBox::Yes );
if ( editSubmesh )
{
selectionMgr()->clearFilters();
@ -1666,7 +1666,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess )
aNewGeomGroupName += aName;
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
aNewGeomGroupName.toLatin1().data(), mainGeom);
aNewGeomGroupName.toLatin1().data(), mainGeom);
}
}
}

View File

@ -102,7 +102,7 @@ private:
const int ); // access to myAvailableHypData
void createHypothesis( const int, const int,
const QString& );
const QString& );
bool createMesh( QString& );
bool createSubMesh( QString& );

View File

@ -420,10 +420,10 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
ok = myNode2->isValid( msg, theMess ) && ok;
if( !ok ) {
if( theMess ) {
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
}
@ -440,14 +440,14 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
{
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
tr("SMESHGUI_INVALID_PARAMETERS"));
tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
if ( myName->text().isEmpty() ) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
tr("SMESHGUI_INVALID_PARAMETERS"));
tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
@ -473,15 +473,15 @@ bool SMESHGUI_MeshPatternDlg::onApply()
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
varIds[i++] = *it;
myType == Type_2d
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
QStringList aParameters;
aParameters << myNode1->text();
if(myType == Type_3d )
aParameters << myNode2->text();
aParameters << myNode2->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
} else { // Applying a pattern to geometrical object
@ -497,15 +497,15 @@ bool SMESHGUI_MeshPatternDlg::onApply()
//mySelectionMgr->clearSelected();
bool autoUpdate = SMESHGUI::automaticUpdate();
if (!isRefine() && autoUpdate) {
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
if (!anActor) {
anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
if (anActor) {
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
SMESH::FitAll();
}
}
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
if (!anActor) {
anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
if (anActor) {
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
SMESH::FitAll();
}
}
}
mySelectionMgr->clearSelected();
SMESH::UpdateView();
@ -517,7 +517,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
return true;
} else {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
tr("SMESH_OPERATION_FAILED"));
tr("SMESH_OPERATION_FAILED"));
return false;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
@ -565,17 +565,17 @@ void SMESHGUI_MeshPatternDlg::onHelp()
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
QString platform;
#ifdef WIN32
platform = "winapplication";
platform = "winapplication";
#else
platform = "application";
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -593,7 +593,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
return;
return;
// Retrieve mesh from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
@ -624,11 +624,11 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
return;
return;
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
anIds = "";
anIds = "";
myBusy = true;
mySelEdit[ Ids ]->setText(anIds);
@ -638,7 +638,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
if (aList.Extent() != 1)
return;
return;
// Get geom object from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
@ -809,14 +809,14 @@ void SMESHGUI_MeshPatternDlg::onOpen()
QFile aFile(fName);
if (!aFile.open(QIODevice::ReadOnly)) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
tr("ERROR_OF_OPENING"));
tr("ERROR_OF_OPENING"));
return;
}
QByteArray aDataArray = aFile.readAll();
if (aDataArray.isEmpty()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
tr("ERROR_OF_READING"));
tr("ERROR_OF_READING"));
return;
}
@ -1046,11 +1046,11 @@ void SMESHGUI_MeshPatternDlg::updateWgState()
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
if (keyPoints->length()) {
myNode1->setEnabled(true);
myNode2->setEnabled(true);
myNode1->setRange(1, keyPoints->length());
myNode2->setRange(1, keyPoints->length());
return;
myNode1->setEnabled(true);
myNode2->setEnabled(true);
myNode1->setRange(1, keyPoints->length());
myNode2->setRange(1, keyPoints->length());
return;
}
}
@ -1075,13 +1075,13 @@ void SMESHGUI_MeshPatternDlg::activateSelection()
if (myType == Type_2d)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
else
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
}
}
else {
@ -1146,7 +1146,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName)
} catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
tr("ERROR_OF_LOADING") );
tr("ERROR_OF_LOADING") );
return false;
}
}
@ -1229,13 +1229,13 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid()
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
varIds[i++] = *it;
pnts = myType == Type_2d
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
} else {
pnts = myType == Type_2d
? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
: myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]);
}
@ -1380,7 +1380,7 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
newIndices.Add(e->GetID());
newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))

View File

@ -46,13 +46,13 @@ namespace SMESH
if(!CORBA::is_nil(anObj)){
SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj);
if(!CORBA::is_nil(aMesh))
return aMesh;
return aMesh;
SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj);
if(!CORBA::is_nil(aGroup))
return aGroup->GetMesh();
return aGroup->GetMesh();
SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj);
if(!CORBA::is_nil(aSubMesh))
return aSubMesh->GetFather();
return aSubMesh->GetFather();
}
return SMESH_Mesh::_nil();
}
@ -65,17 +65,17 @@ namespace SMESH
QString name = baseName;
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
int nb = 0;
QStringList names = name.split("_", QString::KeepEmptyParts);
if ( names.count() > 0 ) {
bool ok;
int index = names.last().toInt( &ok );
if ( ok ) {
nb = index;
names.removeLast();
}
}
names.append( QString::number( nb+1 ) );
name = names.join( "_" );
QStringList names = name.split("_", QString::KeepEmptyParts);
if ( names.count() > 0 ) {
bool ok;
int index = names.last().toInt( &ok );
if ( ok ) {
nb = index;
names.removeLast();
}
}
names.append( QString::number( nb+1 ) );
name = names.join( "_" );
}
return name;
}

View File

@ -278,7 +278,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
if (myId->text().isEmpty()) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
tr("NODE_ID_IS_NOT_DEFINED"));
tr("NODE_ID_IS_NOT_DEFINED"));
return false;
}
@ -291,7 +291,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
if( theMess ) {
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
str += "\n" + msg;
str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
@ -329,7 +329,7 @@ bool SMESHGUI_MoveNodesDlg::onApply()
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
if (aMesh->_is_nil()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
tr("SMESHG_NO_MESH"));
tr("SMESHG_NO_MESH"));
return false;
}
@ -398,17 +398,17 @@ void SMESHGUI_MoveNodesDlg::onHelp()
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
QString platform;
#ifdef WIN32
platform = "winapplication";
platform = "winapplication";
#else
platform = "application";
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -435,13 +435,13 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
myBusy = false;
if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
TColStd_MapOfInteger aListInd;
aListInd.Add(anElem->GetID());
mySelector->AddOrRemoveIndex(anIO,aListInd, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
onSelectionDone();
TColStd_MapOfInteger aListInd;
aListInd.Add(anElem->GetID());
mySelector->AddOrRemoveIndex(anIO,aListInd, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
onSelectionDone();
}
}
}

View File

@ -100,8 +100,8 @@
//=======================================================================
SMESHGUI_MultiEditDlg
::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
const int theMode,
const bool the3d2d):
const int theMode,
const bool the3d2d):
QDialog(SMESH::GetDesktop(theModule)),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
@ -192,7 +192,7 @@ QWidget* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0,
1, mySelGrpLayout->columnCount());
1, mySelGrpLayout->columnCount());
// Split/Join criterion group
myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
@ -440,30 +440,30 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
// skl 07.02.2006
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
if( myFilterType == SMESH::TriaFilter ||
myFilterType == SMESH::QuadFilter ||
myFilterType == SMESH::FaceFilter ) {
SMDS_FaceIteratorPtr it = aMesh->facesIterator();
while(it->more()) {
const SMDS_MeshFace* f = it->next();
if(myFilterType == SMESH::FaceFilter) {
myIds.Add(f->GetID());
}
else if( myFilterType==SMESH::TriaFilter &&
( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
myIds.Add(f->GetID());
}
else if( myFilterType==SMESH::QuadFilter &&
( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
myIds.Add(f->GetID());
}
}
myFilterType == SMESH::QuadFilter ||
myFilterType == SMESH::FaceFilter ) {
SMDS_FaceIteratorPtr it = aMesh->facesIterator();
while(it->more()) {
const SMDS_MeshFace* f = it->next();
if(myFilterType == SMESH::FaceFilter) {
myIds.Add(f->GetID());
}
else if( myFilterType==SMESH::TriaFilter &&
( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
myIds.Add(f->GetID());
}
else if( myFilterType==SMESH::QuadFilter &&
( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
myIds.Add(f->GetID());
}
}
}
else if(myFilterType == SMESH::VolumeFilter) {
SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
while(it->more()) {
const SMDS_MeshVolume* f = it->next();
myIds.Add(f->GetID());
}
SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
while(it->more()) {
const SMDS_MeshVolume* f = it->next();
myIds.Add(f->GetID());
}
}
/* commented by skl 07.02.2006
TVisualObjPtr aVisualObj = anActor->GetObject();
@ -472,14 +472,14 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
for (int i = 0, n = aGrid->GetNumberOfCells(); i < n; i++) {
vtkCell* aCell = aGrid->GetCell(i);
if (aCell != 0) {
vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
if (aTri && myFilterType == SMESHGUI_TriaFilter ||
if (aTri && myFilterType == SMESHGUI_TriaFilter ||
aQua && myFilterType == SMESHGUI_QuadFilter ||
(aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter ||
(a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) {
@ -540,10 +540,10 @@ void SMESHGUI_MultiEditDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -594,10 +594,10 @@ void SMESHGUI_MultiEditDlg::onSelectionDone()
if (aNbItems > 0) {
QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, items)
anItem->setSelected(true);
QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
QListWidgetItem* anItem;
foreach(anItem, items)
anItem->setSelected(true);
}
}
myMesh = SMESH::GetMeshByIO(anIO);
@ -1180,7 +1180,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
if( theMess ) {
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
str += "\n" + msg;
str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;

View File

@ -113,7 +113,7 @@ protected:
void setSelectionMode();
virtual bool isIdValid( const int ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::long_array& ) = 0;
const SMESH::long_array& ) = 0;
int entityType();
protected:

View File

@ -120,7 +120,7 @@ bool SMESHGUI_Operation::isReadyToStart() const
else if ( getSMESHGUI() == 0 )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
tr( "NO_MODULE" ) );
tr( "NO_MODULE" ) );
return false;
}
else if ( isStudyLocked() )
@ -200,10 +200,10 @@ void SMESHGUI_Operation::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName) );
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName) );
}
}
@ -231,7 +231,7 @@ bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
{
if ( theMess )
SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
tr( "WRN_STUDY_LOCKED" ) );
tr( "WRN_STUDY_LOCKED" ) );
return true;
}
}
@ -260,7 +260,7 @@ bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const
return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
( !anOps.contains( theOtherOp->metaObject()->className() ) ||
anOps.contains( metaObject()->className() ) );
anOps.contains( metaObject()->className() ) );
return true;
}

View File

@ -95,9 +95,9 @@ void SMESHGUI_PatternWidget::paintEvent( QPaintEvent* )
QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius,
Radius * 2, Radius * 2, 0, 360 * 16 );
Radius * 2, Radius * 2, 0, 360 * 16 );
painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift,
QString::number( i+1 ) );
QString::number( i+1 ) );
}
// Draw lines

View File

@ -53,8 +53,8 @@ public:
~SMESHGUI_PatternWidget();
void SetPoints( const PointVector&,
const QVector<int>&,
const ConnectivityVector& );
const QVector<int>&,
const ConnectivityVector& );
private:
PointVector myPoints;

View File

@ -158,10 +158,10 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
this, SLOT( DeactivateActiveDialog() ) );
this, SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study change */
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
this, SLOT( ClickOnCancel() ) );
this, SLOT( ClickOnCancel() ) );
}
//=================================================================================

View File

@ -300,7 +300,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
QColor(255, 255, 255));
QColor(255, 255, 255));
myTitleColorBtn->setColor(titleColor);
myTitleFontCombo->setCurrentIndex(0);
if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
@ -316,9 +316,9 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
myTitleItalicCheck->setChecked( f.italic() );
myTitleShadowCheck->setChecked( f.overline() );
}
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
QColor(255, 255, 255));
QColor(255, 255, 255));
myLabelsColorBtn->setColor(labelColor);
myLabelsFontCombo->setCurrentIndex(0);
if (mgr->hasValue("SMESH", "scalar_bar_label_font")) {
@ -352,16 +352,16 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
myIniX = mgr->doubleValue("SMESH", name.arg( "x" ),
myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
myIniY = mgr->doubleValue("SMESH", name.arg( "y" ),
myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
myIniW = mgr->doubleValue("SMESH", name.arg( "width" ),
myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
myIniH = mgr->doubleValue("SMESH", name.arg( "height" ),
myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
setOriginAndSize(myIniX, myIniY, myIniW, myIniH);
@ -504,10 +504,10 @@ void SMESHGUI_Preferences_ScalarBarDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -528,56 +528,56 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
if( anIO->hasEntry() ) {
SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
myActor = anActor;
vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
myActor = anActor;
vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
if ( myScalarBarActor->GetLookupTable() ) {
vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
myMinEdit->setText( QString::number( range[0],'g',12 ) );
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
}
if ( myScalarBarActor->GetLookupTable() ) {
vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
myMinEdit->setText( QString::number( range[0],'g',12 ) );
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
}
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
vtkFloatingPointType aTColor[3];
aTitleTextPrp->GetColor( aTColor );
myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
vtkFloatingPointType aTColor[3];
aTitleTextPrp->GetColor( aTColor );
myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
vtkFloatingPointType aLColor[3];
aLabelsTextPrp->GetColor( aLColor );
myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
vtkFloatingPointType aLColor[3];
aLabelsTextPrp->GetColor( aLColor );
myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
myVertRadioBtn->setChecked( true );
else
myHorizRadioBtn->setChecked( true );
myIniOrientation = myVertRadioBtn->isChecked();
if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
myVertRadioBtn->setChecked( true );
else
myHorizRadioBtn->setChecked( true );
myIniOrientation = myVertRadioBtn->isChecked();
myIniX = myScalarBarActor->GetPosition()[0];
myIniY = myScalarBarActor->GetPosition()[1];
myIniW = myScalarBarActor->GetWidth();
myIniH = myScalarBarActor->GetHeight();
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
myIniX = myScalarBarActor->GetPosition()[0];
myIniY = myScalarBarActor->GetPosition()[1];
myIniW = myScalarBarActor->GetWidth();
myIniH = myScalarBarActor->GetHeight();
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
myRangeGrp->setEnabled( true );
myFontGrp->setEnabled( true );
myLabColorGrp->setEnabled( true );
myOrientationGrp->setEnabled( true );
myOriginDimGrp->setEnabled( true );
myOkBtn->setEnabled( true );
myApplyBtn->setEnabled( true );
return;
myRangeGrp->setEnabled( true );
myFontGrp->setEnabled( true );
myLabColorGrp->setEnabled( true );
myOrientationGrp->setEnabled( true );
myOriginDimGrp->setEnabled( true );
myOkBtn->setEnabled( true );
myApplyBtn->setEnabled( true );
return;
}
}
}
@ -625,9 +625,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onXYChanged()
*/
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x,
const double y,
const double w,
const double h )
const double y,
const double w,
const double h )
{
blockSignals( true );
myXSpin->setValue( x );
@ -656,9 +656,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged()
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
else
setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X,
aOrientation ? DEF_VER_Y : DEF_HOR_Y,
aOrientation ? DEF_VER_W : DEF_HOR_W,
aOrientation ? DEF_VER_H : DEF_HOR_H );
aOrientation ? DEF_VER_Y : DEF_HOR_Y,
aOrientation ? DEF_VER_W : DEF_HOR_W,
aOrientation ? DEF_VER_H : DEF_HOR_H );
}
//=================================================================================================

View File

@ -63,9 +63,9 @@ public:
void closeEvent( QCloseEvent* );
void setOriginAndSize( const double,
const double,
const double,
const double );
const double,
const double,
const double );
void initScalarBarFromResources();
protected slots:

View File

@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
SLOT(onTextChange(const QString&)));
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
@ -291,10 +291,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -321,15 +321,15 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
newIndices.Add(anElem->GetID());
myNbOkElements++;
}
if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
newIndices.Add(anElem->GetID());
myNbOkElements++;
}
}
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
aViewWindow->highlight(anIO,true,true);
}
}
@ -410,8 +410,8 @@ void SMESHGUI_RemoveElementsDlg::SetEditCurrentArgument()
case 0: /* default constructor */
{
if(send == SelectButtonC1A1) {
LineEditC1A1->setFocus();
myEditCurrentArgument = LineEditC1A1;
LineEditC1A1->setFocus();
myEditCurrentArgument = LineEditC1A1;
}
SelectionIntoArgument();
break;
@ -509,8 +509,8 @@ void SMESHGUI_RemoveElementsDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
SLOT(onTextChange(const QString&)));
SMESH::SetPointRepresentation(true);
@ -297,10 +297,10 @@ void SMESHGUI_RemoveNodesDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -327,15 +327,15 @@ void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
newIndices.Add(aNode->GetID());
myNbOkNodes++;
}
if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
newIndices.Add(aNode->GetID());
myNbOkNodes++;
}
}
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight(anIO,true,true);
aViewWindow->highlight(anIO,true,true);
}
}
@ -416,8 +416,8 @@ void SMESHGUI_RemoveNodesDlg::SetEditCurrentArgument()
case 0: /* default constructor */
{
if(send == SelectButtonC1A1) {
LineEditC1A1->setFocus();
myEditCurrentArgument = LineEditC1A1;
LineEditC1A1->setFocus();
myEditCurrentArgument = LineEditC1A1;
}
SelectionIntoArgument();
break;
@ -516,8 +516,8 @@ void SMESHGUI_RemoveNodesDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -78,14 +78,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
setModal(false);
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowTitle(unit == 0 ?
tr("SMESH_RENUMBERING_NODES_TITLE") :
tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
tr("SMESH_RENUMBERING_NODES_TITLE") :
tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
setSizeGripEnabled(true);
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ?
tr("ICON_DLG_RENUMBERING_NODES") :
tr("ICON_DLG_RENUMBERING_ELEMENTS")));
tr("ICON_DLG_RENUMBERING_NODES") :
tr("ICON_DLG_RENUMBERING_ELEMENTS")));
QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
@ -94,9 +94,9 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
/***************************************************************/
GroupConstructors = new QGroupBox(unit == 0 ?
tr("SMESH_NODES") :
tr("SMESH_ELEMENTS"),
this);
tr("SMESH_NODES") :
tr("SMESH_ELEMENTS"),
this);
myHelpFileName = unit == 0 ?
"renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
"renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
@ -219,22 +219,22 @@ void SMESHGUI_RenumberingDlg::ClickOnApply()
bool isUnitsLabeled = false;
if (myUnit == 0 && anActor) {
isUnitsLabeled = anActor->GetPointsLabeled();
if (isUnitsLabeled) anActor->SetPointsLabeled(false);
isUnitsLabeled = anActor->GetPointsLabeled();
if (isUnitsLabeled) anActor->SetPointsLabeled(false);
}
else if (myUnit == 1 && anActor) {
isUnitsLabeled = anActor->GetCellsLabeled();
if (isUnitsLabeled) anActor->SetCellsLabeled(false);
isUnitsLabeled = anActor->GetCellsLabeled();
if (isUnitsLabeled) anActor->SetCellsLabeled(false);
}
SUIT_OverrideCursor aWaitCursor;
if (myUnit == 0) {
aMeshEditor->RenumberNodes();
if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
aMeshEditor->RenumberNodes();
if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
}
else if (myUnit == 1) {
aMeshEditor->RenumberElements();
if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
aMeshEditor->RenumberElements();
if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
}
}
catch(...) {
@ -285,10 +285,10 @@ void SMESHGUI_RenumberingDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -316,7 +316,7 @@ void SMESHGUI_RenumberingDlg::SelectionIntoArgument()
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
if (myMesh->_is_nil())
aString = "";
aString = "";
}
}
@ -338,12 +338,12 @@ void SMESHGUI_RenumberingDlg::SetEditCurrentArgument()
{
case 0: /* default constructor */
{
if(send == SelectButton) {
LineEditMesh->setFocus();
myEditCurrentArgument = LineEditMesh;
}
SelectionIntoArgument();
break;
if(send == SelectButton) {
LineEditMesh->setFocus();
myEditCurrentArgument = LineEditMesh;
}
SelectionIntoArgument();
break;
}
}
}

View File

@ -452,7 +452,7 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
myIDs.clear();
myNbOkElements = 0;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(aSelMode);
aViewWindow->SetSelectionMode(aSelMode);
}
myEditCurrentArgument = (QWidget*)LineEditElements;
@ -519,29 +519,29 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
}
else
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
anAngle, aNbSteps, aTolerance);
if( GetConstructorId() == 0 )
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
else
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
}
else
SMESH::ListOfGroups_var groups =
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
anAngle, aNbSteps, aTolerance);
}
else {
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
else
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
}
else
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
if( GetConstructorId() == 0 )
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
else
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
}
else
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
@ -602,10 +602,10 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -653,15 +653,15 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
aViewWindow->highlight( myActor->getIO(), true, true );
myElementsId = theNewText;
}
@ -744,7 +744,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
myElementsId = aString;
if (aNbUnits < 1)
return;
return;
}
myNbOkElements = true;
} else {
@ -834,20 +834,20 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
}
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
@ -956,13 +956,13 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false);
@ -993,8 +993,8 @@ int SMESHGUI_RevolutionDlg::GetConstructorId()
bool SMESHGUI_RevolutionDlg::IsAxisOk()
{
return (SpinBox_DX->GetValue() != 0 ||
SpinBox_DY->GetValue() != 0 ||
SpinBox_DZ->GetValue() != 0);
SpinBox_DY->GetValue() != 0 ||
SpinBox_DZ->GetValue() != 0);
}
//=================================================================================
@ -1055,7 +1055,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt();
anElementsId[i] = aListElementsId[i].toInt();
SMESH::AxisStruct anAxis;
@ -1071,27 +1071,27 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
double aTolerance = SpinBox_Tolerance->GetValue();
if (GroupAngle->checkedId() == 1)
anAngle = anAngle/aNbSteps;
anAngle = anAngle/aNbSteps;
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
else
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
}
else
aMeshEditor->RotationSweep(anElementsId.inout(),
anAxis,
anAngle,
aNbSteps,
aTolerance);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
if( GetConstructorId() == 0 )
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
else
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
anAngle, aNbSteps, aTolerance);
}
else
aMeshEditor->RotationSweep(anElementsId.inout(),
anAxis,
anAngle,
aNbSteps,
aTolerance);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {}
}
else
@ -1155,8 +1155,8 @@ void SMESHGUI_RevolutionDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -414,8 +414,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
@ -431,8 +431,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
}
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh;
@ -442,8 +442,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
else
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data());
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
}
} catch (...) {
}
@ -506,10 +506,10 @@ void SMESHGUI_RotationDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -543,15 +543,15 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
}
@ -743,23 +743,23 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( aViewWindow )
aViewWindow->SetSelectionMode(ActorSelection);
if ( aViewWindow )
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( aViewWindow )
aViewWindow->SetSelectionMode( CellSelection );
}
if ( aViewWindow )
aViewWindow->SetSelectionMode( CellSelection );
}
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true);
if ( aViewWindow )
aViewWindow->SetSelectionMode( NodeSelection );
if ( aViewWindow )
aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true);
if ( aViewWindow )
aViewWindow->SetSelectionMode( NodeSelection );
if ( aViewWindow )
aViewWindow->SetSelectionMode( NodeSelection );
}
break;
}
@ -879,8 +879,8 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh)
bool SMESHGUI_RotationDlg::IsAxisOk()
{
return (SpinBox_DX->GetValue() != 0 ||
SpinBox_DY->GetValue() != 0 ||
SpinBox_DZ->GetValue() != 0);
SpinBox_DY->GetValue() != 0 ||
SpinBox_DZ->GetValue() != 0);
}
//=================================================================================
@ -977,8 +977,8 @@ void SMESHGUI_RotationDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -360,7 +360,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
//FindSObject( mesh );
//FindSObject( mesh );
if ( so ) {
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
if(!CORBA::is_nil(obj)){
@ -428,7 +428,7 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const
SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
if ( actor && actor->hasIO() ) {
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
return QVariant( aViewWindow->isVisible( actor->getIO() ) );
return QVariant( aViewWindow->isVisible( actor->getIO() ) );
}
}
return QVariant( false );

View File

@ -107,7 +107,7 @@ protected:
//! Select some nodes or elements in VTK
void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
const TColStd_MapOfInteger&, const bool );
const TColStd_MapOfInteger&, const bool isModeShift);
SVTK_ViewWindow* viewWindow() const;
SVTK_Selector* selector() const;

View File

@ -385,9 +385,9 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
LineEdit5->setEnabled(false);
if (!CheckBoxPolygons->isVisible())
CheckBoxPolygons->show();
CheckBoxPolygons->show();
if (!CheckBoxPolyedrs->isVisible())
CheckBoxPolyedrs->show();
CheckBoxPolyedrs->show();
myOk5 = true;
@ -412,7 +412,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
aViewWindow->SetSelectionMode(CellSelection);
break;
}
}
@ -472,8 +472,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
LineEdit4->text().toLong(),
LineEdit5->text().toLong(),
LineEdit6->text().toLong(),
toCreatePolygons,
toCreatePolyedrs);
toCreatePolygons,
toCreatePolyedrs);
else if (aConstructorId == 1)
anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
LineEdit2->text().toLong(),
@ -486,8 +486,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
LineEdit3->text().toLong(),
LineEdit4->text().toLong(),
LineEdit6->text().toLong(),
toCreatePolygons,
toCreatePolyedrs);
toCreatePolygons,
toCreatePolyedrs);
else if (aConstructorId == 3) {
QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
@ -580,10 +580,10 @@ void SMESHGUI_SewingDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -632,15 +632,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(NodeSelection);
aViewWindow->SetSelectionMode(NodeSelection);
const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
if (n) {
newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if (send == LineEdit1)
myOk1 = true;
else if (send == LineEdit2)
@ -658,7 +658,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
aViewWindow->SetSelectionMode(CellSelection);
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
@ -667,8 +667,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
newIndices.Add(e->GetID());
if (!isEvenOneExists)
isEvenOneExists = true;
}
@ -676,7 +676,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
aViewWindow->highlight( myActor->getIO(), true, true );
if (isEvenOneExists) {
if (send == LineEdit1)

View File

@ -129,7 +129,7 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent)
QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
myElementId = new QLineEdit( aMainGrp );
myElementId->setValidator( new SMESHGUI_IdValidator( theParent,
!myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
!myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
// shape name
QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
@ -250,36 +250,36 @@ void SMESHGUI_ShapeByMeshOp::SetMesh (SMESH::SMESH_Mesh_ptr thePtr)
int shapeDim = 0; // max dim with several shapes
//if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
{
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
if ( !mainShape->_is_nil() )
{
TopoDS_Shape aShape;
if ( GEOMBase::GetShape(mainShape, aShape))
{
TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
for ( int dim = 4; dim > 0; --dim ) {
TopAbs_ShapeEnum type = types[ dim - 1 ];
TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
TopExp_Explorer exp( aShape, type, avoid );
for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
++nbShapes[ type ];
if ( nbShapes[ type ] > 1 ) {
shapeDim = dim;
break;
}
}
}
}
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
if ( !mainShape->_is_nil() )
{
TopoDS_Shape aShape;
if ( GEOMBase::GetShape(mainShape, aShape))
{
TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
for ( int dim = 4; dim > 0; --dim ) {
TopAbs_ShapeEnum type = types[ dim - 1 ];
TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
TopExp_Explorer exp( aShape, type, avoid );
for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
++nbShapes[ type ];
if ( nbShapes[ type ] > 1 ) {
shapeDim = dim;
break;
}
}
}
}
}
if (shapeDim > 0)
{
if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
shapeDim = 3;
hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
}
{
if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
shapeDim = 3;
hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
}
myHasSolids = nbShapes[ TopAbs_SOLID ];
}
@ -306,83 +306,83 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
if (aListId.count() == 1)
{
int elemID = (aListId.first()).toInt();
myGeomObj = GEOM::GEOM_Object::_duplicate(
SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
int elemID = (aListId.first()).toInt();
myGeomObj = GEOM::GEOM_Object::_duplicate(
SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
}
else
{
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if (geomGen->_is_nil() || !aStudy)
return;
GEOM::GEOM_IShapesOperations_var aShapesOp =
geomGen->GetIShapesOperations(aStudy->StudyId());
if (aShapesOp->_is_nil() )
return;
TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
GEOM::GEOM_Object_var aGeomObject;
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if (geomGen->_is_nil() || !aStudy)
return;
GEOM::GEOM_IShapesOperations_var aShapesOp =
geomGen->GetIShapesOperations(aStudy->StudyId());
if (aShapesOp->_is_nil() )
return;
TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
GEOM::GEOM_Object_var aGeomObject;
GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
for ( int i = 0; i < aListId.count(); i++ )
{
aGeomObject =
SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
for ( int i = 0; i < aListId.count(); i++ )
{
aGeomObject =
SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
if (aGeomObject->_is_nil()) continue;
double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
{
aGeomObjectsMap[anId] = aGeomObject;
if (aGeomObject->_is_nil()) continue;
double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
{
aGeomObjectsMap[anId] = aGeomObject;
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
if (i == 0)
aGroupType = aSubShapeType;
else if (aSubShapeType != aGroupType)
aGroupType = TopAbs_SHAPE;
}
}
int aNumberOfGO = aGeomObjectsMap.size();
if (aNumberOfGO == 1)
myGeomObj = (*aGeomObjectsMap.begin()).second;
else if (aNumberOfGO > 1)
{
GEOM::GEOM_IGroupOperations_var aGroupOp =
geomGen->GetIGroupOperations(aStudy->StudyId());
if(aGroupOp->_is_nil())
return;
GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
aGeomObjects->length( aNumberOfGO );
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
if (i == 0)
aGroupType = aSubShapeType;
else if (aSubShapeType != aGroupType)
aGroupType = TopAbs_SHAPE;
}
}
int aNumberOfGO = aGeomObjectsMap.size();
if (aNumberOfGO == 1)
myGeomObj = (*aGeomObjectsMap.begin()).second;
else if (aNumberOfGO > 1)
{
GEOM::GEOM_IGroupOperations_var aGroupOp =
geomGen->GetIGroupOperations(aStudy->StudyId());
if(aGroupOp->_is_nil())
return;
GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
aGeomObjects->length( aNumberOfGO );
int i = 0;
std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
aGeomObjects[i++] = (*anIter).second;
//create geometry group
myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
aGroupOp->UnionList(myGeomObj, aGeomObjects);
int i = 0;
std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
aGeomObjects[i++] = (*anIter).second;
//create geometry group
myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
aGroupOp->UnionList(myGeomObj, aGeomObjects);
if (!aGroupOp->IsDone())
return;
}
// publish the GEOM object in study
QString aNewGeomGroupName ( myDlg->myGeomName->text() );
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
aNewGeomGroupName.toLatin1().data(), aMeshShape);
if (!aGroupOp->IsDone())
return;
}
// publish the GEOM object in study
QString aNewGeomGroupName ( myDlg->myGeomName->text() );
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
}
catch (const SALOME::SALOME_Exception& S_ex) {
@ -422,7 +422,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone()
aList.First(), aString);
if (nbElems > 0) {
if (!myIsMultipleAllowed && nbElems != 1 )
return;
return;
setElementID( aString );
myDlg->setButtonEnabled( true, QtxDialog::OK );
}
@ -485,31 +485,31 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText)
{
if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
{
SMDSAbs_ElementType type = SMDSAbs_Edge;
switch ( myDlg->myElemTypeGroup->checkedId() ) {
case EDGE : type = SMDSAbs_Edge; break;
case FACE : type = SMDSAbs_Face; break;
case VOLUME: type = SMDSAbs_Volume; break;
default: return;
}
TColStd_MapOfInteger newIndices;
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
for ( int i = 0; i < aListId.count(); i++ ) {
if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
if ( e->GetType() == type )
newIndices.Add( e->GetID() );
}
if ( !newIndices.IsEmpty() )
{
if (!myIsMultipleAllowed && newIndices.Extent() != 1)
return;
if ( SVTK_Selector* s = selector() ) {
s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
viewWindow()->highlight( actor->getIO(), true, true );
myDlg->setButtonEnabled( true, QtxDialog::OK );
}
}
SMDSAbs_ElementType type = SMDSAbs_Edge;
switch ( myDlg->myElemTypeGroup->checkedId() ) {
case EDGE : type = SMDSAbs_Edge; break;
case FACE : type = SMDSAbs_Face; break;
case VOLUME: type = SMDSAbs_Volume; break;
default: return;
}
TColStd_MapOfInteger newIndices;
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
for ( int i = 0; i < aListId.count(); i++ ) {
if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
if ( e->GetType() == type )
newIndices.Add( e->GetID() );
}
if ( !newIndices.IsEmpty() )
{
if (!myIsMultipleAllowed && newIndices.Extent() != 1)
return;
if ( SVTK_Selector* s = selector() ) {
s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
viewWindow()->highlight( actor->getIO(), true, true );
myDlg->setButtonEnabled( true, QtxDialog::OK );
}
}
}
}
}

View File

@ -278,10 +278,10 @@ void SMESHGUI_SingleEditDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -348,13 +348,13 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
int id1, id2;
if ( !getNodeIds(myEdge->text(), id1, id2) )
return;
return;
const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
return;
return;
// find a triangle and an edge index
const SMDS_MeshElement* tria1;
@ -362,23 +362,23 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
{
newIndices.Add(tria1->GetID());
newIndices.Add(tria1->GetID());
const SMDS_MeshNode* a3Nodes[3];
SMDS_ElemIteratorPtr it;
int edgeInd = 2, i;
for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
edgeInd = i - 1;
break;
}
}
newIndices.Add(-edgeInd-1);
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
const SMDS_MeshNode* a3Nodes[3];
SMDS_ElemIteratorPtr it;
int edgeInd = 2, i;
for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
edgeInd = i - 1;
break;
}
}
newIndices.Add(-edgeInd-1);
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
}
mySelector->AddOrRemoveIndex(anIO,newIndices, false);
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
@ -416,17 +416,17 @@ void SMESHGUI_SingleEditDlg::onSelectionDone()
{
const SMDS_MeshElement* tria[2];
if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 &&
findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
{
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
myEdge->setText(aText);
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
myEdge->setText(aText);
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
}
else
{
myEdge->clear();
myEdge->clear();
}
}
}
@ -494,8 +494,8 @@ bool SMESHGUI_SingleEditDlg::onApply()
if (aMesh->_is_nil()) {
SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI),
tr("SMESH_ERROR"),
tr("SMESHG_NO_MESH"));
tr("SMESH_ERROR"),
tr("SMESHG_NO_MESH"));
return false;
}

View File

@ -365,19 +365,19 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
if ( CheckBoxParametric->isChecked() ) {
if(CheckBoxMesh->isChecked())
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
else
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
else
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
}
else {
if(CheckBoxMesh->isChecked())
aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
else
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
else
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
@ -448,10 +448,10 @@ void SMESHGUI_SmoothingDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -490,28 +490,28 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
}
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
} else if (send == LineEditNodes) {
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
if (n)
newIndices.Add(n->GetID());
myNbOkNodes++;
const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
if (n)
newIndices.Add(n->GetID());
myNbOkNodes++;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
aViewWindow->highlight( myActor->getIO(), true, true );
}
}
@ -629,21 +629,21 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
myEditCurrentArgument = LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
// mySelectionMgr->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
// mySelectionMgr->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
} else if (send == SelectNodesButton) {
LineEditNodes->clear();
LineEditNodes->clear();
myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
aViewWindow->SetSelectionMode(NodeSelection);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
aViewWindow->SetSelectionMode(NodeSelection);
}
}
myEditCurrentArgument->setFocus();
@ -782,8 +782,8 @@ void SMESHGUI_SmoothingDlg::setFilters( const bool theIsElem )
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -107,9 +107,9 @@ QDoubleValidator* SMESHGUI_SpinBox::validator() const
// purpose :
//=================================================================================
void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
double max,
double step,
unsigned short precision )
double max,
double step,
unsigned short precision )
{
setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
// see QtxDoubleSpinBox::mapValueToText( double v )

View File

@ -203,20 +203,20 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
int aDimension = 0;
double aNbDimElements = 0;
if (aNbVolumes > 0) {
aNbDimElements = aNbVolumes;
aDimension = 3;
aNbDimElements = aNbVolumes;
aDimension = 3;
}
else if(aNbFaces > 0) {
aNbDimElements = aNbFaces;
aDimension = 2;
aNbDimElements = aNbFaces;
aDimension = 2;
}
else if(aNbEdges > 0) {
aNbDimElements = aNbEdges;
aDimension = 1;
aNbDimElements = aNbEdges;
aDimension = 1;
}
else if(aNbNodes > 0) {
aNbDimElements = aNbNodes;
aDimension = 0;
aNbDimElements = aNbNodes;
aDimension = 0;
}
// information about the mesh
@ -234,15 +234,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (it->More()) {
if (it->More()) {
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
for ( ; it->More(); it->Next()) {
for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on nodes"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@ -259,7 +259,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
anInfo.append(QString("<br>"));
}
}
}
}
}
// info about groups on edges
@ -271,11 +271,11 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
for ( ; it->More(); it->Next()) {
for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on edges"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@ -292,7 +292,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
anInfo.append(QString("<br>"));
}
}
}
}
}
// info about groups on faces
@ -300,15 +300,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More()) {
if (!hasGroup && it->More()) {
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
for ( ; it->More(); it->Next()) {
for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on faces"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@ -325,7 +325,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
anInfo.append(QString("<br>"));
}
}
}
}
}
// info about groups on volumes
@ -333,13 +333,13 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More())
if (!hasGroup && it->More())
anInfo.append(QString("Groups:<br>"));
for ( ; it->More(); it->Next()) {
for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on volumes"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@ -356,7 +356,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
anInfo.append(QString("<br>"));
}
}
}
}
}
myInfo->setText(anInfo);
@ -448,10 +448,10 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}

View File

@ -416,8 +416,8 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked())
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
}
}
@ -499,8 +499,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case COPY_ELEMS_BUTTON: {
@ -517,8 +517,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
}
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case MAKE_MESH_BUTTON: {
@ -529,8 +529,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
else
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
LineEditNewMesh->text().toLatin1().data());
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
}
@ -595,10 +595,10 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -633,15 +633,15 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true );
aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
}
@ -832,11 +832,11 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument()
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
aViewWindow->SetSelectionMode(CellSelection);
}
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
@ -1076,8 +1076,8 @@ void SMESHGUI_SymmetryDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -417,7 +417,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked())
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
aViewWindow->SetSelectionMode( CellSelection );
}
myEditCurrentArgument = (QWidget*)LineEditElements;
@ -487,8 +487,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
else
aMeshEditor->Translate(anElementsId, aVector, false);
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
@ -504,8 +504,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
else
aMeshEditor->Translate(anElementsId, aVector, true);
}
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !myMesh->_is_nil())
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh;
@ -515,8 +515,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
else
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
LineEditNewMesh->text().toLatin1().data());
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if( !mesh->_is_nil())
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
}
} catch (...) {
}
@ -580,10 +580,10 @@ void SMESHGUI_TranslationDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
@ -618,10 +618,10 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
myNbOkElements++;
}
}
@ -809,12 +809,12 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument()
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
aViewWindow->SetSelectionMode( CellSelection );
}
} else if (send == SelectButton1) {
myEditCurrentArgument = (QWidget*)SpinBox1_1;
@ -1024,8 +1024,8 @@ void SMESHGUI_TranslationDlg::setFilters()
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
tr("SMESH_ERROR"),
tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )

View File

@ -172,7 +172,7 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
if ( app )
app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
QString( "" ), myHelpFileName );
QString( "" ), myHelpFileName );
else {
QString platform;
#ifdef WIN32
@ -181,10 +181,10 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
platform = "application";
#endif
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ).
arg( myHelpFileName ) );
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ).
arg( myHelpFileName ) );
}
}
@ -207,7 +207,7 @@ void SMESHGUI_TransparencyDlg::SetTransparency()
Handle(SALOME_InteractiveObject) IOS = It.Value();
SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
if ( anActor )
anActor->SetOpacity( opacity );
anActor->SetOpacity( opacity );
}
myViewWindow->Repaint();
}
@ -238,31 +238,31 @@ void SMESHGUI_TransparencyDlg::onSelectionChanged()
if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
if ( !FirstIOS.IsNull() ) {
SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
if ( anActor )
opacity = int( anActor->GetOpacity() * 100. + 0.5 );
SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
if ( anActor )
opacity = int( anActor->GetOpacity() * 100. + 0.5 );
}
}
else if ( aList.Extent() > 1 ) {
SALOME_ListIteratorOfListIO It( aList );
int setOp = -1;
for ( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) IO = It.Value();
if ( !IO.IsNull() ) {
SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
if ( anActor ) {
int op = int( anActor->GetOpacity() * 100. + 0.5 );
if ( setOp < 0 )
setOp = op;
else if ( setOp != op ) {
setOp = 100;
break;
}
}
}
Handle(SALOME_InteractiveObject) IO = It.Value();
if ( !IO.IsNull() ) {
SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
if ( anActor ) {
int op = int( anActor->GetOpacity() * 100. + 0.5 );
if ( setOp < 0 )
setOp = op;
else if ( setOp != op ) {
setOp = 100;
break;
}
}
}
}
if ( setOp >= 0 )
opacity = setOp;
opacity = setOp;
}
else {
}

View File

@ -80,11 +80,11 @@ namespace SMESH
if(theOwner){
const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
if(!anIO.IsNull()){
if(anIO->hasEntry()){
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
anObj = SObjectToObject(aSObj,aStudy);
}
if(anIO->hasEntry()){
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
anObj = SObjectToObject(aSObj,aStudy);
}
}
}
return anObj;
@ -124,9 +124,9 @@ namespace SMESH
(SUIT_Session::session()->activeApplication());
if (app && !CORBA::is_nil(theObject)) {
if(_PTR(Study) aStudy = GetActiveStudyDocument()){
CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
if (strcmp(anIOR.in(), "") != 0)
return aStudy->FindObjectIOR(anIOR.in());
CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
if (strcmp(anIOR.in(), "") != 0)
return aStudy->FindObjectIOR(anIOR.in());
}
}
return _PTR(SObject)();
@ -187,9 +187,9 @@ namespace SMESH
if (theSObject) {
_PTR(GenericAttribute) anAttr;
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
return app->orb()->string_to_object(aVal);
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
return app->orb()->string_to_object(aVal);
}
}
return CORBA::Object::_nil();
@ -205,9 +205,9 @@ namespace SMESH
{
if (!theIO.IsNull()) {
if (theIO->hasEntry()) {
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
return SObjectToObject(anObj,aStudy);
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
return SObjectToObject(anObj,aStudy);
}
}
return CORBA::Object::_nil();
@ -273,11 +273,11 @@ namespace SMESH
for (int i = 1; anIter->More(); anIter->Next(), i++) {
_PTR(SObject) aSObj = anIter->Value();
if (i >= 4) {
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
for ( ; anIter1->More(); anIter1->Next()) {
_PTR(SObject) aSObj1 = anIter1->Value();
anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
aPixmap = anAttr;
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
for ( ; anIter1->More(); anIter1->Next()) {
_PTR(SObject) aSObj1 = anIter1->Value();
anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
aPixmap = anAttr;
if (theIsNotModif) {
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
} else if ( isEmptyMesh ) {
@ -285,7 +285,7 @@ namespace SMESH
} else {
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL");
}
}
}
}
}
}
@ -300,10 +300,10 @@ namespace SMESH
}
else {
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(theHelpFileName));
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(theHelpFileName));
}
}

View File

@ -88,7 +88,7 @@ SMESHGUI_EXPORT
{
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
@ -114,7 +114,7 @@ SMESHGUI_EXPORT
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject),
_PTR(Study) );
_PTR(Study) );
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject) );
@ -124,7 +124,7 @@ SMESHGUI_EXPORT
{
CORBA::Object_var anObj = SObjectToObject(theSObject);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
@ -136,7 +136,7 @@ SMESHGUI_EXPORT
{
CORBA::Object_var anObj = IObjectToObject(theIO);
if(!CORBA::is_nil(anObj))
return TInterface::_narrow(anObj);
return TInterface::_narrow(anObj);
return TInterface::_nil();
}
@ -148,7 +148,7 @@ SMESHGUI_EXPORT
{
CORBA::Object_var anObj = IORToObject( theIOR );
if ( !CORBA::is_nil( anObj ) )
return TInterface::_narrow( anObj );
return TInterface::_narrow( anObj );
return TInterface::_nil();
}

View File

@ -145,7 +145,7 @@ namespace SMESH
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
@ -188,7 +188,7 @@ namespace SMESH
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
@ -231,18 +231,18 @@ namespace SMESH
// char* buf = new char[100*1024];
// delete [] buf;
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_VISU_PROBLEM"));
QObject::tr("SMESH_VISU_PROBLEM"));
} catch (...) {
// no more memory at all: last resort
MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<
std::endl << "Try to remove all visual data..." );
std::endl << "Try to remove all visual data..." );
if (theVISU_MemoryReserve) {
delete theVISU_MemoryReserve;
theVISU_MemoryReserve = 0;
}
RemoveAllObjectsWithActors();
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
MESSAGE_END ( "...done" );
}
}
@ -261,59 +261,59 @@ namespace SMESH
#endif
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
if(anIter != VISUAL_OBJ_CONT.end()){
aVisualObj = anIter->second;
aVisualObj = anIter->second;
}else{
SalomeApp_Application* app =
dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
_PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
_PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
if(aSObj){
_PTR(GenericAttribute) anAttr;
if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
if(!CORBA::is_nil(anObj)){
//Try narrow to SMESH_Mesh interface
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
if(!aMesh->_is_nil()){
aVisualObj.reset(new SMESH_MeshObj(aMesh));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
//Try narrow to SMESH_Group interface
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
if(!aGroup->_is_nil()){
_PTR(SObject) aFatherSObj = aSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
//Try narrow to SMESH_subMesh interface
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
if(!aSubMesh->_is_nil()){
_PTR(SObject) aFatherSObj = aSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
}
}
}
_PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
_PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
if(aSObj){
_PTR(GenericAttribute) anAttr;
if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
if(!CORBA::is_nil(anObj)){
//Try narrow to SMESH_Mesh interface
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
if(!aMesh->_is_nil()){
aVisualObj.reset(new SMESH_MeshObj(aMesh));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
//Try narrow to SMESH_Group interface
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
if(!aGroup->_is_nil()){
_PTR(SObject) aFatherSObj = aSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
//Try narrow to SMESH_subMesh interface
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
if(!aSubMesh->_is_nil()){
_PTR(SObject) aFatherSObj = aSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
TVisualObjCont::value_type aValue(aKey,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
}
}
}
}
}catch(...){
INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
@ -354,7 +354,7 @@ namespace SMESH
if ( usedMB * 10 > freeMB )
// even dont try to show
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
else
// there is a chance to succeed
continu = SUIT_MessageBox::warning
@ -362,7 +362,7 @@ namespace SMESH
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
if ( !continu ) {
// remove the corresponding actors from all views
RemoveVisualObjectWithActors( theEntry );
@ -391,7 +391,7 @@ namespace SMESH
if (anApp) {
if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
return aView;
return aView;
SUIT_ViewManager* aViewManager =
anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
@ -516,7 +516,7 @@ namespace SMESH
SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow,
const char* theEntry)
const char* theEntry)
{
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
vtkRenderer *aRenderer = aViewWindow->getRenderer();
@ -524,14 +524,14 @@ namespace SMESH
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->hasIO()){
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
return anActor;
}
}
}
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->hasIO()){
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
return anActor;
}
}
}
}
}
return NULL;
@ -553,8 +553,8 @@ namespace SMESH
CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
_PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
if(aSObject){
CORBA::String_var anEntry = aSObject->GetID().c_str();
return FindActorByEntry(anEntry.in());
CORBA::String_var anEntry = aSObject->GetID().c_str();
return FindActorByEntry(anEntry.in());
}
}
return NULL;
@ -562,41 +562,41 @@ namespace SMESH
SMESH_Actor* CreateActor(_PTR(Study) theStudy,
const char* theEntry,
int theIsClear)
const char* theEntry,
int theIsClear)
{
SMESH_Actor *anActor = NULL;
CORBA::Long anId = theStudy->StudyId();
if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
_PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
if(aSObj){
_PTR(GenericAttribute) anAttr;
if(aSObj->FindAttribute(anAttr,"AttributeName")){
_PTR(AttributeName) aName = anAttr;
std::string aNameVal = aName->Value();
anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
}
_PTR(GenericAttribute) anAttr;
if(aSObj->FindAttribute(anAttr,"AttributeName")){
_PTR(AttributeName) aName = anAttr;
std::string aNameVal = aName->Value();
anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
}
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
if(!CORBA::is_nil(aGroup))
{
SALOMEDS::Color aColor = aGroup->GetColor();
if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
{
int r = 0, g = 0, b = 0;
SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
aColor.R = (float)r / 255.0;
aColor.G = (float)g / 255.0;
aColor.B = (float)b / 255.0;
aGroup->SetColor( aColor );
}
if( aGroup->GetType() == SMESH::NODE )
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
else if( aGroup->GetType() == SMESH::EDGE )
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
else
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
}
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
if(!CORBA::is_nil(aGroup))
{
SALOMEDS::Color aColor = aGroup->GetColor();
if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
{
int r = 0, g = 0, b = 0;
SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
aColor.R = (float)r / 255.0;
aColor.G = (float)g / 255.0;
aColor.B = (float)b / 255.0;
aGroup->SetColor( aColor );
}
if( aGroup->GetType() == SMESH::NODE )
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
else if( aGroup->GetType() == SMESH::EDGE )
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
else
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
}
}
}
return anActor;
@ -626,14 +626,14 @@ namespace SMESH
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
vtkWnd->RemoveActor(theActor);
if(theActor->hasIO()){
Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
if(anIO->hasEntry()){
std::string anEntry = anIO->getEntry();
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
int aStudyId = aStudy->id();
TVisualObjCont::key_type aKey(aStudyId,anEntry);
VISUAL_OBJ_CONT.erase(aKey);
}
Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
if(anIO->hasEntry()){
std::string anEntry = anIO->getEntry();
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
int aStudyId = aStudy->id();
TVisualObjCont::key_type aKey(aStudyId,anEntry);
VISUAL_OBJ_CONT.erase(aKey);
}
}
theActor->Delete();
vtkWnd->Repaint();
@ -654,7 +654,7 @@ namespace SMESH
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor())
if(dynamic_cast<SMESH_Actor*>(anAct))
if(dynamic_cast<SMESH_Actor*>(anAct))
return false;
}
return true;
@ -676,37 +676,37 @@ namespace SMESH
switch (theAction) {
case eDisplayAll: {
while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
anActor->SetVisibility(true);
}
}
break;
while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
anActor->SetVisibility(true);
}
}
break;
}
case eDisplayOnly:
case eEraseAll: {
while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
anActor->SetVisibility(false);
}
}
while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
anActor->SetVisibility(false);
}
}
}
default: {
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
switch (theAction) {
case eDisplay:
case eDisplayOnly:
anActor->SetVisibility(true);
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
break;
case eErase:
anActor->SetVisibility(false);
break;
}
} else {
switch (theAction) {
case eDisplay:
case eDisplayOnly:
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
switch (theAction) {
case eDisplay:
case eDisplayOnly:
anActor->SetVisibility(true);
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
break;
case eErase:
anActor->SetVisibility(false);
break;
}
} else {
switch (theAction) {
case eDisplay:
case eDisplayOnly:
{
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
_PTR(Study) aDocument = aStudy->studyDS();
@ -725,8 +725,8 @@ namespace SMESH
}
break;
}
}
}
}
}
}
}
}
@ -747,24 +747,24 @@ namespace SMESH
SALOME_ListIO selected; mgr->selectedObjects( selected );
if( selected.Extent() == 0){
vtkRenderer* aRenderer = aWnd->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->hasIO())
if (!Update(anActor->getIO(),anActor->GetVisibility()))
vtkRenderer* aRenderer = aWnd->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->hasIO())
if (!Update(anActor->getIO(),anActor->GetVisibility()))
break; // avoid multiple warinings if visu failed
}
}
}
}
}else{
SALOME_ListIteratorOfListIO anIter( selected );
for( ; anIter.More(); anIter.Next()){
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if ( !Update(anIO,true) )
SALOME_ListIteratorOfListIO anIter( selected );
for( ; anIter.More(); anIter.Next()){
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if ( !Update(anIO,true) )
break; // avoid multiple warinings if visu failed
}
}
}
RepaintCurrentView();
}
@ -813,7 +813,7 @@ namespace SMESH
QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
int SW = mgr->integerValue( "SMESH", "selection_width", 5 ),
PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
@ -829,39 +829,39 @@ namespace SMESH
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
for ( int i=0, n=views.count(); i<n; i++ ){
// update VTK viewer properties
if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
// mesh element selection
aVtkView->SetSelectionProp(aSelColor.red()/255.,
aSelColor.green()/255.,
aSelColor.blue()/255.,
SW );
// tolerances
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
// mesh element selection
aVtkView->SetSelectionProp(aSelColor.red()/255.,
aSelColor.green()/255.,
aSelColor.blue()/255.,
SW );
// tolerances
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
// pre-selection
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
aPreColor.green()/255.,
aPreColor.blue()/255.,
PW);
// update actors
vtkRenderer* aRenderer = aVtkView->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
anActor->SetHighlightColor(aHiColor.red()/255.,
aHiColor.green()/255.,
aHiColor.blue()/255.);
anActor->SetPreHighlightColor(aPreColor.red()/255.,
aPreColor.green()/255.,
aPreColor.blue()/255.);
}
}
// pre-selection
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
aPreColor.green()/255.,
aPreColor.blue()/255.,
PW);
// update actors
vtkRenderer* aRenderer = aVtkView->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
anActor->SetHighlightColor(aHiColor.red()/255.,
aHiColor.green()/255.,
aHiColor.blue()/255.);
anActor->SetPreHighlightColor(aPreColor.red()/255.,
aPreColor.green()/255.,
aPreColor.blue()/255.);
}
}
}
}
}
@ -878,7 +878,7 @@ namespace SMESH
}
void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
SVTK_Selector* theSelector)
SVTK_Selector* theSelector)
{
if (theSelector)
theSelector->SetFilter(theFilter);
@ -906,7 +906,7 @@ namespace SMESH
}
bool IsValid(SALOME_Actor* theActor, int theCellId,
SVTK_Selector* theSelector)
SVTK_Selector* theSelector)
{
return theSelector->IsValid(theActor,theCellId);
}
@ -920,11 +920,11 @@ namespace SMESH
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->GetVisibility()){
anActor->SetPointRepresentation(theIsVisible);
}
}
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->GetVisibility()){
anActor->SetPointRepresentation(theIsVisible);
}
}
}
RepaintCurrentView();
}
@ -939,14 +939,14 @@ namespace SMESH
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
if(anActor->GetVisibility()){
anActor->SetPickable(anIsAllPickable);
}
}
if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
if(anActor->GetVisibility()){
anActor->SetPickable(anIsAllPickable);
}
}
}
if(theActor)
theActor->SetPickable(!anIsAllPickable);
theActor->SetPickable(!anIsAllPickable);
RepaintCurrentView();
}
}
@ -954,8 +954,8 @@ namespace SMESH
//----------------------------------------------------------------------------
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
{
theName = "";
TColStd_IndexedMapOfInteger aMapIndex;
@ -968,8 +968,8 @@ namespace SMESH
}
int GetNameOfSelectedElements(SVTK_Selector* theSelector,
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
{
theName = "";
TColStd_IndexedMapOfInteger aMapIndex;
@ -989,9 +989,9 @@ namespace SMESH
int GetEdgeNodes(SVTK_Selector* theSelector,
const TVisualObjPtr& theVisualObject,
int& theId1,
int& theId2)
const TVisualObjPtr& theVisualObject,
int& theId1,
int& theId2)
{
const SALOME_ListIO& selected = theSelector->StoredIObjects();
@ -1011,9 +1011,9 @@ namespace SMESH
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
int aVal = aMapIndex( i );
if ( aVal > 0 )
anObjId = aVal;
anObjId = aVal;
else
anEdgeNum = abs( aVal ) - 1;
anEdgeNum = abs( aVal ) - 1;
}
if ( anObjId == -1 || anEdgeNum == -1 )
@ -1024,18 +1024,18 @@ namespace SMESH
//----------------------------------------------------------------------------
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
{
theName = "";
if(theIO->hasEntry()){
if(FindActorByEntry(theIO->getEntry())){
TColStd_IndexedMapOfInteger aMapIndex;
theMgr->GetIndexes(theIO,aMapIndex);
for(int i = 1; i <= aMapIndex.Extent(); i++){
theName += QString(" %1").arg(aMapIndex(i));
}
return aMapIndex.Extent();
TColStd_IndexedMapOfInteger aMapIndex;
theMgr->GetIndexes(theIO,aMapIndex);
for(int i = 1; i <= aMapIndex.Extent(); i++){
theName += QString(" %1").arg(aMapIndex(i));
}
return aMapIndex.Extent();
}
}
return -1;
@ -1053,23 +1053,23 @@ namespace SMESH
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
const Handle(SALOME_InteractiveObject)& theIO,
QString& theName)
{
theName = "";
if(theIO->hasEntry()){
if(FindActorByEntry(theIO->getEntry())){
TColStd_IndexedMapOfInteger aMapIndex;
theMgr->GetIndexes(theIO,aMapIndex);
typedef std::set<int> TIdContainer;
TIdContainer anIdContainer;
for( int i = 1; i <= aMapIndex.Extent(); i++)
anIdContainer.insert(aMapIndex(i));
TIdContainer::const_iterator anIter = anIdContainer.begin();
for( ; anIter != anIdContainer.end(); anIter++){
theName += QString(" %1").arg(*anIter);
}
return aMapIndex.Extent();
TColStd_IndexedMapOfInteger aMapIndex;
theMgr->GetIndexes(theIO,aMapIndex);
typedef std::set<int> TIdContainer;
TIdContainer anIdContainer;
for( int i = 1; i <= aMapIndex.Extent(); i++)
anIdContainer.insert(aMapIndex(i));
TIdContainer::const_iterator anIter = anIdContainer.begin();
for( ; anIter != anIdContainer.end(); anIter++){
theName += QString(" %1").arg(*anIter);
}
return aMapIndex.Extent();
}
}
return -1;
@ -1089,8 +1089,8 @@ namespace SMESH
}
int GetSelected(LightApp_SelectionMgr* theMgr,
TColStd_IndexedMapOfInteger& theMap,
const bool theIsElement)
TColStd_IndexedMapOfInteger& theMap,
const bool theIsElement)
{
theMap.Clear();
SALOME_ListIO selected; theMgr->selectedObjects( selected );
@ -1099,7 +1099,7 @@ namespace SMESH
{
Handle(SALOME_InteractiveObject) anIO = selected.First();
if ( anIO->hasEntry() ) {
theMgr->GetIndexes( anIO, theMap );
theMgr->GetIndexes( anIO, theMap );
}
}
return theMap.Extent();
@ -1130,9 +1130,9 @@ namespace SMESH
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
int aVal = aMapIndex( i );
if ( aVal > 0 )
anObjId = aVal;
anObjId = aVal;
else
anEdgeNum = abs( aVal );
anEdgeNum = abs( aVal );
}
if ( anObjId == -1 || anEdgeNum == -1 )

View File

@ -69,7 +69,7 @@ SMESHGUI_EXPORT
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
bool = false );
bool = false );
SMESHGUI_EXPORT
SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
SMESHGUI_EXPORT
@ -112,7 +112,7 @@ SMESHGUI_EXPORT
SMESHGUI_EXPORT
bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" );
SMESHGUI_EXPORT
SMESHGUI_EXPORT
bool UpdateView( EDisplaing, const char* = "" );
SMESHGUI_EXPORT
@ -153,31 +153,31 @@ SMESHGUI_EXPORT
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( SVTK_Selector*,
const Handle(SALOME_InteractiveObject)&,
QString& );
const Handle(SALOME_InteractiveObject)&,
QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( SVTK_Selector*,
const Handle(SALOME_InteractiveObject)&,
QString& );
const Handle(SALOME_InteractiveObject)&,
QString& );
SMESHGUI_EXPORT
int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
const Handle(SALOME_InteractiveObject)&,
QString& );
const Handle(SALOME_InteractiveObject)&,
QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( LightApp_SelectionMgr*,
const Handle(SALOME_InteractiveObject)&,
QString& );
const Handle(SALOME_InteractiveObject)&,
QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
const bool = true );
const bool = true );
SMESHGUI_EXPORT
int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );

View File

@ -242,14 +242,14 @@ void SMESHGUI_WhatIsDlg::SelectionsClicked (int selectionId)
{
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
aViewWindow->SetSelectionMode( NodeSelection );
break;
}
case 1:
{
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( CellSelection );
aViewWindow->SetSelectionMode( CellSelection );
break;
}
}
@ -299,10 +299,10 @@ void SMESHGUI_WhatIsDlg::ClickOnHelp()
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(myHelpFileName));
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
"application")).
arg(myHelpFileName));
}
}
@ -329,10 +329,10 @@ void SMESHGUI_WhatIsDlg::onTextChange (const QString& theNewText)
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
aMesh->FindNode(aListId[ i ].toInt()):
aMesh->FindElement(aListId[ i ].toInt());
aMesh->FindNode(aListId[ i ].toInt()):
aMesh->FindElement(aListId[ i ].toInt());
if (e)
newIndices.Add(e->GetID());
newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
@ -455,22 +455,22 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
anInfo+=tr("SMESH_FACE")+"<br>";
anInfo+="<b>" + tr("SMESH_MESHINFO_TYPE")+":</b> ";
if(!ef->IsPoly())
anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
switch(ef->NbNodes()) {
case 3:
case 6:
{
anInfo+=tr("SMESH_TRIANGLE");
break;
}
{
anInfo+=tr("SMESH_TRIANGLE");
break;
}
case 4:
case 8:
{
anInfo+=tr("SMESH_QUADRANGLE");
break;
}
{
anInfo+=tr("SMESH_QUADRANGLE");
break;
}
default:
break;
break;
}
anInfo+="<br>";
} else if(e->GetType() == SMDSAbs_Volume) {
@ -479,39 +479,39 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
SMDS_VolumeTool vt(ev);
if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA)
anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
switch(vt.GetVolumeType()) {
case SMDS_VolumeTool::TETRA:
case SMDS_VolumeTool::QUAD_TETRA:
{
anInfo+=tr("SMESH_TETRAS");
break;
}
{
anInfo+=tr("SMESH_TETRAS");
break;
}
case SMDS_VolumeTool::PYRAM:
case SMDS_VolumeTool::QUAD_PYRAM:
{
anInfo+=tr("SMESH_PYRAMID");
break;
}
{
anInfo+=tr("SMESH_PYRAMID");
break;
}
case SMDS_VolumeTool::PENTA:
case SMDS_VolumeTool::QUAD_PENTA:
{
anInfo+=tr("SMESH_PRISM");
break;
}
{
anInfo+=tr("SMESH_PRISM");
break;
}
case SMDS_VolumeTool::HEXA:
case SMDS_VolumeTool::QUAD_HEXA:
{
anInfo+=tr("SMESH_HEXAS");
break;
}
{
anInfo+=tr("SMESH_HEXAS");
break;
}
case SMDS_VolumeTool::POLYHEDA:
{
anInfo+=tr("SMESH_POLYEDRON");
break;
}
{
anInfo+=tr("SMESH_POLYEDRON");
break;
}
default:
break;
break;
}
anInfo+="<br>";
}
@ -523,17 +523,17 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
if(e->GetType() != SMDSAbs_Node)
aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
// Calculate Connectivity
SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
if (it) {
aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
while (it->more()) {
const SMDS_MeshElement* elem = it->next();
aNodesInfo+=QString(" %1").arg(elem->GetID());
}
if ( (nbNodes+1) != e->NbNodes())
aNodesInfo+=QString("<br><br>");
aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
while (it->more()) {
const SMDS_MeshElement* elem = it->next();
aNodesInfo+=QString(" %1").arg(elem->GetID());
}
if ( (nbNodes+1) != e->NbNodes())
aNodesInfo+=QString("<br><br>");
}
}
if(e->GetType() != SMDSAbs_Node)

View File

@ -103,7 +103,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
{
MESSAGE("Loading Resources " << aResName.toLatin1().data());
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
resMgr->loadTranslator( "resources", QString( "%1_images.qm" ).arg( aResName, lang ) );
}
@ -186,7 +186,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
{
QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
aHypos = aHypos.remove( ' ' );
aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
}
}
}

View File

@ -45,7 +45,7 @@ public:
bool startDocument();
bool startElement( const QString&, const QString&,
const QString&, const QXmlAttributes& );
const QString&, const QXmlAttributes& );
bool endElement( const QString&, const QString&, const QString& );
bool characters( const QString& );