/**
* \brief {Get or create the geom selection tool for active study}
* */
-GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool()
+GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool() const
{
BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
connect( mySizeMapTable, SIGNAL( itemChanged (QTreeWidgetItem *, int)),this, SLOT( onSetSizeMap(QTreeWidgetItem *, int) ) );
connect( myAttractorCheck, SIGNAL( stateChanged ( int )), this, SLOT( onAttractorClicked( int ) ) );
connect( myConstSizeCheck, SIGNAL( stateChanged ( int )), this, SLOT( onConstSizeClicked( int ) ) );
- connect( smpTab, SIGNAL( currentChanged ( int )), this, SLOT( onSmpTabChanged( int ) ) );
+ connect( smpTab, SIGNAL( currentChanged ( int )), this, SLOT( onTabChanged( int ) ) );
+ connect( myTabWidget, SIGNAL( currentChanged ( int )), this, SLOT( onTabChanged( int ) ) );
// Enforced vertices
connect( myEnforcedTreeWidget,SIGNAL( itemClicked(QTreeWidgetItem *, int)), this, SLOT( synchronizeCoords() ) );
BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
- that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+ getGeomSelectionTool()->selectionMgr()->clearFilters();
myEnfFaceWdg->deactivateSelection();
myEnfVertexWdg->deactivateSelection();
}
}
-void BLSURFPluginGUI_HypothesisCreator::onSmpTabChanged(int tab)
+void BLSURFPluginGUI_HypothesisCreator::onTabChanged(int tab)
{
- myAttDistSpin->setValue(0.); // Reinitialize widgets
- myAttSizeSpin->setValue(0.);
- myAttDistSpin2->setValue(0.);
- mySmpSizeSpin->setValue(0.);
- myGeomSelWdg1->deactivateSelection();
- myGeomSelWdg2->deactivateSelection();
- myAttSelWdg->deactivateSelection();
- myGeomSelWdg1->SetObject(CORBA::Object::_nil());
- myGeomSelWdg2->SetObject(CORBA::Object::_nil());
- myAttSelWdg->SetObject(CORBA::Object::_nil());
- myAttractorCheck->setChecked(false);
- myConstSizeCheck->setChecked(false);
+ getGeomSelectionTool()->selectionMgr()->clearFilters();// rm other tab filters
+ if ( sender() == myTabWidget )
+ {
+ myGeomSelWdg1 ->deactivateSelection();
+ myGeomSelWdg2 ->deactivateSelection();
+ myAttSelWdg ->deactivateSelection();
+ myEnfFaceWdg ->deactivateSelection();
+ myEnfVertexWdg ->deactivateSelection();
+ myPeriodicitySourceFaceWdg->deactivateSelection();
+ myPeriodicityTargetFaceWdg->deactivateSelection();
+ myPeriodicityP1SourceWdg ->deactivateSelection();
+ myPeriodicityP2SourceWdg ->deactivateSelection();
+ myPeriodicityP3SourceWdg ->deactivateSelection();
+ myPeriodicityP1TargetWdg ->deactivateSelection();
+ myPeriodicityP2TargetWdg ->deactivateSelection();
+ myPeriodicityP3TargetWdg ->deactivateSelection();
+ return;
+ }
+ else if ( sender() == smpTab )
+ {
+ myAttDistSpin->setValue(0.); // Reinitialize widgets
+ myAttSizeSpin->setValue(0.);
+ myAttDistSpin2->setValue(0.);
+ mySmpSizeSpin->setValue(0.);
+ myGeomSelWdg1->deactivateSelection();
+ myGeomSelWdg2->deactivateSelection();
+ myAttSelWdg->deactivateSelection();
+ myGeomSelWdg1->SetObject(CORBA::Object::_nil());
+ myGeomSelWdg2->SetObject(CORBA::Object::_nil());
+ myAttSelWdg->SetObject(CORBA::Object::_nil());
+ myAttractorCheck->setChecked(false);
+ myConstSizeCheck->setChecked(false);
+ }
}
void BLSURFPluginGUI_HypothesisCreator::onAttractorClicked(int state)
SUIT_MessageBox::critical( dlg(),"Error" , msg );
return;
}
- BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
- that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+ getGeomSelectionTool()->selectionMgr()->clearFilters();
myAttDistSpin->setValue(0.);
myAttSizeSpin->setValue(0.);
myAttDistSpin2->setValue(0.);
SUIT_MessageBox::critical( dlg(),"Error" , msg );
return;
}
- BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
- that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+ getGeomSelectionTool()->selectionMgr()->clearFilters();
myAttDistSpin->setValue(0.);
myAttSizeSpin->setValue(0.);
myAttDistSpin2->setValue(0.);