// Seletction type radio buttons
- QGroupBox* selTypeGrBox = new QGroupBox( mainFrame() );
+ mySelTypeGrBox = new QGroupBox( mainFrame() );
//
- QRadioButton* objBtn = new QRadioButton( tr( "SMESH_SUBMESH_GROUP"),selTypeGrBox );
- QRadioButton* elemBtn = new QRadioButton( tr( "SMESH_ELEMENTS" ),selTypeGrBox );
- QRadioButton* nodeBtn = new QRadioButton( tr( "SMESH_NODES" ),selTypeGrBox );
+ QRadioButton* objBtn = new QRadioButton( tr( "SMESH_SUBMESH_GROUP"),mySelTypeGrBox );
+ QRadioButton* elemBtn = new QRadioButton( tr( "SMESH_ELEMENTS" ),mySelTypeGrBox );
+ QRadioButton* nodeBtn = new QRadioButton( tr( "SMESH_NODES" ),mySelTypeGrBox );
//
- QHBoxLayout* selTypeLay = new QHBoxLayout( selTypeGrBox );
+ QHBoxLayout* selTypeLay = new QHBoxLayout( mySelTypeGrBox );
selTypeLay->setMargin(MARGIN);
selTypeLay->setSpacing(SPACING);
selTypeLay->addWidget( objBtn );
aLay->setMargin(MARGIN);
aLay->setSpacing(SPACING);
//
- aLay->addWidget( selTypeGrBox, 0, 0, 1, 5 );
+ aLay->addWidget( mySelTypeGrBox, 0, 0, 1, 5 );
//
aLay->addWidget( objectWg( 0, Label ), 1, 0 );
aLay->addWidget( objectWg( 0, Btn ), 1, 1 );
// Signals
- connect( myGroupBox, SIGNAL( toggled( bool )), SLOT( onGroupChecked() ));
+ connect( myGroupBox, SIGNAL( toggled( bool )), SLOT( onGroupChecked( bool ) ));
connect( mySelTypeBtnGrp, SIGNAL( buttonClicked(int) ), SLOT( onSelTypeChange(int)));
-
+ connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ),
+ this, SLOT( DeactivateActiveDialog() ) );
onSelTypeChange( SEL_OBJECT );
}
return mySelTypeBtnGrp->checkedId();
}
+//=================================================================================
+/*!
+ \brief Reactivate dialog box, when mouse pointer goes into it.
+*/
+//=================================================================================
+void SMESHGUI_Add0DElemsOnAllNodesDlg::enterEvent( QEvent* event)
+{
+ ActivateThisDialog();
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT to deactivate dialog
+ */
+//=================================================================================
+
+void SMESHGUI_Add0DElemsOnAllNodesDlg::DeactivateActiveDialog()
+{
+ if (myGroupBox->isEnabled()) {
+ mySelTypeGrBox->setEnabled(false);
+ myGroupBox->setEnabled(false);
+ myGroupLabel->setEnabled(false);
+ myGroupListCmBox->setEnabled(false);
+ myFilterBtn->setEnabled(false);
+ objectWg( 0, Label )->setEnabled(false);
+ objectWg( 0, Btn )->setEnabled(false);
+ objectWg( 0, Control )->setEnabled(false);
+ button( QtxDialog::OK )->setEnabled(false);
+ button( QtxDialog::Apply )->setEnabled(false);
+ button( QtxDialog::Close )->setEnabled(false);
+ button( QtxDialog::Help )->setEnabled(false);
+ setObjectText( 0, "" );
+ SMESHGUI::GetSMESHGUI()->ResetState();
+ SMESHGUI::GetSMESHGUI()->SetActiveDialogBox(0);
+ }
+}
+//=================================================================================
+/*!
+ * \brief SLOT to activate dialog
+ */
+//=================================================================================
+
+void SMESHGUI_Add0DElemsOnAllNodesDlg::ActivateThisDialog()
+{
+ if (!myGroupBox->isEnabled()) {
+ SMESHGUI::GetSMESHGUI()->SetActiveDialogBox( this );
+ mySelTypeGrBox->setEnabled(true);
+ myGroupBox->setEnabled(true);
+ myGroupLabel->setEnabled(true);
+ myGroupListCmBox->setEnabled(true);
+ myFilterBtn->setEnabled(true);
+ objectWg( 0, Label )->setEnabled(true);
+ objectWg( 0, Btn )->setEnabled(true);
+ objectWg( 0, Control )->setEnabled(true);
+ button( QtxDialog::OK )->setEnabled(true);
+ button( QtxDialog::Apply )->setEnabled(true);
+ button( QtxDialog::Close )->setEnabled(true);
+ button( QtxDialog::Help )->setEnabled(true);
+ }
+ emit selTypeChanged( getSelectionType() );
+}
//================================================================================
/*!
* \brief Checks consistency of data
if (!myDlg->myGroupBox->isEnabled()) return; // inactive
myIO.Nullify();
- myDlg->setObjectText( 0, "");
updateButtons();
SALOME_ListIO aList;
selectionMgr()->selectedObjects( aList );
if ( aList.Extent() == 1 )
myIO = aList.First();
- else
+ else {
+ myDlg->setObjectText( 0, "" );
return;
+ }
QString ids;
switch ( myDlg->getSelectionType() ) {
QPixmap iconSelect (rm->loadPixmap("SMESH", tr("ICON_SELECT")));
// constructor
- QGroupBox* aPixGrp = new QGroupBox(tr("MOVE_NODE"), this);
- aPixGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myGroupBox = new QGroupBox(tr("MOVE_NODE"), this);
+ myGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myButtonGroup = new QButtonGroup(this);
- QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
+ QHBoxLayout* aPixGrpLayout = new QHBoxLayout(myGroupBox);
aPixGrpLayout->setMargin(MARGIN);
aPixGrpLayout->setSpacing(SPACING);
- myRButNodeToMove = new QRadioButton(aPixGrp);
- myRButMoveWithoutNode = new QRadioButton(aPixGrp);
+ myRButNodeToMove = new QRadioButton(myGroupBox);
+ myRButMoveWithoutNode = new QRadioButton(myGroupBox);
myRButNodeToMove->setIcon(iconMoveNode);
myRButMoveWithoutNode->setIcon(iconMoveWithoutNode);
myRButNodeToMove->setChecked(true);
myPreviewChkBox = new QCheckBox( tr("PREVIEW"), aFrame);
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
- aLay->addWidget(aPixGrp);
+ aLay->addWidget(myGroupBox);
aLay->addWidget(myNodeToMoveGrp);
aLay->addWidget(myDestinationGrp);
aLay->addWidget(myPreviewChkBox);
- connect(myDestBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
- connect(myIdBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
- connect(myButtonGroup, SIGNAL (buttonClicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(myDestBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
+ connect(myIdBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
+ connect(myButtonGroup, SIGNAL (buttonClicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(SMESHGUI::GetSMESHGUI(), SIGNAL (SignalDeactivateActiveDialog()),
+ this, SLOT(DeactivateActiveDialog()));
myIdBtn->setChecked(true);
resize(minimumSizeHint());
}
+//=================================================================================
+/*!
+ \brief Reactivate dialog box, when mouse pointer goes into it.
+*/
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointDlg::enterEvent( QEvent* event)
+{
+ ActivateThisDialog();
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT to deactivate dialog
+ */
+//=================================================================================
+
+void SMESHGUI_MakeNodeAtPointDlg::DeactivateActiveDialog()
+{
+ if (myGroupBox->isEnabled()) {
+ myGroupBox->setEnabled(false);
+ myNodeToMoveGrp->setEnabled(false);
+ myDestinationGrp->setEnabled(false);
+ myPreviewChkBox->setEnabled(false);
+ button( QtxDialog::OK )->setEnabled(false);
+ button( QtxDialog::Apply )->setEnabled(false);
+ button( QtxDialog::Close )->setEnabled(false);
+ button( QtxDialog::Help )->setEnabled(false);
+ SMESHGUI::GetSMESHGUI()->ResetState();
+ SMESHGUI::GetSMESHGUI()->SetActiveDialogBox(0);
+ emit deactivatedDialog();
+ }
+}
+//=================================================================================
+/*!
+ * \brief SLOT to activate dialog
+ */
+//=================================================================================
+
+void SMESHGUI_MakeNodeAtPointDlg::ActivateThisDialog()
+{
+ if (!myGroupBox->isEnabled()) {
+ myGroupBox->setEnabled(true);
+ myNodeToMoveGrp->setEnabled(true);
+ myDestinationGrp->setEnabled(true);
+ myPreviewChkBox->setEnabled(true);
+ button( QtxDialog::OK )->setEnabled(true);
+ button( QtxDialog::Apply )->setEnabled(true);
+ button( QtxDialog::Close )->setEnabled(true);
+ button( QtxDialog::Help )->setEnabled(true);
+ emit activatedDialog();
+ }
+}
+
//================================================================================
/*!
* \brief Constructor
// note: this slot seems to be lost together with removed obsolete SMESHGUI_MoveNodesDlg class
connect(myDlg->myId,SIGNAL (textChanged(const QString&)),SLOT(onTextChange(const QString&)));
connect(myDlg->myUpdateBtn, SIGNAL (clicked()), this, SLOT(onUpdateDestination()));
+ connect(myDlg, SIGNAL (activatedDialog()), this, SLOT(onActivatedDialog()));
+ connect(myDlg, SIGNAL (deactivatedDialog()), this, SLOT(onDeactivatedDialog()));
}
void SMESHGUI_MakeNodeAtPointOp::onUpdateDestination()
{
if ( !myDlg->isVisible() || !myDlg->isEnabled() )
return;
-
myNoPreview = true;
try {
SALOME_ListIO aList;
bool moveShown = false;
if ( myMeshActor)
{
- const bool isPreview = myDlg->myPreviewChkBox->isChecked();
+ const bool isPreview = myDlg->myPreviewChkBox->isChecked() && myDlg->myPreviewChkBox->isEnabled();
const bool isMoveNode = myDlg->myRButMoveWithoutNode->isChecked();
QString msg;
if ( isValid( msg ) )
mySimulation = 0;
}
+//=================================================================================
+/*!
+ * \brief SLOT called when the activated dialog
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onActivatedDialog()
+{
+ mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() ) );
+ vtkProperty* aProp = vtkProperty::New();
+ aProp->SetRepresentationToWireframe();
+ aProp->SetColor(250, 0, 250);
+ aProp->SetPointSize(5);
+ aProp->SetLineWidth( SMESH::GetFloat("SMESH:element_width",1) + 1);
+ mySimulation->GetActor()->SetProperty(aProp);
+ aProp->Delete();
+ SMESHGUI_SelectionOp::startOperation();
+ SMESH::SetPointRepresentation( true );
+ onSelectionDone();
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT called when the deactivated dialog
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onDeactivatedDialog()
+{
+ if ( mySimulation )
+ {
+ mySimulation->SetVisibility(false);
+ delete mySimulation;
+ mySimulation = 0;
+ }
+ if ( myMeshActor ) {
+ myMeshActor = 0;
+ }
+ SMESH::SetPointRepresentation( false );
+ SMESHGUI_SelectionOp::stopOperation();
+}
+
//================================================================================
/*!
* \brief SLOT called when the node id is manually changed