1 // Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SMESHGUI_AddNodeOnFaceDlg.cxx
24 // Author : Edward AGAPOV, Open CASCADE S.A.S.
26 #include "SMESHGUI_AddNodeOnFaceDlg.h"
29 #include "SMESHGUI_Filter.h"
30 #include "SMESHGUI_IdValidator.h"
31 #include "SMESHGUI_MeshEditPreview.h"
32 #include "SMESHGUI_MeshUtils.h"
33 #include "SMESHGUI_SpinBox.h"
34 #include "SMESHGUI_VTKUtils.h"
36 #include <SMDS_Mesh.hxx>
37 #include <SMESH_Actor.h>
38 #include <SMESH_ActorUtils.h>
39 #include <SMESH_TypeDefs.hxx>
40 #include <SMESH_MeshAlgos.hxx>
42 // SALOME GUI includes
43 #include <LightApp_SelectionMgr.h>
44 #include <SALOME_ListIO.hxx>
45 #include <SUIT_Desktop.h>
46 #include <SVTK_ViewModel.h>
47 #include <SVTK_ViewWindow.h>
48 #include <SalomeApp_Tools.h>
49 #include <SalomeApp_TypeFilter.h>
50 #include <SUIT_ResourceMgr.h>
51 #include <SUIT_OverrideCursor.h>
52 #include <SUIT_MessageBox.h>
53 #include <SVTK_RenderWindowInteractor.h>
54 #include <SVTK_Renderer.h>
55 #include <SVTK_Event.h>
58 #include <QApplication>
60 #include <QGridLayout>
61 #include <QHBoxLayout>
62 #include <QVBoxLayout>
64 #include <QPushButton>
66 #include <QRadioButton>
68 #include <QButtonGroup>
71 #include <vtkProperty.h>
72 #include <vtkCellPicker.h>
73 #include <vtkInteractorStyle.h>
74 #include <vtkGenericRenderWindowInteractor.h>
75 #include <vtkInteractorObserver.h>
79 #include <SALOMEconfig.h>
80 #include CORBA_SERVER_HEADER(SMESH_Mesh)
81 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
86 #define TOLERANCE 1e-3
88 //=======================================================================
90 * \brief Dialog to publish a sub-shape of the mesh main shape
91 * by selecting mesh elements
93 //=======================================================================
95 SMESHGUI_AddNodeOnFaceDlg::SMESHGUI_AddNodeOnFaceDlg()
96 : SMESHGUI_Dialog( 0, false, true )
98 setWindowTitle(tr("CAPTION"));
100 QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
101 aDlgLay->setMargin(0);
102 aDlgLay->setSpacing(SPACING);
103 myMainFrame = createMainFrame(mainFrame());
105 aDlgLay->addWidget(myMainFrame);
107 aDlgLay->setStretchFactor(myMainFrame, 1);
110 //=======================================================================
111 // function : createMainFrame()
112 // purpose : Create frame containing dialog's input fields
113 //=======================================================================
115 QWidget* SMESHGUI_AddNodeOnFaceDlg::createMainFrame (QWidget* theParent)
117 QWidget* aFrame = new QWidget(theParent);
119 SUIT_ResourceMgr* rm = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
120 QPixmap iconSelect( rm->loadPixmap("SMESH", tr("ICON_SELECT")));
124 QGroupBox* faceGrp = new QGroupBox(tr("FACE_GROUP"), aFrame);
125 faceGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
126 QLabel* idLabel = new QLabel(tr("FACE_ID"), faceGrp);
127 myIdBtn = new QPushButton(faceGrp);
128 myIdBtn->setIcon(iconSelect);
129 myIdBtn->setCheckable(true);
130 myId = new QLineEdit(faceGrp);
131 myId->setValidator(new SMESHGUI_IdValidator(this, 1));
133 QGridLayout* faceGrpLayout = new QGridLayout(faceGrp);
134 faceGrpLayout->setSpacing(SPACING);
135 faceGrpLayout->setMargin(MARGIN);
137 faceGrpLayout->addWidget( idLabel, 0, 0 );
138 faceGrpLayout->addWidget( myIdBtn, 0, 1 );
139 faceGrpLayout->addWidget( myId, 0, 2 );
143 QGroupBox* xyzGrp = new QGroupBox(tr("XYZ_GROUP"), aFrame);
144 xyzGrp->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
146 myDestBtn = new QPushButton(xyzGrp);
147 myDestBtn->setIcon(iconSelect);
148 myDestBtn->setCheckable(true);
150 QLabel* locationXLabel = new QLabel(tr("SMESH_X"), xyzGrp);
151 myDestinationX = new SMESHGUI_SpinBox(xyzGrp);
152 QLabel* locationYLabel = new QLabel(tr("SMESH_Y"), xyzGrp);
153 myDestinationY = new SMESHGUI_SpinBox(xyzGrp);
154 QLabel* locationZLabel = new QLabel(tr("SMESH_Z"), xyzGrp);
155 myDestinationZ = new SMESHGUI_SpinBox(xyzGrp);
157 myDestinationX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
158 myDestinationY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
159 myDestinationZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
161 myPointOnFace = new QCheckBox(tr("XYZ_NODE_ON_FACE"), xyzGrp);
163 QGridLayout* aDestLayout = new QGridLayout(xyzGrp);
164 aDestLayout->setMargin(MARGIN);
165 aDestLayout->setSpacing(SPACING);
166 aDestLayout->addWidget(myDestBtn, 0, 0);
167 aDestLayout->addWidget(locationXLabel, 0, 1);
168 aDestLayout->addWidget(myDestinationX, 0, 2);
169 aDestLayout->addWidget(locationYLabel, 0, 3);
170 aDestLayout->addWidget(myDestinationY, 0, 4);
171 aDestLayout->addWidget(locationZLabel, 0, 5);
172 aDestLayout->addWidget(myDestinationZ, 0, 6);
173 aDestLayout->setColumnStretch(2, 1);
174 aDestLayout->setColumnStretch(4, 1);
175 aDestLayout->setColumnStretch(6, 1);
176 aDestLayout->addWidget(myPointOnFace, 1, 0, 1, 6);
179 myPreviewChkBox = new QCheckBox( tr("PREVIEW"), aFrame);
180 myPreviewChkBox->setChecked( true );
182 QVBoxLayout* aLay = new QVBoxLayout(aFrame);
183 aLay->addWidget(faceGrp);
184 aLay->addWidget(xyzGrp);
185 aLay->addWidget(myPreviewChkBox);
187 connect(myDestBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
188 connect(myIdBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
190 myIdBtn->setChecked(true);
195 //================================================================================
197 * \brief SLOT called when any button is toggled
198 * \param bool - on or off
200 //================================================================================
202 void SMESHGUI_AddNodeOnFaceDlg::ButtonToggled (bool on)
204 const QObject* aSender = sender();
206 if ( aSender == myDestBtn ) // button to set coord by node selection
208 if ( myIdBtn->isEnabled() )
209 myIdBtn->setChecked( !on );
211 else if ( aSender == myIdBtn ) // button to select a node to move
213 myDestBtn->setChecked( !on );
216 emit selTypeChanged();
219 //================================================================================
223 //================================================================================
225 SMESHGUI_AddNodeOnFaceOp::SMESHGUI_AddNodeOnFaceOp() :
226 SMESHGUI_InteractiveOp()
230 myDlg = new SMESHGUI_AddNodeOnFaceDlg;
231 myHelpFileName = "add_node_on_face.html";
234 myUpdateDestination = false;
236 // connect signals and slots
237 connect(myDlg->myDestinationX, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
238 connect(myDlg->myDestinationY, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
239 connect(myDlg->myDestinationZ, SIGNAL (valueChanged(double)), this, SLOT(onDestCoordChanged()));
240 connect(myDlg->myId, SIGNAL (textChanged(const QString&)),SLOT(redisplayPreview()));
241 connect(myDlg->myPreviewChkBox, SIGNAL (toggled(bool)), SLOT(redisplayPreview()));
242 connect(myDlg, SIGNAL (selTypeChanged() ), SLOT(onSelTypeChange()));
243 connect(myDlg->myId, SIGNAL (textChanged(const QString&)),SLOT(onTextChange(const QString&)));
244 connect(myDlg->myPointOnFace, SIGNAL(toggled(bool)), SLOT(pointLocationChanged(bool)));
246 myFacePicker = vtkCellPicker::New();
247 myFacePicker->SetTolerance(0.005);
248 myFacePicker->PickFromListOn();
252 //================================================================================
254 * \brief SLOT. Called upon change of selection type
256 //================================================================================
258 void SMESHGUI_AddNodeOnFaceOp::onSelTypeChange()
260 if ( myDlg->myIdBtn->isChecked() )
262 setSelectionMode( FaceSelection );
264 else if ( myDlg->myDestBtn->isChecked() )
268 //Disconnect selectionChanged to keep selected element
269 disconnect(selectionMgr(), SIGNAL(selectionChanged()), this, SLOT(onSelectionDone()));
270 // Set selection mode to ActorSelection to avoid element's prehighlight during interactive selection
271 setSelectionMode(ActorSelection);
272 connect(selectionMgr(), SIGNAL(selectionChanged()), SLOT(onSelectionDone()));
277 setSelectionMode( ActorSelection );
281 //=======================================================================
282 // function : startOperation()
283 // purpose : Init dialog fields, connect signals and slots, show dialog
284 //=======================================================================
286 void SMESHGUI_AddNodeOnFaceOp::startOperation()
291 // init simulation with a current View
292 if ( mySimulation ) delete mySimulation;
293 mySMESHGUI = getSMESHGUI();
294 mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
295 connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
296 connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
297 vtkProperty* aProp = vtkProperty::New();
298 aProp->SetRepresentationToWireframe();
299 aProp->SetColor(250, 0, 250);
300 aProp->SetPointSize(5);
301 aProp->SetLineWidth( SMESH::GetFloat("SMESH:element_width",1) + 1);
302 mySimulation->GetActor()->SetProperty(aProp);
305 SMESHGUI_SelectionOp::startOperation();
306 SMESHGUI_InteractiveOp::startOperation();
307 myDlg->myId->setText("");
308 myUpdateDestination = true;
309 myDlg->myDestinationX->SetValue(0);
310 myDlg->myDestinationY->SetValue(0);
311 myDlg->myDestinationZ->SetValue(0);
312 myUpdateDestination = false;
318 onSelectionDone(); // init myMeshActor
321 //================================================================================
323 * \brief Stops operation
325 //================================================================================
327 void SMESHGUI_AddNodeOnFaceOp::stopOperation()
332 mySimulation->SetVisibility(false);
339 // SMESH::SetPointRepresentation( false );
340 // SMESH::RepaintCurrentView();
342 disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
343 disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
344 SMESHGUI_SelectionOp::stopOperation();
348 //================================================================================
350 * \brief perform it's intention action: split a face
352 //================================================================================
354 bool SMESHGUI_AddNodeOnFaceOp::onApply()
356 if( SMESHGUI::isStudyLocked() )
359 if ( !myMeshActor ) {
360 SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ), tr("INVALID_MESH") );
366 if ( !isValid( msg ) ) { // node id is invalid
368 SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ), tr("INVALID_ID") );
373 QStringList aParameters;
374 aParameters << myDlg->myDestinationX->text();
375 aParameters << myDlg->myDestinationY->text();
376 aParameters << myDlg->myDestinationZ->text();
379 SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
380 if (aMesh->_is_nil()) {
381 SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), tr("SMESHG_NO_MESH") );
384 SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
385 if (aMeshEditor->_is_nil())
388 aMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
391 SMESH::smIdType anId = myDlg->myId->text().toLong( &ok );
393 aMeshEditor->AddNodeOnFace( anId,
394 myDlg->myDestinationX->GetValue(),
395 myDlg->myDestinationY->GetValue(),
396 myDlg->myDestinationZ->GetValue() );
398 selectionMgr()->setSelectedObjects(aList,false);
399 aList.Append(myMeshActor->getIO());
400 selectionMgr()->setSelectedObjects(aList,false);
403 SMESHGUI::Modified();
405 catch (const SALOME::SALOME_Exception& S_ex) {
406 SalomeApp_Tools::QtCatchCorbaException(S_ex);
414 //================================================================================
416 * \brief Check selected face id validity
418 //================================================================================
420 bool SMESHGUI_AddNodeOnFaceOp::isValid( QString& msg )
425 SMESH::smIdType id = myDlg->myId->text().toLong();
427 if (SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh())
428 if ( const SMDS_MeshElement* face = aMesh->FindElement( id ))
430 if ( face->GetType() == SMDSAbs_Face )
433 msg += tr("NOT_FACE") + "\n";
436 msg += tr("INVALID_ID") + "\n";
439 ok = myDlg->myDestinationX->isValid( msg, !myNoPreview ) && ok;
440 ok = myDlg->myDestinationY->isValid( msg, !myNoPreview ) && ok;
441 ok = myDlg->myDestinationZ->isValid( msg, !myNoPreview ) && ok;
446 //================================================================================
448 * \brief SLOT called when selection changed
450 //================================================================================
452 void SMESHGUI_AddNodeOnFaceOp::onSelectionDone()
454 if ( !myDlg->isVisible() || !myDlg->isEnabled() )
461 selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type());
462 if (aList.Extent() != 1)
464 Handle(SALOME_InteractiveObject) anIO = aList.First();
465 myMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
466 myFacePicker->InitializePickList();
467 myFacePicker->AddPickList(myMeshActor);
470 int nbElems = SMESH::GetNameOfSelectedElements(selector(),anIO, aString);
472 if ( SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh())
473 if ( const SMDS_MeshElement* face = aMesh->FindElement( aString.toLong() ))
476 // set coordinates to face gravity center
477 gp_XYZ faceGC( 0,0,0 );
478 for ( int i = 0; i < face->NbCornerNodes(); ++i )
479 faceGC += SMESH_NodeXYZ( face->GetNode( i ));
480 faceGC /= face->NbCornerNodes();
481 myUpdateDestination = true;
482 myDlg->myDestinationX->SetValue(faceGC.X());
483 myDlg->myDestinationY->SetValue(faceGC.Y());
484 myDlg->myDestinationZ->SetValue(faceGC.Z());
485 myUpdateDestination = false;
489 myDlg->myId->setText( idStr );
495 //================================================================================
497 * \brief update preview
499 //================================================================================
501 void SMESHGUI_AddNodeOnFaceOp::redisplayPreview()
507 SMESH::MeshPreviewStruct_var aMeshPreviewStruct;
509 if ( myMeshActor && myDlg->myPreviewChkBox->isChecked() )
515 SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
516 if (!aMesh->_is_nil()) {
517 SMESH::SMESH_MeshEditor_var aPreviewer = aMesh->GetMeshEditPreviewer();
518 if (!aPreviewer->_is_nil())
520 SUIT_OverrideCursor aWaitCursor;
522 SMESH::smIdType anId = myDlg->myId->text().toLong();
523 aPreviewer->AddNodeOnFace(anId,
524 myDlg->myDestinationX->GetValue(),
525 myDlg->myDestinationY->GetValue(),
526 myDlg->myDestinationZ->GetValue());
527 aMeshPreviewStruct = aPreviewer->GetPreviewData();
536 mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
538 if ( & aMeshPreviewStruct.in() )
540 mySimulation->SetData( aMeshPreviewStruct.in() );
544 mySimulation->SetVisibility(false);
550 //=================================================================================
552 * \brief SLOT called when the viewer opened
554 //=================================================================================
556 void SMESHGUI_AddNodeOnFaceOp::onOpenView()
558 if ( mySimulation ) {
559 mySimulation->SetVisibility(false);
560 SMESH::SetPointRepresentation(false);
563 mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
567 //=================================================================================
569 * \brief SLOT called when the viewer closed
571 //=================================================================================
573 void SMESHGUI_AddNodeOnFaceOp::onCloseView()
579 //================================================================================
581 * \brief SLOT called when the face id is manually changed
583 //================================================================================
585 void SMESHGUI_AddNodeOnFaceOp::onTextChange( const QString& theText )
589 if( SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh() )
591 Handle(SALOME_InteractiveObject) anIO = myMeshActor->getIO();
593 aList.Append( anIO );
594 selectionMgr()->setSelectedObjects( aList, false );
596 if( const SMDS_MeshElement* face = aMesh->FindElement( theText.toLong() ) )
598 SVTK_TVtkIDsMap aListInd;
599 aListInd.Add( FromSmIdType<int>( face->GetID()) );
600 selector()->AddOrRemoveIndex( anIO, aListInd, false );
601 if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) )
602 aViewWindow->highlight( anIO, true, true );
608 //================================================================================
610 * \brief Activate selection
612 //================================================================================
614 void SMESHGUI_AddNodeOnFaceOp::activateSelection()
616 selectionMgr()->clearFilters();
617 SMESH::SetPointRepresentation( false );
621 //================================================================================
625 //================================================================================
627 SMESHGUI_AddNodeOnFaceOp::~SMESHGUI_AddNodeOnFaceOp()
629 if ( myDlg ) delete myDlg;
630 if ( mySimulation ) delete mySimulation;
631 myFacePicker->Delete();
634 //================================================================================
636 * \brief SLOT called when destination coordinates are changed
638 //================================================================================
639 void SMESHGUI_AddNodeOnFaceOp::onDestCoordChanged()
641 if (myUpdateDestination)
643 pointLocationChanged(myDlg->myPointOnFace->isChecked());
647 //================================================================================
649 * \brief SLOT called when 'Node on face' checkbox is changed
651 //================================================================================
652 void SMESHGUI_AddNodeOnFaceOp::pointLocationChanged(bool onFace) {
655 if (myMeshActor && isValid(msg)) {
656 SMESH::smIdType id = myDlg->myId->text().toLong();
658 if (SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()) {
659 if (const SMDS_MeshElement* face = aMesh->FindElement(id))
661 if (face->GetType() == SMDSAbs_Face) {
662 gp_Pnt point(myDlg->myDestinationX->GetValue(), myDlg->myDestinationY->GetValue(),myDlg->myDestinationZ->GetValue());
664 double dist = SMESH_MeshAlgos::GetDistance( face, point, &closestPnt);
665 if (dist > TOLERANCE) {
666 myUpdateDestination = true;
667 myDlg->myDestinationX->SetValue(closestPnt.X());
668 myDlg->myDestinationY->SetValue(closestPnt.Y());
669 myDlg->myDestinationZ->SetValue(closestPnt.Z());
670 myUpdateDestination = false;
681 //================================================================================
683 * \brief Gets dialog of this operation
684 * \retval LightApp_Dialog* - pointer to dialog of this operation
686 //================================================================================
688 LightApp_Dialog* SMESHGUI_AddNodeOnFaceOp::dlg() const
693 //================================================================================
695 * \brief Process InteractiveSelectionChanged event
697 //================================================================================
698 void SMESHGUI_AddNodeOnFaceOp::processStyleEvents(unsigned long theEvent, void* theCallData)
703 if (theEvent == SVTK::InteractiveSelectionChanged) {
704 if (myDlg->myPointOnFace->isChecked()) {
705 // Pick point on a mesh surface
707 if (myMeshActor && isValid(msg)) {
708 SMESH::smIdType id = myDlg->myId->text().toLong();
710 if (SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()) {
711 if (const SMDS_MeshElement* face = aMesh->FindElement(id))
713 if (face->GetType() == SMDSAbs_Face) {
714 int xClick, yClick; // Last event (move or left button bown) position
715 myRWInteractor->GetDevice()->GetEventPosition(xClick, yClick);
716 gp_XYZ faceNode(0, 0, 0);
719 std::vector<const SMDS_MeshNode*> tmpNodes;
720 for (int i = 0; i < face->NbCornerNodes(); ++i) {
721 faceNode = SMESH_NodeXYZ(face->GetNode(i));
722 vtkInteractorObserver::ComputeWorldToDisplay(myRWInteractor->GetRenderer()->GetDevice(),
723 faceNode.X(), faceNode.Y(), faceNode.Z(), Ni);
724 tmpNodes.push_back(tmp.AddNode(Ni[0], Ni[1], 0));
726 SMDS_MeshFace* face2D = tmp.AddPolygonalFace(tmpNodes);
727 gp_Pnt point(double(xClick), double(yClick), 0);
729 double dist = SMESH_MeshAlgos::GetDistance(face2D, point, &closestPnt);
730 double xPick = 0, yPick = 0;
731 if (dist < TOLERANCE) {
736 xPick = closestPnt.X();
737 yPick = closestPnt.Y();
739 myFacePicker->Pick(xPick, yPick, 0.0, myRWInteractor->GetRenderer()->GetDevice());
741 myFacePicker->GetPickPosition(closest);
742 myUpdateDestination = true;
743 myDlg->myDestinationX->SetValue(closest[0]);
744 myDlg->myDestinationY->SetValue(closest[1]);
745 myDlg->myDestinationZ->SetValue(closest[2]);
746 myUpdateDestination = false;
755 double* aCoord = (double*)theCallData;
756 myUpdateDestination = true;
757 myDlg->myDestinationX->SetValue(aCoord[0]);
758 myDlg->myDestinationY->SetValue(aCoord[1]);
759 myDlg->myDestinationZ->SetValue(aCoord[2]);
760 myUpdateDestination = false;
767 //================================================================================
769 * \brief Process LeftButtonPressEvent event: activate interactive selection
771 //================================================================================
772 void SMESHGUI_AddNodeOnFaceOp::processInteractorEvents(unsigned long theEvent, void* theCallData)
775 if (theEvent == vtkCommand::LeftButtonPressEvent && myDlg->myDestBtn->isChecked()) {
776 bool control = myRWInteractor->GetDevice()->GetControlKey();
777 bool shift = myRWInteractor->GetDevice()->GetControlKey();
778 SVTK_ViewWindow* svtkViewWindow = SMESH::GetViewWindow(mySMESHGUI);
779 if (svtkViewWindow && !shift && !control) {
782 svtkViewWindow->activateInteractiveSelection();