mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
untabify
This commit is contained in:
parent
fe22993f88
commit
7af78cc3d0
File diff suppressed because it is too large
Load Diff
@ -186,11 +186,11 @@ namespace SMESH
|
|||||||
vtkIdList *anIds = vtkIdList::New();
|
vtkIdList *anIds = vtkIdList::New();
|
||||||
|
|
||||||
if(aConn)
|
if(aConn)
|
||||||
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
||||||
anIds->InsertId(i,theIds[aConn[i]]);
|
anIds->InsertId(i,theIds[aConn[i]]);
|
||||||
else
|
else
|
||||||
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
||||||
anIds->InsertId(i,theIds[i]);
|
anIds->InsertId(i,theIds[i]);
|
||||||
|
|
||||||
myGrid->InsertNextCell(theType,anIds);
|
myGrid->InsertNextCell(theType,anIds);
|
||||||
anIds->Delete();
|
anIds->Delete();
|
||||||
@ -212,8 +212,8 @@ namespace SMESH
|
|||||||
~TElementSimulation()
|
~TElementSimulation()
|
||||||
{
|
{
|
||||||
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
||||||
myVTKViewWindow->RemoveActor(myPreviewActor);
|
myVTKViewWindow->RemoveActor(myPreviewActor);
|
||||||
myVTKViewWindow->RemoveActor(myFaceOrientation);
|
myVTKViewWindow->RemoveActor(myFaceOrientation);
|
||||||
}
|
}
|
||||||
myPreviewActor->Delete();
|
myPreviewActor->Delete();
|
||||||
myFaceOrientation->Delete();
|
myFaceOrientation->Delete();
|
||||||
@ -237,7 +237,7 @@ namespace SMESH
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
|
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
|
||||||
SMDSAbs_ElementType ElementType,
|
SMDSAbs_ElementType ElementType,
|
||||||
int nbNodes )
|
int nbNodes )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
||||||
@ -466,9 +466,9 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
|
|||||||
aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
|
aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
|
||||||
case SMDSAbs_Face: {
|
case SMDSAbs_Face: {
|
||||||
if(myIsPoly)
|
if(myIsPoly)
|
||||||
aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
|
aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
|
||||||
else
|
else
|
||||||
aMeshEditor->AddFace(anArrayOfIndices.inout());
|
aMeshEditor->AddFace(anArrayOfIndices.inout());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
@ -536,10 +536,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,12 +571,12 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
|
|||||||
bool allOk = true;
|
bool allOk = true;
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
|
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
|
||||||
{
|
{
|
||||||
newIndices.Add( n->GetID() );
|
newIndices.Add( n->GetID() );
|
||||||
myNbOkNodes++;
|
myNbOkNodes++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
allOk = false;
|
allOk = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
||||||
@ -587,10 +587,10 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
if (myIsPoly)
|
if (myIsPoly)
|
||||||
{
|
{
|
||||||
if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
|
if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
|
||||||
myNbOkNodes = 0;
|
myNbOkNodes = 0;
|
||||||
else
|
else
|
||||||
myNbOkNodes = aListId.count();
|
myNbOkNodes = aListId.count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ namespace SMESH
|
|||||||
void SetPosition (SMESH_Actor* theActor,
|
void SetPosition (SMESH_Actor* theActor,
|
||||||
const int theType,
|
const int theType,
|
||||||
TVTKIds& theIds,
|
TVTKIds& theIds,
|
||||||
const int theMode,
|
const int theMode,
|
||||||
const bool theReverse)
|
const bool theReverse)
|
||||||
{
|
{
|
||||||
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
||||||
@ -311,8 +311,8 @@ namespace SMESH
|
|||||||
~TElementSimulation()
|
~TElementSimulation()
|
||||||
{
|
{
|
||||||
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
||||||
myVTKViewWindow->RemoveActor(myPreviewActor);
|
myVTKViewWindow->RemoveActor(myPreviewActor);
|
||||||
myVTKViewWindow->RemoveActor(myFaceOrientation);
|
myVTKViewWindow->RemoveActor(myFaceOrientation);
|
||||||
}
|
}
|
||||||
myPreviewActor->Delete();
|
myPreviewActor->Delete();
|
||||||
myFaceOrientation->Delete();
|
myFaceOrientation->Delete();
|
||||||
@ -411,7 +411,7 @@ QWidget* IdEditItem::createEditor() const
|
|||||||
// purpose : constructor
|
// purpose : constructor
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
|
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
|
||||||
const int theType )
|
const int theType )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
@ -766,10 +766,10 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,12 +797,12 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
|
|||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
|
if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
|
||||||
{
|
{
|
||||||
newIndices.Add( n->GetID() );
|
newIndices.Add( n->GetID() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
allOk = false;
|
allOk = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -914,16 +914,16 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
for ( int row = 0; row < myNbCorners; row++ )
|
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++ )
|
for ( int row = 0; row < myTable->rowCount(); row++ )
|
||||||
{
|
{
|
||||||
anID = myTable->item(row, 1)->text().toInt(&ok);
|
anID = myTable->item(row, 1)->text().toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
anID = myTable->item(row, 0)->text().toInt();
|
anID = myTable->item(row, 0)->text().toInt();
|
||||||
aDisplayMode = VTK_WIREFRAME;
|
aDisplayMode = VTK_WIREFRAME;
|
||||||
}
|
}
|
||||||
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
|
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1117,7 +1117,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
|
|||||||
// clear table
|
// clear table
|
||||||
for ( int row = 0; row < myTable->rowCount(); row++ )
|
for ( int row = 0; row < myTable->rowCount(); row++ )
|
||||||
for ( int col = 0; col < myTable->columnCount(); col++ )
|
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 );
|
myTable->setEnabled( false );
|
||||||
}
|
}
|
||||||
|
@ -292,22 +292,22 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
if (!myMesh->_is_nil()) {
|
if (!myMesh->_is_nil()) {
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
|
|
||||||
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
||||||
// concatenate meshes
|
// concatenate meshes
|
||||||
SMESH::SMESH_Mesh_var aCompoundMesh;
|
SMESH::SMESH_Mesh_var aCompoundMesh;
|
||||||
if(CheckBoxCommon->isChecked())
|
if(CheckBoxCommon->isChecked())
|
||||||
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
|
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
|
||||||
!(ComboBoxUnion->currentIndex()),
|
!(ComboBoxUnion->currentIndex()),
|
||||||
CheckBoxMerge->isChecked(),
|
CheckBoxMerge->isChecked(),
|
||||||
SpinBoxTol->GetValue());
|
SpinBoxTol->GetValue());
|
||||||
else
|
else
|
||||||
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
|
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
|
||||||
!(ComboBoxUnion->currentIndex()),
|
!(ComboBoxUnion->currentIndex()),
|
||||||
CheckBoxMerge->isChecked(),
|
CheckBoxMerge->isChecked(),
|
||||||
SpinBoxTol->GetValue());
|
SpinBoxTol->GetValue());
|
||||||
|
|
||||||
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
@ -360,10 +360,10 @@ void SMESHGUI_BuildCompoundDlg::ClickOnHelp()
|
|||||||
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
"application")).
|
"application")).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,31 +264,31 @@ void SMESHGUI_ClippingDlg::AddPlane (SMESH_Actor* theActor,
|
|||||||
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
|
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
|
||||||
|
|
||||||
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
|
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 aParam, aPnt0[3], aPnt1[3], aPnt2[3];
|
||||||
|
|
||||||
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
|
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
|
||||||
aPnt[1] - aDelta[0][1] - aDelta[1][1],
|
aPnt[1] - aDelta[0][1] - aDelta[1][1],
|
||||||
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
|
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
|
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
|
||||||
aPnt01[1] + aNormal[1],
|
aPnt01[1] + aNormal[1],
|
||||||
aPnt01[2] + aNormal[2]};
|
aPnt01[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
|
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
|
||||||
|
|
||||||
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
|
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
|
||||||
aPnt[1] - aDelta[0][1] + aDelta[1][1],
|
aPnt[1] - aDelta[0][1] + aDelta[1][1],
|
||||||
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
|
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
|
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
|
||||||
aPnt11[1] + aNormal[1],
|
aPnt11[1] + aNormal[1],
|
||||||
aPnt11[2] + aNormal[2]};
|
aPnt11[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
|
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
|
||||||
|
|
||||||
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
|
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
|
||||||
aPnt[1] + aDelta[0][1] - aDelta[1][1],
|
aPnt[1] + aDelta[0][1] - aDelta[1][1],
|
||||||
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
|
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
|
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
|
||||||
aPnt21[1] + aNormal[1],
|
aPnt21[1] + aNormal[1],
|
||||||
aPnt21[2] + aNormal[2]};
|
aPnt21[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
|
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
|
||||||
|
|
||||||
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
|
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
|
||||||
@ -555,17 +555,17 @@ void SMESHGUI_ClippingDlg::ClickOnHelp()
|
|||||||
if (app)
|
if (app)
|
||||||
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
||||||
else {
|
else {
|
||||||
QString platform;
|
QString platform;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
platform = "winapplication";
|
platform = "winapplication";
|
||||||
#else
|
#else
|
||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,24 +581,24 @@ void SMESHGUI_ClippingDlg::onSelectionChanged()
|
|||||||
Handle(SALOME_InteractiveObject) IOS = aList.First();
|
Handle(SALOME_InteractiveObject) IOS = aList.First();
|
||||||
myActor = SMESH::FindActorByEntry(IOS->getEntry());
|
myActor = SMESH::FindActorByEntry(IOS->getEntry());
|
||||||
if (myActor) {
|
if (myActor) {
|
||||||
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
|
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
|
||||||
myPlanes.clear();
|
myPlanes.clear();
|
||||||
|
|
||||||
vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
|
vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
|
||||||
for ( ; anId < anEnd; anId++) {
|
for ( ; anId < anEnd; anId++) {
|
||||||
if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
|
if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
|
||||||
if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
|
if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
|
||||||
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
|
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
|
||||||
SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
|
SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
|
||||||
anOrientedPlane->Delete();
|
anOrientedPlane->Delete();
|
||||||
aTVTKPlane->ShallowCopy(aPlane);
|
aTVTKPlane->ShallowCopy(aPlane);
|
||||||
myPlanes.push_back(aTVTKPlane);
|
myPlanes.push_back(aTVTKPlane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::for_each(myPlanes.begin(),myPlanes.end(),
|
std::for_each(myPlanes.begin(),myPlanes.end(),
|
||||||
TSetVisiblity(PreviewCheckBox->isChecked()));
|
TSetVisiblity(PreviewCheckBox->isChecked()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SMESH::RenderViewWindow(aViewWindow);
|
SMESH::RenderViewWindow(aViewWindow);
|
||||||
@ -840,31 +840,31 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
|
|||||||
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
|
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
|
||||||
|
|
||||||
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
|
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 aParam, aPnt0[3], aPnt1[3], aPnt2[3];
|
||||||
|
|
||||||
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
|
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
|
||||||
aPnt[1] - aDelta[0][1] - aDelta[1][1],
|
aPnt[1] - aDelta[0][1] - aDelta[1][1],
|
||||||
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
|
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
|
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
|
||||||
aPnt01[1] + aNormal[1],
|
aPnt01[1] + aNormal[1],
|
||||||
aPnt01[2] + aNormal[2]};
|
aPnt01[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
|
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
|
||||||
|
|
||||||
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
|
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
|
||||||
aPnt[1] - aDelta[0][1] + aDelta[1][1],
|
aPnt[1] - aDelta[0][1] + aDelta[1][1],
|
||||||
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
|
aPnt[2] - aDelta[0][2] + aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
|
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
|
||||||
aPnt11[1] + aNormal[1],
|
aPnt11[1] + aNormal[1],
|
||||||
aPnt11[2] + aNormal[2]};
|
aPnt11[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
|
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
|
||||||
|
|
||||||
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
|
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
|
||||||
aPnt[1] + aDelta[0][1] - aDelta[1][1],
|
aPnt[1] + aDelta[0][1] - aDelta[1][1],
|
||||||
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
|
aPnt[2] + aDelta[0][2] - aDelta[1][2]};
|
||||||
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
|
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
|
||||||
aPnt21[1] + aNormal[1],
|
aPnt21[1] + aNormal[1],
|
||||||
aPnt21[2] + aNormal[2]};
|
aPnt21[2] + aNormal[2]};
|
||||||
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
|
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
|
||||||
|
|
||||||
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
|
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
|
||||||
|
@ -82,16 +82,16 @@ public:
|
|||||||
// used in SMESHGUI::restoreVisualParameters() to avoid
|
// used in SMESHGUI::restoreVisualParameters() to avoid
|
||||||
// declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
|
// declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
|
||||||
static void AddPlane (SMESH_Actor* theActor,
|
static void AddPlane (SMESH_Actor* theActor,
|
||||||
SVTK_ViewWindow* theViewWindow,
|
SVTK_ViewWindow* theViewWindow,
|
||||||
SMESH::Orientation theOrientation,
|
SMESH::Orientation theOrientation,
|
||||||
double theDistance,
|
double theDistance,
|
||||||
vtkFloatingPointType theAngle[2]);
|
vtkFloatingPointType theAngle[2]);
|
||||||
|
|
||||||
static void GetPlaneParam (SMESH_Actor* theActor,
|
static void GetPlaneParam (SMESH_Actor* theActor,
|
||||||
int thePlaneIndex,
|
int thePlaneIndex,
|
||||||
SMESH::Orientation& theOrientation,
|
SMESH::Orientation& theOrientation,
|
||||||
double& theDistance,
|
double& theDistance,
|
||||||
vtkFloatingPointType* theAngle);
|
vtkFloatingPointType* theAngle);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent( QKeyEvent* );
|
void keyPressEvent( QKeyEvent* );
|
||||||
|
@ -185,7 +185,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
|
|||||||
{
|
{
|
||||||
dlg()->show();
|
dlg()->show();
|
||||||
SUIT_MessageBox::warning( myDlg,
|
SUIT_MessageBox::warning( myDlg,
|
||||||
tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
|
tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
|
|||||||
if( CORBA::is_nil(mesh) )
|
if( CORBA::is_nil(mesh) )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( myDlg,
|
SUIT_MessageBox::warning( myDlg,
|
||||||
tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
|
tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
|
|||||||
{
|
{
|
||||||
bool aParam = true;
|
bool aParam = true;
|
||||||
if( myDlg->IsEnabledCheck() )
|
if( myDlg->IsEnabledCheck() )
|
||||||
aParam = myDlg->IsMediumNdsOnGeom();
|
aParam = myDlg->IsMediumNdsOnGeom();
|
||||||
|
|
||||||
aEditor->ConvertToQuadratic( aParam );
|
aEditor->ConvertToQuadratic( aParam );
|
||||||
aResult = true;
|
aResult = true;
|
||||||
|
@ -193,11 +193,11 @@ QWidget* SMESHGUI_CreatePatternDlg::createMainFrame( QWidget* theParent )
|
|||||||
// Connect signals and slots
|
// Connect signals and slots
|
||||||
|
|
||||||
connect( myTypeGrp, SIGNAL( buttonClicked( int ) ),
|
connect( myTypeGrp, SIGNAL( buttonClicked( int ) ),
|
||||||
this, SLOT( onTypeChanged( int ) ) );
|
this, SLOT( onTypeChanged( int ) ) );
|
||||||
connect( myProjectChk, SIGNAL( toggled( bool ) ),
|
connect( myProjectChk, SIGNAL( toggled( bool ) ),
|
||||||
this, SLOT( onProject( bool ) ) );
|
this, SLOT( onProject( bool ) ) );
|
||||||
connect( aSelBtn, SIGNAL( clicked() ),
|
connect( aSelBtn, SIGNAL( clicked() ),
|
||||||
this, SLOT( onSelBtnClicked() ) );
|
this, SLOT( onSelBtnClicked() ) );
|
||||||
|
|
||||||
return aMainGrp;
|
return aMainGrp;
|
||||||
}
|
}
|
||||||
@ -274,11 +274,11 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType )
|
|||||||
|
|
||||||
// selection and SMESHGUI
|
// selection and SMESHGUI
|
||||||
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
|
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
|
||||||
this, SLOT( onSelectionDone() ) );
|
this, SLOT( onSelectionDone() ) );
|
||||||
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
|
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
|
||||||
this, SLOT( onDeactivate() ) );
|
this, SLOT( onDeactivate() ) );
|
||||||
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
|
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
|
||||||
this, SLOT( onClose() ) );
|
this, SLOT( onClose() ) );
|
||||||
|
|
||||||
mySwitch2d->setEnabled( theType == Type_2d );
|
mySwitch2d->setEnabled( theType == Type_2d );
|
||||||
mySwitch3d->setEnabled( theType == Type_3d );
|
mySwitch3d->setEnabled( theType == Type_3d );
|
||||||
@ -342,8 +342,8 @@ bool SMESHGUI_CreatePatternDlg::isValid()
|
|||||||
{
|
{
|
||||||
if ( myGeomObj->_is_nil() ) {
|
if ( myGeomObj->_is_nil() ) {
|
||||||
SUIT_MessageBox::information( this,
|
SUIT_MessageBox::information( this,
|
||||||
tr( "SMESH_INSUFFICIENT_DATA" ),
|
tr( "SMESH_INSUFFICIENT_DATA" ),
|
||||||
tr( "SMESHGUI_INVALID_PARAMETERS" ) );
|
tr( "SMESHGUI_INVALID_PARAMETERS" ) );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -406,13 +406,13 @@ void SMESHGUI_CreatePatternDlg::onSave()
|
|||||||
|
|
||||||
if ( aWritten != aLen ) {
|
if ( aWritten != aLen ) {
|
||||||
SUIT_MessageBox::information( this,
|
SUIT_MessageBox::information( this,
|
||||||
tr( "SMESH_ERROR" ),
|
tr( "SMESH_ERROR" ),
|
||||||
tr( "ERROR_OF_SAVING" ) );
|
tr( "ERROR_OF_SAVING" ) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
|
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
|
||||||
aViewWindow->SetSelectionMode( ActorSelection );
|
aViewWindow->SetSelectionMode( ActorSelection );
|
||||||
disconnect( mySelectionMgr, 0, this, 0 );
|
disconnect( mySelectionMgr, 0, this, 0 );
|
||||||
disconnect( mySMESHGUI, 0, this, 0 );
|
disconnect( mySMESHGUI, 0, this, 0 );
|
||||||
mySMESHGUI->ResetState();
|
mySMESHGUI->ResetState();
|
||||||
@ -465,7 +465,7 @@ void SMESHGUI_CreatePatternDlg::onOk()
|
|||||||
else {
|
else {
|
||||||
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
|
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
|
||||||
aViewWindow->SetSelectionMode( ActorSelection );
|
aViewWindow->SetSelectionMode( ActorSelection );
|
||||||
disconnect( mySelectionMgr, 0, this, 0 );
|
disconnect( mySelectionMgr, 0, this, 0 );
|
||||||
disconnect( mySMESHGUI, 0, this, 0 );
|
disconnect( mySMESHGUI, 0, this, 0 );
|
||||||
mySMESHGUI->ResetState();
|
mySMESHGUI->ResetState();
|
||||||
@ -512,11 +512,11 @@ void SMESHGUI_CreatePatternDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning( this,
|
SUIT_MessageBox::warning( this,
|
||||||
tr( "WRN_WARNING" ),
|
tr( "WRN_WARNING" ),
|
||||||
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
||||||
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
|
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
|
||||||
platform ) ).
|
platform ) ).
|
||||||
arg( myHelpFileName ) );
|
arg( myHelpFileName ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,20 +754,20 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
|
|||||||
|
|
||||||
if ( myType == Type_2d ) {
|
if ( myType == Type_2d ) {
|
||||||
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
|
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
|
||||||
TopAbs_SHAPE,
|
TopAbs_SHAPE,
|
||||||
-1,
|
-1,
|
||||||
TopAbs_FACE ) );
|
TopAbs_FACE ) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TColStd_MapOfInteger aTypes;
|
TColStd_MapOfInteger aTypes;
|
||||||
aTypes.Add( TopAbs_SHELL );
|
aTypes.Add( TopAbs_SHELL );
|
||||||
aTypes.Add( TopAbs_SOLID );
|
aTypes.Add( TopAbs_SOLID );
|
||||||
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
|
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
|
||||||
TopAbs_FACE,
|
TopAbs_FACE,
|
||||||
6,
|
6,
|
||||||
aTypes,
|
aTypes,
|
||||||
GEOM::GEOM_Object::_nil(),
|
GEOM::GEOM_Object::_nil(),
|
||||||
true ) );
|
true ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,9 +129,9 @@ namespace SMESH
|
|||||||
|
|
||||||
typedef std::vector<vtkIdType> TVTKIds;
|
typedef std::vector<vtkIdType> TVTKIds;
|
||||||
void SetPosition(SMESH_Actor* theActor,
|
void SetPosition(SMESH_Actor* theActor,
|
||||||
vtkIdType theType,
|
vtkIdType theType,
|
||||||
const TVTKIds& theIds,
|
const TVTKIds& theIds,
|
||||||
bool theReset=true)
|
bool theReset=true)
|
||||||
{
|
{
|
||||||
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
||||||
myGrid->SetPoints(aGrid->GetPoints());
|
myGrid->SetPoints(aGrid->GetPoints());
|
||||||
@ -141,12 +141,12 @@ namespace SMESH
|
|||||||
vtkIdList *anIds = vtkIdList::New();
|
vtkIdList *anIds = vtkIdList::New();
|
||||||
|
|
||||||
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
|
||||||
anIds->InsertId(i,theIds[i]);
|
anIds->InsertId(i,theIds[i]);
|
||||||
|
|
||||||
myGrid->InsertNextCell(theType,anIds);
|
myGrid->InsertNextCell(theType,anIds);
|
||||||
if(theIds.size()!=0){
|
if(theIds.size()!=0){
|
||||||
myGrid->InsertNextCell(theType,anIds);
|
myGrid->InsertNextCell(theType,anIds);
|
||||||
myGrid->Modified();
|
myGrid->Modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
anIds->Delete();
|
anIds->Delete();
|
||||||
@ -167,7 +167,7 @@ namespace SMESH
|
|||||||
|
|
||||||
~TPolySimulation(){
|
~TPolySimulation(){
|
||||||
if( myViewWindow )
|
if( myViewWindow )
|
||||||
myViewWindow->RemoveActor(myPreviewActor);
|
myViewWindow->RemoveActor(myPreviewActor);
|
||||||
|
|
||||||
myPreviewActor->Delete();
|
myPreviewActor->Delete();
|
||||||
|
|
||||||
@ -358,42 +358,42 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
|
|||||||
{
|
{
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
{
|
||||||
if ( myActor ){
|
if ( myActor ){
|
||||||
myActor->SetPointRepresentation(true);
|
myActor->SetPointRepresentation(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
|
|
||||||
AddButton->setEnabled(false);
|
AddButton->setEnabled(false);
|
||||||
RemoveButton->setEnabled(false);
|
RemoveButton->setEnabled(false);
|
||||||
TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
|
TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
|
||||||
myFacesByNodesLabel->show();
|
myFacesByNodesLabel->show();
|
||||||
myFacesByNodes->clear();
|
myFacesByNodes->clear();
|
||||||
myFacesByNodes->show();
|
myFacesByNodes->show();
|
||||||
AddButton->show();
|
AddButton->show();
|
||||||
RemoveButton->show();
|
RemoveButton->show();
|
||||||
Preview->show();
|
Preview->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1 :
|
case 1 :
|
||||||
{
|
{
|
||||||
if( myActor ){
|
if( myActor ){
|
||||||
myActor->SetPointRepresentation(false);
|
myActor->SetPointRepresentation(false);
|
||||||
} else {
|
} else {
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
}
|
}
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
|
|
||||||
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
|
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
|
||||||
myFacesByNodesLabel->hide();
|
myFacesByNodesLabel->hide();
|
||||||
myFacesByNodes->hide();
|
myFacesByNodes->hide();
|
||||||
AddButton->hide();
|
AddButton->hide();
|
||||||
RemoveButton->hide();
|
RemoveButton->hide();
|
||||||
Preview->show();
|
Preview->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,71 +425,71 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
|
|||||||
if(checkEditLine(false) == -1) {return;}
|
if(checkEditLine(false) == -1) {return;}
|
||||||
busy = true;
|
busy = true;
|
||||||
if (GetConstructorId() == 0)
|
if (GetConstructorId() == 0)
|
||||||
{
|
{
|
||||||
SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
|
SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
|
||||||
SMESH::long_array_var aQuantities = 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;
|
int aNbQuantities = 0;
|
||||||
for (int i = 0; i < myFacesByNodes->count(); i++ ) {
|
for (int i = 0; i < myFacesByNodes->count(); i++ ) {
|
||||||
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
|
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
|
||||||
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
|
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
|
||||||
aNodesIds.Append( (*it).toInt() );
|
aNodesIds.Append( (*it).toInt() );
|
||||||
|
|
||||||
aQuantities[aNbQuantities++] = anIds.count();
|
aQuantities[aNbQuantities++] = anIds.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
anIdsOfNodes->length(aNodesIds.Extent());
|
anIdsOfNodes->length(aNodesIds.Extent());
|
||||||
|
|
||||||
int aNbIdsOfNodes = 0;
|
int aNbIdsOfNodes = 0;
|
||||||
TColStd_ListIteratorOfListOfInteger It;
|
TColStd_ListIteratorOfListOfInteger It;
|
||||||
It.Initialize(aNodesIds);
|
It.Initialize(aNodesIds);
|
||||||
for( ;It.More();It.Next())
|
for( ;It.More();It.Next())
|
||||||
anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
|
anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
|
aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
|
||||||
}catch(SALOME::SALOME_Exception& exc){
|
}catch(SALOME::SALOME_Exception& exc){
|
||||||
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
|
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
|
||||||
}catch(std::exception& exc){
|
}catch(std::exception& exc){
|
||||||
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
||||||
}catch(...){
|
}catch(...){
|
||||||
INFOS("Unknown exception was cought !!!");
|
INFOS("Unknown exception was cought !!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GetConstructorId() == 1)
|
else if (GetConstructorId() == 1)
|
||||||
{
|
{
|
||||||
SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
|
SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
|
||||||
|
|
||||||
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
||||||
anIdsOfFaces->length(aListId.count());
|
anIdsOfFaces->length(aListId.count());
|
||||||
for ( int i = 0; i < aListId.count(); i++ )
|
for ( int i = 0; i < aListId.count(); i++ )
|
||||||
anIdsOfFaces[i] = aListId[i].toInt();
|
anIdsOfFaces[i] = aListId[i].toInt();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
|
aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
|
||||||
}catch(SALOME::SALOME_Exception& exc){
|
}catch(SALOME::SALOME_Exception& exc){
|
||||||
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
|
INFOS("Follow exception was cought:\n\t"<<exc.details.text);
|
||||||
}catch(std::exception& exc){
|
}catch(std::exception& exc){
|
||||||
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
INFOS("Follow exception was cought:\n\t"<<exc.what());
|
||||||
}catch(...){
|
}catch(...){
|
||||||
INFOS("Unknown exception was cought !!!");
|
INFOS("Unknown exception was cought !!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//SALOME_ListIO aList;
|
//SALOME_ListIO aList;
|
||||||
//mySelectionMgr->setSelectedObjects( aList );
|
//mySelectionMgr->setSelectedObjects( aList );
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
if( myActor ){
|
if( myActor ){
|
||||||
unsigned int anEntityMode = myActor->GetEntityMode();
|
unsigned int anEntityMode = myActor->GetEntityMode();
|
||||||
myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
|
myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
|
||||||
}
|
}
|
||||||
//ConstructorsClicked( GetConstructorId() );
|
//ConstructorsClicked( GetConstructorId() );
|
||||||
busy = false;
|
busy = false;
|
||||||
@ -543,10 +543,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,67 +570,67 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
|
|||||||
if (GetConstructorId() == 0)
|
if (GetConstructorId() == 0)
|
||||||
{
|
{
|
||||||
if ( aMesh ) {
|
if ( aMesh ) {
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
|
|
||||||
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
|
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
|
||||||
for ( int i = 0; i < aListId.count(); i++ ) {
|
for ( int i = 0; i < aListId.count(); i++ ) {
|
||||||
const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
|
const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
|
||||||
if ( n ) {
|
if ( n ) {
|
||||||
newIndices.Add(n->GetID());
|
newIndices.Add(n->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
aViewWindow->highlight( myActor->getIO(), true, true );
|
||||||
|
|
||||||
if ( myNbOkElements>0 && aListId.count()>=3)
|
if ( myNbOkElements>0 && aListId.count()>=3)
|
||||||
AddButton->setEnabled(true);
|
AddButton->setEnabled(true);
|
||||||
else
|
else
|
||||||
AddButton->setEnabled(false);
|
AddButton->setEnabled(false);
|
||||||
|
|
||||||
displaySimulation();
|
displaySimulation();
|
||||||
}
|
}
|
||||||
} else if (GetConstructorId() == 1)
|
} else if (GetConstructorId() == 1)
|
||||||
{
|
{
|
||||||
myNbOkElements = 0;
|
myNbOkElements = 0;
|
||||||
buttonOk->setEnabled( false );
|
buttonOk->setEnabled( false );
|
||||||
buttonApply->setEnabled( false );
|
buttonApply->setEnabled( false );
|
||||||
|
|
||||||
// check entered ids of faces and hilight them
|
// check entered ids of faces and hilight them
|
||||||
QStringList aListId;
|
QStringList aListId;
|
||||||
if ( aMesh ) {
|
if ( aMesh ) {
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
|
|
||||||
aListId = theNewText.split( " ", QString::SkipEmptyParts );
|
aListId = theNewText.split( " ", QString::SkipEmptyParts );
|
||||||
|
|
||||||
for ( int i = 0; i < aListId.count(); i++ ) {
|
for ( int i = 0; i < aListId.count(); i++ ) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
|
const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
|
||||||
if ( e ) {
|
if ( e ) {
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
aViewWindow->highlight( myActor->getIO(), true, true );
|
||||||
|
|
||||||
if ( myNbOkElements ) {
|
if ( myNbOkElements ) {
|
||||||
if (aListId.count()>1){
|
if (aListId.count()>1){
|
||||||
buttonOk->setEnabled( true );
|
buttonOk->setEnabled( true );
|
||||||
buttonApply->setEnabled( true );
|
buttonApply->setEnabled( true );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
buttonOk->setEnabled( false );
|
buttonOk->setEnabled( false );
|
||||||
buttonApply->setEnabled( false );
|
buttonApply->setEnabled( false );
|
||||||
}
|
}
|
||||||
if(aListId.count()>1)
|
if(aListId.count()>1)
|
||||||
displaySimulation();
|
displaySimulation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
busy = false;
|
busy = false;
|
||||||
}
|
}
|
||||||
@ -749,13 +749,13 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
|
|||||||
case 0:{ // nodes
|
case 0:{ // nodes
|
||||||
const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() );
|
const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() );
|
||||||
if( !aNode ){
|
if( !aNode ){
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_POLYEDRE_CREATE_ERROR"),
|
tr("SMESH_POLYEDRE_CREATE_ERROR"),
|
||||||
tr("The incorrect indices of nodes!"));
|
tr("The incorrect indices of nodes!"));
|
||||||
|
|
||||||
myEditCurrentArgument->clear();
|
myEditCurrentArgument->clear();
|
||||||
myEditCurrentArgument->setText( aString );
|
myEditCurrentArgument->setText( aString );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -764,24 +764,24 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast)
|
|||||||
bool aElemIsOK = true;
|
bool aElemIsOK = true;
|
||||||
const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() );
|
const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() );
|
||||||
if (!aElem)
|
if (!aElem)
|
||||||
{
|
{
|
||||||
aElemIsOK = false;
|
aElemIsOK = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
|
SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
|
||||||
if (aType != SMDSAbs_Face){
|
if (aType != SMDSAbs_Face){
|
||||||
aElemIsOK = false;
|
aElemIsOK = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!aElemIsOK){
|
if (!aElemIsOK){
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_POLYEDRE_CREATE_ERROR"),
|
tr("SMESH_POLYEDRE_CREATE_ERROR"),
|
||||||
tr("The incorrect indices of faces!"));
|
tr("The incorrect indices of faces!"));
|
||||||
|
|
||||||
myEditCurrentArgument->clear();
|
myEditCurrentArgument->clear();
|
||||||
myEditCurrentArgument->setText( aString );
|
myEditCurrentArgument->setText( aString );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -804,66 +804,66 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation()
|
|||||||
vtkIdType aType = VTK_CONVEX_POINT_SET;
|
vtkIdType aType = VTK_CONVEX_POINT_SET;
|
||||||
SMDS_Mesh* aMesh = 0;
|
SMDS_Mesh* aMesh = 0;
|
||||||
if ( myActor ){
|
if ( myActor ){
|
||||||
aMesh = myActor->GetObject()->GetMesh();
|
aMesh = myActor->GetObject()->GetMesh();
|
||||||
}
|
}
|
||||||
if (GetConstructorId() == 0 && aMesh){
|
if (GetConstructorId() == 0 && aMesh){
|
||||||
if (!AddButton->isEnabled()){
|
if (!AddButton->isEnabled()){
|
||||||
mySimulation->ResetGrid(true);
|
mySimulation->ResetGrid(true);
|
||||||
for (int i = 0; i < myFacesByNodes->count(); i++) {
|
for (int i = 0; i < myFacesByNodes->count(); i++) {
|
||||||
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
|
QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
|
||||||
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
|
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
|
||||||
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
|
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
|
||||||
const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
|
const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
|
||||||
if (!aNode) continue;
|
if (!aNode) continue;
|
||||||
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
|
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
|
||||||
aVTKIds.push_back(aId);
|
aVTKIds.push_back(aId);
|
||||||
aVTKIds_faces.push_back(aId);
|
aVTKIds_faces.push_back(aId);
|
||||||
}
|
}
|
||||||
if(!Preview->isChecked()){
|
if(!Preview->isChecked()){
|
||||||
aType = VTK_POLYGON;
|
aType = VTK_POLYGON;
|
||||||
mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
|
mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(myFacesByNodes->count() == 0){
|
if(myFacesByNodes->count() == 0){
|
||||||
mySimulation->SetVisibility(false);
|
mySimulation->SetVisibility(false);
|
||||||
} else {
|
} else {
|
||||||
mySimulation->SetVisibility(true);
|
mySimulation->SetVisibility(true);
|
||||||
}
|
}
|
||||||
if(Preview->isChecked()){
|
if(Preview->isChecked()){
|
||||||
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// add ids from edit line
|
// add ids from edit line
|
||||||
QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
||||||
for ( int i = 0; i < anEditIds.count(); i++ )
|
for ( int i = 0; i < anEditIds.count(); i++ )
|
||||||
aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
|
aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
|
||||||
aType = VTK_POLYGON;
|
aType = VTK_POLYGON;
|
||||||
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
||||||
}
|
}
|
||||||
}else if(GetConstructorId() == 1 && aMesh){
|
}else if(GetConstructorId() == 1 && aMesh){
|
||||||
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
|
||||||
for ( int i = 0; i < aListId.count(); i++ )
|
for ( int i = 0; i < aListId.count(); i++ )
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
|
const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
|
||||||
if ( !anElem ) continue;
|
if ( !anElem ) continue;
|
||||||
SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
|
SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
|
||||||
if (aFaceType != SMDSAbs_Face) continue;
|
if (aFaceType != SMDSAbs_Face) continue;
|
||||||
|
|
||||||
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
|
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
|
||||||
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
|
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
|
||||||
while( anIter->more() )
|
while( anIter->more() )
|
||||||
if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
|
if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
|
||||||
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
|
vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
|
||||||
aVTKIds.push_back(aId);
|
aVTKIds.push_back(aId);
|
||||||
aVTKIds_faces.push_back(aId);
|
aVTKIds_faces.push_back(aId);
|
||||||
}
|
}
|
||||||
if(!Preview->isChecked()){
|
if(!Preview->isChecked()){
|
||||||
aType = VTK_POLYGON;
|
aType = VTK_POLYGON;
|
||||||
mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
|
mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Preview->isChecked())
|
if(Preview->isChecked())
|
||||||
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
mySimulation->SetPosition(myActor, aType, aVTKIds);
|
||||||
}
|
}
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid()
|
|||||||
{
|
{
|
||||||
if (myListBox->count() == 0) {
|
if (myListBox->count() == 0) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("NO_SELECTED_GROUPS"));
|
tr("NO_SELECTED_GROUPS"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,10 +266,10 @@ void SMESHGUI_DeleteGroupDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,16 +59,16 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
|
|||||||
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
|
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
|
||||||
if( !anActor )
|
if( !anActor )
|
||||||
anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
|
anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
|
||||||
if( anActor )
|
if( anActor )
|
||||||
{
|
{
|
||||||
SMESH::DisplayActor( wnd, anActor );
|
SMESH::DisplayActor( wnd, anActor );
|
||||||
prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
|
prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
|
||||||
}
|
}
|
||||||
if( prs )
|
if( prs )
|
||||||
UpdatePrs( prs );
|
UpdatePrs( prs );
|
||||||
else if( anActor )
|
else if( anActor )
|
||||||
SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
|
SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetPointsData ( SMDS_Mesh* theMesh,
|
void SetPointsData ( SMDS_Mesh* theMesh,
|
||||||
TColStd_MapOfInteger & theNodesIdMap )
|
TColStd_MapOfInteger & theNodesIdMap )
|
||||||
{
|
{
|
||||||
vtkPoints* aPoints = vtkPoints::New();
|
vtkPoints* aPoints = vtkPoints::New();
|
||||||
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
|
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
|
||||||
@ -177,9 +177,9 @@ namespace SMESH
|
|||||||
|
|
||||||
TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
|
TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
|
||||||
for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
|
for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
|
||||||
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
|
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
|
||||||
aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
|
aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
|
||||||
myIDs.push_back(idIter.Key());
|
myIDs.push_back(idIter.Key());
|
||||||
}
|
}
|
||||||
|
|
||||||
myIdGrid->SetPoints(aPoints);
|
myIdGrid->SetPoints(aPoints);
|
||||||
@ -190,7 +190,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetElemsData( TColStd_MapOfInteger & theElemsIdMap,
|
void SetElemsData( TColStd_MapOfInteger & theElemsIdMap,
|
||||||
std::list<gp_XYZ> & aGrCentersXYZ )
|
std::list<gp_XYZ> & aGrCentersXYZ )
|
||||||
{
|
{
|
||||||
vtkPoints* aPoints = vtkPoints::New();
|
vtkPoints* aPoints = vtkPoints::New();
|
||||||
aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
|
aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
|
||||||
@ -198,14 +198,14 @@ namespace SMESH
|
|||||||
|
|
||||||
TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
|
TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
|
||||||
for( ; idIter.More(); idIter.Next() ) {
|
for( ; idIter.More(); idIter.Next() ) {
|
||||||
myIDs.push_back(idIter.Key());
|
myIDs.push_back(idIter.Key());
|
||||||
}
|
}
|
||||||
|
|
||||||
gp_XYZ aXYZ;
|
gp_XYZ aXYZ;
|
||||||
std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
|
std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
|
||||||
for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
|
for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
|
||||||
aXYZ = *coordIt;
|
aXYZ = *coordIt;
|
||||||
aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
|
aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
|
||||||
}
|
}
|
||||||
myIdGrid->SetPoints(aPoints);
|
myIdGrid->SetPoints(aPoints);
|
||||||
aPoints->Delete();
|
aPoints->Delete();
|
||||||
@ -234,20 +234,20 @@ namespace SMESH
|
|||||||
myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
|
myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
|
||||||
|
|
||||||
if ( myIsPointsLabeled ) {
|
if ( myIsPointsLabeled ) {
|
||||||
myPointsNumDataSet->ShallowCopy(myIdGrid);
|
myPointsNumDataSet->ShallowCopy(myIdGrid);
|
||||||
vtkDataSet *aDataSet = myPointsNumDataSet;
|
vtkDataSet *aDataSet = myPointsNumDataSet;
|
||||||
int aNbElem = myIDs.size();
|
int aNbElem = myIDs.size();
|
||||||
vtkIntArray *anArray = vtkIntArray::New();
|
vtkIntArray *anArray = vtkIntArray::New();
|
||||||
anArray->SetNumberOfValues( aNbElem );
|
anArray->SetNumberOfValues( aNbElem );
|
||||||
for ( int i = 0; i < aNbElem; i++ )
|
for ( int i = 0; i < aNbElem; i++ )
|
||||||
anArray->SetValue( i, myIDs[i] );
|
anArray->SetValue( i, myIDs[i] );
|
||||||
aDataSet->GetPointData()->SetScalars( anArray );
|
aDataSet->GetPointData()->SetScalars( anArray );
|
||||||
anArray->Delete();
|
anArray->Delete();
|
||||||
myPtsMaskPoints->SetInput( aDataSet );
|
myPtsMaskPoints->SetInput( aDataSet );
|
||||||
myPointLabels->SetVisibility( theIsActorVisible );
|
myPointLabels->SetVisibility( theIsActorVisible );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myPointLabels->SetVisibility( false );
|
myPointLabels->SetVisibility( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ namespace SMESH
|
|||||||
//myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
|
//myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
|
||||||
myPtsSelectVisiblePoints->Delete();
|
myPtsSelectVisiblePoints->Delete();
|
||||||
|
|
||||||
//myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
|
//myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
|
||||||
myPtsMaskPoints->Delete();
|
myPtsMaskPoints->Delete();
|
||||||
|
|
||||||
myPointLabels->Delete();
|
myPointLabels->Delete();
|
||||||
@ -282,8 +282,8 @@ namespace SMESH
|
|||||||
|
|
||||||
static const char * IconFirst[] = {
|
static const char * IconFirst[] = {
|
||||||
"18 10 2 1",
|
"18 10 2 1",
|
||||||
" g None",
|
" g None",
|
||||||
". g #000000",
|
". g #000000",
|
||||||
" . . ",
|
" . . ",
|
||||||
" .. .. .. ",
|
" .. .. .. ",
|
||||||
" .. ... ... ",
|
" .. ... ... ",
|
||||||
@ -300,7 +300,7 @@ static const char * IconFirst[] = {
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
|
SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
|
||||||
int theAction)
|
int theAction)
|
||||||
: QDialog(SMESH::GetDesktop(theModule)),
|
: QDialog(SMESH::GetDesktop(theModule)),
|
||||||
mySMESHGUI(theModule),
|
mySMESHGUI(theModule),
|
||||||
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
||||||
@ -327,9 +327,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
|
|||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors = new QGroupBox(myAction == 1 ?
|
GroupConstructors = new QGroupBox(myAction == 1 ?
|
||||||
tr("SMESH_MERGE_ELEMENTS") :
|
tr("SMESH_MERGE_ELEMENTS") :
|
||||||
tr("SMESH_MERGE_NODES"),
|
tr("SMESH_MERGE_NODES"),
|
||||||
this);
|
this);
|
||||||
|
|
||||||
QButtonGroup* ButtonGroup = new QButtonGroup(this);
|
QButtonGroup* ButtonGroup = new QButtonGroup(this);
|
||||||
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
|
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
|
||||||
@ -362,9 +362,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
// Controls for coincident elements detecting
|
// Controls for coincident elements detecting
|
||||||
GroupCoincident = new QGroupBox(myAction == 1 ?
|
GroupCoincident = new QGroupBox(myAction == 1 ?
|
||||||
tr("COINCIDENT_ELEMENTS") :
|
tr("COINCIDENT_ELEMENTS") :
|
||||||
tr("COINCIDENT_NODES"),
|
tr("COINCIDENT_NODES"),
|
||||||
this);
|
this);
|
||||||
|
|
||||||
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
|
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
|
||||||
GroupCoincidentLayout->setSpacing(SPACING);
|
GroupCoincidentLayout->setSpacing(SPACING);
|
||||||
@ -542,7 +542,7 @@ void SMESHGUI_EditMeshDlg::Init()
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
|
void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
|
||||||
std::list< gp_XYZ > & theGrCentersXYZ)
|
std::list< gp_XYZ > & theGrCentersXYZ)
|
||||||
{
|
{
|
||||||
if (!myActor)
|
if (!myActor)
|
||||||
return;
|
return;
|
||||||
@ -659,10 +659,10 @@ void SMESHGUI_EditMeshDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,15 +722,15 @@ void SMESHGUI_EditMeshDlg::onDetect()
|
|||||||
switch (myAction) {
|
switch (myAction) {
|
||||||
case 0 :
|
case 0 :
|
||||||
if(!mySubMeshOrGroup->_is_nil())
|
if(!mySubMeshOrGroup->_is_nil())
|
||||||
aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
|
aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
|
||||||
else
|
else
|
||||||
aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
|
aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
if(!mySubMeshOrGroup->_is_nil())
|
if(!mySubMeshOrGroup->_is_nil())
|
||||||
aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
|
aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
|
||||||
else
|
else
|
||||||
aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
|
aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ void SMESHGUI_EditMeshDlg::onDetect()
|
|||||||
|
|
||||||
QStringList anIDs;
|
QStringList anIDs;
|
||||||
for (int j = 0; j < aGroup.length(); j++)
|
for (int j = 0; j < aGroup.length(); j++)
|
||||||
anIDs.append(QString::number(aGroup[j]));
|
anIDs.append(QString::number(aGroup[j]));
|
||||||
|
|
||||||
ListCoincident->addItem(anIDs.join(" "));
|
ListCoincident->addItem(anIDs.join(" "));
|
||||||
}
|
}
|
||||||
@ -1044,11 +1044,11 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument()
|
|||||||
if (myAction == 0) {
|
if (myAction == 0) {
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,9 +354,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
||||||
|
|
||||||
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
|
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
|
||||||
SLOT(onTextChange(const QString&)));
|
SLOT(onTextChange(const QString&)));
|
||||||
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
|
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
|
||||||
SLOT(onTextChange(const QString&)));
|
SLOT(onTextChange(const QString&)));
|
||||||
|
|
||||||
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
||||||
|
|
||||||
@ -440,19 +440,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (MeshCheck->isChecked()) {
|
if (MeshCheck->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myElementsFilter);
|
mySelectionMgr->installFilter(myElementsFilter);
|
||||||
} else {
|
} else {
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
if (type == 1)
|
if (type == 1)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
@ -492,16 +492,16 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
bool bOk;
|
bool bOk;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (int i = 0; i < aListElementsId.count(); i++) {
|
for (int i = 0; i < aListElementsId.count(); i++) {
|
||||||
long ind = aListElementsId[ i ].toLong(&bOk);
|
long ind = aListElementsId[ i ].toLong(&bOk);
|
||||||
if (bOk) {
|
if (bOk) {
|
||||||
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
||||||
if (e) {
|
if (e) {
|
||||||
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
|
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
|
||||||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
|
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
|
||||||
if (typeMatch)
|
if (typeMatch)
|
||||||
anElementsId[ j++ ] = ind;
|
anElementsId[ j++ ] = ind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
anElementsId->length(j);
|
anElementsId->length(j);
|
||||||
}
|
}
|
||||||
@ -559,44 +559,44 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
/*
|
/*
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( MeshCheck->isChecked() ) {
|
if( MeshCheck->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
|
aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint, retVal);
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
|
aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint, retVal);
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
|
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint, retVal);
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( MeshCheck->isChecked() ) {
|
if( MeshCheck->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
|
retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint);
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
else
|
else
|
||||||
retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
|
retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint);
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
|
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint);
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -606,17 +606,17 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
ElemType = SMESH::EDGE;
|
ElemType = SMESH::EDGE;
|
||||||
if( !MeshCheck->isChecked() ) {
|
if( !MeshCheck->isChecked() ) {
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint,
|
||||||
NeedGroups, ElemType, retVal);
|
NeedGroups, ElemType, retVal);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint,
|
||||||
NeedGroups, ElemType, retVal);
|
NeedGroups, ElemType, retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -628,33 +628,33 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
switch (retVal) {
|
switch (retVal) {
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
|
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_ELEMENTS_SELECTED"));
|
tr("NO_ELEMENTS_SELECTED"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
|
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("SELECTED_PATH_IS_NOT_EDGE"));
|
tr("SELECTED_PATH_IS_NOT_EDGE"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("BAD_SHAPE_TYPE"));
|
tr("BAD_SHAPE_TYPE"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("EXTR_BAD_STARTING_NODE"));
|
tr("EXTR_BAD_STARTING_NODE"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
|
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("WRONG_ANGLES_NUMBER"));
|
tr("WRONG_ANGLES_NUMBER"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
|
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
|
||||||
SUIT_MessageBox::warning(this,
|
SUIT_MessageBox::warning(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("CANT_GET_TANGENT"));
|
tr("CANT_GET_TANGENT"));
|
||||||
return false; break;
|
return false; break;
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_OK:
|
case SMESH::SMESH_MeshEditor::EXTR_OK:
|
||||||
break;
|
break;
|
||||||
@ -700,10 +700,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,21 +762,21 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
|||||||
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
|
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
long ind = aListId[ i ].toLong(&bOk);
|
long ind = aListId[ i ].toLong(&bOk);
|
||||||
if (bOk) {
|
if (bOk) {
|
||||||
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
||||||
if (e) {
|
if (e) {
|
||||||
// check also type of element
|
// check also type of element
|
||||||
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
|
bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
|
||||||
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
|
Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
|
||||||
if (typeMatch)
|
if (typeMatch)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( anIO, true, true );
|
aViewWindow->highlight( anIO, true, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (send == StartPointLineEdit &&
|
else if (send == StartPointLineEdit &&
|
||||||
@ -785,27 +785,27 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
|||||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||||
SMDS_Mesh* aMesh = 0;
|
SMDS_Mesh* aMesh = 0;
|
||||||
if (aPathActor)
|
if (aPathActor)
|
||||||
aMesh = aPathActor->GetObject()->GetMesh();
|
aMesh = aPathActor->GetObject()->GetMesh();
|
||||||
if (aMesh) {
|
if (aMesh) {
|
||||||
//mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
//mySelectionMgr->AddIObject(aPathActor->getIO());
|
//mySelectionMgr->AddIObject(aPathActor->getIO());
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
aList.Append(aPathActor->getIO());
|
aList.Append(aPathActor->getIO());
|
||||||
mySelectionMgr->setSelectedObjects(aList, false);
|
mySelectionMgr->setSelectedObjects(aList, false);
|
||||||
|
|
||||||
bool bOk;
|
bool bOk;
|
||||||
long ind = theNewText.toLong(&bOk);
|
long ind = theNewText.toLong(&bOk);
|
||||||
if (bOk) {
|
if (bOk) {
|
||||||
const SMDS_MeshNode* n = aMesh->FindNode(ind);
|
const SMDS_MeshNode* n = aMesh->FindNode(ind);
|
||||||
if (n) {
|
if (n) {
|
||||||
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
|
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
newIndices.Add(n->GetID());
|
newIndices.Add(n->GetID());
|
||||||
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
|
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( aPathActor->getIO(), true, true );
|
aViewWindow->highlight( aPathActor->getIO(), true, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -929,10 +929,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Vertex aVertex;
|
TopoDS_Vertex aVertex;
|
||||||
if (!aGeomObj->_is_nil()) {
|
if (!aGeomObj->_is_nil()) {
|
||||||
if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
|
if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
|
||||||
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
|
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
|
||||||
XSpin->SetValue(aPnt.X());
|
XSpin->SetValue(aPnt.X());
|
||||||
YSpin->SetValue(aPnt.Y());
|
YSpin->SetValue(aPnt.Y());
|
||||||
ZSpin->SetValue(aPnt.Z());
|
ZSpin->SetValue(aPnt.Z());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -997,19 +997,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (MeshCheck->isChecked()) {
|
if (MeshCheck->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myElementsFilter);
|
mySelectionMgr->installFilter(myElementsFilter);
|
||||||
} else {
|
} else {
|
||||||
if (Elements1dRB->isChecked())
|
if (Elements1dRB->isChecked())
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
else if (Elements2dRB->isChecked())
|
else if (Elements2dRB->isChecked())
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (button == SelectPathMeshButton) {
|
} else if (button == SelectPathMeshButton) {
|
||||||
myEditCurrentArgument = PathMeshLineEdit;
|
myEditCurrentArgument = PathMeshLineEdit;
|
||||||
@ -1024,10 +1024,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
|
|||||||
if (!myPath->_is_nil()) {
|
if (!myPath->_is_nil()) {
|
||||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||||
if (aPathActor) {
|
if (aPathActor) {
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
SMESH::SetPickable(aPathActor);
|
SMESH::SetPickable(aPathActor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1172,21 +1172,21 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
|
|||||||
QKeyEvent* ke = (QKeyEvent*)event;
|
QKeyEvent* ke = (QKeyEvent*)event;
|
||||||
if (object == AnglesList) {
|
if (object == AnglesList) {
|
||||||
if (ke->key() == Qt::Key_Delete)
|
if (ke->key() == Qt::Key_Delete)
|
||||||
OnAngleRemoved();
|
OnAngleRemoved();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::FocusIn) {
|
else if (event->type() == QEvent::FocusIn) {
|
||||||
if (object == ElementsLineEdit) {
|
if (object == ElementsLineEdit) {
|
||||||
if (myEditCurrentArgument != ElementsLineEdit)
|
if (myEditCurrentArgument != ElementsLineEdit)
|
||||||
SetEditCurrentArgument(SelectElementsButton);
|
SetEditCurrentArgument(SelectElementsButton);
|
||||||
}
|
}
|
||||||
else if (object == StartPointLineEdit) {
|
else if (object == StartPointLineEdit) {
|
||||||
if (myEditCurrentArgument != StartPointLineEdit)
|
if (myEditCurrentArgument != StartPointLineEdit)
|
||||||
SetEditCurrentArgument(SelectStartPointButton);
|
SetEditCurrentArgument(SelectStartPointButton);
|
||||||
}
|
}
|
||||||
else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
|
else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
|
||||||
if (myEditCurrentArgument != XSpin)
|
if (myEditCurrentArgument != XSpin)
|
||||||
SetEditCurrentArgument(SelectBasePointButton);
|
SetEditCurrentArgument(SelectBasePointButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QDialog::eventFilter(object, event);
|
return QDialog::eventFilter(object, event);
|
||||||
@ -1216,8 +1216,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
@ -1270,7 +1270,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
|
|||||||
enableLinear = false;
|
enableLinear = false;
|
||||||
anItem->text().toDouble(&enableLinear);
|
anItem->text().toDouble(&enableLinear);
|
||||||
if( !enableLinear )
|
if( !enableLinear )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !enableLinear )
|
if( !enableLinear )
|
||||||
|
@ -400,24 +400,24 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
|
|||||||
{
|
{
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
{
|
{
|
||||||
LineEditElements->clear();
|
LineEditElements->clear();
|
||||||
myIDs.clear();
|
myIDs.clear();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
{
|
{
|
||||||
LineEditElements->clear();
|
LineEditElements->clear();
|
||||||
myIDs.clear();
|
myIDs.clear();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,8 +509,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
aParameters << SpinBox_Dz->text();
|
aParameters << SpinBox_Dz->text();
|
||||||
} else if ( RadioButton4->isChecked() ) {
|
} else if ( RadioButton4->isChecked() ) {
|
||||||
gp_XYZ aNormale(SpinBox_Vx->GetValue(),
|
gp_XYZ aNormale(SpinBox_Vx->GetValue(),
|
||||||
SpinBox_Vy->GetValue(),
|
SpinBox_Vy->GetValue(),
|
||||||
SpinBox_Vz->GetValue());
|
SpinBox_Vz->GetValue());
|
||||||
|
|
||||||
|
|
||||||
aNormale /= aNormale.Modulus();
|
aNormale /= aNormale.Modulus();
|
||||||
@ -536,26 +536,26 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
||||||
else
|
else
|
||||||
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
@ -611,10 +611,10 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,7 +666,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
|
|||||||
myElementsId->length( myNbOkElements = newIndices.Extent() );
|
myElementsId->length( myNbOkElements = newIndices.Extent() );
|
||||||
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
|
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
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();
|
aNbElements = aMapIndex.Extent();
|
||||||
|
|
||||||
if (aNbElements < 1)
|
if (aNbElements < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myElementsId = new SMESH::long_array;
|
myElementsId = new SMESH::long_array;
|
||||||
myElementsId->length( aNbElements );
|
myElementsId->length( aNbElements );
|
||||||
@ -802,20 +802,20 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
|
|||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
myEditCurrentArgument = (QWidget*)LineEditElements;
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
if (aConstructorId == 0)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
else if (aConstructorId == 1)
|
else if (aConstructorId == 1)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (send == SelectVectorButton){
|
else if (send == SelectVectorButton){
|
||||||
@ -930,13 +930,13 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
|
|||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
if (aConstructorId == 0)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
else if (aConstructorId == 1)
|
else if (aConstructorId == 1)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
LineEditElements->setReadOnly(false);
|
LineEditElements->setReadOnly(false);
|
||||||
@ -983,8 +983,8 @@ void SMESHGUI_ExtrusionDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -210,7 +210,7 @@ bool SMESHGUI_FilterTable::AdditionalWidget::IsValid (const bool theMsg) const
|
|||||||
if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
|
if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
|
||||||
if (theMsg)
|
if (theMsg)
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("SMESHGUI_INVALID_PARAMETERS"));
|
tr("SMESHGUI_INVALID_PARAMETERS"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -423,13 +423,13 @@ public:
|
|||||||
~ComboDelegate();
|
~ComboDelegate();
|
||||||
|
|
||||||
QWidget* createEditor( QWidget*, const QStyleOptionViewItem&,
|
QWidget* createEditor( QWidget*, const QStyleOptionViewItem&,
|
||||||
const QModelIndex& ) const;
|
const QModelIndex& ) const;
|
||||||
|
|
||||||
void setEditorData( QWidget*, const QModelIndex& ) const;
|
void setEditorData( QWidget*, const QModelIndex& ) const;
|
||||||
void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
|
void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
|
||||||
|
|
||||||
void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&,
|
void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&,
|
||||||
const QModelIndex& ) const;
|
const QModelIndex& ) const;
|
||||||
private:
|
private:
|
||||||
QTableWidget* myTable;
|
QTableWidget* myTable;
|
||||||
};
|
};
|
||||||
@ -445,8 +445,8 @@ SMESHGUI_FilterTable::ComboDelegate::~ComboDelegate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
|
QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
|
||||||
const QStyleOptionViewItem& option,
|
const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index ) const
|
const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QStringList l = index.data( Qt::UserRole ).toStringList();
|
QStringList l = index.data( Qt::UserRole ).toStringList();
|
||||||
if ( !l.isEmpty() ) {
|
if ( !l.isEmpty() ) {
|
||||||
@ -459,7 +459,7 @@ QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
|
void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
|
||||||
const QModelIndex& index ) const
|
const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QString value = index.model()->data( index, Qt::DisplayRole ).toString();
|
QString value = index.model()->data( index, Qt::DisplayRole ).toString();
|
||||||
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
|
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
|
||||||
@ -475,8 +475,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
|
void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
|
||||||
QAbstractItemModel* model,
|
QAbstractItemModel* model,
|
||||||
const QModelIndex& index) const
|
const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
|
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
|
||||||
if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
|
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,
|
void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor,
|
||||||
const QStyleOptionViewItem& option,
|
const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index ) const
|
const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
editor->setGeometry( option.rect );
|
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 )
|
void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
|
||||||
{
|
{
|
||||||
setEditTriggers( on ?
|
setEditTriggers( on ?
|
||||||
QAbstractItemView::NoEditTriggers :
|
QAbstractItemView::NoEditTriggers :
|
||||||
QAbstractItemView::AllEditTriggers );
|
QAbstractItemView::AllEditTriggers );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SMESHGUI_FilterTable::Table::isReadOnly() const
|
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();
|
theCriterion.Threshold = (double)((ComboItem*)aTable->item(theRow, 2))->value();
|
||||||
else if ( aCriterionType != SMESH::FT_RangeOfIds &&
|
else if ( aCriterionType != SMESH::FT_RangeOfIds &&
|
||||||
aCriterionType != SMESH::FT_BelongToGeom &&
|
aCriterionType != SMESH::FT_BelongToGeom &&
|
||||||
aCriterionType != SMESH::FT_BelongToPlane &&
|
aCriterionType != SMESH::FT_BelongToPlane &&
|
||||||
aCriterionType != SMESH::FT_BelongToCylinder &&
|
aCriterionType != SMESH::FT_BelongToCylinder &&
|
||||||
aCriterionType != SMESH::FT_BelongToGenSurface &&
|
aCriterionType != SMESH::FT_BelongToGenSurface &&
|
||||||
aCriterionType != SMESH::FT_LyingOnGeom)
|
aCriterionType != SMESH::FT_LyingOnGeom)
|
||||||
{
|
{
|
||||||
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
|
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
|
||||||
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
|
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);
|
aText.toDouble(&isOk);
|
||||||
aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
|
aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
|
||||||
if (!aTable->isEditable(row, 1))
|
if (!aTable->isEditable(row, 1))
|
||||||
aTable->setEditable(true, row, 1);
|
aTable->setEditable(true, row, 1);
|
||||||
if (!aTable->isEditable(row, 2))
|
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 -
|
static int aLenCr = qAbs( aMaxLenCr -
|
||||||
aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
|
aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
|
||||||
|
|
||||||
QString aCrStr;
|
QString aCrStr;
|
||||||
aCrStr.fill(' ', aLenCr);
|
aCrStr.fill(' ', aLenCr);
|
||||||
@ -1811,10 +1811,10 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
|
|||||||
aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
|
aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
|
||||||
|
|
||||||
connect(aTable, SIGNAL(cellChanged(int, int)),
|
connect(aTable, SIGNAL(cellChanged(int, int)),
|
||||||
this, SLOT(onCriterionChanged(int, int)));
|
this, SLOT(onCriterionChanged(int, int)));
|
||||||
|
|
||||||
connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
|
connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
|
||||||
this, SLOT(onCurrentChanged(int, int)));
|
this, SLOT(onCurrentChanged(int, int)));
|
||||||
|
|
||||||
return aTable;
|
return aTable;
|
||||||
}
|
}
|
||||||
@ -1844,15 +1844,15 @@ void SMESHGUI_FilterTable::SetEditable (const bool isEditable)
|
|||||||
Table* aTable = anIter.value();
|
Table* aTable = anIter.value();
|
||||||
for (int i = 0, n = aTable->rowCount(); i < n; i++)
|
for (int i = 0, n = aTable->rowCount(); i < n; i++)
|
||||||
for (int j = 0, m = aTable->columnCount(); j < m; j++)
|
for (int j = 0, m = aTable->columnCount(); j < m; j++)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* anItem = aTable->item(i, j);
|
QTableWidgetItem* anItem = aTable->item(i, j);
|
||||||
if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
|
if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
|
||||||
Qt::ItemFlags f = anItem->flags();
|
Qt::ItemFlags f = anItem->flags();
|
||||||
if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
|
if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
|
||||||
else f = f | Qt::ItemIsUserCheckable;
|
else f = f | Qt::ItemIsUserCheckable;
|
||||||
anItem->setFlags( f );
|
anItem->setFlags( f );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//end of IPAL19974
|
//end of IPAL19974
|
||||||
|
|
||||||
if (isEditable)
|
if (isEditable)
|
||||||
@ -2037,8 +2037,8 @@ void SMESHGUI_FilterTable::SetID( const int theRow,
|
|||||||
// Purpose : Get text and internal value from cell of ID value
|
// Purpose : Get text and internal value from cell of ID value
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool SMESHGUI_FilterTable::GetID( const int theRow,
|
bool SMESHGUI_FilterTable::GetID( const int theRow,
|
||||||
QString& theText,
|
QString& theText,
|
||||||
const int theEntityType )
|
const int theEntityType )
|
||||||
{
|
{
|
||||||
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
||||||
QTableWidgetItem* anItem = aTable->item( theRow, 5 );
|
QTableWidgetItem* anItem = aTable->item( theRow, 5 );
|
||||||
@ -2335,8 +2335,8 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes)
|
|||||||
mySetInViewer->setChecked(true);
|
mySetInViewer->setChecked(true);
|
||||||
|
|
||||||
mySourceGrp->button(myApplyToState.contains(theTypes.first()) ?
|
mySourceGrp->button(myApplyToState.contains(theTypes.first()) ?
|
||||||
myApplyToState[ theTypes.first() ] :
|
myApplyToState[ theTypes.first() ] :
|
||||||
Selection)->setChecked(true);
|
Selection)->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2410,10 +2410,10 @@ void SMESHGUI_FilterDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2568,7 +2568,7 @@ bool SMESHGUI_FilterDlg::isValid() const
|
|||||||
SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
|
SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
|
||||||
if (aList.size() == 0) {
|
if (aList.size() == 0) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("BAD_SHAPE_NAME").arg(aName));
|
tr("BAD_SHAPE_NAME").arg(aName));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2584,26 +2584,26 @@ bool SMESHGUI_FilterDlg::isValid() const
|
|||||||
aFace.IsNull() ||
|
aFace.IsNull() ||
|
||||||
aFace.ShapeType() != TopAbs_FACE) {
|
aFace.ShapeType() != TopAbs_FACE) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
|
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
|
||||||
if (aSurf.IsNull()) {
|
if (aSurf.IsNull()) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
|
if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,12 +123,12 @@ public:
|
|||||||
const int = -1 );
|
const int = -1 );
|
||||||
|
|
||||||
void SetID( const int,
|
void SetID( const int,
|
||||||
const QString&,
|
const QString&,
|
||||||
const int = -1 );
|
const int = -1 );
|
||||||
|
|
||||||
bool GetID( const int,
|
bool GetID( const int,
|
||||||
QString&,
|
QString&,
|
||||||
const int = -1 );
|
const int = -1 );
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
|
|||||||
connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
|
connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
|
||||||
|
|
||||||
connect(myListBox, SIGNAL(itemSelectionChanged()),
|
connect(myListBox, SIGNAL(itemSelectionChanged()),
|
||||||
this, SLOT(onFilterChanged()));
|
this, SLOT(onFilterChanged()));
|
||||||
|
|
||||||
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
|
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
|
||||||
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
|
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
|
||||||
@ -423,7 +423,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
|
|||||||
|
|
||||||
if (myLibrary->_is_nil()) {
|
if (myLibrary->_is_nil()) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
||||||
tr("LIBRARY_IS_NOT_LOADED"));
|
tr("LIBRARY_IS_NOT_LOADED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,11 +437,11 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
|
|||||||
} else if (myMode == EDIT || myMode == ADD_TO) {
|
} else if (myMode == EDIT || myMode == ADD_TO) {
|
||||||
SMESH::Filter_var aFilter = createFilter();
|
SMESH::Filter_var aFilter = createFilter();
|
||||||
if (!myListBox->selectedItems().empty() &&
|
if (!myListBox->selectedItems().empty() &&
|
||||||
!myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
!myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
||||||
myName->text().toLatin1().constData(),
|
myName->text().toLatin1().constData(),
|
||||||
aFilter.in())) {
|
aFilter.in())) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_EDITING"));
|
tr("ERROR_OF_EDITING"));
|
||||||
aResult = false;
|
aResult = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -457,7 +457,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
|
|||||||
delete aFileName;
|
delete aFileName;
|
||||||
} else if (myMode != COPY_FROM) {
|
} else if (myMode != COPY_FROM) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_SAVING"));
|
tr("ERROR_OF_SAVING"));
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,10 +507,10 @@ void SMESHGUI_FilterLibraryDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -674,7 +674,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary()
|
|||||||
if (myLibrary->_is_nil()) {
|
if (myLibrary->_is_nil()) {
|
||||||
if (myMode == COPY_FROM) {
|
if (myMode == COPY_FROM) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
||||||
tr("ERROR_LOAD"));
|
tr("ERROR_LOAD"));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
myLibrary = aFilterMgr->CreateLibrary();
|
myLibrary = aFilterMgr->CreateLibrary();
|
||||||
@ -730,7 +730,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
|
|||||||
if (aCurrName.isEmpty()) {
|
if (aCurrName.isEmpty()) {
|
||||||
if (theMess)
|
if (theMess)
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("EMPTY_FILTER_NAME"));
|
tr("EMPTY_FILTER_NAME"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const
|
|||||||
if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
|
if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
|
||||||
if (theMess)
|
if (theMess)
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("ERROR_FILTER_NAME"));
|
tr("ERROR_FILTER_NAME"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -787,7 +787,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly)
|
|||||||
|
|
||||||
if (!isWritable) {
|
if (!isWritable) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
||||||
tr("NO_PERMISSION"));
|
tr("NO_PERMISSION"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,8 +831,8 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged()
|
|||||||
|
|
||||||
SMESH::Filter_var aFilter = createFilter();
|
SMESH::Filter_var aFilter = createFilter();
|
||||||
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
||||||
myName->text().toLatin1().constData(),
|
myName->text().toLatin1().constData(),
|
||||||
aFilter);
|
aFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill table with filter parameters
|
// Fill table with filter parameters
|
||||||
@ -938,8 +938,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed()
|
|||||||
|
|
||||||
SMESH::Filter_var aFilter = createFilter();
|
SMESH::Filter_var aFilter = createFilter();
|
||||||
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
||||||
myName->text().toLatin1().constData(),
|
myName->text().toLatin1().constData(),
|
||||||
aFilter);
|
aFilter);
|
||||||
}
|
}
|
||||||
myTable->Clear(myTable->GetType());
|
myTable->Clear(myTable->GetType());
|
||||||
|
|
||||||
@ -955,7 +955,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
|
|||||||
{
|
{
|
||||||
if (myLibrary->_is_nil()) {
|
if (myLibrary->_is_nil()) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
||||||
tr("LIBRARY_IS_NOT_LOADED"));
|
tr("LIBRARY_IS_NOT_LOADED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
|
|||||||
|
|
||||||
if (!aResult) {
|
if (!aResult) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_ADDING"));
|
tr("ERROR_OF_ADDING"));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateList();
|
updateList();
|
||||||
@ -989,7 +989,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
|
|||||||
|
|
||||||
if (theName != aName)
|
if (theName != aName)
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
|
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()) {
|
if (myLibrary->_is_nil()) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
|
||||||
tr("LIBRARY_IS_NOT_LOADED"));
|
tr("LIBRARY_IS_NOT_LOADED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,7 +1097,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
|
|||||||
|
|
||||||
if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) {
|
if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) {
|
||||||
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_DELETING"));
|
tr("ERROR_OF_DELETING"));
|
||||||
} else {
|
} else {
|
||||||
myCurrFilterName = "";
|
myCurrFilterName = "";
|
||||||
myCurrFilter = -1;
|
myCurrFilter = -1;
|
||||||
@ -1188,8 +1188,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation()
|
|||||||
{
|
{
|
||||||
SMESH::Filter_var aFilter = createFilter(myTable->GetType());
|
SMESH::Filter_var aFilter = createFilter(myTable->GetType());
|
||||||
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
|
||||||
myName->text().toLatin1().constData(),
|
myName->text().toLatin1().constData(),
|
||||||
aFilter);
|
aFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace SMESH
|
|||||||
SMESH::SMESH_subMesh_var aSubmesh =
|
SMESH::SMESH_subMesh_var aSubmesh =
|
||||||
SObjectToInterface<SMESH::SMESH_subMesh>( theMeshOrSubmesh );
|
SObjectToInterface<SMESH::SMESH_subMesh>( theMeshOrSubmesh );
|
||||||
if ( !aSubmesh->_is_nil() )
|
if ( !aSubmesh->_is_nil() )
|
||||||
return aSubmesh->GetSubShape();
|
return aSubmesh->GetSubShape();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return GEOM::GEOM_Object::_nil();
|
return GEOM::GEOM_Object::_nil();
|
||||||
@ -89,7 +89,7 @@ namespace SMESH
|
|||||||
SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
|
SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
|
||||||
aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
|
aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
|
||||||
} else {
|
} else {
|
||||||
SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
|
SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
|
||||||
aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
|
aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
||||||
SMESH::SMESH_Mesh_ptr theMesh )
|
SMESH::SMESH_Mesh_ptr theMesh )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
@ -129,7 +129,7 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
||||||
SMESH::SMESH_GroupBase_ptr theGroup,
|
SMESH::SMESH_GroupBase_ptr theGroup,
|
||||||
const bool theIsConvert )
|
const bool theIsConvert )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
@ -330,7 +330,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
|
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
|
||||||
myColorBtn = new QtxColorButton(aColorBox);
|
myColorBtn = new QtxColorButton(aColorBox);
|
||||||
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
|
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
|
||||||
myColorBtn->sizePolicy().verticalPolicy() );
|
myColorBtn->sizePolicy().verticalPolicy() );
|
||||||
|
|
||||||
aColorBoxLayout->addWidget(aColorLab);
|
aColorBoxLayout->addWidget(aColorLab);
|
||||||
aColorBoxLayout->addWidget(myColorBtn);
|
aColorBoxLayout->addWidget(myColorBtn);
|
||||||
@ -693,36 +693,36 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
|
|||||||
switch (theMode) {
|
switch (theMode) {
|
||||||
case 0:
|
case 0:
|
||||||
if (myActor)
|
if (myActor)
|
||||||
myActor->SetPointRepresentation(true);
|
myActor->SetPointRepresentation(true);
|
||||||
else
|
else
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(VolumeSelection);
|
aViewWindow->SetSelectionMode(VolumeSelection);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (theMode == 4)
|
if (theMode == 4)
|
||||||
mySelectionMgr->installFilter(mySubMeshFilter);
|
mySelectionMgr->installFilter(mySubMeshFilter);
|
||||||
else if (theMode == 5)
|
else if (theMode == 5)
|
||||||
mySelectionMgr->installFilter(myGroupFilter);
|
mySelectionMgr->installFilter(myGroupFilter);
|
||||||
else if (theMode == 6)
|
else if (theMode == 6)
|
||||||
mySelectionMgr->installFilter(myMeshFilter);
|
mySelectionMgr->installFilter(myMeshFilter);
|
||||||
else if (theMode == 7)
|
else if (theMode == 7)
|
||||||
mySelectionMgr->installFilter(myGeomFilter);
|
mySelectionMgr->installFilter(myGeomFilter);
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
}
|
}
|
||||||
mySelectionMode = theMode;
|
mySelectionMode = theMode;
|
||||||
}
|
}
|
||||||
@ -752,7 +752,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return false;
|
return false;
|
||||||
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
|
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
|
||||||
// nullify pointer, because object become dead
|
// nullify pointer, because object become dead
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -773,7 +773,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
int i, k = myElements->count();
|
int i, k = myElements->count();
|
||||||
anIdList->length(k);
|
anIdList->length(k);
|
||||||
for (i = 0; i < k; i++) {
|
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());
|
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
|
||||||
@ -800,46 +800,46 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
||||||
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
||||||
anActor->setName(myName->text().toLatin1().data());
|
anActor->setName(myName->text().toLatin1().data());
|
||||||
switch ( myTypeId ) {
|
switch ( myTypeId ) {
|
||||||
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> aAddList;
|
QList<int> aAddList;
|
||||||
|
|
||||||
int i, total = myElements->count();
|
int i, total = myElements->count();
|
||||||
for (i = 0; i < total; i++) {
|
for (i = 0; i < total; i++) {
|
||||||
int anId = myElements->item(i)->text().toInt();
|
int anId = myElements->item(i)->text().toInt();
|
||||||
int idx = myIdList.indexOf(anId);
|
int idx = myIdList.indexOf(anId);
|
||||||
if ( idx == -1 )
|
if ( idx == -1 )
|
||||||
aAddList.append(anId);
|
aAddList.append(anId);
|
||||||
else
|
else
|
||||||
myIdList.removeAt(idx);
|
myIdList.removeAt(idx);
|
||||||
}
|
}
|
||||||
if (!aAddList.empty()) {
|
if (!aAddList.empty()) {
|
||||||
SMESH::long_array_var anIdList = new SMESH::long_array;
|
SMESH::long_array_var anIdList = new SMESH::long_array;
|
||||||
int added = aAddList.count();
|
int added = aAddList.count();
|
||||||
anIdList->length(added);
|
anIdList->length(added);
|
||||||
for (i = 0; i < added; i++)
|
for (i = 0; i < added; i++)
|
||||||
anIdList[i] = aAddList[i];
|
anIdList[i] = aAddList[i];
|
||||||
myGroup->Add(anIdList.inout());
|
myGroup->Add(anIdList.inout());
|
||||||
}
|
}
|
||||||
if (!myIdList.empty()) {
|
if (!myIdList.empty()) {
|
||||||
SMESH::long_array_var anIdList = new SMESH::long_array;
|
SMESH::long_array_var anIdList = new SMESH::long_array;
|
||||||
int removed = myIdList.count();
|
int removed = myIdList.count();
|
||||||
anIdList->length(removed);
|
anIdList->length(removed);
|
||||||
for (i = 0; i < removed; i++)
|
for (i = 0; i < removed; i++)
|
||||||
anIdList[i] = myIdList[i];
|
anIdList[i] = myIdList[i];
|
||||||
myGroup->Remove(anIdList.inout());
|
myGroup->Remove(anIdList.inout());
|
||||||
}
|
}
|
||||||
/* init for next operation */
|
/* init for next operation */
|
||||||
myIdList.clear();
|
myIdList.clear();
|
||||||
for (i = 0; i < total; i++) {
|
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();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
||||||
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
|
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
|
||||||
|
|
||||||
if (myGeomObjects->length() == 1) {
|
if (myGeomObjects->length() == 1) {
|
||||||
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
|
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
|
||||||
myName->text().toLatin1().data(),
|
myName->text().toLatin1().data(),
|
||||||
myGeomObjects[0]);
|
myGeomObjects[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
||||||
@ -910,12 +910,12 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
aNewGeomGroupName += myName->text();
|
aNewGeomGroupName += myName->text();
|
||||||
SALOMEDS::SObject_var aNewGroupSO =
|
SALOMEDS::SObject_var aNewGroupSO =
|
||||||
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
|
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
|
||||||
aNewGeomGroupName.toLatin1().data(), aMeshShape);
|
aNewGeomGroupName.toLatin1().data(), aMeshShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
|
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
|
||||||
myName->text().toLatin1().data(),
|
myName->text().toLatin1().data(),
|
||||||
aGroupVar);
|
aGroupVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
SALOMEDS::Color aColor = getGroupColor();
|
||||||
@ -938,13 +938,13 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
||||||
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
||||||
anActor->setName(myName->text().toLatin1().data());
|
anActor->setName(myName->text().toLatin1().data());
|
||||||
switch ( myTypeId ) {
|
switch ( myTypeId ) {
|
||||||
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1026,7 +1026,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
myGeomObjects->length(0);
|
myGeomObjects->length(0);
|
||||||
|
|
||||||
if (myGeomGroupBtn->isChecked())
|
if (myGeomGroupBtn->isChecked())
|
||||||
myGeomGroupBtn->setChecked(false);
|
myGeomGroupBtn->setChecked(false);
|
||||||
if (!myCreate)
|
if (!myCreate)
|
||||||
myName->setText( "" );
|
myName->setText( "" );
|
||||||
|
|
||||||
@ -1045,16 +1045,16 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||||
|
|
||||||
if (myCreate) {
|
if (myCreate) {
|
||||||
restoreShowEntityMode();
|
restoreShowEntityMode();
|
||||||
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
||||||
setShowEntityMode();
|
setShowEntityMode();
|
||||||
updateGeomPopup();
|
updateGeomPopup();
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
{
|
{
|
||||||
updateButtons();
|
updateButtons();
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
|
|
||||||
// NPAL19389: create a group with a selection in another group
|
// NPAL19389: create a group with a selection in another group
|
||||||
@ -1075,15 +1075,15 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
else {
|
else {
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
||||||
if (aGroup->_is_nil())
|
if (aGroup->_is_nil())
|
||||||
{
|
{
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
myCurrentLineEdit = 0;
|
myCurrentLineEdit = 0;
|
||||||
|
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
|
||||||
init(aGroup);
|
init(aGroup);
|
||||||
myIsBusy = true;
|
myIsBusy = true;
|
||||||
@ -1097,13 +1097,13 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
|
|
||||||
if (myGrpTypeId == 0)
|
if (myGrpTypeId == 0)
|
||||||
{
|
{
|
||||||
if (myTypeId == -1)
|
if (myTypeId == -1)
|
||||||
onTypeChanged(0);
|
onTypeChanged(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myElements->clear();
|
myElements->clear();
|
||||||
setSelectionMode(myTypeId);
|
setSelectionMode(myTypeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
@ -1119,10 +1119,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
|
|
||||||
if (aNbSel == 0 || !aMeshSO)
|
if (aNbSel == 0 || !aMeshSO)
|
||||||
{
|
{
|
||||||
myGeomObjects->length(0);
|
myGeomObjects->length(0);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myGeomObjects->length(aNbSel);
|
myGeomObjects->length(aNbSel);
|
||||||
@ -1181,10 +1181,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
|
|
||||||
myGeomObjects->length(i);
|
myGeomObjects->length(i);
|
||||||
if ( i == 0 )
|
if ( i == 0 )
|
||||||
{
|
{
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aNbSel = i;
|
aNbSel = i;
|
||||||
}
|
}
|
||||||
@ -1258,26 +1258,26 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
QString aListStr = "";
|
QString aListStr = "";
|
||||||
int aNbItems = 0;
|
int aNbItems = 0;
|
||||||
if (myTypeId == 0) {
|
if (myTypeId == 0) {
|
||||||
aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
|
aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
|
||||||
} else {
|
} else {
|
||||||
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
|
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
|
||||||
}
|
}
|
||||||
if (aNbItems > 0) {
|
if (aNbItems > 0) {
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
QList<QListWidgetItem*> listItemsToSel;
|
QList<QListWidgetItem*> listItemsToSel;
|
||||||
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
|
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
|
||||||
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
||||||
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
|
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
|
||||||
foreach(anItem, found)
|
foreach(anItem, found)
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
bool blocked = myElements->signalsBlocked();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
||||||
myElements->blockSignals(blocked);
|
myElements->blockSignals(blocked);
|
||||||
onListSelectionChanged();
|
onListSelectionChanged();
|
||||||
listItemsToSel.clear();
|
listItemsToSel.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1413,8 +1413,8 @@ void SMESHGUI_GroupDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1511,18 +1511,18 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
if (aNbItems > 0) {
|
if (aNbItems > 0) {
|
||||||
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
|
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
|
||||||
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
||||||
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
|
QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
|
||||||
if (found.count() == 0) {
|
if (found.count() == 0) {
|
||||||
anItem = new QListWidgetItem(*it);
|
anItem = new QListWidgetItem(*it);
|
||||||
myElements->addItem(anItem);
|
myElements->addItem(anItem);
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach(anItem, found)
|
foreach(anItem, found)
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool blocked = myElements->signalsBlocked();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
@ -1542,8 +1542,8 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
SMESH::SMESH_subMesh_var aSubMesh =
|
SMESH::SMESH_subMesh_var aSubMesh =
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
|
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
|
||||||
if (!aSubMesh->_is_nil()) {
|
if (!aSubMesh->_is_nil()) {
|
||||||
// check if mesh is the same
|
// check if mesh is the same
|
||||||
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
|
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
|
||||||
try {
|
try {
|
||||||
SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
|
SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
@ -1553,21 +1553,21 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
if (found.count() == 0) {
|
if (found.count() == 0) {
|
||||||
anItem = new QListWidgetItem(aText);
|
anItem = new QListWidgetItem(aText);
|
||||||
myElements->addItem(anItem);
|
myElements->addItem(anItem);
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
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();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
||||||
myElements->blockSignals(blocked);
|
myElements->blockSignals(blocked);
|
||||||
onListSelectionChanged();
|
onListSelectionChanged();
|
||||||
listItemsToSel.clear();
|
listItemsToSel.clear();
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& ex) {
|
catch (const SALOME::SALOME_Exception& ex) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(ex);
|
SalomeApp_Tools::QtCatchCorbaException(ex);
|
||||||
@ -1589,32 +1589,32 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
SMESH::SMESH_GroupBase_var aGroup =
|
SMESH::SMESH_GroupBase_var aGroup =
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
|
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
|
||||||
if (!aGroup->_is_nil()) {
|
if (!aGroup->_is_nil()) {
|
||||||
// check if mesh is the same
|
// check if mesh is the same
|
||||||
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
|
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
|
||||||
SMESH::long_array_var anElements = aGroup->GetListOfID();
|
SMESH::long_array_var anElements = aGroup->GetListOfID();
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
for (int i = 0; i < k; i++) {
|
for (int i = 0; i < k; i++) {
|
||||||
QString aText = QString::number(anElements[i]);
|
QString aText = QString::number(anElements[i]);
|
||||||
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
|
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
|
||||||
if (found.count() == 0) {
|
if (found.count() == 0) {
|
||||||
anItem = new QListWidgetItem(aText);
|
anItem = new QListWidgetItem(aText);
|
||||||
myElements->addItem(anItem);
|
myElements->addItem(anItem);
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach(anItem, found)
|
foreach(anItem, found)
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool blocked = myElements->signalsBlocked();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
foreach(anItem, listItemsToSel) anItem->setSelected(true);
|
||||||
myElements->blockSignals(blocked);
|
myElements->blockSignals(blocked);
|
||||||
onListSelectionChanged();
|
onListSelectionChanged();
|
||||||
listItemsToSel.clear();
|
listItemsToSel.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mySelectGroup->setChecked(false);
|
mySelectGroup->setChecked(false);
|
||||||
@ -1652,19 +1652,19 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
|
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
for (int i = 0; i < k; i++) {
|
for (int i = 0; i < k; i++) {
|
||||||
QString aText = QString::number(anElements[i]);
|
QString aText = QString::number(anElements[i]);
|
||||||
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
|
QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
|
||||||
if (found.count() == 0) {
|
if (found.count() == 0) {
|
||||||
anItem = new QListWidgetItem(aText);
|
anItem = new QListWidgetItem(aText);
|
||||||
myElements->addItem(anItem);
|
myElements->addItem(anItem);
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach(anItem, found)
|
foreach(anItem, found)
|
||||||
if (!anItem->isSelected())
|
if (!anItem->isSelected())
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool blocked = myElements->signalsBlocked();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
@ -1717,42 +1717,42 @@ void SMESHGUI_GroupDlg::onRemove()
|
|||||||
|
|
||||||
SALOME_ListIteratorOfListIO anIt (aList);
|
SALOME_ListIteratorOfListIO anIt (aList);
|
||||||
for ( ; anIt.More(); anIt.Next()) {
|
for ( ; anIt.More(); anIt.Next()) {
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
|
||||||
if (!aSubMesh->_is_nil()) {
|
if (!aSubMesh->_is_nil()) {
|
||||||
// check if mesh is the same
|
// check if mesh is the same
|
||||||
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
|
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
|
||||||
if (aType == SMESH::NODE) {
|
if (aType == SMESH::NODE) {
|
||||||
try {
|
try {
|
||||||
SMESH::long_array_var anElements = aSubMesh->GetNodesId();
|
SMESH::long_array_var anElements = aSubMesh->GetNodesId();
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
for (int i = 0; i < k; i++) {
|
for (int i = 0; i < k; i++) {
|
||||||
QList<QListWidgetItem*> found =
|
QList<QListWidgetItem*> found =
|
||||||
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, found) delete anItem;
|
foreach(anItem, found) delete anItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& ex) {
|
catch (const SALOME::SALOME_Exception& ex) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(ex);
|
SalomeApp_Tools::QtCatchCorbaException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
SMESH::long_array_var anElements = aSubMesh->GetElementsId();
|
SMESH::long_array_var anElements = aSubMesh->GetElementsId();
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
for (int i = 0; i < k; i++) {
|
for (int i = 0; i < k; i++) {
|
||||||
QList<QListWidgetItem*> found =
|
QList<QListWidgetItem*> found =
|
||||||
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, found) delete anItem;
|
foreach(anItem, found) delete anItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& ex) {
|
catch (const SALOME::SALOME_Exception& ex) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(ex);
|
SalomeApp_Tools::QtCatchCorbaException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (myCurrentLineEdit == myGroupLine) {
|
else if (myCurrentLineEdit == myGroupLine) {
|
||||||
@ -1763,20 +1763,20 @@ void SMESHGUI_GroupDlg::onRemove()
|
|||||||
|
|
||||||
SALOME_ListIteratorOfListIO anIt (aList);
|
SALOME_ListIteratorOfListIO anIt (aList);
|
||||||
for ( ; anIt.More(); anIt.Next()) {
|
for ( ; anIt.More(); anIt.Next()) {
|
||||||
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
|
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
|
||||||
if (aRes && !aGroup->_is_nil()) {
|
if (aRes && !aGroup->_is_nil()) {
|
||||||
// check if mesh is the same
|
// check if mesh is the same
|
||||||
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
|
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
|
||||||
SMESH::long_array_var anElements = aGroup->GetListOfID();
|
SMESH::long_array_var anElements = aGroup->GetListOfID();
|
||||||
int k = anElements->length();
|
int k = anElements->length();
|
||||||
for (int i = 0; i < k; i++) {
|
for (int i = 0; i < k; i++) {
|
||||||
QList<QListWidgetItem*> found =
|
QList<QListWidgetItem*> found =
|
||||||
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, found) delete anItem;
|
foreach(anItem, found) delete anItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1804,7 +1804,7 @@ void SMESHGUI_GroupDlg::onSort()
|
|||||||
int id = myElements->item(i)->text().toInt();
|
int id = myElements->item(i)->text().toInt();
|
||||||
anArray[i] = id;
|
anArray[i] = id;
|
||||||
if (myElements->item(i)->isSelected())
|
if (myElements->item(i)->isSelected())
|
||||||
aSelected.append(id);
|
aSelected.append(id);
|
||||||
}
|
}
|
||||||
// sort & update list
|
// sort & update list
|
||||||
std::sort(anArray.begin(), anArray.end());
|
std::sort(anArray.begin(), anArray.end());
|
||||||
@ -1816,7 +1816,7 @@ void SMESHGUI_GroupDlg::onSort()
|
|||||||
anItem = new QListWidgetItem(QString::number(anArray[i]));
|
anItem = new QListWidgetItem(QString::number(anArray[i]));
|
||||||
myElements->addItem(anItem);
|
myElements->addItem(anItem);
|
||||||
if (aSelected.contains(anArray[i]))
|
if (aSelected.contains(anArray[i]))
|
||||||
listItemsToSel.push_back(anItem);
|
listItemsToSel.push_back(anItem);
|
||||||
}
|
}
|
||||||
bool blocked = myElements->signalsBlocked();
|
bool blocked = myElements->signalsBlocked();
|
||||||
myElements->blockSignals(true);
|
myElements->blockSignals(true);
|
||||||
@ -1875,10 +1875,10 @@ void SMESHGUI_GroupDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
|
SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
|
||||||
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
||||||
arg(app->resourceMgr()->stringValue( "ExternalBrowser",
|
arg(app->resourceMgr()->stringValue( "ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1979,7 +1979,7 @@ void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn)
|
|||||||
myCurrentLineEdit = myGeomGroupLine;
|
myCurrentLineEdit = myGeomGroupLine;
|
||||||
QAction* a = myGeomPopup->exec( QCursor::pos() );
|
QAction* a = myGeomPopup->exec( QCursor::pos() );
|
||||||
if (!a || myActions[a] == DIRECT_GEOM_INDEX)
|
if (!a || myActions[a] == DIRECT_GEOM_INDEX)
|
||||||
setSelectionMode(7);
|
setSelectionMode(7);
|
||||||
}
|
}
|
||||||
else if (!isBtnOn)
|
else if (!isBtnOn)
|
||||||
{
|
{
|
||||||
@ -1999,17 +1999,17 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a )
|
|||||||
{
|
{
|
||||||
mySelectionMode = -1;
|
mySelectionMode = -1;
|
||||||
if ( !myShapeByMeshOp ) {
|
if ( !myShapeByMeshOp ) {
|
||||||
myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
|
myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
|
||||||
connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
|
connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
|
||||||
SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
|
SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
|
||||||
connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
|
connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
|
||||||
SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
|
SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
|
||||||
}
|
}
|
||||||
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
|
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
|
||||||
if ( !myMesh->_is_nil() ) {
|
if ( !myMesh->_is_nil() ) {
|
||||||
myIsBusy = true;
|
myIsBusy = true;
|
||||||
hide(); // stop processing selection
|
hide(); // stop processing selection
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
myShapeByMeshOp->setModule( mySMESHGUI );
|
myShapeByMeshOp->setModule( mySMESHGUI );
|
||||||
myShapeByMeshOp->setStudy( 0 ); // it's really necessary
|
myShapeByMeshOp->setStudy( 0 ); // it's really necessary
|
||||||
myShapeByMeshOp->SetMesh( myMesh );
|
myShapeByMeshOp->SetMesh( myMesh );
|
||||||
@ -2036,12 +2036,12 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
|
|||||||
QString ID = aGeomVar->GetStudyEntry();
|
QString ID = aGeomVar->GetStudyEntry();
|
||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
|
if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
|
||||||
SALOME_ListIO anIOList;
|
SALOME_ListIO anIOList;
|
||||||
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
|
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
|
||||||
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
|
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
|
||||||
anIOList.Append( anIO );
|
anIOList.Append( anIO );
|
||||||
mySelectionMgr->setSelectedObjects( anIOList, false );
|
mySelectionMgr->setSelectedObjects( anIOList, false );
|
||||||
onObjectSelectionChanged();
|
onObjectSelectionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2069,8 +2069,8 @@ void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op)
|
|||||||
void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor )
|
void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor )
|
||||||
{
|
{
|
||||||
QColor aQColor( (int)( theColor.R * 255.0 ),
|
QColor aQColor( (int)( theColor.R * 255.0 ),
|
||||||
(int)( theColor.G * 255.0 ),
|
(int)( theColor.G * 255.0 ),
|
||||||
(int)( theColor.B * 255.0 ) );
|
(int)( theColor.B * 255.0 ) );
|
||||||
setGroupQColor( aQColor );
|
setGroupQColor( aQColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2141,8 +2141,8 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor()
|
|||||||
|
|
||||||
SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
|
SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
|
||||||
aQColor.setRgb( (int)( aColor.R * 255.0 ),
|
aQColor.setRgb( (int)( aColor.R * 255.0 ),
|
||||||
(int)( aColor.G * 255.0 ),
|
(int)( aColor.G * 255.0 ),
|
||||||
(int)( aColor.B * 255.0 ) );
|
(int)( aColor.B * 255.0 ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ QWidget* SMESHGUI_GroupOpDlg::createMainFrame( QWidget* theParent )
|
|||||||
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
|
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
|
||||||
myColorBtn = new QtxColorButton(aColorBox);
|
myColorBtn = new QtxColorButton(aColorBox);
|
||||||
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
|
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
|
||||||
myColorBtn->sizePolicy().verticalPolicy() );
|
myColorBtn->sizePolicy().verticalPolicy() );
|
||||||
|
|
||||||
aColorBoxLayout->addWidget(aColorLab);
|
aColorBoxLayout->addWidget(aColorLab);
|
||||||
aColorBoxLayout->addWidget(myColorBtn);
|
aColorBoxLayout->addWidget(myColorBtn);
|
||||||
@ -242,7 +242,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
|
|||||||
if ( theListGrp.isEmpty() )
|
if ( theListGrp.isEmpty() )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("INCORRECT_ARGUMENTS") );
|
tr("INCORRECT_ARGUMENTS") );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,14 +289,14 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
|
|||||||
if ( aMeshId == -1 )
|
if ( aMeshId == -1 )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("DIFF_MESHES"));
|
tr("DIFF_MESHES"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( aGrpType == -1 )
|
if ( aGrpType == -1 )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("DIFF_TYPES"));
|
tr("DIFF_TYPES"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,10 +343,10 @@ void SMESHGUI_GroupOpDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESH_OPERATION_FAILED"));
|
tr("SMESH_OPERATION_FAILED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -712,7 +712,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESH_OPERATION_FAILED"));
|
tr("SMESH_OPERATION_FAILED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,7 +878,7 @@ bool SMESHGUI_CutGroupsDlg::onApply()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESH_OPERATION_FAILED"));
|
tr("SMESH_OPERATION_FAILED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1029,7 +1029,7 @@ bool SMESHGUI_DimGroupDlg::onApply()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESH_OPERATION_FAILED"));
|
tr("SMESH_OPERATION_FAILED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,13 @@
|
|||||||
namespace SMESH
|
namespace SMESH
|
||||||
{
|
{
|
||||||
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
|
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
|
||||||
SMESH::ElementType theType,
|
SMESH::ElementType theType,
|
||||||
const QString& theGroupName )
|
const QString& theGroupName )
|
||||||
{
|
{
|
||||||
SMESH::SMESH_Group_var aGroup;
|
SMESH::SMESH_Group_var aGroup;
|
||||||
try {
|
try {
|
||||||
if ( !theMesh->_is_nil() )
|
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 ) {
|
catch( const SALOME::SALOME_Exception& S_ex ) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
||||||
|
@ -40,8 +40,8 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
|
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
|
||||||
SMESH::ElementType,
|
SMESH::ElementType,
|
||||||
const QString& );
|
const QString& );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SMESHGUI_GROUPUTILS_H
|
#endif // SMESHGUI_GROUPUTILS_H
|
||||||
|
@ -68,7 +68,7 @@ void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
|
void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
|
||||||
const QString& theHypName,
|
const QString& theHypName,
|
||||||
QWidget* parent, QObject* obj, const QString& slot )
|
QWidget* parent, QObject* obj, const QString& slot )
|
||||||
{
|
{
|
||||||
MESSAGE( "Creation of hypothesis with initial params" );
|
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,
|
void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
|
||||||
const QString& theHypName,
|
const QString& theHypName,
|
||||||
QWidget* theParent, QObject* obj, const QString& slot )
|
QWidget* theParent, QObject* obj, const QString& slot )
|
||||||
{
|
{
|
||||||
MESSAGE( "Creation of hypothesis" );
|
MESSAGE( "Creation of hypothesis" );
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
|
void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
|
||||||
const QString& theHypName,
|
const QString& theHypName,
|
||||||
QWidget* theParent, QObject* obj, const QString& slot )
|
QWidget* theParent, QObject* obj, const QString& slot )
|
||||||
{
|
{
|
||||||
if( CORBA::is_nil( theHypothesis ) )
|
if( CORBA::is_nil( theHypothesis ) )
|
||||||
return;
|
return;
|
||||||
@ -111,8 +111,8 @@ void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h,
|
void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h,
|
||||||
const QString& theHypName,
|
const QString& theHypName,
|
||||||
QWidget* theParent,
|
QWidget* theParent,
|
||||||
QObject* obj, const QString& slot )
|
QObject* obj, const QString& slot )
|
||||||
{
|
{
|
||||||
myHypName = theHypName;
|
myHypName = theHypName;
|
||||||
@ -173,7 +173,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
|
|||||||
case QVariant::Int:
|
case QVariant::Int:
|
||||||
{
|
{
|
||||||
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
|
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
|
||||||
sb->setObjectName( (*anIt).myName );
|
sb->setObjectName( (*anIt).myName );
|
||||||
attuneStdWidget( sb, i );
|
attuneStdWidget( sb, i );
|
||||||
sb->setValue( (*anIt).myValue.toInt() );
|
sb->setValue( (*anIt).myValue.toInt() );
|
||||||
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
|
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
|
||||||
@ -183,7 +183,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
|
|||||||
case QVariant::Double:
|
case QVariant::Double:
|
||||||
{
|
{
|
||||||
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
|
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
|
||||||
sb->setObjectName( (*anIt).myName );
|
sb->setObjectName( (*anIt).myName );
|
||||||
attuneStdWidget( sb, i );
|
attuneStdWidget( sb, i );
|
||||||
sb->setValue( (*anIt).myValue.toDouble() );
|
sb->setValue( (*anIt).myValue.toDouble() );
|
||||||
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
|
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
|
||||||
@ -275,13 +275,13 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
|
|||||||
if( listSOmesh.size() > 0 )
|
if( listSOmesh.size() > 0 )
|
||||||
for( int i = 0; i < listSOmesh.size(); i++ )
|
for( int i = 0; i < listSOmesh.size(); i++ )
|
||||||
{
|
{
|
||||||
_PTR(SObject) submSO = listSOmesh[i];
|
_PTR(SObject) submSO = listSOmesh[i];
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
|
||||||
if( !aSubMesh->_is_nil() )
|
if( !aSubMesh->_is_nil() )
|
||||||
aMesh = aSubMesh->GetFather();
|
aMesh = aSubMesh->GetFather();
|
||||||
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
|
_PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
|
||||||
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
|
SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
|
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
|
||||||
@ -630,10 +630,10 @@ void SMESHGUI_HypothesisDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,18 +648,18 @@ void SMESHGUI_HypothesisDlg::setType( const QString& t )
|
|||||||
}
|
}
|
||||||
|
|
||||||
HypothesisData::HypothesisData( const QString& theTypeName,
|
HypothesisData::HypothesisData( const QString& theTypeName,
|
||||||
const QString& thePluginName,
|
const QString& thePluginName,
|
||||||
const QString& theServerLibName,
|
const QString& theServerLibName,
|
||||||
const QString& theClientLibName,
|
const QString& theClientLibName,
|
||||||
const QString& theLabel,
|
const QString& theLabel,
|
||||||
const QString& theIconId,
|
const QString& theIconId,
|
||||||
const QList<int>& theDim,
|
const QList<int>& theDim,
|
||||||
const bool theIsAux,
|
const bool theIsAux,
|
||||||
const QStringList& theNeededHypos,
|
const QStringList& theNeededHypos,
|
||||||
const QStringList& theOptionalHypos,
|
const QStringList& theOptionalHypos,
|
||||||
const QStringList& theInputTypes,
|
const QStringList& theInputTypes,
|
||||||
const QStringList& theOutputTypes,
|
const QStringList& theOutputTypes,
|
||||||
const bool theIsNeedGeometry,
|
const bool theIsNeedGeometry,
|
||||||
const bool supportSub)
|
const bool supportSub)
|
||||||
: TypeName( theTypeName ),
|
: TypeName( theTypeName ),
|
||||||
PluginName( thePluginName ),
|
PluginName( thePluginName ),
|
||||||
@ -685,8 +685,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName )
|
|||||||
}
|
}
|
||||||
|
|
||||||
HypothesesSet::HypothesesSet( const QString& theSetName,
|
HypothesesSet::HypothesesSet( const QString& theSetName,
|
||||||
const QStringList& theHypoList,
|
const QStringList& theHypoList,
|
||||||
const QStringList& theAlgoList )
|
const QStringList& theAlgoList )
|
||||||
: myHypoSetName( theSetName ),
|
: myHypoSetName( theSetName ),
|
||||||
myHypoList( theHypoList ),
|
myHypoList( theHypoList ),
|
||||||
myAlgoList( theAlgoList ),
|
myAlgoList( theAlgoList ),
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
virtual ~SMESHGUI_GenericHypothesisCreator();
|
virtual ~SMESHGUI_GenericHypothesisCreator();
|
||||||
|
|
||||||
void create( SMESH::SMESH_Hypothesis_ptr,
|
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 create( bool, const QString&, QWidget*, QObject*, const QString& );
|
||||||
void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
|
void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
|
||||||
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
|
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
|
||||||
@ -105,7 +105,7 @@ protected:
|
|||||||
static QString stdParamValues( const ListOfStdParams& );
|
static QString stdParamValues( const ListOfStdParams& );
|
||||||
virtual void attuneStdWidget( QWidget*, const int ) const;
|
virtual void attuneStdWidget( QWidget*, const int ) const;
|
||||||
virtual QWidget* getCustomWidget( const StdParam&,
|
virtual QWidget* getCustomWidget( const StdParam&,
|
||||||
QWidget*, const int ) const;
|
QWidget*, const int ) const;
|
||||||
virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
|
virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
|
||||||
virtual void valueChanged( QWidget* );
|
virtual void valueChanged( QWidget* );
|
||||||
virtual QString caption() const;
|
virtual QString caption() const;
|
||||||
@ -166,7 +166,7 @@ public:
|
|||||||
const QList<int>&, const bool,
|
const QList<int>&, const bool,
|
||||||
const QStringList&, const QStringList&,
|
const QStringList&, const QStringList&,
|
||||||
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 TypeName; //!< hypothesis type name
|
||||||
QString PluginName; //!< plugin name
|
QString PluginName; //!< plugin name
|
||||||
|
@ -89,39 +89,39 @@ namespace SMESH
|
|||||||
QList<HypothesesSet*> myListOfHypothesesSets;
|
QList<HypothesesSet*> myListOfHypothesesSets;
|
||||||
|
|
||||||
void processHypothesisStatus(const int theHypStatus,
|
void processHypothesisStatus(const int theHypStatus,
|
||||||
SMESH::SMESH_Hypothesis_ptr theHyp,
|
SMESH::SMESH_Hypothesis_ptr theHyp,
|
||||||
const bool theIsAddition)
|
const bool theIsAddition)
|
||||||
{
|
{
|
||||||
if (theHypStatus > SMESH::HYP_OK) {
|
if (theHypStatus > SMESH::HYP_OK) {
|
||||||
// get Hyp name
|
// get Hyp name
|
||||||
QString aHypName ("NULL Hypothesis");
|
QString aHypName ("NULL Hypothesis");
|
||||||
if (!CORBA::is_nil(theHyp)) {
|
if (!CORBA::is_nil(theHyp)) {
|
||||||
_PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
|
_PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
|
||||||
if (Shyp)
|
if (Shyp)
|
||||||
// name in study
|
// name in study
|
||||||
aHypName = Shyp->GetName().c_str();
|
aHypName = Shyp->GetName().c_str();
|
||||||
else
|
else
|
||||||
// label in xml file
|
// label in xml file
|
||||||
aHypName = GetHypothesisData(theHyp->GetName())->Label;
|
aHypName = GetHypothesisData(theHyp->GetName())->Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// message
|
// message
|
||||||
bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL);
|
bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL);
|
||||||
QString aMsg;
|
QString aMsg;
|
||||||
if (theIsAddition)
|
if (theIsAddition)
|
||||||
aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
|
aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
|
||||||
else
|
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) +
|
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
|
if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501
|
||||||
aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
|
aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
|
||||||
|
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
||||||
QObject::tr("SMESH_WRN_WARNING"),
|
QObject::tr("SMESH_WRN_WARNING"),
|
||||||
aMsg);
|
aMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,73 +138,73 @@ namespace SMESH
|
|||||||
QString HypsXml;
|
QString HypsXml;
|
||||||
char* cenv = getenv("SMESH_MeshersList");
|
char* cenv = getenv("SMESH_MeshersList");
|
||||||
if (cenv)
|
if (cenv)
|
||||||
HypsXml.sprintf("%s", cenv);
|
HypsXml.sprintf("%s", cenv);
|
||||||
|
|
||||||
QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
|
QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
|
||||||
if (HypsXmlList.count() == 0) {
|
if (HypsXmlList.count() == 0) {
|
||||||
SUIT_MessageBox::critical(SMESHGUI::desktop(),
|
SUIT_MessageBox::critical(SMESHGUI::desktop(),
|
||||||
QObject::tr("SMESH_WRN_WARNING"),
|
QObject::tr("SMESH_WRN_WARNING"),
|
||||||
QObject::tr("MESHERS_FILE_NO_VARIABLE"));
|
QObject::tr("MESHERS_FILE_NO_VARIABLE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop on files in HypsXml
|
// loop on files in HypsXml
|
||||||
QString aNoAccessFiles;
|
QString aNoAccessFiles;
|
||||||
for (int i = 0; i < HypsXmlList.count(); i++) {
|
for (int i = 0; i < HypsXmlList.count(); i++) {
|
||||||
QString HypsXml = HypsXmlList[ i ];
|
QString HypsXml = HypsXmlList[ i ];
|
||||||
|
|
||||||
// Find full path to the resource XML file
|
// Find full path to the resource XML file
|
||||||
QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
|
QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
|
||||||
if ( xmlFile.isEmpty() ) // try PLUGIN resources
|
if ( xmlFile.isEmpty() ) // try PLUGIN resources
|
||||||
xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
|
xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
|
||||||
|
|
||||||
QFile file (xmlFile);
|
QFile file (xmlFile);
|
||||||
if (file.exists() && file.open(QIODevice::ReadOnly)) {
|
if (file.exists() && file.open(QIODevice::ReadOnly)) {
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
|
SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
|
||||||
ASSERT(aXmlHandler);
|
ASSERT(aXmlHandler);
|
||||||
|
|
||||||
QXmlInputSource source (&file);
|
QXmlInputSource source (&file);
|
||||||
QXmlSimpleReader reader;
|
QXmlSimpleReader reader;
|
||||||
reader.setContentHandler(aXmlHandler);
|
reader.setContentHandler(aXmlHandler);
|
||||||
reader.setErrorHandler(aXmlHandler);
|
reader.setErrorHandler(aXmlHandler);
|
||||||
bool ok = reader.parse(source);
|
bool ok = reader.parse(source);
|
||||||
file.close();
|
file.close();
|
||||||
if (ok) {
|
if (ok) {
|
||||||
myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
|
myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
|
||||||
myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
|
myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
|
||||||
QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
|
QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
|
||||||
for ( it = aXmlHandler->myListOfHypothesesSets.begin();
|
for ( it = aXmlHandler->myListOfHypothesesSets.begin();
|
||||||
it != aXmlHandler->myListOfHypothesesSets.end();
|
it != aXmlHandler->myListOfHypothesesSets.end();
|
||||||
++it ) {
|
++it ) {
|
||||||
myListOfHypothesesSets.insert( pos, *it );
|
myListOfHypothesesSets.insert( pos, *it );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::critical(SMESHGUI::desktop(),
|
SUIT_MessageBox::critical(SMESHGUI::desktop(),
|
||||||
QObject::tr("INF_PARSE_ERROR"),
|
QObject::tr("INF_PARSE_ERROR"),
|
||||||
QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
|
QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
|
||||||
}
|
}
|
||||||
delete aXmlHandler;
|
delete aXmlHandler;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aNoAccessFiles.isEmpty())
|
if (aNoAccessFiles.isEmpty())
|
||||||
aNoAccessFiles = xmlFile;
|
aNoAccessFiles = xmlFile;
|
||||||
else
|
else
|
||||||
aNoAccessFiles += ", " + xmlFile;
|
aNoAccessFiles += ", " + xmlFile;
|
||||||
}
|
}
|
||||||
} // end loop
|
} // end loop
|
||||||
|
|
||||||
|
|
||||||
if (!aNoAccessFiles.isEmpty()) {
|
if (!aNoAccessFiles.isEmpty()) {
|
||||||
QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
|
QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
|
||||||
aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
|
aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
SUIT_MessageBox::warning(SMESHGUI::desktop(),
|
||||||
QObject::tr("SMESH_WRN_WARNING"),
|
QObject::tr("SMESH_WRN_WARNING"),
|
||||||
aMess);
|
aMess);
|
||||||
wc.resume();
|
wc.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,13 +226,13 @@ namespace SMESH
|
|||||||
for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
|
for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
|
||||||
HypothesisData* aData = anIter.value();
|
HypothesisData* aData = anIter.value();
|
||||||
if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
|
if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
|
||||||
if (checkGeometry) {
|
if (checkGeometry) {
|
||||||
if (aData->IsNeedGeometry == isNeedGeometry)
|
if (aData->IsNeedGeometry == isNeedGeometry)
|
||||||
aHypList.append(anIter.key());
|
aHypList.append(anIter.key());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aHypList.append(anIter.key());
|
aHypList.append(anIter.key());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return aHypList;
|
return aHypList;
|
||||||
@ -248,11 +248,11 @@ namespace SMESH
|
|||||||
|
|
||||||
QList<HypothesesSet*>::iterator hypoSet;
|
QList<HypothesesSet*>::iterator hypoSet;
|
||||||
for ( hypoSet = myListOfHypothesesSets.begin();
|
for ( hypoSet = myListOfHypothesesSets.begin();
|
||||||
hypoSet != myListOfHypothesesSets.end();
|
hypoSet != myListOfHypothesesSets.end();
|
||||||
++hypoSet ) {
|
++hypoSet ) {
|
||||||
HypothesesSet* aSet = *hypoSet;
|
HypothesesSet* aSet = *hypoSet;
|
||||||
if ( aSet && aSet->count( true ) ) {
|
if ( aSet && aSet->count( true ) ) {
|
||||||
aSetNameList.append( aSet->name() );
|
aSetNameList.append( aSet->name() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,11 +263,11 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
QList<HypothesesSet*>::iterator hypoSet;
|
QList<HypothesesSet*>::iterator hypoSet;
|
||||||
for ( hypoSet = myListOfHypothesesSets.begin();
|
for ( hypoSet = myListOfHypothesesSets.begin();
|
||||||
hypoSet != myListOfHypothesesSets.end();
|
hypoSet != myListOfHypothesesSets.end();
|
||||||
++hypoSet ) {
|
++hypoSet ) {
|
||||||
HypothesesSet* aSet = *hypoSet;
|
HypothesesSet* aSet = *hypoSet;
|
||||||
if ( aSet && aSet->name() == theSetName )
|
if ( aSet && aSet->name() == theSetName )
|
||||||
return aSet;
|
return aSet;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -347,48 +347,48 @@ namespace SMESH
|
|||||||
|
|
||||||
// 3. Load Client Plugin Library
|
// 3. Load Client Plugin Library
|
||||||
try {
|
try {
|
||||||
// load plugin library
|
// load plugin library
|
||||||
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
|
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
|
||||||
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
|
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
|
||||||
if (!libHandle) {
|
if (!libHandle) {
|
||||||
// report any error, if occured
|
// report any error, if occured
|
||||||
if ( MYDEBUG ) {
|
if ( MYDEBUG ) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
const char* anError = "Can't load client meshers plugin library";
|
const char* anError = "Can't load client meshers plugin library";
|
||||||
#else
|
#else
|
||||||
const char* anError = dlerror();
|
const char* anError = dlerror();
|
||||||
#endif
|
#endif
|
||||||
MESSAGE(anError);
|
MESSAGE(anError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// get method, returning hypothesis creator
|
// get method, returning hypothesis creator
|
||||||
if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
|
if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
|
||||||
typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
|
typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
|
||||||
( const QString& );
|
( const QString& );
|
||||||
GetHypothesisCreator procHandle =
|
GetHypothesisCreator procHandle =
|
||||||
(GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
|
(GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
|
||||||
if (!procHandle) {
|
if (!procHandle) {
|
||||||
if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
|
if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
|
||||||
UnLoadLib(libHandle);
|
UnLoadLib(libHandle);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// get hypothesis creator
|
// get hypothesis creator
|
||||||
if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
|
if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
|
||||||
aCreator = procHandle( aHypType );
|
aCreator = procHandle( aHypType );
|
||||||
if (!aCreator) {
|
if (!aCreator) {
|
||||||
if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
|
if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// map hypothesis creator to a hypothesis name
|
// map hypothesis creator to a hypothesis name
|
||||||
// BUG 0020378
|
// BUG 0020378
|
||||||
//myHypCreatorMap[aHypType] = aCreator;
|
//myHypCreatorMap[aHypType] = aCreator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
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,
|
SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType,
|
||||||
const QString& aHypName,
|
const QString& aHypName,
|
||||||
const bool isAlgo)
|
const bool isAlgo)
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
|
if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
|
||||||
" with name " << aHypName.toLatin1().data());
|
" with name " << aHypName.toLatin1().data());
|
||||||
HypothesisData* aHypData = GetHypothesisData(aHypType);
|
HypothesisData* aHypData = GetHypothesisData(aHypType);
|
||||||
QString aServLib = aHypData->ServerLibName;
|
QString aServLib = aHypData->ServerLibName;
|
||||||
try {
|
try {
|
||||||
SMESH::SMESH_Hypothesis_var aHypothesis;
|
SMESH::SMESH_Hypothesis_var aHypothesis;
|
||||||
aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
|
aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
|
||||||
aServLib.toLatin1().data());
|
aServLib.toLatin1().data());
|
||||||
if (!aHypothesis->_is_nil()) {
|
if (!aHypothesis->_is_nil()) {
|
||||||
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
|
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
|
||||||
if (aHypSObject) {
|
if (aHypSObject) {
|
||||||
if (!aHypName.isEmpty())
|
if (!aHypName.isEmpty())
|
||||||
SMESH::SetName(aHypSObject, aHypName);
|
SMESH::SetName(aHypSObject, aHypName);
|
||||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
||||||
return aHypothesis._retn();
|
return aHypothesis._retn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (const SALOME::SALOME_Exception & S_ex) {
|
} catch (const SALOME::SALOME_Exception & S_ex) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
@ -435,23 +435,23 @@ namespace SMESH
|
|||||||
_PTR(SObject) SM = SMESH::FindSObject(aMesh);
|
_PTR(SObject) SM = SMESH::FindSObject(aMesh);
|
||||||
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM);
|
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM);
|
||||||
try {
|
try {
|
||||||
res = aMesh->AddHypothesis(aShapeObject, aHyp);
|
res = aMesh->AddHypothesis(aShapeObject, aHyp);
|
||||||
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
||||||
_PTR(SObject) aSH = SMESH::FindSObject(aHyp);
|
_PTR(SObject) aSH = SMESH::FindSObject(aHyp);
|
||||||
if (SM && aSH) {
|
if (SM && aSH) {
|
||||||
SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
|
SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (res > SMESH::HYP_OK) {
|
if (res > SMESH::HYP_OK) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
processHypothesisStatus(res, aHyp, true);
|
processHypothesisStatus(res, aHyp, true);
|
||||||
wc.resume();
|
wc.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
res = SMESH::HYP_UNKNOWN_FATAL;
|
res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res < SMESH::HYP_UNKNOWN_FATAL;
|
return res < SMESH::HYP_UNKNOWN_FATAL;
|
||||||
@ -466,33 +466,33 @@ namespace SMESH
|
|||||||
|
|
||||||
if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
|
if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
|
||||||
try {
|
try {
|
||||||
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
|
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
|
||||||
_PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
|
_PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
|
||||||
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
|
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
|
||||||
if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
|
if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
|
||||||
res = aMesh->AddHypothesis(aShapeObject, aHyp);
|
res = aMesh->AddHypothesis(aShapeObject, aHyp);
|
||||||
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
||||||
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
||||||
if (meshSO)
|
if (meshSO)
|
||||||
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
||||||
}
|
}
|
||||||
if (res > SMESH::HYP_OK) {
|
if (res > SMESH::HYP_OK) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
processHypothesisStatus(res, aHyp, true);
|
processHypothesisStatus(res, aHyp, true);
|
||||||
wc.resume();
|
wc.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SCRUTE(aHyp->_is_nil());
|
SCRUTE(aHyp->_is_nil());
|
||||||
SCRUTE(aMesh->_is_nil());
|
SCRUTE(aMesh->_is_nil());
|
||||||
SCRUTE(!SsubM);
|
SCRUTE(!SsubM);
|
||||||
SCRUTE(aShapeObject->_is_nil());
|
SCRUTE(aShapeObject->_is_nil());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
res = SMESH::HYP_UNKNOWN_FATAL;
|
res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -511,28 +511,28 @@ namespace SMESH
|
|||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
|
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
|
||||||
if( aHypObj )
|
if( aHypObj )
|
||||||
{
|
{
|
||||||
_PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
|
_PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
|
||||||
_PTR(SObject) aRealHypo;
|
_PTR(SObject) aRealHypo;
|
||||||
if( aHypObj->ReferencedObject( aRealHypo ) )
|
if( aHypObj->ReferencedObject( aRealHypo ) )
|
||||||
{
|
{
|
||||||
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
|
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
|
||||||
RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
|
RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
|
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
|
||||||
SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
|
SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
|
||||||
for( int i = 0; i < meshList.size(); i++ )
|
for( int i = 0; i < meshList.size(); i++ )
|
||||||
RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
|
RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex)
|
catch(const SALOME::SALOME_Exception& S_ex)
|
||||||
{
|
{
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
res = SMESH::HYP_UNKNOWN_FATAL;
|
res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
return res < SMESH::HYP_UNKNOWN_FATAL;
|
return res < SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
@ -566,7 +566,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
else if(!aMesh->HasShapeToMesh()){
|
else if(!aMesh->HasShapeToMesh()){
|
||||||
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
|
||||||
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
if (res < SMESH::HYP_UNKNOWN_FATAL) {
|
||||||
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
|
||||||
if (meshSO)
|
if (meshSO)
|
||||||
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
|
||||||
@ -579,9 +579,9 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(const SALOME::SALOME_Exception& S_ex) {
|
} catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
res = SMESH::HYP_UNKNOWN_FATAL;
|
res = SMESH::HYP_UNKNOWN_FATAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res < SMESH::HYP_UNKNOWN_FATAL;
|
return res < SMESH::HYP_UNKNOWN_FATAL;
|
||||||
@ -596,25 +596,25 @@ namespace SMESH
|
|||||||
if (!AlgoOrHyp->_is_nil()) {
|
if (!AlgoOrHyp->_is_nil()) {
|
||||||
_PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
|
_PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
|
||||||
if (SO_Hypothesis) {
|
if (SO_Hypothesis) {
|
||||||
SObjectList listSO =
|
SObjectList listSO =
|
||||||
SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
|
SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
|
||||||
|
|
||||||
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
|
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
|
||||||
for (unsigned int i = 0; i < listSO.size(); i++) {
|
for (unsigned int i = 0; i < listSO.size(); i++) {
|
||||||
_PTR(SObject) SO = listSO[i];
|
_PTR(SObject) SO = listSO[i];
|
||||||
if (SO) {
|
if (SO) {
|
||||||
_PTR(SObject) aFather = SO->GetFather();
|
_PTR(SObject) aFather = SO->GetFather();
|
||||||
if (aFather) {
|
if (aFather) {
|
||||||
_PTR(SObject) SOfatherFather = aFather->GetFather();
|
_PTR(SObject) SOfatherFather = aFather->GetFather();
|
||||||
if (SOfatherFather) {
|
if (SOfatherFather) {
|
||||||
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
|
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
|
||||||
index++;
|
index++;
|
||||||
listSOmesh.resize(index);
|
listSOmesh.resize(index);
|
||||||
listSOmesh[index - 1] = SOfatherFather;
|
listSOmesh[index - 1] = SOfatherFather;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed");
|
if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed");
|
||||||
|
@ -65,7 +65,7 @@ namespace SMESH
|
|||||||
QStringList GetAvailableHypotheses( const bool,
|
QStringList GetAvailableHypotheses( const bool,
|
||||||
const int = -1,
|
const int = -1,
|
||||||
const bool = false,
|
const bool = false,
|
||||||
const bool = true);
|
const bool = true);
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
QStringList GetHypothesesSets();
|
QStringList GetHypothesesSets();
|
||||||
|
|
||||||
@ -77,12 +77,12 @@ namespace SMESH
|
|||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
bool IsAvailableHypothesis( const HypothesisData*,
|
bool IsAvailableHypothesis( const HypothesisData*,
|
||||||
const QString&,
|
const QString&,
|
||||||
bool& );
|
bool& );
|
||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
bool IsCompatibleAlgorithm( const HypothesisData*,
|
bool IsCompatibleAlgorithm( const HypothesisData*,
|
||||||
const HypothesisData* );
|
const HypothesisData* );
|
||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
|
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
|
||||||
@ -103,7 +103,7 @@ namespace SMESH
|
|||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
|
bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
|
||||||
SMESH::SMESH_Hypothesis_ptr );
|
SMESH::SMESH_Hypothesis_ptr );
|
||||||
|
|
||||||
typedef std::vector<_PTR(SObject)> SObjectList;
|
typedef std::vector<_PTR(SObject)> SObjectList;
|
||||||
SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
|
SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
|
||||||
|
@ -47,15 +47,15 @@ public:
|
|||||||
// truncate extra ids
|
// truncate extra ids
|
||||||
int ind = 0, nbId = 0;
|
int ind = 0, nbId = 0;
|
||||||
while ( ind < input.length() ) {
|
while ( ind < input.length() ) {
|
||||||
if ( input.at( ind ) != ' ' ) {
|
if ( input.at( ind ) != ' ' ) {
|
||||||
if ( ++nbId > myMaxNbId ) {
|
if ( ++nbId > myMaxNbId ) {
|
||||||
input.truncate( ind );
|
input.truncate( ind );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ind = input.indexOf( ' ', ind );
|
ind = input.indexOf( ' ', ind );
|
||||||
if ( ind < 0 ) break;
|
if ( ind < 0 ) break;
|
||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( pos > input.length() )
|
if ( pos > input.length() )
|
||||||
|
@ -189,8 +189,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
|
|||||||
int nbSel = selected.Extent();
|
int nbSel = selected.Extent();
|
||||||
if (nbSel != 1) {
|
if (nbSel != 1) {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
|
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
|
||||||
onCancel();
|
onCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -199,8 +199,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
|
|||||||
myMesh = SMESH::GetMeshByIO(anIO);
|
myMesh = SMESH::GetMeshByIO(anIO);
|
||||||
if (myMesh->_is_nil()) {
|
if (myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
|
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
|
||||||
onCancel();
|
onCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -214,8 +214,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation()
|
|||||||
|
|
||||||
if (!compute2DMesh()) {
|
if (!compute2DMesh()) {
|
||||||
SUIT_MessageBox::warning(desktop(),
|
SUIT_MessageBox::warning(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_COMPUTE_FAILED"));
|
tr("SMESH_WRN_COMPUTE_FAILED"));
|
||||||
onCancel();
|
onCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh
|
|||||||
myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
|
myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
|
||||||
myHypoSetButton->setEnabled( false );
|
myHypoSetButton->setEnabled( false );
|
||||||
myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding,
|
myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding,
|
||||||
myHypoSetButton->sizePolicy().verticalPolicy() );
|
myHypoSetButton->sizePolicy().verticalPolicy() );
|
||||||
|
|
||||||
// Fill layout
|
// Fill layout
|
||||||
QGridLayout* aLay = new QGridLayout( mainFrame() );
|
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("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
|
||||||
myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
|
myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
|
||||||
connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
|
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 {
|
else {
|
||||||
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
|
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
|
||||||
if ( myGeomPopup ) {
|
if ( myGeomPopup ) {
|
||||||
delete myGeomPopup;
|
delete myGeomPopup;
|
||||||
myGeomPopup = 0;
|
myGeomPopup = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,52 +358,52 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
|
|||||||
|
|
||||||
// edges
|
// edges
|
||||||
myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
|
myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
|
||||||
theInfo[SMDSEntity_Quad_Edge] ));
|
theInfo[SMDSEntity_Quad_Edge] ));
|
||||||
myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
|
myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
|
||||||
myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
|
myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
|
||||||
|
|
||||||
// faces
|
// faces
|
||||||
myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
||||||
theInfo[SMDSEntity_Quad_Triangle] +
|
theInfo[SMDSEntity_Quad_Triangle] +
|
||||||
theInfo[SMDSEntity_Quadrangle] +
|
theInfo[SMDSEntity_Quadrangle] +
|
||||||
theInfo[SMDSEntity_Quad_Quadrangle] +
|
theInfo[SMDSEntity_Quad_Quadrangle] +
|
||||||
theInfo[SMDSEntity_Polygon] ));
|
theInfo[SMDSEntity_Polygon] ));
|
||||||
myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
||||||
theInfo[SMDSEntity_Quadrangle] +
|
theInfo[SMDSEntity_Quadrangle] +
|
||||||
theInfo[SMDSEntity_Polygon] ));
|
theInfo[SMDSEntity_Polygon] ));
|
||||||
myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
|
myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
|
||||||
theInfo[SMDSEntity_Quad_Quadrangle] ));
|
theInfo[SMDSEntity_Quad_Quadrangle] ));
|
||||||
|
|
||||||
// volumes
|
// volumes
|
||||||
myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
||||||
theInfo[SMDSEntity_Quad_Tetra] +
|
theInfo[SMDSEntity_Quad_Tetra] +
|
||||||
theInfo[SMDSEntity_Pyramid] +
|
theInfo[SMDSEntity_Pyramid] +
|
||||||
theInfo[SMDSEntity_Quad_Pyramid] +
|
theInfo[SMDSEntity_Quad_Pyramid] +
|
||||||
theInfo[SMDSEntity_Hexa] +
|
theInfo[SMDSEntity_Hexa] +
|
||||||
theInfo[SMDSEntity_Quad_Hexa] +
|
theInfo[SMDSEntity_Quad_Hexa] +
|
||||||
theInfo[SMDSEntity_Penta] +
|
theInfo[SMDSEntity_Penta] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] +
|
theInfo[SMDSEntity_Quad_Penta] +
|
||||||
theInfo[SMDSEntity_Polyhedra] ));
|
theInfo[SMDSEntity_Polyhedra] ));
|
||||||
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
||||||
theInfo[SMDSEntity_Pyramid] +
|
theInfo[SMDSEntity_Pyramid] +
|
||||||
theInfo[SMDSEntity_Hexa] +
|
theInfo[SMDSEntity_Hexa] +
|
||||||
theInfo[SMDSEntity_Penta] +
|
theInfo[SMDSEntity_Penta] +
|
||||||
theInfo[SMDSEntity_Polyhedra] ));
|
theInfo[SMDSEntity_Polyhedra] ));
|
||||||
myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
|
myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
|
||||||
theInfo[SMDSEntity_Quad_Pyramid] +
|
theInfo[SMDSEntity_Quad_Pyramid] +
|
||||||
theInfo[SMDSEntity_Quad_Hexa] +
|
theInfo[SMDSEntity_Quad_Hexa] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] ));
|
theInfo[SMDSEntity_Quad_Penta] ));
|
||||||
|
|
||||||
if ( myFull )
|
if ( myFull )
|
||||||
{
|
{
|
||||||
// triangles
|
// triangles
|
||||||
myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
|
||||||
theInfo[SMDSEntity_Quad_Triangle] ));
|
theInfo[SMDSEntity_Quad_Triangle] ));
|
||||||
myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
|
myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
|
||||||
myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
|
myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
|
||||||
// quadrangles
|
// quadrangles
|
||||||
myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
|
myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
|
||||||
theInfo[SMDSEntity_Quad_Quadrangle] ));
|
theInfo[SMDSEntity_Quad_Quadrangle] ));
|
||||||
myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
|
myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
|
||||||
myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
|
myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
|
||||||
// poligones
|
// poligones
|
||||||
@ -411,22 +411,22 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
|
|||||||
|
|
||||||
// tetras
|
// tetras
|
||||||
myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
||||||
theInfo[SMDSEntity_Quad_Tetra] ));
|
theInfo[SMDSEntity_Quad_Tetra] ));
|
||||||
myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
|
myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
|
||||||
myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
|
myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
|
||||||
// hexas
|
// hexas
|
||||||
myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
|
myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
|
||||||
theInfo[SMDSEntity_Quad_Hexa] ));
|
theInfo[SMDSEntity_Quad_Hexa] ));
|
||||||
myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
|
myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
|
||||||
myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
|
myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
|
||||||
// pyras
|
// pyras
|
||||||
myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
|
myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
|
||||||
theInfo[SMDSEntity_Quad_Pyramid] ));
|
theInfo[SMDSEntity_Quad_Pyramid] ));
|
||||||
myNbLinPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] ));
|
myNbLinPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] ));
|
||||||
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
|
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
|
||||||
// prisms
|
// prisms
|
||||||
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
|
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] ));
|
theInfo[SMDSEntity_Quad_Penta] ));
|
||||||
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
|
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
|
||||||
myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
|
myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
|
||||||
// polyedres
|
// polyedres
|
||||||
|
@ -198,17 +198,17 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos()
|
|||||||
//CORBA::Object_var anObject = aSO->GetObject();
|
//CORBA::Object_var anObject = aSO->GetObject();
|
||||||
CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
|
CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
|
||||||
if (!CORBA::is_nil(anObject)) {
|
if (!CORBA::is_nil(anObject)) {
|
||||||
SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
|
SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
|
||||||
if (!anIDSource->_is_nil()) {
|
if (!anIDSource->_is_nil()) {
|
||||||
myWGStack->setCurrentWidget(myMeshWidget);
|
myWGStack->setCurrentWidget(myMeshWidget);
|
||||||
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
|
||||||
myMeshName->setText(aSO->GetName().c_str());
|
myMeshName->setText(aSO->GetName().c_str());
|
||||||
|
|
||||||
SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
|
SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
|
||||||
myMeshInfoBox->SetMeshInfo( aMeshInfo );
|
myMeshInfoBox->SetMeshInfo( aMeshInfo );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,10 +297,10 @@ void SMESHGUI_MeshInfosDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,11 +576,11 @@ void SMESHGUI_MeshOp::selectionDone()
|
|||||||
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
|
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
|
||||||
bool editSubmesh = ( !sm->_is_nil() &&
|
bool editSubmesh = ( !sm->_is_nil() &&
|
||||||
SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
|
SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
|
||||||
tr( "EDIT_SUBMESH_QUESTION"),
|
tr( "EDIT_SUBMESH_QUESTION"),
|
||||||
SUIT_MessageBox::Yes |
|
SUIT_MessageBox::Yes |
|
||||||
SUIT_MessageBox::No,
|
SUIT_MessageBox::No,
|
||||||
SUIT_MessageBox::No )
|
SUIT_MessageBox::No )
|
||||||
== SUIT_MessageBox::Yes );
|
== SUIT_MessageBox::Yes );
|
||||||
if ( editSubmesh )
|
if ( editSubmesh )
|
||||||
{
|
{
|
||||||
selectionMgr()->clearFilters();
|
selectionMgr()->clearFilters();
|
||||||
@ -1666,7 +1666,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess )
|
|||||||
aNewGeomGroupName += aName;
|
aNewGeomGroupName += aName;
|
||||||
SALOMEDS::SObject_var aNewGroupSO =
|
SALOMEDS::SObject_var aNewGroupSO =
|
||||||
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
|
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
|
||||||
aNewGeomGroupName.toLatin1().data(), mainGeom);
|
aNewGeomGroupName.toLatin1().data(), mainGeom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ private:
|
|||||||
const int ); // access to myAvailableHypData
|
const int ); // access to myAvailableHypData
|
||||||
|
|
||||||
void createHypothesis( const int, const int,
|
void createHypothesis( const int, const int,
|
||||||
const QString& );
|
const QString& );
|
||||||
|
|
||||||
bool createMesh( QString& );
|
bool createMesh( QString& );
|
||||||
bool createSubMesh( QString& );
|
bool createSubMesh( QString& );
|
||||||
|
@ -420,10 +420,10 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
|
|||||||
ok = myNode2->isValid( msg, theMess ) && ok;
|
ok = myNode2->isValid( msg, theMess ) && ok;
|
||||||
if( !ok ) {
|
if( !ok ) {
|
||||||
if( theMess ) {
|
if( theMess ) {
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
if ( !msg.isEmpty() )
|
if ( !msg.isEmpty() )
|
||||||
str += "\n" + msg;
|
str += "\n" + msg;
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -440,14 +440,14 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
|
|||||||
{
|
{
|
||||||
if (theMess)
|
if (theMess)
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("SMESHGUI_INVALID_PARAMETERS"));
|
tr("SMESHGUI_INVALID_PARAMETERS"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( myName->text().isEmpty() ) {
|
if ( myName->text().isEmpty() ) {
|
||||||
if (theMess)
|
if (theMess)
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
|
||||||
tr("SMESHGUI_INVALID_PARAMETERS"));
|
tr("SMESHGUI_INVALID_PARAMETERS"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,15 +473,15 @@ bool SMESHGUI_MeshPatternDlg::onApply()
|
|||||||
varIds->length(ids.count());
|
varIds->length(ids.count());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
|
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
|
||||||
varIds[i++] = *it;
|
varIds[i++] = *it;
|
||||||
myType == Type_2d
|
myType == Type_2d
|
||||||
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
||||||
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
|
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
|
||||||
|
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << myNode1->text();
|
aParameters << myNode1->text();
|
||||||
if(myType == Type_3d )
|
if(myType == Type_3d )
|
||||||
aParameters << myNode2->text();
|
aParameters << myNode2->text();
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
} else { // Applying a pattern to geometrical object
|
} else { // Applying a pattern to geometrical object
|
||||||
@ -497,15 +497,15 @@ bool SMESHGUI_MeshPatternDlg::onApply()
|
|||||||
//mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
bool autoUpdate = SMESHGUI::automaticUpdate();
|
bool autoUpdate = SMESHGUI::automaticUpdate();
|
||||||
if (!isRefine() && autoUpdate) {
|
if (!isRefine() && autoUpdate) {
|
||||||
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
|
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
|
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
|
||||||
if (!anActor) {
|
if (!anActor) {
|
||||||
anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
|
anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
|
||||||
if (anActor) {
|
if (anActor) {
|
||||||
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
|
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
|
||||||
SMESH::FitAll();
|
SMESH::FitAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
@ -517,7 +517,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESH_OPERATION_FAILED"));
|
tr("SMESH_OPERATION_FAILED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (const SALOME::SALOME_Exception& S_ex) {
|
} catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -565,17 +565,17 @@ void SMESHGUI_MeshPatternDlg::onHelp()
|
|||||||
if (app)
|
if (app)
|
||||||
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
||||||
else {
|
else {
|
||||||
QString platform;
|
QString platform;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
platform = "winapplication";
|
platform = "winapplication";
|
||||||
#else
|
#else
|
||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
|
|||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
|
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
|
||||||
if (aList.Extent() != 1)
|
if (aList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Retrieve mesh from selection
|
// Retrieve mesh from selection
|
||||||
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
||||||
@ -624,11 +624,11 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
|
|||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
|
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
|
||||||
if (aList.Extent() != 1)
|
if (aList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString anIds;
|
QString anIds;
|
||||||
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
|
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
|
||||||
anIds = "";
|
anIds = "";
|
||||||
|
|
||||||
myBusy = true;
|
myBusy = true;
|
||||||
mySelEdit[ Ids ]->setText(anIds);
|
mySelEdit[ Ids ]->setText(anIds);
|
||||||
@ -638,7 +638,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone()
|
|||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
|
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
|
||||||
if (aList.Extent() != 1)
|
if (aList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get geom object from selection
|
// Get geom object from selection
|
||||||
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
||||||
@ -809,14 +809,14 @@ void SMESHGUI_MeshPatternDlg::onOpen()
|
|||||||
QFile aFile(fName);
|
QFile aFile(fName);
|
||||||
if (!aFile.open(QIODevice::ReadOnly)) {
|
if (!aFile.open(QIODevice::ReadOnly)) {
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_OPENING"));
|
tr("ERROR_OF_OPENING"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray aDataArray = aFile.readAll();
|
QByteArray aDataArray = aFile.readAll();
|
||||||
if (aDataArray.isEmpty()) {
|
if (aDataArray.isEmpty()) {
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_READING"));
|
tr("ERROR_OF_READING"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1046,11 +1046,11 @@ void SMESHGUI_MeshPatternDlg::updateWgState()
|
|||||||
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
|
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
|
||||||
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
|
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
|
||||||
if (keyPoints->length()) {
|
if (keyPoints->length()) {
|
||||||
myNode1->setEnabled(true);
|
myNode1->setEnabled(true);
|
||||||
myNode2->setEnabled(true);
|
myNode2->setEnabled(true);
|
||||||
myNode1->setRange(1, keyPoints->length());
|
myNode1->setRange(1, keyPoints->length());
|
||||||
myNode2->setRange(1, keyPoints->length());
|
myNode2->setRange(1, keyPoints->length());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1075,13 +1075,13 @@ void SMESHGUI_MeshPatternDlg::activateSelection()
|
|||||||
|
|
||||||
if (myType == Type_2d)
|
if (myType == Type_2d)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1146,7 +1146,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName)
|
|||||||
} catch (const SALOME::SALOME_Exception& S_ex) {
|
} catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
||||||
tr("ERROR_OF_LOADING") );
|
tr("ERROR_OF_LOADING") );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1229,13 +1229,13 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid()
|
|||||||
varIds->length(ids.count());
|
varIds->length(ids.count());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
|
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
|
||||||
varIds[i++] = *it;
|
varIds[i++] = *it;
|
||||||
pnts = myType == Type_2d
|
pnts = myType == Type_2d
|
||||||
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
||||||
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
|
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
|
||||||
} else {
|
} else {
|
||||||
pnts = myType == Type_2d
|
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 ]);
|
: 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++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
|
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);
|
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
@ -46,13 +46,13 @@ namespace SMESH
|
|||||||
if(!CORBA::is_nil(anObj)){
|
if(!CORBA::is_nil(anObj)){
|
||||||
SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj);
|
SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj);
|
||||||
if(!CORBA::is_nil(aMesh))
|
if(!CORBA::is_nil(aMesh))
|
||||||
return aMesh;
|
return aMesh;
|
||||||
SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj);
|
SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj);
|
||||||
if(!CORBA::is_nil(aGroup))
|
if(!CORBA::is_nil(aGroup))
|
||||||
return aGroup->GetMesh();
|
return aGroup->GetMesh();
|
||||||
SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj);
|
SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj);
|
||||||
if(!CORBA::is_nil(aSubMesh))
|
if(!CORBA::is_nil(aSubMesh))
|
||||||
return aSubMesh->GetFather();
|
return aSubMesh->GetFather();
|
||||||
}
|
}
|
||||||
return SMESH_Mesh::_nil();
|
return SMESH_Mesh::_nil();
|
||||||
}
|
}
|
||||||
@ -65,17 +65,17 @@ namespace SMESH
|
|||||||
QString name = baseName;
|
QString name = baseName;
|
||||||
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
|
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
|
||||||
int nb = 0;
|
int nb = 0;
|
||||||
QStringList names = name.split("_", QString::KeepEmptyParts);
|
QStringList names = name.split("_", QString::KeepEmptyParts);
|
||||||
if ( names.count() > 0 ) {
|
if ( names.count() > 0 ) {
|
||||||
bool ok;
|
bool ok;
|
||||||
int index = names.last().toInt( &ok );
|
int index = names.last().toInt( &ok );
|
||||||
if ( ok ) {
|
if ( ok ) {
|
||||||
nb = index;
|
nb = index;
|
||||||
names.removeLast();
|
names.removeLast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
names.append( QString::number( nb+1 ) );
|
names.append( QString::number( nb+1 ) );
|
||||||
name = names.join( "_" );
|
name = names.join( "_" );
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
|
|||||||
if (myId->text().isEmpty()) {
|
if (myId->text().isEmpty()) {
|
||||||
if (theMess)
|
if (theMess)
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
|
SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
|
||||||
tr("NODE_ID_IS_NOT_DEFINED"));
|
tr("NODE_ID_IS_NOT_DEFINED"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
|
|||||||
if( theMess ) {
|
if( theMess ) {
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
if ( !msg.isEmpty() )
|
if ( !msg.isEmpty() )
|
||||||
str += "\n" + msg;
|
str += "\n" + msg;
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -329,7 +329,7 @@ bool SMESHGUI_MoveNodesDlg::onApply()
|
|||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
|
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
|
||||||
if (aMesh->_is_nil()) {
|
if (aMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
|
||||||
tr("SMESHG_NO_MESH"));
|
tr("SMESHG_NO_MESH"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,17 +398,17 @@ void SMESHGUI_MoveNodesDlg::onHelp()
|
|||||||
if (app)
|
if (app)
|
||||||
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
||||||
else {
|
else {
|
||||||
QString platform;
|
QString platform;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
platform = "winapplication";
|
platform = "winapplication";
|
||||||
#else
|
#else
|
||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,13 +435,13 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
|
|||||||
myBusy = false;
|
myBusy = false;
|
||||||
|
|
||||||
if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
|
if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
|
||||||
TColStd_MapOfInteger aListInd;
|
TColStd_MapOfInteger aListInd;
|
||||||
aListInd.Add(anElem->GetID());
|
aListInd.Add(anElem->GetID());
|
||||||
mySelector->AddOrRemoveIndex(anIO,aListInd, false);
|
mySelector->AddOrRemoveIndex(anIO,aListInd, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight(anIO,true,true);
|
aViewWindow->highlight(anIO,true,true);
|
||||||
|
|
||||||
onSelectionDone();
|
onSelectionDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,8 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESHGUI_MultiEditDlg
|
SMESHGUI_MultiEditDlg
|
||||||
::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
|
::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
|
||||||
const int theMode,
|
const int theMode,
|
||||||
const bool the3d2d):
|
const bool the3d2d):
|
||||||
QDialog(SMESH::GetDesktop(theModule)),
|
QDialog(SMESH::GetDesktop(theModule)),
|
||||||
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
|
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
|
||||||
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
||||||
@ -192,7 +192,7 @@ QWidget* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool
|
|||||||
|
|
||||||
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
|
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
|
||||||
mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0,
|
mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0,
|
||||||
1, mySelGrpLayout->columnCount());
|
1, mySelGrpLayout->columnCount());
|
||||||
|
|
||||||
// Split/Join criterion group
|
// Split/Join criterion group
|
||||||
myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
|
myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
|
||||||
@ -440,30 +440,30 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
|
|||||||
// skl 07.02.2006
|
// skl 07.02.2006
|
||||||
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
|
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
|
||||||
if( myFilterType == SMESH::TriaFilter ||
|
if( myFilterType == SMESH::TriaFilter ||
|
||||||
myFilterType == SMESH::QuadFilter ||
|
myFilterType == SMESH::QuadFilter ||
|
||||||
myFilterType == SMESH::FaceFilter ) {
|
myFilterType == SMESH::FaceFilter ) {
|
||||||
SMDS_FaceIteratorPtr it = aMesh->facesIterator();
|
SMDS_FaceIteratorPtr it = aMesh->facesIterator();
|
||||||
while(it->more()) {
|
while(it->more()) {
|
||||||
const SMDS_MeshFace* f = it->next();
|
const SMDS_MeshFace* f = it->next();
|
||||||
if(myFilterType == SMESH::FaceFilter) {
|
if(myFilterType == SMESH::FaceFilter) {
|
||||||
myIds.Add(f->GetID());
|
myIds.Add(f->GetID());
|
||||||
}
|
}
|
||||||
else if( myFilterType==SMESH::TriaFilter &&
|
else if( myFilterType==SMESH::TriaFilter &&
|
||||||
( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
|
( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
|
||||||
myIds.Add(f->GetID());
|
myIds.Add(f->GetID());
|
||||||
}
|
}
|
||||||
else if( myFilterType==SMESH::QuadFilter &&
|
else if( myFilterType==SMESH::QuadFilter &&
|
||||||
( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
|
( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
|
||||||
myIds.Add(f->GetID());
|
myIds.Add(f->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(myFilterType == SMESH::VolumeFilter) {
|
else if(myFilterType == SMESH::VolumeFilter) {
|
||||||
SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
|
SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
|
||||||
while(it->more()) {
|
while(it->more()) {
|
||||||
const SMDS_MeshVolume* f = it->next();
|
const SMDS_MeshVolume* f = it->next();
|
||||||
myIds.Add(f->GetID());
|
myIds.Add(f->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* commented by skl 07.02.2006
|
/* commented by skl 07.02.2006
|
||||||
TVisualObjPtr aVisualObj = anActor->GetObject();
|
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++) {
|
for (int i = 0, n = aGrid->GetNumberOfCells(); i < n; i++) {
|
||||||
vtkCell* aCell = aGrid->GetCell(i);
|
vtkCell* aCell = aGrid->GetCell(i);
|
||||||
if (aCell != 0) {
|
if (aCell != 0) {
|
||||||
vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
|
vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
|
||||||
vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
|
vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
|
||||||
vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
|
vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
|
||||||
|
|
||||||
vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
|
vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
|
||||||
vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
|
vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
|
||||||
|
|
||||||
if (aTri && myFilterType == SMESHGUI_TriaFilter ||
|
if (aTri && myFilterType == SMESHGUI_TriaFilter ||
|
||||||
aQua && myFilterType == SMESHGUI_QuadFilter ||
|
aQua && myFilterType == SMESHGUI_QuadFilter ||
|
||||||
(aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter ||
|
(aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter ||
|
||||||
(a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) {
|
(a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) {
|
||||||
@ -540,10 +540,10 @@ void SMESHGUI_MultiEditDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,10 +594,10 @@ void SMESHGUI_MultiEditDlg::onSelectionDone()
|
|||||||
if (aNbItems > 0) {
|
if (aNbItems > 0) {
|
||||||
QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
|
QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
|
||||||
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
|
||||||
QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
|
QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, items)
|
foreach(anItem, items)
|
||||||
anItem->setSelected(true);
|
anItem->setSelected(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myMesh = SMESH::GetMeshByIO(anIO);
|
myMesh = SMESH::GetMeshByIO(anIO);
|
||||||
@ -1180,7 +1180,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
|
|||||||
if( theMess ) {
|
if( theMess ) {
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
if ( !msg.isEmpty() )
|
if ( !msg.isEmpty() )
|
||||||
str += "\n" + msg;
|
str += "\n" + msg;
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -113,7 +113,7 @@ protected:
|
|||||||
void setSelectionMode();
|
void setSelectionMode();
|
||||||
virtual bool isIdValid( const int ) const;
|
virtual bool isIdValid( const int ) const;
|
||||||
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
|
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
|
||||||
const SMESH::long_array& ) = 0;
|
const SMESH::long_array& ) = 0;
|
||||||
int entityType();
|
int entityType();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -120,7 +120,7 @@ bool SMESHGUI_Operation::isReadyToStart() const
|
|||||||
else if ( getSMESHGUI() == 0 )
|
else if ( getSMESHGUI() == 0 )
|
||||||
{
|
{
|
||||||
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
||||||
tr( "NO_MODULE" ) );
|
tr( "NO_MODULE" ) );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ( isStudyLocked() )
|
else if ( isStudyLocked() )
|
||||||
@ -200,10 +200,10 @@ void SMESHGUI_Operation::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
|
SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName) );
|
arg(myHelpFileName) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
|
|||||||
{
|
{
|
||||||
if ( theMess )
|
if ( theMess )
|
||||||
SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
|
SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
|
||||||
tr( "WRN_STUDY_LOCKED" ) );
|
tr( "WRN_STUDY_LOCKED" ) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const
|
|||||||
|
|
||||||
return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
|
return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
|
||||||
( !anOps.contains( theOtherOp->metaObject()->className() ) ||
|
( !anOps.contains( theOtherOp->metaObject()->className() ) ||
|
||||||
anOps.contains( metaObject()->className() ) );
|
anOps.contains( metaObject()->className() ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -95,9 +95,9 @@ void SMESHGUI_PatternWidget::paintEvent( QPaintEvent* )
|
|||||||
QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
|
QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
|
||||||
|
|
||||||
painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius,
|
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,
|
painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift,
|
||||||
QString::number( i+1 ) );
|
QString::number( i+1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw lines
|
// Draw lines
|
||||||
|
@ -53,8 +53,8 @@ public:
|
|||||||
~SMESHGUI_PatternWidget();
|
~SMESHGUI_PatternWidget();
|
||||||
|
|
||||||
void SetPoints( const PointVector&,
|
void SetPoints( const PointVector&,
|
||||||
const QVector<int>&,
|
const QVector<int>&,
|
||||||
const ConnectivityVector& );
|
const ConnectivityVector& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PointVector myPoints;
|
PointVector myPoints;
|
||||||
|
@ -158,10 +158,10 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
|
|||||||
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
|
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
|
||||||
|
|
||||||
connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
|
connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
|
||||||
this, SLOT( DeactivateActiveDialog() ) );
|
this, SLOT( DeactivateActiveDialog() ) );
|
||||||
/* to close dialog if study change */
|
/* to close dialog if study change */
|
||||||
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
|
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
|
||||||
this, SLOT( ClickOnCancel() ) );
|
this, SLOT( ClickOnCancel() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
@ -300,7 +300,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
||||||
|
|
||||||
QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
|
QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
|
||||||
QColor(255, 255, 255));
|
QColor(255, 255, 255));
|
||||||
myTitleColorBtn->setColor(titleColor);
|
myTitleColorBtn->setColor(titleColor);
|
||||||
myTitleFontCombo->setCurrentIndex(0);
|
myTitleFontCombo->setCurrentIndex(0);
|
||||||
if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
|
if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
|
||||||
@ -318,7 +318,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
}
|
}
|
||||||
|
|
||||||
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
|
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
|
||||||
QColor(255, 255, 255));
|
QColor(255, 255, 255));
|
||||||
myLabelsColorBtn->setColor(labelColor);
|
myLabelsColorBtn->setColor(labelColor);
|
||||||
myLabelsFontCombo->setCurrentIndex(0);
|
myLabelsFontCombo->setCurrentIndex(0);
|
||||||
if (mgr->hasValue("SMESH", "scalar_bar_label_font")) {
|
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";
|
QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
|
||||||
|
|
||||||
myIniX = mgr->doubleValue("SMESH", name.arg( "x" ),
|
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" ),
|
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" ),
|
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" ),
|
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);
|
setOriginAndSize(myIniX, myIniY, myIniW, myIniH);
|
||||||
|
|
||||||
@ -504,10 +504,10 @@ void SMESHGUI_Preferences_ScalarBarDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,56 +528,56 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
|
|||||||
if( anIO->hasEntry() ) {
|
if( anIO->hasEntry() ) {
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
|
SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
|
||||||
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
|
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
|
||||||
myActor = anActor;
|
myActor = anActor;
|
||||||
vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
|
vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
|
||||||
|
|
||||||
if ( myScalarBarActor->GetLookupTable() ) {
|
if ( myScalarBarActor->GetLookupTable() ) {
|
||||||
vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
|
vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
|
||||||
myMinEdit->setText( QString::number( range[0],'g',12 ) );
|
myMinEdit->setText( QString::number( range[0],'g',12 ) );
|
||||||
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
|
myMaxEdit->setText( QString::number( range[1],'g',12 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
|
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
|
||||||
vtkFloatingPointType aTColor[3];
|
vtkFloatingPointType aTColor[3];
|
||||||
aTitleTextPrp->GetColor( aTColor );
|
aTitleTextPrp->GetColor( aTColor );
|
||||||
myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
|
myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
|
||||||
myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
|
myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
|
||||||
myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
|
myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
|
||||||
myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
|
myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
|
||||||
myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
|
myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
|
||||||
|
|
||||||
vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
|
vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
|
||||||
vtkFloatingPointType aLColor[3];
|
vtkFloatingPointType aLColor[3];
|
||||||
aLabelsTextPrp->GetColor( aLColor );
|
aLabelsTextPrp->GetColor( aLColor );
|
||||||
myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
|
myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
|
||||||
myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
|
myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
|
||||||
myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
|
myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
|
||||||
myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
|
myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
|
||||||
myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
|
myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
|
||||||
|
|
||||||
myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
|
myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
|
||||||
myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
|
myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
|
||||||
|
|
||||||
if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
|
if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
|
||||||
myVertRadioBtn->setChecked( true );
|
myVertRadioBtn->setChecked( true );
|
||||||
else
|
else
|
||||||
myHorizRadioBtn->setChecked( true );
|
myHorizRadioBtn->setChecked( true );
|
||||||
myIniOrientation = myVertRadioBtn->isChecked();
|
myIniOrientation = myVertRadioBtn->isChecked();
|
||||||
|
|
||||||
myIniX = myScalarBarActor->GetPosition()[0];
|
myIniX = myScalarBarActor->GetPosition()[0];
|
||||||
myIniY = myScalarBarActor->GetPosition()[1];
|
myIniY = myScalarBarActor->GetPosition()[1];
|
||||||
myIniW = myScalarBarActor->GetWidth();
|
myIniW = myScalarBarActor->GetWidth();
|
||||||
myIniH = myScalarBarActor->GetHeight();
|
myIniH = myScalarBarActor->GetHeight();
|
||||||
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
|
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
|
||||||
|
|
||||||
myRangeGrp->setEnabled( true );
|
myRangeGrp->setEnabled( true );
|
||||||
myFontGrp->setEnabled( true );
|
myFontGrp->setEnabled( true );
|
||||||
myLabColorGrp->setEnabled( true );
|
myLabColorGrp->setEnabled( true );
|
||||||
myOrientationGrp->setEnabled( true );
|
myOrientationGrp->setEnabled( true );
|
||||||
myOriginDimGrp->setEnabled( true );
|
myOriginDimGrp->setEnabled( true );
|
||||||
myOkBtn->setEnabled( true );
|
myOkBtn->setEnabled( true );
|
||||||
myApplyBtn->setEnabled( true );
|
myApplyBtn->setEnabled( true );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -625,9 +625,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onXYChanged()
|
|||||||
*/
|
*/
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x,
|
void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x,
|
||||||
const double y,
|
const double y,
|
||||||
const double w,
|
const double w,
|
||||||
const double h )
|
const double h )
|
||||||
{
|
{
|
||||||
blockSignals( true );
|
blockSignals( true );
|
||||||
myXSpin->setValue( x );
|
myXSpin->setValue( x );
|
||||||
@ -656,9 +656,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged()
|
|||||||
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
|
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
|
||||||
else
|
else
|
||||||
setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X,
|
setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X,
|
||||||
aOrientation ? DEF_VER_Y : DEF_HOR_Y,
|
aOrientation ? DEF_VER_Y : DEF_HOR_Y,
|
||||||
aOrientation ? DEF_VER_W : DEF_HOR_W,
|
aOrientation ? DEF_VER_W : DEF_HOR_W,
|
||||||
aOrientation ? DEF_VER_H : DEF_HOR_H );
|
aOrientation ? DEF_VER_H : DEF_HOR_H );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
|
@ -63,9 +63,9 @@ public:
|
|||||||
|
|
||||||
void closeEvent( QCloseEvent* );
|
void closeEvent( QCloseEvent* );
|
||||||
void setOriginAndSize( const double,
|
void setOriginAndSize( const double,
|
||||||
const double,
|
const double,
|
||||||
const double,
|
const double,
|
||||||
const double );
|
const double );
|
||||||
void initScalarBarFromResources();
|
void initScalarBarFromResources();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
|
|||||||
/* to close dialog if study change */
|
/* to close dialog if study change */
|
||||||
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
|
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
|
||||||
SLOT(onTextChange(const QString&)));
|
SLOT(onTextChange(const QString&)));
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
@ -291,10 +291,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,15 +321,15 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
|
|||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
|
if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
|
||||||
newIndices.Add(anElem->GetID());
|
newIndices.Add(anElem->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
|
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
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 */
|
case 0: /* default constructor */
|
||||||
{
|
{
|
||||||
if(send == SelectButtonC1A1) {
|
if(send == SelectButtonC1A1) {
|
||||||
LineEditC1A1->setFocus();
|
LineEditC1A1->setFocus();
|
||||||
myEditCurrentArgument = LineEditC1A1;
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
}
|
}
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
break;
|
break;
|
||||||
@ -509,8 +509,8 @@ void SMESHGUI_RemoveElementsDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
|
|||||||
/* to close dialog if study change */
|
/* to close dialog if study change */
|
||||||
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
|
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
|
||||||
SLOT(onTextChange(const QString&)));
|
SLOT(onTextChange(const QString&)));
|
||||||
|
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
|
|
||||||
@ -297,10 +297,10 @@ void SMESHGUI_RemoveNodesDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,15 +327,15 @@ void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText)
|
|||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
|
if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
|
||||||
newIndices.Add(aNode->GetID());
|
newIndices.Add(aNode->GetID());
|
||||||
myNbOkNodes++;
|
myNbOkNodes++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
|
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
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 */
|
case 0: /* default constructor */
|
||||||
{
|
{
|
||||||
if(send == SelectButtonC1A1) {
|
if(send == SelectButtonC1A1) {
|
||||||
LineEditC1A1->setFocus();
|
LineEditC1A1->setFocus();
|
||||||
myEditCurrentArgument = LineEditC1A1;
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
}
|
}
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
break;
|
break;
|
||||||
@ -516,8 +516,8 @@ void SMESHGUI_RemoveNodesDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -78,14 +78,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
|
|||||||
setModal(false);
|
setModal(false);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
setWindowTitle(unit == 0 ?
|
setWindowTitle(unit == 0 ?
|
||||||
tr("SMESH_RENUMBERING_NODES_TITLE") :
|
tr("SMESH_RENUMBERING_NODES_TITLE") :
|
||||||
tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
|
tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
|
||||||
setSizeGripEnabled(true);
|
setSizeGripEnabled(true);
|
||||||
|
|
||||||
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
|
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
|
||||||
QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ?
|
QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ?
|
||||||
tr("ICON_DLG_RENUMBERING_NODES") :
|
tr("ICON_DLG_RENUMBERING_NODES") :
|
||||||
tr("ICON_DLG_RENUMBERING_ELEMENTS")));
|
tr("ICON_DLG_RENUMBERING_ELEMENTS")));
|
||||||
QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
|
QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
|
||||||
|
|
||||||
QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
|
QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
|
||||||
@ -94,9 +94,9 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int
|
|||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors = new QGroupBox(unit == 0 ?
|
GroupConstructors = new QGroupBox(unit == 0 ?
|
||||||
tr("SMESH_NODES") :
|
tr("SMESH_NODES") :
|
||||||
tr("SMESH_ELEMENTS"),
|
tr("SMESH_ELEMENTS"),
|
||||||
this);
|
this);
|
||||||
myHelpFileName = unit == 0 ?
|
myHelpFileName = unit == 0 ?
|
||||||
"renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
|
"renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
|
||||||
"renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
|
"renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
|
||||||
@ -219,22 +219,22 @@ void SMESHGUI_RenumberingDlg::ClickOnApply()
|
|||||||
bool isUnitsLabeled = false;
|
bool isUnitsLabeled = false;
|
||||||
|
|
||||||
if (myUnit == 0 && anActor) {
|
if (myUnit == 0 && anActor) {
|
||||||
isUnitsLabeled = anActor->GetPointsLabeled();
|
isUnitsLabeled = anActor->GetPointsLabeled();
|
||||||
if (isUnitsLabeled) anActor->SetPointsLabeled(false);
|
if (isUnitsLabeled) anActor->SetPointsLabeled(false);
|
||||||
}
|
}
|
||||||
else if (myUnit == 1 && anActor) {
|
else if (myUnit == 1 && anActor) {
|
||||||
isUnitsLabeled = anActor->GetCellsLabeled();
|
isUnitsLabeled = anActor->GetCellsLabeled();
|
||||||
if (isUnitsLabeled) anActor->SetCellsLabeled(false);
|
if (isUnitsLabeled) anActor->SetCellsLabeled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
if (myUnit == 0) {
|
if (myUnit == 0) {
|
||||||
aMeshEditor->RenumberNodes();
|
aMeshEditor->RenumberNodes();
|
||||||
if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
|
if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
|
||||||
}
|
}
|
||||||
else if (myUnit == 1) {
|
else if (myUnit == 1) {
|
||||||
aMeshEditor->RenumberElements();
|
aMeshEditor->RenumberElements();
|
||||||
if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
|
if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...) {
|
catch(...) {
|
||||||
@ -285,10 +285,10 @@ void SMESHGUI_RenumberingDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ void SMESHGUI_RenumberingDlg::SelectionIntoArgument()
|
|||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||||
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
aString = "";
|
aString = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,12 +338,12 @@ void SMESHGUI_RenumberingDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
case 0: /* default constructor */
|
case 0: /* default constructor */
|
||||||
{
|
{
|
||||||
if(send == SelectButton) {
|
if(send == SelectButton) {
|
||||||
LineEditMesh->setFocus();
|
LineEditMesh->setFocus();
|
||||||
myEditCurrentArgument = LineEditMesh;
|
myEditCurrentArgument = LineEditMesh;
|
||||||
}
|
}
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
|
|||||||
myIDs.clear();
|
myIDs.clear();
|
||||||
myNbOkElements = 0;
|
myNbOkElements = 0;
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(aSelMode);
|
aViewWindow->SetSelectionMode(aSelMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
myEditCurrentArgument = (QWidget*)LineEditElements;
|
||||||
@ -519,29 +519,29 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
|
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
|
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
|
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
else
|
else
|
||||||
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
@ -602,10 +602,10 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,15 +653,15 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
|
|||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
|
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
aViewWindow->highlight( myActor->getIO(), true, true );
|
||||||
|
|
||||||
myElementsId = theNewText;
|
myElementsId = theNewText;
|
||||||
}
|
}
|
||||||
@ -744,7 +744,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
||||||
myElementsId = aString;
|
myElementsId = aString;
|
||||||
if (aNbUnits < 1)
|
if (aNbUnits < 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myNbOkElements = true;
|
myNbOkElements = true;
|
||||||
} else {
|
} else {
|
||||||
@ -834,20 +834,20 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
if (aConstructorId == 0)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
else if (aConstructorId == 1)
|
else if (aConstructorId == 1)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (send == SelectPointButton) {
|
} else if (send == SelectPointButton) {
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
||||||
@ -956,13 +956,13 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
|
|||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
if (aConstructorId == 0)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
}
|
}
|
||||||
else if (aConstructorId == 1)
|
else if (aConstructorId == 1)
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
LineEditElements->setReadOnly(false);
|
LineEditElements->setReadOnly(false);
|
||||||
@ -993,8 +993,8 @@ int SMESHGUI_RevolutionDlg::GetConstructorId()
|
|||||||
bool SMESHGUI_RevolutionDlg::IsAxisOk()
|
bool SMESHGUI_RevolutionDlg::IsAxisOk()
|
||||||
{
|
{
|
||||||
return (SpinBox_DX->GetValue() != 0 ||
|
return (SpinBox_DX->GetValue() != 0 ||
|
||||||
SpinBox_DY->GetValue() != 0 ||
|
SpinBox_DY->GetValue() != 0 ||
|
||||||
SpinBox_DZ->GetValue() != 0);
|
SpinBox_DZ->GetValue() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1055,7 +1055,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
|
|
||||||
anElementsId->length(aListElementsId.count());
|
anElementsId->length(aListElementsId.count());
|
||||||
for (int i = 0; i < aListElementsId.count(); i++)
|
for (int i = 0; i < aListElementsId.count(); i++)
|
||||||
anElementsId[i] = aListElementsId[i].toInt();
|
anElementsId[i] = aListElementsId[i].toInt();
|
||||||
|
|
||||||
SMESH::AxisStruct anAxis;
|
SMESH::AxisStruct anAxis;
|
||||||
|
|
||||||
@ -1071,27 +1071,27 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
double aTolerance = SpinBox_Tolerance->GetValue();
|
double aTolerance = SpinBox_Tolerance->GetValue();
|
||||||
|
|
||||||
if (GroupAngle->checkedId() == 1)
|
if (GroupAngle->checkedId() == 1)
|
||||||
anAngle = anAngle/aNbSteps;
|
anAngle = anAngle/aNbSteps;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
|
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
else
|
else
|
||||||
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
|
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(),
|
aMeshEditor->RotationSweep(anElementsId.inout(),
|
||||||
anAxis,
|
anAxis,
|
||||||
anAngle,
|
anAngle,
|
||||||
aNbSteps,
|
aNbSteps,
|
||||||
aTolerance);
|
aTolerance);
|
||||||
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
||||||
mySimulation->SetData(aMeshPreviewStruct._retn());
|
mySimulation->SetData(aMeshPreviewStruct._retn());
|
||||||
} catch (...) {}
|
} catch (...) {}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1155,8 +1155,8 @@ void SMESHGUI_RevolutionDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -414,8 +414,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
|
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
|
||||||
else
|
else
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups ) {
|
if ( makeGroups ) {
|
||||||
@ -431,8 +431,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON:
|
case MAKE_MESH_BUTTON:
|
||||||
SMESH::SMESH_Mesh_var mesh;
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
@ -442,8 +442,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( !mesh->_is_nil())
|
if( !mesh->_is_nil())
|
||||||
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
@ -506,10 +506,10 @@ void SMESHGUI_RotationDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,15 +543,15 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( anIO, true, true );
|
aViewWindow->highlight( anIO, true, true );
|
||||||
|
|
||||||
myElementsId = theNewText;
|
myElementsId = theNewText;
|
||||||
}
|
}
|
||||||
@ -743,23 +743,23 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
|
|||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
myEditCurrentArgument = (QWidget*)LineEditElements;
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
if ( aViewWindow )
|
if ( aViewWindow )
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
if ( aViewWindow )
|
if ( aViewWindow )
|
||||||
aViewWindow->SetSelectionMode( CellSelection );
|
aViewWindow->SetSelectionMode( CellSelection );
|
||||||
}
|
}
|
||||||
} else if (send == SelectPointButton) {
|
} else if (send == SelectPointButton) {
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( aViewWindow )
|
if ( aViewWindow )
|
||||||
aViewWindow->SetSelectionMode( NodeSelection );
|
aViewWindow->SetSelectionMode( NodeSelection );
|
||||||
} else if (send == SelectVectorButton) {
|
} else if (send == SelectVectorButton) {
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox_DX;
|
myEditCurrentArgument = (QWidget*)SpinBox_DX;
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( aViewWindow )
|
if ( aViewWindow )
|
||||||
aViewWindow->SetSelectionMode( NodeSelection );
|
aViewWindow->SetSelectionMode( NodeSelection );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -879,8 +879,8 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh)
|
|||||||
bool SMESHGUI_RotationDlg::IsAxisOk()
|
bool SMESHGUI_RotationDlg::IsAxisOk()
|
||||||
{
|
{
|
||||||
return (SpinBox_DX->GetValue() != 0 ||
|
return (SpinBox_DX->GetValue() != 0 ||
|
||||||
SpinBox_DY->GetValue() != 0 ||
|
SpinBox_DY->GetValue() != 0 ||
|
||||||
SpinBox_DZ->GetValue() != 0);
|
SpinBox_DZ->GetValue() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -977,8 +977,8 @@ void SMESHGUI_RotationDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -360,7 +360,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
|
|||||||
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
|
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
|
||||||
if ( !mesh->_is_nil() ) {*/
|
if ( !mesh->_is_nil() ) {*/
|
||||||
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
|
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
|
||||||
//FindSObject( mesh );
|
//FindSObject( mesh );
|
||||||
if ( so ) {
|
if ( so ) {
|
||||||
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
|
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
|
||||||
if(!CORBA::is_nil(obj)){
|
if(!CORBA::is_nil(obj)){
|
||||||
@ -428,7 +428,7 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const
|
|||||||
SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
|
SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
|
||||||
if ( actor && actor->hasIO() ) {
|
if ( actor && actor->hasIO() ) {
|
||||||
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
|
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
|
||||||
return QVariant( aViewWindow->isVisible( actor->getIO() ) );
|
return QVariant( aViewWindow->isVisible( actor->getIO() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QVariant( false );
|
return QVariant( false );
|
||||||
|
@ -107,7 +107,7 @@ protected:
|
|||||||
|
|
||||||
//! Select some nodes or elements in VTK
|
//! Select some nodes or elements in VTK
|
||||||
void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
|
void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
|
||||||
const TColStd_MapOfInteger&, const bool );
|
const TColStd_MapOfInteger&, const bool isModeShift);
|
||||||
|
|
||||||
SVTK_ViewWindow* viewWindow() const;
|
SVTK_ViewWindow* viewWindow() const;
|
||||||
SVTK_Selector* selector() const;
|
SVTK_Selector* selector() const;
|
||||||
|
@ -385,9 +385,9 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
|
|||||||
LineEdit5->setEnabled(false);
|
LineEdit5->setEnabled(false);
|
||||||
|
|
||||||
if (!CheckBoxPolygons->isVisible())
|
if (!CheckBoxPolygons->isVisible())
|
||||||
CheckBoxPolygons->show();
|
CheckBoxPolygons->show();
|
||||||
if (!CheckBoxPolyedrs->isVisible())
|
if (!CheckBoxPolyedrs->isVisible())
|
||||||
CheckBoxPolyedrs->show();
|
CheckBoxPolyedrs->show();
|
||||||
|
|
||||||
myOk5 = true;
|
myOk5 = true;
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -472,8 +472,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
|
|||||||
LineEdit4->text().toLong(),
|
LineEdit4->text().toLong(),
|
||||||
LineEdit5->text().toLong(),
|
LineEdit5->text().toLong(),
|
||||||
LineEdit6->text().toLong(),
|
LineEdit6->text().toLong(),
|
||||||
toCreatePolygons,
|
toCreatePolygons,
|
||||||
toCreatePolyedrs);
|
toCreatePolyedrs);
|
||||||
else if (aConstructorId == 1)
|
else if (aConstructorId == 1)
|
||||||
anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
|
anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
|
||||||
LineEdit2->text().toLong(),
|
LineEdit2->text().toLong(),
|
||||||
@ -486,8 +486,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
|
|||||||
LineEdit3->text().toLong(),
|
LineEdit3->text().toLong(),
|
||||||
LineEdit4->text().toLong(),
|
LineEdit4->text().toLong(),
|
||||||
LineEdit6->text().toLong(),
|
LineEdit6->text().toLong(),
|
||||||
toCreatePolygons,
|
toCreatePolygons,
|
||||||
toCreatePolyedrs);
|
toCreatePolyedrs);
|
||||||
else if (aConstructorId == 3) {
|
else if (aConstructorId == 3) {
|
||||||
QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
|
QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
|
||||||
QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
|
QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
|
||||||
@ -580,10 +580,10 @@ void SMESHGUI_SewingDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,14 +632,14 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
|
|||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
|
|
||||||
const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
|
const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
|
||||||
if (n) {
|
if (n) {
|
||||||
newIndices.Add(n->GetID());
|
newIndices.Add(n->GetID());
|
||||||
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
aViewWindow->highlight( myActor->getIO(), true, true );
|
||||||
|
|
||||||
if (send == LineEdit1)
|
if (send == LineEdit1)
|
||||||
myOk1 = true;
|
myOk1 = true;
|
||||||
@ -658,7 +658,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
|
|||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
|
|
||||||
if (!isEvenOneExists)
|
if (!isEvenOneExists)
|
||||||
isEvenOneExists = true;
|
isEvenOneExists = true;
|
||||||
@ -676,7 +676,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
aViewWindow->highlight( myActor->getIO(), true, true );
|
||||||
|
|
||||||
if (isEvenOneExists) {
|
if (isEvenOneExists) {
|
||||||
if (send == LineEdit1)
|
if (send == LineEdit1)
|
||||||
|
@ -129,7 +129,7 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent)
|
|||||||
QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
|
QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
|
||||||
myElementId = new QLineEdit( aMainGrp );
|
myElementId = new QLineEdit( aMainGrp );
|
||||||
myElementId->setValidator( new SMESHGUI_IdValidator( theParent,
|
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
|
// shape name
|
||||||
QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
|
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
|
int shapeDim = 0; // max dim with several shapes
|
||||||
//if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
|
//if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
|
||||||
{
|
{
|
||||||
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
|
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
|
||||||
GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
|
GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
|
||||||
if ( !mainShape->_is_nil() )
|
if ( !mainShape->_is_nil() )
|
||||||
{
|
{
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape(mainShape, aShape))
|
if ( GEOMBase::GetShape(mainShape, aShape))
|
||||||
{
|
{
|
||||||
TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
|
TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
|
||||||
for ( int dim = 4; dim > 0; --dim ) {
|
for ( int dim = 4; dim > 0; --dim ) {
|
||||||
TopAbs_ShapeEnum type = types[ dim - 1 ];
|
TopAbs_ShapeEnum type = types[ dim - 1 ];
|
||||||
TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
|
TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
|
||||||
TopExp_Explorer exp( aShape, type, avoid );
|
TopExp_Explorer exp( aShape, type, avoid );
|
||||||
for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
|
for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
|
||||||
++nbShapes[ type ];
|
++nbShapes[ type ];
|
||||||
if ( nbShapes[ type ] > 1 ) {
|
if ( nbShapes[ type ] > 1 ) {
|
||||||
shapeDim = dim;
|
shapeDim = dim;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shapeDim > 0)
|
if (shapeDim > 0)
|
||||||
{
|
{
|
||||||
if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
|
if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
|
||||||
shapeDim = 3;
|
shapeDim = 3;
|
||||||
hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
|
hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
|
||||||
hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
|
hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
|
||||||
hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
|
hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
|
||||||
}
|
}
|
||||||
myHasSolids = nbShapes[ TopAbs_SOLID ];
|
myHasSolids = nbShapes[ TopAbs_SOLID ];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,83 +306,83 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
|
|||||||
QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
|
QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
|
||||||
if (aListId.count() == 1)
|
if (aListId.count() == 1)
|
||||||
{
|
{
|
||||||
int elemID = (aListId.first()).toInt();
|
int elemID = (aListId.first()).toInt();
|
||||||
myGeomObj = GEOM::GEOM_Object::_duplicate(
|
myGeomObj = GEOM::GEOM_Object::_duplicate(
|
||||||
SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
|
SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
|
||||||
( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
|
( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
|
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
|
||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
|
|
||||||
if (geomGen->_is_nil() || !aStudy)
|
if (geomGen->_is_nil() || !aStudy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
geomGen->GetIShapesOperations(aStudy->StudyId());
|
geomGen->GetIShapesOperations(aStudy->StudyId());
|
||||||
if (aShapesOp->_is_nil() )
|
if (aShapesOp->_is_nil() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
|
TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
|
||||||
|
|
||||||
std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
|
std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
|
||||||
GEOM::GEOM_Object_var aGeomObject;
|
GEOM::GEOM_Object_var aGeomObject;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
|
GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
|
||||||
|
|
||||||
for ( int i = 0; i < aListId.count(); i++ )
|
for ( int i = 0; i < aListId.count(); i++ )
|
||||||
{
|
{
|
||||||
aGeomObject =
|
aGeomObject =
|
||||||
SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
|
SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
|
||||||
|
|
||||||
if (aGeomObject->_is_nil()) continue;
|
if (aGeomObject->_is_nil()) continue;
|
||||||
|
|
||||||
double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
|
double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
|
||||||
if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
|
if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
|
||||||
{
|
{
|
||||||
aGeomObjectsMap[anId] = aGeomObject;
|
aGeomObjectsMap[anId] = aGeomObject;
|
||||||
|
|
||||||
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
|
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
aGroupType = aSubShapeType;
|
aGroupType = aSubShapeType;
|
||||||
else if (aSubShapeType != aGroupType)
|
else if (aSubShapeType != aGroupType)
|
||||||
aGroupType = TopAbs_SHAPE;
|
aGroupType = TopAbs_SHAPE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int aNumberOfGO = aGeomObjectsMap.size();
|
int aNumberOfGO = aGeomObjectsMap.size();
|
||||||
if (aNumberOfGO == 1)
|
if (aNumberOfGO == 1)
|
||||||
myGeomObj = (*aGeomObjectsMap.begin()).second;
|
myGeomObj = (*aGeomObjectsMap.begin()).second;
|
||||||
else if (aNumberOfGO > 1)
|
else if (aNumberOfGO > 1)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
||||||
geomGen->GetIGroupOperations(aStudy->StudyId());
|
geomGen->GetIGroupOperations(aStudy->StudyId());
|
||||||
if(aGroupOp->_is_nil())
|
if(aGroupOp->_is_nil())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
|
GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
|
||||||
aGeomObjects->length( aNumberOfGO );
|
aGeomObjects->length( aNumberOfGO );
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
|
std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
|
||||||
for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
|
for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
|
||||||
aGeomObjects[i++] = (*anIter).second;
|
aGeomObjects[i++] = (*anIter).second;
|
||||||
|
|
||||||
//create geometry group
|
//create geometry group
|
||||||
myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
|
myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
|
||||||
aGroupOp->UnionList(myGeomObj, aGeomObjects);
|
aGroupOp->UnionList(myGeomObj, aGeomObjects);
|
||||||
|
|
||||||
if (!aGroupOp->IsDone())
|
if (!aGroupOp->IsDone())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// publish the GEOM object in study
|
// publish the GEOM object in study
|
||||||
QString aNewGeomGroupName ( myDlg->myGeomName->text() );
|
QString aNewGeomGroupName ( myDlg->myGeomName->text() );
|
||||||
|
|
||||||
SALOMEDS::SObject_var aNewGroupSO =
|
SALOMEDS::SObject_var aNewGroupSO =
|
||||||
geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
|
geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
|
||||||
aNewGeomGroupName.toLatin1().data(), aMeshShape);
|
aNewGeomGroupName.toLatin1().data(), aMeshShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -422,7 +422,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone()
|
|||||||
aList.First(), aString);
|
aList.First(), aString);
|
||||||
if (nbElems > 0) {
|
if (nbElems > 0) {
|
||||||
if (!myIsMultipleAllowed && nbElems != 1 )
|
if (!myIsMultipleAllowed && nbElems != 1 )
|
||||||
return;
|
return;
|
||||||
setElementID( aString );
|
setElementID( aString );
|
||||||
myDlg->setButtonEnabled( true, QtxDialog::OK );
|
myDlg->setButtonEnabled( true, QtxDialog::OK );
|
||||||
}
|
}
|
||||||
@ -485,31 +485,31 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText)
|
|||||||
{
|
{
|
||||||
if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
|
if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
|
||||||
{
|
{
|
||||||
SMDSAbs_ElementType type = SMDSAbs_Edge;
|
SMDSAbs_ElementType type = SMDSAbs_Edge;
|
||||||
switch ( myDlg->myElemTypeGroup->checkedId() ) {
|
switch ( myDlg->myElemTypeGroup->checkedId() ) {
|
||||||
case EDGE : type = SMDSAbs_Edge; break;
|
case EDGE : type = SMDSAbs_Edge; break;
|
||||||
case FACE : type = SMDSAbs_Face; break;
|
case FACE : type = SMDSAbs_Face; break;
|
||||||
case VOLUME: type = SMDSAbs_Volume; break;
|
case VOLUME: type = SMDSAbs_Volume; break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
|
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
|
||||||
for ( int i = 0; i < aListId.count(); i++ ) {
|
for ( int i = 0; i < aListId.count(); i++ ) {
|
||||||
if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
|
if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
|
||||||
if ( e->GetType() == type )
|
if ( e->GetType() == type )
|
||||||
newIndices.Add( e->GetID() );
|
newIndices.Add( e->GetID() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !newIndices.IsEmpty() )
|
if ( !newIndices.IsEmpty() )
|
||||||
{
|
{
|
||||||
if (!myIsMultipleAllowed && newIndices.Extent() != 1)
|
if (!myIsMultipleAllowed && newIndices.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
if ( SVTK_Selector* s = selector() ) {
|
if ( SVTK_Selector* s = selector() ) {
|
||||||
s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
|
s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
|
||||||
viewWindow()->highlight( actor->getIO(), true, true );
|
viewWindow()->highlight( actor->getIO(), true, true );
|
||||||
myDlg->setButtonEnabled( true, QtxDialog::OK );
|
myDlg->setButtonEnabled( true, QtxDialog::OK );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,10 +278,10 @@ void SMESHGUI_SingleEditDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,13 +348,13 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
int id1, id2;
|
int id1, id2;
|
||||||
if ( !getNodeIds(myEdge->text(), id1, id2) )
|
if ( !getNodeIds(myEdge->text(), id1, id2) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
|
const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
|
||||||
const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
|
const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
|
||||||
|
|
||||||
if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
|
if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// find a triangle and an edge index
|
// find a triangle and an edge index
|
||||||
const SMDS_MeshElement* tria1;
|
const SMDS_MeshElement* tria1;
|
||||||
@ -362,23 +362,23 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
|
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
|
||||||
{
|
{
|
||||||
newIndices.Add(tria1->GetID());
|
newIndices.Add(tria1->GetID());
|
||||||
|
|
||||||
const SMDS_MeshNode* a3Nodes[3];
|
const SMDS_MeshNode* a3Nodes[3];
|
||||||
SMDS_ElemIteratorPtr it;
|
SMDS_ElemIteratorPtr it;
|
||||||
int edgeInd = 2, i;
|
int edgeInd = 2, i;
|
||||||
for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
|
for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
|
||||||
a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
|
a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
|
||||||
if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
|
if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
|
||||||
a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
|
a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
|
||||||
edgeInd = i - 1;
|
edgeInd = i - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newIndices.Add(-edgeInd-1);
|
newIndices.Add(-edgeInd-1);
|
||||||
|
|
||||||
myOkBtn->setEnabled(true);
|
myOkBtn->setEnabled(true);
|
||||||
myApplyBtn->setEnabled(true);
|
myApplyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
mySelector->AddOrRemoveIndex(anIO,newIndices, false);
|
mySelector->AddOrRemoveIndex(anIO,newIndices, false);
|
||||||
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
|
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
|
||||||
@ -416,17 +416,17 @@ void SMESHGUI_SingleEditDlg::onSelectionDone()
|
|||||||
{
|
{
|
||||||
const SMDS_MeshElement* tria[2];
|
const SMDS_MeshElement* tria[2];
|
||||||
if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 &&
|
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);
|
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
|
||||||
myEdge->setText(aText);
|
myEdge->setText(aText);
|
||||||
|
|
||||||
myOkBtn->setEnabled(true);
|
myOkBtn->setEnabled(true);
|
||||||
myApplyBtn->setEnabled(true);
|
myApplyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myEdge->clear();
|
myEdge->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,8 +494,8 @@ bool SMESHGUI_SingleEditDlg::onApply()
|
|||||||
|
|
||||||
if (aMesh->_is_nil()) {
|
if (aMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI),
|
SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI),
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("SMESHG_NO_MESH"));
|
tr("SMESHG_NO_MESH"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,19 +365,19 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
|
|||||||
|
|
||||||
if ( CheckBoxParametric->isChecked() ) {
|
if ( CheckBoxParametric->isChecked() ) {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
|
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
else
|
else
|
||||||
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
|
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
|
aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
else
|
else
|
||||||
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
|
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
@ -448,10 +448,10 @@ void SMESHGUI_SmoothingDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,28 +490,28 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
|
|||||||
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
|
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( anIO, true, true );
|
aViewWindow->highlight( anIO, true, true );
|
||||||
myElementsId = theNewText;
|
myElementsId = theNewText;
|
||||||
|
|
||||||
} else if (send == LineEditNodes) {
|
} else if (send == LineEditNodes) {
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
|
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
|
const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
|
||||||
if (n)
|
if (n)
|
||||||
newIndices.Add(n->GetID());
|
newIndices.Add(n->GetID());
|
||||||
myNbOkNodes++;
|
myNbOkNodes++;
|
||||||
}
|
}
|
||||||
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
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;
|
myEditCurrentArgument = LineEditElements;
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
// mySelectionMgr->setSelectionModes(ActorSelection);
|
// mySelectionMgr->setSelectionModes(ActorSelection);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
} else if (send == SelectNodesButton) {
|
} else if (send == SelectNodesButton) {
|
||||||
LineEditNodes->clear();
|
LineEditNodes->clear();
|
||||||
myEditCurrentArgument = LineEditNodes;
|
myEditCurrentArgument = LineEditNodes;
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setFocus();
|
myEditCurrentArgument->setFocus();
|
||||||
@ -782,8 +782,8 @@ void SMESHGUI_SmoothingDlg::setFilters( const bool theIsElem )
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -107,9 +107,9 @@ QDoubleValidator* SMESHGUI_SpinBox::validator() const
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
|
void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
|
||||||
double max,
|
double max,
|
||||||
double step,
|
double step,
|
||||||
unsigned short precision )
|
unsigned short precision )
|
||||||
{
|
{
|
||||||
setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
|
setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
|
||||||
// see QtxDoubleSpinBox::mapValueToText( double v )
|
// see QtxDoubleSpinBox::mapValueToText( double v )
|
||||||
|
@ -203,20 +203,20 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
int aDimension = 0;
|
int aDimension = 0;
|
||||||
double aNbDimElements = 0;
|
double aNbDimElements = 0;
|
||||||
if (aNbVolumes > 0) {
|
if (aNbVolumes > 0) {
|
||||||
aNbDimElements = aNbVolumes;
|
aNbDimElements = aNbVolumes;
|
||||||
aDimension = 3;
|
aDimension = 3;
|
||||||
}
|
}
|
||||||
else if(aNbFaces > 0) {
|
else if(aNbFaces > 0) {
|
||||||
aNbDimElements = aNbFaces;
|
aNbDimElements = aNbFaces;
|
||||||
aDimension = 2;
|
aDimension = 2;
|
||||||
}
|
}
|
||||||
else if(aNbEdges > 0) {
|
else if(aNbEdges > 0) {
|
||||||
aNbDimElements = aNbEdges;
|
aNbDimElements = aNbEdges;
|
||||||
aDimension = 1;
|
aDimension = 1;
|
||||||
}
|
}
|
||||||
else if(aNbNodes > 0) {
|
else if(aNbNodes > 0) {
|
||||||
aNbDimElements = aNbNodes;
|
aNbDimElements = aNbNodes;
|
||||||
aDimension = 0;
|
aDimension = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// information about the mesh
|
// information about the mesh
|
||||||
@ -234,15 +234,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
|
aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
|
||||||
if (anObj) {
|
if (anObj) {
|
||||||
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
||||||
if (it->More()) {
|
if (it->More()) {
|
||||||
anInfo.append(QString("Groups:<br><br>"));
|
anInfo.append(QString("Groups:<br><br>"));
|
||||||
hasGroup = true;
|
hasGroup = true;
|
||||||
}
|
}
|
||||||
for ( ; it->More(); it->Next()) {
|
for ( ; it->More(); it->Next()) {
|
||||||
_PTR(SObject) subObj = it->Value();
|
_PTR(SObject) subObj = it->Value();
|
||||||
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
||||||
if (!aGroup->_is_nil()) {
|
if (!aGroup->_is_nil()) {
|
||||||
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
||||||
anInfo.append(QString("%1<br>").arg("on nodes"));
|
anInfo.append(QString("%1<br>").arg("on nodes"));
|
||||||
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
||||||
@ -259,7 +259,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
anInfo.append(QString("<br>"));
|
anInfo.append(QString("<br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// info about groups on edges
|
// info about groups on edges
|
||||||
@ -271,11 +271,11 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
anInfo.append(QString("Groups:<br><br>"));
|
anInfo.append(QString("Groups:<br><br>"));
|
||||||
hasGroup = true;
|
hasGroup = true;
|
||||||
}
|
}
|
||||||
for ( ; it->More(); it->Next()) {
|
for ( ; it->More(); it->Next()) {
|
||||||
_PTR(SObject) subObj = it->Value();
|
_PTR(SObject) subObj = it->Value();
|
||||||
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
||||||
if (!aGroup->_is_nil()) {
|
if (!aGroup->_is_nil()) {
|
||||||
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
||||||
anInfo.append(QString("%1<br>").arg("on edges"));
|
anInfo.append(QString("%1<br>").arg("on edges"));
|
||||||
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
||||||
@ -292,7 +292,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
anInfo.append(QString("<br>"));
|
anInfo.append(QString("<br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// info about groups on faces
|
// info about groups on faces
|
||||||
@ -300,15 +300,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
|
aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
|
||||||
if (anObj) {
|
if (anObj) {
|
||||||
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
||||||
if (!hasGroup && it->More()) {
|
if (!hasGroup && it->More()) {
|
||||||
anInfo.append(QString("Groups:<br><br>"));
|
anInfo.append(QString("Groups:<br><br>"));
|
||||||
hasGroup = true;
|
hasGroup = true;
|
||||||
}
|
}
|
||||||
for ( ; it->More(); it->Next()) {
|
for ( ; it->More(); it->Next()) {
|
||||||
_PTR(SObject) subObj = it->Value();
|
_PTR(SObject) subObj = it->Value();
|
||||||
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
||||||
if (!aGroup->_is_nil()) {
|
if (!aGroup->_is_nil()) {
|
||||||
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
||||||
anInfo.append(QString("%1<br>").arg("on faces"));
|
anInfo.append(QString("%1<br>").arg("on faces"));
|
||||||
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
||||||
@ -325,7 +325,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
anInfo.append(QString("<br>"));
|
anInfo.append(QString("<br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// info about groups on volumes
|
// info about groups on volumes
|
||||||
@ -333,13 +333,13 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
|
aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
|
||||||
if (anObj) {
|
if (anObj) {
|
||||||
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
|
||||||
if (!hasGroup && it->More())
|
if (!hasGroup && it->More())
|
||||||
anInfo.append(QString("Groups:<br>"));
|
anInfo.append(QString("Groups:<br>"));
|
||||||
for ( ; it->More(); it->Next()) {
|
for ( ; it->More(); it->Next()) {
|
||||||
_PTR(SObject) subObj = it->Value();
|
_PTR(SObject) subObj = it->Value();
|
||||||
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
||||||
if (!aGroup->_is_nil()) {
|
if (!aGroup->_is_nil()) {
|
||||||
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
|
||||||
anInfo.append(QString("%1<br>").arg("on volumes"));
|
anInfo.append(QString("%1<br>").arg("on volumes"));
|
||||||
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
|
||||||
@ -356,7 +356,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
|
|||||||
anInfo.append(QString("<br>"));
|
anInfo.append(QString("<br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myInfo->setText(anInfo);
|
myInfo->setText(anInfo);
|
||||||
@ -448,10 +448,10 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,8 +416,8 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -499,8 +499,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
|
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
|
||||||
|
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COPY_ELEMS_BUTTON: {
|
case COPY_ELEMS_BUTTON: {
|
||||||
@ -517,8 +517,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MAKE_MESH_BUTTON: {
|
case MAKE_MESH_BUTTON: {
|
||||||
@ -529,8 +529,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
|
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( !mesh->_is_nil())
|
if( !mesh->_is_nil())
|
||||||
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -595,10 +595,10 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,15 +633,15 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
if (send == LineEditElements) {
|
if (send == LineEditElements) {
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->highlight( anIO, true, true );
|
aViewWindow->highlight( anIO, true, true );
|
||||||
|
|
||||||
myElementsId = theNewText;
|
myElementsId = theNewText;
|
||||||
}
|
}
|
||||||
@ -832,11 +832,11 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument()
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(CellSelection);
|
aViewWindow->SetSelectionMode(CellSelection);
|
||||||
}
|
}
|
||||||
} else if (send == SelectPointButton) {
|
} else if (send == SelectPointButton) {
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
||||||
@ -1076,8 +1076,8 @@ void SMESHGUI_SymmetryDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -417,7 +417,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( CellSelection );
|
aViewWindow->SetSelectionMode( CellSelection );
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
myEditCurrentArgument = (QWidget*)LineEditElements;
|
||||||
@ -487,8 +487,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
|
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
|
||||||
else
|
else
|
||||||
aMeshEditor->Translate(anElementsId, aVector, false);
|
aMeshEditor->Translate(anElementsId, aVector, false);
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups ) {
|
if ( makeGroups ) {
|
||||||
@ -504,8 +504,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Translate(anElementsId, aVector, true);
|
aMeshEditor->Translate(anElementsId, aVector, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON:
|
case MAKE_MESH_BUTTON:
|
||||||
SMESH::SMESH_Mesh_var mesh;
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
@ -515,8 +515,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( !mesh->_is_nil())
|
if( !mesh->_is_nil())
|
||||||
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
@ -580,10 +580,10 @@ void SMESHGUI_TranslationDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
platform)).
|
platform)).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,10 +618,10 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
if (send == LineEditElements) {
|
if (send == LineEditElements) {
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
myNbOkElements++;
|
myNbOkElements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -809,12 +809,12 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument()
|
|||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( ActorSelection );
|
aViewWindow->SetSelectionMode( ActorSelection );
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( CellSelection );
|
aViewWindow->SetSelectionMode( CellSelection );
|
||||||
}
|
}
|
||||||
} else if (send == SelectButton1) {
|
} else if (send == SelectButton1) {
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox1_1;
|
myEditCurrentArgument = (QWidget*)SpinBox1_1;
|
||||||
@ -1024,8 +1024,8 @@ void SMESHGUI_TranslationDlg::setFilters()
|
|||||||
{
|
{
|
||||||
if(myMesh->_is_nil()) {
|
if(myMesh->_is_nil()) {
|
||||||
SUIT_MessageBox::critical(this,
|
SUIT_MessageBox::critical(this,
|
||||||
tr("SMESH_ERROR"),
|
tr("SMESH_ERROR"),
|
||||||
tr("NO_MESH_SELECTED"));
|
tr("NO_MESH_SELECTED"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
|
@ -172,7 +172,7 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
|
|||||||
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
|
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
|
||||||
if ( app )
|
if ( app )
|
||||||
app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
|
app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
|
||||||
QString( "" ), myHelpFileName );
|
QString( "" ), myHelpFileName );
|
||||||
else {
|
else {
|
||||||
QString platform;
|
QString platform;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -181,10 +181,10 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp()
|
|||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
|
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
|
||||||
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
|
||||||
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
|
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
|
||||||
platform ) ).
|
platform ) ).
|
||||||
arg( myHelpFileName ) );
|
arg( myHelpFileName ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ void SMESHGUI_TransparencyDlg::SetTransparency()
|
|||||||
Handle(SALOME_InteractiveObject) IOS = It.Value();
|
Handle(SALOME_InteractiveObject) IOS = It.Value();
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
|
||||||
if ( anActor )
|
if ( anActor )
|
||||||
anActor->SetOpacity( opacity );
|
anActor->SetOpacity( opacity );
|
||||||
}
|
}
|
||||||
myViewWindow->Repaint();
|
myViewWindow->Repaint();
|
||||||
}
|
}
|
||||||
@ -238,31 +238,31 @@ void SMESHGUI_TransparencyDlg::onSelectionChanged()
|
|||||||
if ( aList.Extent() == 1 ) {
|
if ( aList.Extent() == 1 ) {
|
||||||
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
|
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
|
||||||
if ( !FirstIOS.IsNull() ) {
|
if ( !FirstIOS.IsNull() ) {
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
|
||||||
if ( anActor )
|
if ( anActor )
|
||||||
opacity = int( anActor->GetOpacity() * 100. + 0.5 );
|
opacity = int( anActor->GetOpacity() * 100. + 0.5 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( aList.Extent() > 1 ) {
|
else if ( aList.Extent() > 1 ) {
|
||||||
SALOME_ListIteratorOfListIO It( aList );
|
SALOME_ListIteratorOfListIO It( aList );
|
||||||
int setOp = -1;
|
int setOp = -1;
|
||||||
for ( ; It.More(); It.Next() ) {
|
for ( ; It.More(); It.Next() ) {
|
||||||
Handle(SALOME_InteractiveObject) IO = It.Value();
|
Handle(SALOME_InteractiveObject) IO = It.Value();
|
||||||
if ( !IO.IsNull() ) {
|
if ( !IO.IsNull() ) {
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
|
||||||
if ( anActor ) {
|
if ( anActor ) {
|
||||||
int op = int( anActor->GetOpacity() * 100. + 0.5 );
|
int op = int( anActor->GetOpacity() * 100. + 0.5 );
|
||||||
if ( setOp < 0 )
|
if ( setOp < 0 )
|
||||||
setOp = op;
|
setOp = op;
|
||||||
else if ( setOp != op ) {
|
else if ( setOp != op ) {
|
||||||
setOp = 100;
|
setOp = 100;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( setOp >= 0 )
|
if ( setOp >= 0 )
|
||||||
opacity = setOp;
|
opacity = setOp;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
|
@ -80,11 +80,11 @@ namespace SMESH
|
|||||||
if(theOwner){
|
if(theOwner){
|
||||||
const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
|
const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
|
||||||
if(!anIO.IsNull()){
|
if(!anIO.IsNull()){
|
||||||
if(anIO->hasEntry()){
|
if(anIO->hasEntry()){
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
_PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
|
_PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
|
||||||
anObj = SObjectToObject(aSObj,aStudy);
|
anObj = SObjectToObject(aSObj,aStudy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return anObj;
|
return anObj;
|
||||||
@ -124,9 +124,9 @@ namespace SMESH
|
|||||||
(SUIT_Session::session()->activeApplication());
|
(SUIT_Session::session()->activeApplication());
|
||||||
if (app && !CORBA::is_nil(theObject)) {
|
if (app && !CORBA::is_nil(theObject)) {
|
||||||
if(_PTR(Study) aStudy = GetActiveStudyDocument()){
|
if(_PTR(Study) aStudy = GetActiveStudyDocument()){
|
||||||
CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
|
CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
|
||||||
if (strcmp(anIOR.in(), "") != 0)
|
if (strcmp(anIOR.in(), "") != 0)
|
||||||
return aStudy->FindObjectIOR(anIOR.in());
|
return aStudy->FindObjectIOR(anIOR.in());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _PTR(SObject)();
|
return _PTR(SObject)();
|
||||||
@ -187,9 +187,9 @@ namespace SMESH
|
|||||||
if (theSObject) {
|
if (theSObject) {
|
||||||
_PTR(GenericAttribute) anAttr;
|
_PTR(GenericAttribute) anAttr;
|
||||||
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
|
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
_PTR(AttributeIOR) anIOR = anAttr;
|
_PTR(AttributeIOR) anIOR = anAttr;
|
||||||
CORBA::String_var aVal = anIOR->Value().c_str();
|
CORBA::String_var aVal = anIOR->Value().c_str();
|
||||||
return app->orb()->string_to_object(aVal);
|
return app->orb()->string_to_object(aVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CORBA::Object::_nil();
|
return CORBA::Object::_nil();
|
||||||
@ -205,9 +205,9 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
if (!theIO.IsNull()) {
|
if (!theIO.IsNull()) {
|
||||||
if (theIO->hasEntry()) {
|
if (theIO->hasEntry()) {
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
_PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
|
_PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
|
||||||
return SObjectToObject(anObj,aStudy);
|
return SObjectToObject(anObj,aStudy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CORBA::Object::_nil();
|
return CORBA::Object::_nil();
|
||||||
@ -273,11 +273,11 @@ namespace SMESH
|
|||||||
for (int i = 1; anIter->More(); anIter->Next(), i++) {
|
for (int i = 1; anIter->More(); anIter->Next(), i++) {
|
||||||
_PTR(SObject) aSObj = anIter->Value();
|
_PTR(SObject) aSObj = anIter->Value();
|
||||||
if (i >= 4) {
|
if (i >= 4) {
|
||||||
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
|
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
|
||||||
for ( ; anIter1->More(); anIter1->Next()) {
|
for ( ; anIter1->More(); anIter1->Next()) {
|
||||||
_PTR(SObject) aSObj1 = anIter1->Value();
|
_PTR(SObject) aSObj1 = anIter1->Value();
|
||||||
anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
|
anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
|
||||||
aPixmap = anAttr;
|
aPixmap = anAttr;
|
||||||
if (theIsNotModif) {
|
if (theIsNotModif) {
|
||||||
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
|
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
|
||||||
} else if ( isEmptyMesh ) {
|
} else if ( isEmptyMesh ) {
|
||||||
@ -285,7 +285,7 @@ namespace SMESH
|
|||||||
} else {
|
} else {
|
||||||
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL");
|
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,10 +300,10 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
|
||||||
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
"application")).
|
"application")).
|
||||||
arg(theHelpFileName));
|
arg(theHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ SMESHGUI_EXPORT
|
|||||||
{
|
{
|
||||||
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
|
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
|
||||||
if(!CORBA::is_nil(anObj))
|
if(!CORBA::is_nil(anObj))
|
||||||
return TInterface::_narrow(anObj);
|
return TInterface::_narrow(anObj);
|
||||||
return TInterface::_nil();
|
return TInterface::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ SMESHGUI_EXPORT
|
|||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
CORBA::Object_var SObjectToObject( _PTR(SObject),
|
CORBA::Object_var SObjectToObject( _PTR(SObject),
|
||||||
_PTR(Study) );
|
_PTR(Study) );
|
||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
CORBA::Object_var SObjectToObject( _PTR(SObject) );
|
CORBA::Object_var SObjectToObject( _PTR(SObject) );
|
||||||
@ -124,7 +124,7 @@ SMESHGUI_EXPORT
|
|||||||
{
|
{
|
||||||
CORBA::Object_var anObj = SObjectToObject(theSObject);
|
CORBA::Object_var anObj = SObjectToObject(theSObject);
|
||||||
if(!CORBA::is_nil(anObj))
|
if(!CORBA::is_nil(anObj))
|
||||||
return TInterface::_narrow(anObj);
|
return TInterface::_narrow(anObj);
|
||||||
return TInterface::_nil();
|
return TInterface::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ SMESHGUI_EXPORT
|
|||||||
{
|
{
|
||||||
CORBA::Object_var anObj = IObjectToObject(theIO);
|
CORBA::Object_var anObj = IObjectToObject(theIO);
|
||||||
if(!CORBA::is_nil(anObj))
|
if(!CORBA::is_nil(anObj))
|
||||||
return TInterface::_narrow(anObj);
|
return TInterface::_narrow(anObj);
|
||||||
return TInterface::_nil();
|
return TInterface::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ SMESHGUI_EXPORT
|
|||||||
{
|
{
|
||||||
CORBA::Object_var anObj = IORToObject( theIOR );
|
CORBA::Object_var anObj = IORToObject( theIOR );
|
||||||
if ( !CORBA::is_nil( anObj ) )
|
if ( !CORBA::is_nil( anObj ) )
|
||||||
return TInterface::_narrow( anObj );
|
return TInterface::_narrow( anObj );
|
||||||
return TInterface::_nil();
|
return TInterface::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ namespace SMESH
|
|||||||
for ( int iV = 0; iV < views.count(); ++iV ) {
|
for ( int iV = 0; iV < views.count(); ++iV ) {
|
||||||
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
|
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
|
||||||
vtkRenderer *aRenderer = vtkWnd->getRenderer();
|
vtkRenderer *aRenderer = vtkWnd->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *actors = aCopy.GetActors();
|
vtkActorCollection *actors = aCopy.GetActors();
|
||||||
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
|
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
|
||||||
// size of actors changes inside the loop
|
// size of actors changes inside the loop
|
||||||
@ -188,7 +188,7 @@ namespace SMESH
|
|||||||
for ( int iV = 0; iV < views.count(); ++iV ) {
|
for ( int iV = 0; iV < views.count(); ++iV ) {
|
||||||
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
|
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
|
||||||
vtkRenderer *aRenderer = vtkWnd->getRenderer();
|
vtkRenderer *aRenderer = vtkWnd->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *actors = aCopy.GetActors();
|
vtkActorCollection *actors = aCopy.GetActors();
|
||||||
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
|
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
|
||||||
// size of actors changes inside the loop
|
// size of actors changes inside the loop
|
||||||
@ -231,18 +231,18 @@ namespace SMESH
|
|||||||
// char* buf = new char[100*1024];
|
// char* buf = new char[100*1024];
|
||||||
// delete [] buf;
|
// delete [] buf;
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
|
||||||
QObject::tr("SMESH_VISU_PROBLEM"));
|
QObject::tr("SMESH_VISU_PROBLEM"));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// no more memory at all: last resort
|
// no more memory at all: last resort
|
||||||
MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<
|
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) {
|
if (theVISU_MemoryReserve) {
|
||||||
delete theVISU_MemoryReserve;
|
delete theVISU_MemoryReserve;
|
||||||
theVISU_MemoryReserve = 0;
|
theVISU_MemoryReserve = 0;
|
||||||
}
|
}
|
||||||
RemoveAllObjectsWithActors();
|
RemoveAllObjectsWithActors();
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
|
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" );
|
MESSAGE_END ( "...done" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,59 +261,59 @@ namespace SMESH
|
|||||||
#endif
|
#endif
|
||||||
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
|
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
|
||||||
if(anIter != VISUAL_OBJ_CONT.end()){
|
if(anIter != VISUAL_OBJ_CONT.end()){
|
||||||
aVisualObj = anIter->second;
|
aVisualObj = anIter->second;
|
||||||
}else{
|
}else{
|
||||||
SalomeApp_Application* app =
|
SalomeApp_Application* app =
|
||||||
dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
|
dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
|
||||||
_PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
|
_PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
|
||||||
_PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
|
_PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
|
||||||
if(aSObj){
|
if(aSObj){
|
||||||
_PTR(GenericAttribute) anAttr;
|
_PTR(GenericAttribute) anAttr;
|
||||||
if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
|
if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
|
||||||
_PTR(AttributeIOR) anIOR = anAttr;
|
_PTR(AttributeIOR) anIOR = anAttr;
|
||||||
CORBA::String_var aVal = anIOR->Value().c_str();
|
CORBA::String_var aVal = anIOR->Value().c_str();
|
||||||
CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
|
CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
|
||||||
if(!CORBA::is_nil(anObj)){
|
if(!CORBA::is_nil(anObj)){
|
||||||
//Try narrow to SMESH_Mesh interface
|
//Try narrow to SMESH_Mesh interface
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
|
||||||
if(!aMesh->_is_nil()){
|
if(!aMesh->_is_nil()){
|
||||||
aVisualObj.reset(new SMESH_MeshObj(aMesh));
|
aVisualObj.reset(new SMESH_MeshObj(aMesh));
|
||||||
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
||||||
VISUAL_OBJ_CONT.insert(aValue);
|
VISUAL_OBJ_CONT.insert(aValue);
|
||||||
}
|
}
|
||||||
//Try narrow to SMESH_Group interface
|
//Try narrow to SMESH_Group interface
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
|
||||||
if(!aGroup->_is_nil()){
|
if(!aGroup->_is_nil()){
|
||||||
_PTR(SObject) aFatherSObj = aSObj->GetFather();
|
_PTR(SObject) aFatherSObj = aSObj->GetFather();
|
||||||
if(!aFatherSObj) return aVisualObj;
|
if(!aFatherSObj) return aVisualObj;
|
||||||
aFatherSObj = aFatherSObj->GetFather();
|
aFatherSObj = aFatherSObj->GetFather();
|
||||||
if(!aFatherSObj) return aVisualObj;
|
if(!aFatherSObj) return aVisualObj;
|
||||||
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
|
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
|
||||||
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
|
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
|
||||||
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
|
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
|
||||||
aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
|
aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
|
||||||
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
||||||
VISUAL_OBJ_CONT.insert(aValue);
|
VISUAL_OBJ_CONT.insert(aValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Try narrow to SMESH_subMesh interface
|
//Try narrow to SMESH_subMesh interface
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
|
||||||
if(!aSubMesh->_is_nil()){
|
if(!aSubMesh->_is_nil()){
|
||||||
_PTR(SObject) aFatherSObj = aSObj->GetFather();
|
_PTR(SObject) aFatherSObj = aSObj->GetFather();
|
||||||
if(!aFatherSObj) return aVisualObj;
|
if(!aFatherSObj) return aVisualObj;
|
||||||
aFatherSObj = aFatherSObj->GetFather();
|
aFatherSObj = aFatherSObj->GetFather();
|
||||||
if(!aFatherSObj) return aVisualObj;
|
if(!aFatherSObj) return aVisualObj;
|
||||||
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
|
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
|
||||||
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
|
TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
|
||||||
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
|
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
|
||||||
aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
|
aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
|
||||||
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
TVisualObjCont::value_type aValue(aKey,aVisualObj);
|
||||||
VISUAL_OBJ_CONT.insert(aValue);
|
VISUAL_OBJ_CONT.insert(aValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch(...){
|
}catch(...){
|
||||||
INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
|
INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
|
||||||
@ -354,7 +354,7 @@ namespace SMESH
|
|||||||
if ( usedMB * 10 > freeMB )
|
if ( usedMB * 10 > freeMB )
|
||||||
// even dont try to show
|
// even dont try to show
|
||||||
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
|
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
|
||||||
QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
|
QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
|
||||||
else
|
else
|
||||||
// there is a chance to succeed
|
// there is a chance to succeed
|
||||||
continu = SUIT_MessageBox::warning
|
continu = SUIT_MessageBox::warning
|
||||||
@ -362,7 +362,7 @@ namespace SMESH
|
|||||||
QObject::tr("SMESH_WRN_WARNING"),
|
QObject::tr("SMESH_WRN_WARNING"),
|
||||||
QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
|
QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
|
||||||
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
|
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
|
||||||
SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
|
SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
|
||||||
if ( !continu ) {
|
if ( !continu ) {
|
||||||
// remove the corresponding actors from all views
|
// remove the corresponding actors from all views
|
||||||
RemoveVisualObjectWithActors( theEntry );
|
RemoveVisualObjectWithActors( theEntry );
|
||||||
@ -391,7 +391,7 @@ namespace SMESH
|
|||||||
|
|
||||||
if (anApp) {
|
if (anApp) {
|
||||||
if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
|
if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
|
||||||
return aView;
|
return aView;
|
||||||
|
|
||||||
SUIT_ViewManager* aViewManager =
|
SUIT_ViewManager* aViewManager =
|
||||||
anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
|
anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
|
||||||
@ -516,7 +516,7 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow,
|
SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow,
|
||||||
const char* theEntry)
|
const char* theEntry)
|
||||||
{
|
{
|
||||||
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
|
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
|
||||||
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
||||||
@ -524,14 +524,14 @@ namespace SMESH
|
|||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor()){
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
||||||
if(anActor->hasIO()){
|
if(anActor->hasIO()){
|
||||||
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
|
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
|
||||||
if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
|
if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
|
||||||
return anActor;
|
return anActor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -553,8 +553,8 @@ namespace SMESH
|
|||||||
CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
|
CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
|
||||||
_PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
|
_PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
|
||||||
if(aSObject){
|
if(aSObject){
|
||||||
CORBA::String_var anEntry = aSObject->GetID().c_str();
|
CORBA::String_var anEntry = aSObject->GetID().c_str();
|
||||||
return FindActorByEntry(anEntry.in());
|
return FindActorByEntry(anEntry.in());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -562,41 +562,41 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
SMESH_Actor* CreateActor(_PTR(Study) theStudy,
|
SMESH_Actor* CreateActor(_PTR(Study) theStudy,
|
||||||
const char* theEntry,
|
const char* theEntry,
|
||||||
int theIsClear)
|
int theIsClear)
|
||||||
{
|
{
|
||||||
SMESH_Actor *anActor = NULL;
|
SMESH_Actor *anActor = NULL;
|
||||||
CORBA::Long anId = theStudy->StudyId();
|
CORBA::Long anId = theStudy->StudyId();
|
||||||
if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
|
if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
|
||||||
_PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
|
_PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
|
||||||
if(aSObj){
|
if(aSObj){
|
||||||
_PTR(GenericAttribute) anAttr;
|
_PTR(GenericAttribute) anAttr;
|
||||||
if(aSObj->FindAttribute(anAttr,"AttributeName")){
|
if(aSObj->FindAttribute(anAttr,"AttributeName")){
|
||||||
_PTR(AttributeName) aName = anAttr;
|
_PTR(AttributeName) aName = anAttr;
|
||||||
std::string aNameVal = aName->Value();
|
std::string aNameVal = aName->Value();
|
||||||
anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
|
anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
|
||||||
if(!CORBA::is_nil(aGroup))
|
if(!CORBA::is_nil(aGroup))
|
||||||
{
|
{
|
||||||
SALOMEDS::Color aColor = aGroup->GetColor();
|
SALOMEDS::Color aColor = aGroup->GetColor();
|
||||||
if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
|
if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
|
||||||
{
|
{
|
||||||
int r = 0, g = 0, b = 0;
|
int r = 0, g = 0, b = 0;
|
||||||
SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
|
SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
|
||||||
aColor.R = (float)r / 255.0;
|
aColor.R = (float)r / 255.0;
|
||||||
aColor.G = (float)g / 255.0;
|
aColor.G = (float)g / 255.0;
|
||||||
aColor.B = (float)b / 255.0;
|
aColor.B = (float)b / 255.0;
|
||||||
aGroup->SetColor( aColor );
|
aGroup->SetColor( aColor );
|
||||||
}
|
}
|
||||||
if( aGroup->GetType() == SMESH::NODE )
|
if( aGroup->GetType() == SMESH::NODE )
|
||||||
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
|
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
|
||||||
else if( aGroup->GetType() == SMESH::EDGE )
|
else if( aGroup->GetType() == SMESH::EDGE )
|
||||||
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
|
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
|
||||||
else
|
else
|
||||||
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
|
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return anActor;
|
return anActor;
|
||||||
@ -626,14 +626,14 @@ namespace SMESH
|
|||||||
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
|
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
|
||||||
vtkWnd->RemoveActor(theActor);
|
vtkWnd->RemoveActor(theActor);
|
||||||
if(theActor->hasIO()){
|
if(theActor->hasIO()){
|
||||||
Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
|
Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
|
||||||
if(anIO->hasEntry()){
|
if(anIO->hasEntry()){
|
||||||
std::string anEntry = anIO->getEntry();
|
std::string anEntry = anIO->getEntry();
|
||||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
|
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
|
||||||
int aStudyId = aStudy->id();
|
int aStudyId = aStudy->id();
|
||||||
TVisualObjCont::key_type aKey(aStudyId,anEntry);
|
TVisualObjCont::key_type aKey(aStudyId,anEntry);
|
||||||
VISUAL_OBJ_CONT.erase(aKey);
|
VISUAL_OBJ_CONT.erase(aKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
theActor->Delete();
|
theActor->Delete();
|
||||||
vtkWnd->Repaint();
|
vtkWnd->Repaint();
|
||||||
@ -654,7 +654,7 @@ namespace SMESH
|
|||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor())
|
while(vtkActor *anAct = aCollection->GetNextActor())
|
||||||
if(dynamic_cast<SMESH_Actor*>(anAct))
|
if(dynamic_cast<SMESH_Actor*>(anAct))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -676,37 +676,37 @@ namespace SMESH
|
|||||||
|
|
||||||
switch (theAction) {
|
switch (theAction) {
|
||||||
case eDisplayAll: {
|
case eDisplayAll: {
|
||||||
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
||||||
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
||||||
anActor->SetVisibility(true);
|
anActor->SetVisibility(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
case eEraseAll: {
|
case eEraseAll: {
|
||||||
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
while (vtkActor *anAct = aCollection->GetNextActor()) {
|
||||||
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
|
||||||
anActor->SetVisibility(false);
|
anActor->SetVisibility(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
|
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
|
||||||
switch (theAction) {
|
switch (theAction) {
|
||||||
case eDisplay:
|
case eDisplay:
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
anActor->SetVisibility(true);
|
anActor->SetVisibility(true);
|
||||||
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
|
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
|
||||||
break;
|
break;
|
||||||
case eErase:
|
case eErase:
|
||||||
anActor->SetVisibility(false);
|
anActor->SetVisibility(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (theAction) {
|
switch (theAction) {
|
||||||
case eDisplay:
|
case eDisplay:
|
||||||
case eDisplayOnly:
|
case eDisplayOnly:
|
||||||
{
|
{
|
||||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
|
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
|
||||||
_PTR(Study) aDocument = aStudy->studyDS();
|
_PTR(Study) aDocument = aStudy->studyDS();
|
||||||
@ -725,8 +725,8 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -747,24 +747,24 @@ namespace SMESH
|
|||||||
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
||||||
|
|
||||||
if( selected.Extent() == 0){
|
if( selected.Extent() == 0){
|
||||||
vtkRenderer* aRenderer = aWnd->getRenderer();
|
vtkRenderer* aRenderer = aWnd->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor()){
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
||||||
if(anActor->hasIO())
|
if(anActor->hasIO())
|
||||||
if (!Update(anActor->getIO(),anActor->GetVisibility()))
|
if (!Update(anActor->getIO(),anActor->GetVisibility()))
|
||||||
break; // avoid multiple warinings if visu failed
|
break; // avoid multiple warinings if visu failed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
SALOME_ListIteratorOfListIO anIter( selected );
|
SALOME_ListIteratorOfListIO anIter( selected );
|
||||||
for( ; anIter.More(); anIter.Next()){
|
for( ; anIter.More(); anIter.Next()){
|
||||||
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
|
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
|
||||||
if ( !Update(anIO,true) )
|
if ( !Update(anIO,true) )
|
||||||
break; // avoid multiple warinings if visu failed
|
break; // avoid multiple warinings if visu failed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RepaintCurrentView();
|
RepaintCurrentView();
|
||||||
}
|
}
|
||||||
@ -813,7 +813,7 @@ namespace SMESH
|
|||||||
|
|
||||||
QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
|
QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
|
||||||
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
|
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 ),
|
int SW = mgr->integerValue( "SMESH", "selection_width", 5 ),
|
||||||
PW = mgr->integerValue( "SMESH", "highlight_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 ),
|
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
|
||||||
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
|
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++ ){
|
for ( int i=0, n=views.count(); i<n; i++ ){
|
||||||
// update VTK viewer properties
|
// update VTK viewer properties
|
||||||
if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
|
if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
|
||||||
// mesh element selection
|
// mesh element selection
|
||||||
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
||||||
aSelColor.green()/255.,
|
aSelColor.green()/255.,
|
||||||
aSelColor.blue()/255.,
|
aSelColor.blue()/255.,
|
||||||
SW );
|
SW );
|
||||||
// tolerances
|
// tolerances
|
||||||
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
|
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
|
||||||
|
|
||||||
// pre-selection
|
// pre-selection
|
||||||
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
|
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
|
||||||
aPreColor.green()/255.,
|
aPreColor.green()/255.,
|
||||||
aPreColor.blue()/255.,
|
aPreColor.blue()/255.,
|
||||||
PW);
|
PW);
|
||||||
// update actors
|
// update actors
|
||||||
vtkRenderer* aRenderer = aVtkView->getRenderer();
|
vtkRenderer* aRenderer = aVtkView->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor()){
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
||||||
anActor->SetHighlightColor(aHiColor.red()/255.,
|
anActor->SetHighlightColor(aHiColor.red()/255.,
|
||||||
aHiColor.green()/255.,
|
aHiColor.green()/255.,
|
||||||
aHiColor.blue()/255.);
|
aHiColor.blue()/255.);
|
||||||
anActor->SetPreHighlightColor(aPreColor.red()/255.,
|
anActor->SetPreHighlightColor(aPreColor.red()/255.,
|
||||||
aPreColor.green()/255.,
|
aPreColor.green()/255.,
|
||||||
aPreColor.blue()/255.);
|
aPreColor.blue()/255.);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,7 +878,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
|
void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
|
||||||
SVTK_Selector* theSelector)
|
SVTK_Selector* theSelector)
|
||||||
{
|
{
|
||||||
if (theSelector)
|
if (theSelector)
|
||||||
theSelector->SetFilter(theFilter);
|
theSelector->SetFilter(theFilter);
|
||||||
@ -906,7 +906,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsValid(SALOME_Actor* theActor, int theCellId,
|
bool IsValid(SALOME_Actor* theActor, int theCellId,
|
||||||
SVTK_Selector* theSelector)
|
SVTK_Selector* theSelector)
|
||||||
{
|
{
|
||||||
return theSelector->IsValid(theActor,theCellId);
|
return theSelector->IsValid(theActor,theCellId);
|
||||||
}
|
}
|
||||||
@ -920,11 +920,11 @@ namespace SMESH
|
|||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor()){
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
||||||
if(anActor->GetVisibility()){
|
if(anActor->GetVisibility()){
|
||||||
anActor->SetPointRepresentation(theIsVisible);
|
anActor->SetPointRepresentation(theIsVisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RepaintCurrentView();
|
RepaintCurrentView();
|
||||||
}
|
}
|
||||||
@ -939,14 +939,14 @@ namespace SMESH
|
|||||||
vtkActorCollection *aCollection = aCopy.GetActors();
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aCollection->InitTraversal();
|
aCollection->InitTraversal();
|
||||||
while(vtkActor *anAct = aCollection->GetNextActor()){
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
|
if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
|
||||||
if(anActor->GetVisibility()){
|
if(anActor->GetVisibility()){
|
||||||
anActor->SetPickable(anIsAllPickable);
|
anActor->SetPickable(anIsAllPickable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(theActor)
|
if(theActor)
|
||||||
theActor->SetPickable(!anIsAllPickable);
|
theActor->SetPickable(!anIsAllPickable);
|
||||||
RepaintCurrentView();
|
RepaintCurrentView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -954,8 +954,8 @@ namespace SMESH
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
|
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
@ -968,8 +968,8 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GetNameOfSelectedElements(SVTK_Selector* theSelector,
|
int GetNameOfSelectedElements(SVTK_Selector* theSelector,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
@ -989,9 +989,9 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
int GetEdgeNodes(SVTK_Selector* theSelector,
|
int GetEdgeNodes(SVTK_Selector* theSelector,
|
||||||
const TVisualObjPtr& theVisualObject,
|
const TVisualObjPtr& theVisualObject,
|
||||||
int& theId1,
|
int& theId1,
|
||||||
int& theId2)
|
int& theId2)
|
||||||
{
|
{
|
||||||
const SALOME_ListIO& selected = theSelector->StoredIObjects();
|
const SALOME_ListIO& selected = theSelector->StoredIObjects();
|
||||||
|
|
||||||
@ -1011,9 +1011,9 @@ namespace SMESH
|
|||||||
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
|
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
|
||||||
int aVal = aMapIndex( i );
|
int aVal = aMapIndex( i );
|
||||||
if ( aVal > 0 )
|
if ( aVal > 0 )
|
||||||
anObjId = aVal;
|
anObjId = aVal;
|
||||||
else
|
else
|
||||||
anEdgeNum = abs( aVal ) - 1;
|
anEdgeNum = abs( aVal ) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( anObjId == -1 || anEdgeNum == -1 )
|
if ( anObjId == -1 || anEdgeNum == -1 )
|
||||||
@ -1024,18 +1024,18 @@ namespace SMESH
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
|
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
if(theIO->hasEntry()){
|
if(theIO->hasEntry()){
|
||||||
if(FindActorByEntry(theIO->getEntry())){
|
if(FindActorByEntry(theIO->getEntry())){
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
theMgr->GetIndexes(theIO,aMapIndex);
|
theMgr->GetIndexes(theIO,aMapIndex);
|
||||||
for(int i = 1; i <= aMapIndex.Extent(); i++){
|
for(int i = 1; i <= aMapIndex.Extent(); i++){
|
||||||
theName += QString(" %1").arg(aMapIndex(i));
|
theName += QString(" %1").arg(aMapIndex(i));
|
||||||
}
|
}
|
||||||
return aMapIndex.Extent();
|
return aMapIndex.Extent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -1053,23 +1053,23 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
|
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
if(theIO->hasEntry()){
|
if(theIO->hasEntry()){
|
||||||
if(FindActorByEntry(theIO->getEntry())){
|
if(FindActorByEntry(theIO->getEntry())){
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
theMgr->GetIndexes(theIO,aMapIndex);
|
theMgr->GetIndexes(theIO,aMapIndex);
|
||||||
typedef std::set<int> TIdContainer;
|
typedef std::set<int> TIdContainer;
|
||||||
TIdContainer anIdContainer;
|
TIdContainer anIdContainer;
|
||||||
for( int i = 1; i <= aMapIndex.Extent(); i++)
|
for( int i = 1; i <= aMapIndex.Extent(); i++)
|
||||||
anIdContainer.insert(aMapIndex(i));
|
anIdContainer.insert(aMapIndex(i));
|
||||||
TIdContainer::const_iterator anIter = anIdContainer.begin();
|
TIdContainer::const_iterator anIter = anIdContainer.begin();
|
||||||
for( ; anIter != anIdContainer.end(); anIter++){
|
for( ; anIter != anIdContainer.end(); anIter++){
|
||||||
theName += QString(" %1").arg(*anIter);
|
theName += QString(" %1").arg(*anIter);
|
||||||
}
|
}
|
||||||
return aMapIndex.Extent();
|
return aMapIndex.Extent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -1089,8 +1089,8 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GetSelected(LightApp_SelectionMgr* theMgr,
|
int GetSelected(LightApp_SelectionMgr* theMgr,
|
||||||
TColStd_IndexedMapOfInteger& theMap,
|
TColStd_IndexedMapOfInteger& theMap,
|
||||||
const bool theIsElement)
|
const bool theIsElement)
|
||||||
{
|
{
|
||||||
theMap.Clear();
|
theMap.Clear();
|
||||||
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
||||||
@ -1099,7 +1099,7 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
Handle(SALOME_InteractiveObject) anIO = selected.First();
|
Handle(SALOME_InteractiveObject) anIO = selected.First();
|
||||||
if ( anIO->hasEntry() ) {
|
if ( anIO->hasEntry() ) {
|
||||||
theMgr->GetIndexes( anIO, theMap );
|
theMgr->GetIndexes( anIO, theMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return theMap.Extent();
|
return theMap.Extent();
|
||||||
@ -1130,9 +1130,9 @@ namespace SMESH
|
|||||||
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
|
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
|
||||||
int aVal = aMapIndex( i );
|
int aVal = aMapIndex( i );
|
||||||
if ( aVal > 0 )
|
if ( aVal > 0 )
|
||||||
anObjId = aVal;
|
anObjId = aVal;
|
||||||
else
|
else
|
||||||
anEdgeNum = abs( aVal );
|
anEdgeNum = abs( aVal );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( anObjId == -1 || anEdgeNum == -1 )
|
if ( anObjId == -1 || anEdgeNum == -1 )
|
||||||
|
@ -69,7 +69,7 @@ SMESHGUI_EXPORT
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
|
SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
|
||||||
bool = false );
|
bool = false );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
|
SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
@ -153,31 +153,31 @@ SMESHGUI_EXPORT
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedNodes( SVTK_Selector*,
|
int GetNameOfSelectedNodes( SVTK_Selector*,
|
||||||
const Handle(SALOME_InteractiveObject)&,
|
const Handle(SALOME_InteractiveObject)&,
|
||||||
QString& );
|
QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedElements( SVTK_Selector*,
|
int GetNameOfSelectedElements( SVTK_Selector*,
|
||||||
const Handle(SALOME_InteractiveObject)&,
|
const Handle(SALOME_InteractiveObject)&,
|
||||||
QString& );
|
QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
|
int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
|
int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
|
||||||
const Handle(SALOME_InteractiveObject)&,
|
const Handle(SALOME_InteractiveObject)&,
|
||||||
QString& );
|
QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
|
int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedElements( LightApp_SelectionMgr*,
|
int GetNameOfSelectedElements( LightApp_SelectionMgr*,
|
||||||
const Handle(SALOME_InteractiveObject)&,
|
const Handle(SALOME_InteractiveObject)&,
|
||||||
QString& );
|
QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
|
int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
|
int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
|
||||||
const bool = true );
|
const bool = true );
|
||||||
|
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
|
int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
|
||||||
|
@ -242,14 +242,14 @@ void SMESHGUI_WhatIsDlg::SelectionsClicked (int selectionId)
|
|||||||
{
|
{
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( NodeSelection );
|
aViewWindow->SetSelectionMode( NodeSelection );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( CellSelection );
|
aViewWindow->SetSelectionMode( CellSelection );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,10 +299,10 @@ void SMESHGUI_WhatIsDlg::ClickOnHelp()
|
|||||||
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
||||||
else {
|
else {
|
||||||
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
||||||
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
||||||
"application")).
|
"application")).
|
||||||
arg(myHelpFileName));
|
arg(myHelpFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,10 +329,10 @@ void SMESHGUI_WhatIsDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
for (int i = 0; i < aListId.count(); i++) {
|
||||||
const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
|
const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
|
||||||
aMesh->FindNode(aListId[ i ].toInt()):
|
aMesh->FindNode(aListId[ i ].toInt()):
|
||||||
aMesh->FindElement(aListId[ i ].toInt());
|
aMesh->FindElement(aListId[ i ].toInt());
|
||||||
if (e)
|
if (e)
|
||||||
newIndices.Add(e->GetID());
|
newIndices.Add(e->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
|
||||||
@ -455,22 +455,22 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
|
|||||||
anInfo+=tr("SMESH_FACE")+"<br>";
|
anInfo+=tr("SMESH_FACE")+"<br>";
|
||||||
anInfo+="<b>" + tr("SMESH_MESHINFO_TYPE")+":</b> ";
|
anInfo+="<b>" + tr("SMESH_MESHINFO_TYPE")+":</b> ";
|
||||||
if(!ef->IsPoly())
|
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()) {
|
switch(ef->NbNodes()) {
|
||||||
case 3:
|
case 3:
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_TRIANGLE");
|
anInfo+=tr("SMESH_TRIANGLE");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
case 8:
|
case 8:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_QUADRANGLE");
|
anInfo+=tr("SMESH_QUADRANGLE");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
anInfo+="<br>";
|
anInfo+="<br>";
|
||||||
} else if(e->GetType() == SMDSAbs_Volume) {
|
} else if(e->GetType() == SMDSAbs_Volume) {
|
||||||
@ -479,39 +479,39 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
|
|||||||
const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
|
const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
|
||||||
SMDS_VolumeTool vt(ev);
|
SMDS_VolumeTool vt(ev);
|
||||||
if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA)
|
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()) {
|
switch(vt.GetVolumeType()) {
|
||||||
case SMDS_VolumeTool::TETRA:
|
case SMDS_VolumeTool::TETRA:
|
||||||
case SMDS_VolumeTool::QUAD_TETRA:
|
case SMDS_VolumeTool::QUAD_TETRA:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_TETRAS");
|
anInfo+=tr("SMESH_TETRAS");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDS_VolumeTool::PYRAM:
|
case SMDS_VolumeTool::PYRAM:
|
||||||
case SMDS_VolumeTool::QUAD_PYRAM:
|
case SMDS_VolumeTool::QUAD_PYRAM:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_PYRAMID");
|
anInfo+=tr("SMESH_PYRAMID");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDS_VolumeTool::PENTA:
|
case SMDS_VolumeTool::PENTA:
|
||||||
case SMDS_VolumeTool::QUAD_PENTA:
|
case SMDS_VolumeTool::QUAD_PENTA:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_PRISM");
|
anInfo+=tr("SMESH_PRISM");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDS_VolumeTool::HEXA:
|
case SMDS_VolumeTool::HEXA:
|
||||||
case SMDS_VolumeTool::QUAD_HEXA:
|
case SMDS_VolumeTool::QUAD_HEXA:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_HEXAS");
|
anInfo+=tr("SMESH_HEXAS");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDS_VolumeTool::POLYHEDA:
|
case SMDS_VolumeTool::POLYHEDA:
|
||||||
{
|
{
|
||||||
anInfo+=tr("SMESH_POLYEDRON");
|
anInfo+=tr("SMESH_POLYEDRON");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
anInfo+="<br>";
|
anInfo+="<br>";
|
||||||
}
|
}
|
||||||
@ -523,17 +523,17 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
|
|||||||
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
|
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
|
||||||
anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
|
anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
|
||||||
if(e->GetType() != SMDSAbs_Node)
|
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
|
// Calculate Connectivity
|
||||||
SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
|
SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
|
||||||
if (it) {
|
if (it) {
|
||||||
aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
|
aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
|
||||||
while (it->more()) {
|
while (it->more()) {
|
||||||
const SMDS_MeshElement* elem = it->next();
|
const SMDS_MeshElement* elem = it->next();
|
||||||
aNodesInfo+=QString(" %1").arg(elem->GetID());
|
aNodesInfo+=QString(" %1").arg(elem->GetID());
|
||||||
}
|
}
|
||||||
if ( (nbNodes+1) != e->NbNodes())
|
if ( (nbNodes+1) != e->NbNodes())
|
||||||
aNodesInfo+=QString("<br><br>");
|
aNodesInfo+=QString("<br><br>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(e->GetType() != SMDSAbs_Node)
|
if(e->GetType() != SMDSAbs_Node)
|
||||||
|
@ -103,7 +103,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
|
|||||||
{
|
{
|
||||||
MESSAGE("Loading Resources " << aResName.toLatin1().data());
|
MESSAGE("Loading Resources " << aResName.toLatin1().data());
|
||||||
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
|
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_msg_%2.qm" ).arg( aResName, lang ) );
|
||||||
resMgr->loadTranslator( "resources", QString( "%1_images.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");
|
QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
|
||||||
aHypos = aHypos.remove( ' ' );
|
aHypos = aHypos.remove( ' ' );
|
||||||
aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
|
aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
|
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement( const QString&, const QString&,
|
bool startElement( const QString&, const QString&,
|
||||||
const QString&, const QXmlAttributes& );
|
const QString&, const QXmlAttributes& );
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool endElement( const QString&, const QString&, const QString& );
|
||||||
bool characters( const QString& );
|
bool characters( const QString& );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user