From: eap Date: Wed, 2 Jul 2014 11:52:51 +0000 (+0400) Subject: 22623: [CEA 1198] Select graphically a point to set him a local size X-Git-Tag: V7_5_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=af686b976c493bd5c172ade6531b464c5ca9d5b2;p=plugins%2Fblsurfplugin.git 22623: [CEA 1198] Select graphically a point to set him a local size deactivate all selection widgets at tab change --- diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index 6798a80..91013ff 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -471,7 +471,7 @@ BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator() /** * \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(); @@ -1133,7 +1133,8 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() 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() ) ); @@ -1423,7 +1424,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - that->getGeomSelectionTool()->selectionMgr()->clearFilters(); + getGeomSelectionTool()->selectionMgr()->clearFilters(); myEnfFaceWdg->deactivateSelection(); myEnfVertexWdg->deactivateSelection(); @@ -2812,20 +2813,41 @@ void BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked(QTreeWidgetItem * item, } } -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) @@ -2969,8 +2991,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddMap() 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.); @@ -3008,8 +3029,7 @@ void BLSURFPluginGUI_HypothesisCreator::onModifyMap() 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.); diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index db44322..e936a56 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -199,7 +199,7 @@ protected slots: // Sizemap tab void onMapGeomContentModified(); void onSmpItemClicked( QTreeWidgetItem *, int ); - void onSmpTabChanged(int); + void onTabChanged(int); void onAttractorClicked(int); void onConstSizeClicked(int); void onAddMap(); @@ -233,7 +233,7 @@ private: bool sizeMapsValidation(); bool sizeMapValidationFromRow(int,bool displayError = true); bool sizeMapValidationFromEntry(QString,bool displayError = true); - GeomSelectionTools* getGeomSelectionTool(); + GeomSelectionTools* getGeomSelectionTool() const; GEOM::GEOM_Gen_var getGeomEngine(); //void insertElementType( TopAbs_ShapeEnum ); bool insertElement( GEOM::GEOM_Object_var, bool modify = false );