updated to modern VTK
[engrid-github.git] / src / libengrid / guipick.cpp
blob7510fae3c43a614fcceb111b993723ee73863002
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
11 // + +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
16 // + +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #include "guipick.h"
22 #include "guimainwindow.h"
24 void GuiPick::before()
26 m_Ui.spinBox_Point->setMaximum(m_Grid->GetNumberOfPoints()-1);
27 m_Ui.spinBox_Cell->setMaximum(m_Grid->GetNumberOfCells()-1);
30 void GuiPick::operate()
32 cout<<"GuiPick called"<<endl;
33 if(m_Ui.radioButton_Point->isChecked())
35 vtkIdType nodeId=m_Ui.spinBox_Point->value();
36 cout<<"Pick point "<<nodeId<<endl;
37 GuiMainWindow::pointer()->setPickMode(false,false);
38 GuiMainWindow::pointer()->pickPoint(nodeId);
40 else
42 vtkIdType cellId=m_Ui.spinBox_Cell->value();
43 cout<<"Pick cell "<<cellId<<endl;
44 GuiMainWindow::pointer()->setPickMode(false,true);
45 GuiMainWindow::pointer()->pickCell(cellId);
47 updateActors();