2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008-2013 enGits GmbH +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #include "boxselect.h"
25 #include "guimainwindow.h"
27 #include <vtkBoxWidget.h>
28 #include <vtkCommand.h>
30 class vtkMyCallback
: public vtkCommand
33 static vtkMyCallback
*New()
34 { return new vtkMyCallback
; }
35 virtual void Execute(vtkObject
*caller
, unsigned long, void*)
37 caller
= caller
; ///\todo get rid of warning
38 /* vtkTransform *t = vtkTransform::New();
39 vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
40 widget->GetTransform(t);
41 widget->GetProp3D()->SetUserTransform(t);
46 BoxSelect::BoxSelect()
52 BoxSelect::~BoxSelect()
57 void BoxSelect::operate()
59 cout
<<"BoxSelect"<<endl
;
61 ///\todo Finish BoxSelect
63 boxWidget = vtkBoxWidget::New();
64 boxWidget->SetInteractor(GuiMainWindow::pointer()->getInteractor());
66 boxWidget->SetPlaceFactor(1.25);
69 // Place the interactor initially. The input to a 3D widget is used to
70 // initially position and scale the widget. The EndInteractionEvent is
71 // observed which invokes the SelectPolygons callback.
73 GuiMainWindow::pointer()->getRenderer();
74 GuiMainWindow::pointer()->getInteractor();
75 // boxWidget->SetProp3D(surface_actor);
76 boxWidget->PlaceWidget();
77 vtkMyCallback *callback = vtkMyCallback::New();
78 boxWidget->AddObserver(vtkCommand::InteractionEvent, callback);