if (anEditRow >= 0 && anEditCol >= 0)
endEdit(anEditRow, anEditCol, true, false);
- QTable::insertRows(row, count);
+ QTable::insertRows( row, count );
}
//=======================================================================
// name : SMESHGUI_FilterTable::SMESHGUI_FilterTable
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterTable::SMESHGUI_FilterTable (QWidget* parent,
+SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
+ QWidget* parent,
const int type)
-: QFrame(parent)
+: QFrame(parent),
+ myIsLocked( false ),
+ mySMESHGUI( theModule )
{
myEntityType = -1;
Init(type);
// name : SMESHGUI_FilterTable::SMESHGUI_FilterTable
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterTable::SMESHGUI_FilterTable (QWidget* parent,
+SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
+ QWidget* parent,
const QValueList<int>& types)
-: QFrame(parent)
+: QFrame(parent),
+ myIsLocked( false ),
+ mySMESHGUI( theModule )
{
myEntityType = -1;
Init(types);
aCriterion == FT_BelongToGeom ||
aCriterion == FT_BelongToPlane ||
aCriterion == FT_BelongToCylinder ||
- aCriterion == FT_LyingOnGeom) {
+ aCriterion == FT_LyingOnGeom) {
if (aTable->text(i, 2).isEmpty()) {
if (theMess)
QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
myAddWidgets[ anItem ]->SetDouble(AdditionalWidget::Tolerance, theCriterion.Tolerance);
}
- emit CretarionChanged(theRow, aType);
+ emit CriterionChanged(theRow, aType);
}
GetCriterionType(aRow) != FT_LyingOnGeom &&
GetCriterionType(aRow) != FT_RangeOfIds &&
GetCriterionType(aRow) != FT_FreeEdges &&
- GetCriterionType(aRow) != FT_BadOrientedVolume;
+ GetCriterionType(aRow) != FT_BadOrientedVolume;
if (!myAddWidgets.contains(anItem))
{
myAddWidgets[ anItem ] = new AdditionalWidget(myWgStack);
//=======================================================================
void SMESHGUI_FilterTable::onCurrentChanged (int theRow, int theCol)
{
- updateAdditionalWidget();
+ if( !myIsLocked )
+ updateAdditionalWidget();
emit CurrentChanged(theRow, theCol);
}
aTable->SetEditable(false, row, 2);
}
else if (aCriterionType == SMESH::FT_RangeOfIds ||
- aCriterionType == SMESH::FT_BelongToGeom ||
- aCriterionType == SMESH::FT_BelongToPlane ||
- aCriterionType == SMESH::FT_BelongToCylinder ||
- aCriterionType == SMESH::FT_LyingOnGeom)
+ aCriterionType == SMESH::FT_BelongToGeom ||
+ aCriterionType == SMESH::FT_BelongToPlane ||
+ aCriterionType == SMESH::FT_BelongToCylinder ||
+ aCriterionType == SMESH::FT_LyingOnGeom)
{
QMap<int, QString> aMap;
aMap[ FT_EqualTo ] = tr("EQUAL_TO");
updateAdditionalWidget();
- emit CretarionChanged(row, entityType);
+ emit CriterionChanged(row, entityType);
}
//=======================================================================
int aSelectedRow = getFirstSelectedRow();
int aCurrCol = theTable->currentColumn();
+ myIsLocked = true;
if (toTheEnd || aSelectedRow == -1)
{
theTable->insertRows(theTable->numRows());
theTable->insertRows(aSelectedRow);
aCurrRow = aSelectedRow;
}
+ myIsLocked = false;
// Criteria
theTable->setItem(aCurrRow, 0, getCriterionItem(theTable, theType));
{
if (myLibDlg == 0)
myLibDlg = new SMESHGUI_FilterLibraryDlg(
- this, GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
+ mySMESHGUI, this, GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
else
myLibDlg->Init(GetType(), SMESHGUI_FilterLibraryDlg::COPY_FROM);
return;
if (myLibDlg == 0)
myLibDlg = new SMESHGUI_FilterLibraryDlg(
- this, GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
+ mySMESHGUI, this, GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
else
myLibDlg->Init(GetType(), SMESHGUI_FilterLibraryDlg::ADD_TO);
: 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);
}
: 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();
QValueList<int> aTypes;
aTypes.append(theType);
construct(aTypes);
// filter frame
- myTable = new SMESHGUI_FilterTable(aMainFrame, myTypes);
+ myTable = new SMESHGUI_FilterTable( mySMESHGUI, aMainFrame, myTypes );
myTable->SetLibsEnabled(true);
QFrame* aLine = new QFrame(myTable->GetTableGrp());
// other controls
mySourceGrp = createSourceGroup(aMainFrame);
- connect(myTable, SIGNAL(CretarionChanged(const int, const int)),
+ connect(myTable, SIGNAL(CriterionChanged(const int, const int)),
SLOT(onCriterionChanged(const int, const int)));
connect(myTable, SIGNAL(CurrentChanged(int, int)),
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);
}
{
int aType = myTable->GetCriterionType(i);
if (aType == FT_BelongToGeom ||
- aType == FT_BelongToPlane ||
- aType == FT_BelongToCylinder ||
- aType == FT_LyingOnGeom) {
+ aType == FT_BelongToPlane ||
+ aType == FT_BelongToCylinder ||
+ aType == FT_LyingOnGeom) {
QString aName;
myTable->GetThreshold(i, aName);
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())
int aRow, aCol;
if (myTable->CurrentCell(aRow, aCol) &&
- (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
- myTable->GetCriterionType(aRow) == FT_BelongToPlane ||
- myTable->GetCriterionType(aRow) == FT_BelongToCylinder ||
- myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) {
+ (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
+ myTable->GetCriterionType(aRow) == FT_BelongToPlane ||
+ myTable->GetCriterionType(aRow) == FT_BelongToCylinder ||
+ myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) {
if (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
myTable->GetCriterionType(aRow) == FT_LyingOnGeom) {
- mySelectionMgr->installFilter(new SMESH_NumberFilter("GEOM",TopAbs_SHAPE,0,allTypes));
+ mySelectionMgr->installFilter(new GEOM_SelectionFilter( aStudy, true ));
} else if (myTable->GetCriterionType(aRow) == FT_BelongToPlane) {
mySelectionMgr->installFilter(new GEOM_FaceFilter( aStudy, StdSelect_Plane ) );
} else {
if (myIsSelectionChanged) {
- mySelectionMgr->installFilter(new SMESH_NumberFilter ("This filter deactivates selection",TopAbs_SHAPE,0,allTypes));
+ mySelectionMgr->installFilter( new GEOM_TypeFilter( aStudy, -1 ) ); // This filter deactivates selection
}
}
}