QWidget* parent,
const int type )
: QWidget( parent ),
- myIsLocked( false ),
- mySMESHGUI( theModule )
+ mySMESHGUI( theModule ),
+ myIsLocked( false )
{
myEntityType = -1;
QWidget* parent,
const QList<int>& types )
: QWidget( parent ),
- myIsLocked( false ),
- mySMESHGUI( theModule )
+ mySMESHGUI( theModule ),
+ myIsLocked( false )
{
myEntityType = -1;
Init(types);
bool aRes = false;
bool isSignalsBlocked = aTable->signalsBlocked();
aTable->blockSignals(true);
- double aThreshold = (int)aTable->text(i, 2).toDouble(&aRes);
+ /*double aThreshold =*/ aTable->text(i, 2).toDouble( &aRes );
aTable->blockSignals(isSignalsBlocked);
if (!aRes && aTable->isEditable(i, 2))
if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
//
- bool toFilter = (( SMESH::FindActorByObject( myMesh )) ||
+ bool toFilter = (( getActor() ) ||
( myInitSourceWgOnApply && mySourceWg ) ||
( mySourceGrp->checkedId() == Dialog && mySourceWg ));
if ( toFilter ) {
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
aPrecision = mgr->integerValue( "SMESH", "controls_precision", aPrecision );
- for (CORBA::ULong i = 0; i < n; i++) {
+ for ( int i = 0; i < n; i++) {
SMESH::Filter::Criterion aCriterion = createCriterion();
myTable->GetCriterion(i, aCriterion);
aCriterion.Precision = aPrecision;
theResIds.append(aResIter.Key());
}
+//=======================================================================
+//function : getActor
+//purpose : Returns an actor to show filtered entities
+//=======================================================================
+
+SMESH_Actor* SMESHGUI_FilterDlg::getActor()
+{
+ SMESH_Actor* meshActor = SMESH::FindActorByObject( myMesh );
+ if ( meshActor && meshActor->GetVisibility() )
+ return meshActor;
+
+ SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects);
+ for ( ; anIter.More(); anIter.Next())
+ {
+ Handle(SALOME_InteractiveObject) io = anIter.Key();
+ if ( io->hasEntry() )
+ {
+ SMESH_Actor* actor = SMESH::FindActorByEntry( io->getEntry() );
+ if ( !actor )
+ continue;
+ if ( actor->GetVisibility() )
+ return actor;
+ if ( !meshActor )
+ meshActor = actor;
+ }
+ }
+ return meshActor;
+}
+
//=======================================================================
// name : SMESHGUI_FilterDlg::selectInViewer
// Purpose : Select given entities in viewer
}
// Clear selection
- SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
- if (!anActor || !anActor->hasIO())
+ SMESH_Actor* anActor = getActor();
+ if ( !anActor || !anActor->hasIO() )
return;
Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
myIsBusy( false ),
myNameChanged( false ),
- myIsApplyAndClose( false ),
- myNbChangesOfContents(0)
+ myNbChangesOfContents(0),
+ myIsApplyAndClose( false )
{
initDialog( true );
if ( !theMesh->_is_nil() )
case SMESH::EDGE: aType = grpEdgeSelection; break;
case SMESH::FACE: aType = grpFaceSelection; break;
case SMESH::VOLUME: aType = grpVolumeSelection; break;
+ case SMESH::ALL:
+ case SMESH::NB_ELEMENT_TYPES: break;
}
myTypeGroup->button(aType)->setChecked(true);
// check and add all selected GEOM objects: they must be
// a sub-shapes of the main GEOM and must be of one type
TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
- for ( int i =0; i < myGeomObjects->length(); i++) {
+ for ( int i =0; i < (int)myGeomObjects->length(); i++) {
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType();
if (i == 0)
aGroupType = aSubShapeType;
mesh = myGroupOnFilter->GetMesh();
}
myFilter->SetMesh( mesh );
+
+ // highlight ids if selection changed in the Viewer (IPAL52924)
+ myCurrentLineEdit = 0;
+ onObjectSelectionChanged();
}
updateButtons();
}
}
else if (myCurrentLineEdit == myGroupLine) {
- Standard_Boolean aRes;
- //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
- if (aRes && !aGroup->_is_nil()) {
+ if (!aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
- app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString( "" ), myHelpFileName);
- else {
- QString platform;
+ {
+ app->onHelpContextModule
+ ( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString(""), myHelpFileName );
+ }
+ else
+ {
#ifdef WIN32
- platform = "winapplication";
+ QString platform = "winapplication";
#else
- platform = "application";
+ QString platform = "application";
#endif
SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg(app->resourceMgr()->stringValue( "ExternalBrowser",
- platform)).
+ arg(app->resourceMgr()->stringValue( "ExternalBrowser", platform)).
arg(myHelpFileName));
}
}
return;
if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ {
+ e->accept();
+ onHelp();
+ }
}
//================================================================================
/*!
* \brief Enable showing of the popup when Geometry selection btn is clicked
- * \param enable - true to enable
+ * \param enable - true to enable
*/
//================================================================================
void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn)
{
if ( myGeomPopup && isBtnOn )
- {
- myCurrentLineEdit = myGeomGroupLine;
- QAction* a = myGeomPopup->exec( QCursor::pos() );
- if (!a || myActions[a] == DIRECT_GEOM_INDEX)
- setSelectionMode(grpGeomSelection);
- }
+ {
+ myCurrentLineEdit = myGeomGroupLine;
+ QAction* a = myGeomPopup->exec( QCursor::pos() );
+ if (!a || myActions[a] == DIRECT_GEOM_INDEX)
+ setSelectionMode(grpGeomSelection);
+ }
else if (!isBtnOn)
- {
- myCurrentLineEdit = 0;
- setSelectionMode(grpAllSelection);
- }
+ {
+ myCurrentLineEdit = 0;
+ setSelectionMode(grpAllSelection);
+ }
}
//=================================================================================
{
int index = myActions[a];
if ( index == GEOM_BY_MESH_INDEX )
- {
- mySelectionMode = grpNoSelection;
- if ( !myShapeByMeshOp ) {
- myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
- connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
- SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
- connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
- SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
- }
- // set mesh object to SMESHGUI_ShapeByMeshOp and start it
- if ( !myMesh->_is_nil() ) {
- myIsBusy = true;
- hide(); // stop processing selection
- myIsBusy = false;
- myShapeByMeshOp->setModule( mySMESHGUI );
- myShapeByMeshOp->setStudy( 0 ); // it's really necessary
- myShapeByMeshOp->SetMesh( myMesh );
- myShapeByMeshOp->start();
- }
+ {
+ mySelectionMode = grpNoSelection;
+ if ( !myShapeByMeshOp ) {
+ myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
+ connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
+ SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
+ connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
+ SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
+ }
+ // set mesh object to SMESHGUI_ShapeByMeshOp and start it
+ if ( !myMesh->_is_nil() ) {
+ myIsBusy = true;
+ hide(); // stop processing selection
+ myIsBusy = false;
+ myShapeByMeshOp->setModule( mySMESHGUI );
+ myShapeByMeshOp->setStudy( 0 ); // it's really necessary
+ myShapeByMeshOp->SetMesh( myMesh );
+ myShapeByMeshOp->start();
}
+ }
}
//================================================================================
void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op)
{
if ( myShapeByMeshOp == op )
- {
- show();
- setSelectionMode(grpGeomSelection);
- }
+ {
+ show();
+ setSelectionMode(grpGeomSelection);
+ }
}
//=================================================================================
myDlg->selectObject( names, types, ids );
// enable/desable "new mesh" button
- bool isMesh = true;
- for ( int i = 0; i < ids.count() && isMesh; ++i )
- {
- _PTR(SObject) sobj =
- SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
- mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
- isMesh = !mySrcMesh->_is_nil();
- }
+ bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh
+ // for ( int i = 0; i < ids.count() && isMesh; ++i )
+ // {
+ // _PTR(SObject) sobj =
+ // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
+ // mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
+ // isMesh = !mySrcMesh->_is_nil();
+ // }
myDlg->setNewMeshEnabled( isMesh );
}
catch ( const SALOME::SALOME_Exception& S_ex ) {
idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
if ( !idSource->_is_nil() ) {
SMESH::array_of_ElementType_var types = idSource->GetTypes();
- for ( int j = 0; j < types->length(); ++j )
+ for ( int j = 0; j < (int) types->length(); ++j )
if ( types[j] == SMESH::VOLUME )
hasVolumes = true;
else if ( types[j] == SMESH::FACE )