: QDialog( SMESH::GetDesktop( theModule ), theName, false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ mySelector = aViewWindow->GetSelector();
+
construct(theTypes);
}
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
- myViewWindow = SMESH::GetViewWindow( theModule );
- mySelector = myViewWindow->GetSelector();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ mySelector = aViewWindow->GetSelector();
QValueList<int> aTypes;
aTypes.append(theType);
construct(aTypes);
aResMap.Add(anIndMap(i));
mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false);
- myViewWindow->highlight( anIter.Key(), true, true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIter.Key(), true, true );
}
mySelectionMgr->setSelectedObjects(aList, false);
}
aCriteria->length(n);
long aPrecision = -1;
- SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr();
+ SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) {
- QString aStr = mgr->stringValue("SMESH", "ControlsPrecision");
- bool isOk = false;
- int aVal = aStr.toInt(&isOk);
- if (isOk)
- aPrecision = aVal;
- }
+ if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
+ aPrecision = mgr->integerValue( "SMESH", "controls_precision", aPrecision );
for (CORBA::ULong i = 0; i < n; i++) {
SMESH::Filter::Criterion aCriterion = createCriterion();
// Set new selection mode if necessary
Selection_Mode aSelMode = getSelMode(theType);
- if (myViewWindow->SelectionMode()!=aSelMode) {
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+ if ( aViewWindow && aViewWindow->SelectionMode()!=aSelMode) {
mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters();
if (aSelMode == NodeSelection)
SMESH::SetPointRepresentation(true);
- myViewWindow->SetSelectionMode(aSelMode);
+ aViewWindow->SetSelectionMode(aSelMode);
}
// Clear selection
// Set new selection
mySelector->AddOrRemoveIndex(anIO, aMap, false);
- myViewWindow->highlight( anIO, true, true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anIO, true, true );
// insert previously stored filter in viewer if necessary
if (!aFilter.IsNull())