Points&Forces (survey)
Software tools facilitating the task of surveying architecture
view_tri_interactor.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2020 Pierre SMARS (smars@yuntech.edu.tw)
3  This program is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 #ifndef _view_tri_interactor_H_
17 #define _view_tri_interactor_H_
18 
19 // .NAME view_tri_interactor
20 // .SECTION Author
21 // Pierre Smars
22 
23 #include "vtkInteractorStyleTrackballCamera.h"
24 #include "vtkRenderer.h"
25 #include "vtkActor2D.h"
26 #include "vtkPoints.h"
27 #include "vtkCellLocator.h"
28 
29 class VTKINTERACTIONSTYLE_EXPORT view_tri_interactor : public vtkInteractorStyleTrackballCamera
30 {
31  public:
32  static view_tri_interactor *New();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
36  inline void geometry(vtkDataSet * geometry) {geometry_ = geometry;}
37  inline void magnification(int val) {magnification_ = val;}
38  inline void flat(bool val) {flat_ = val;}
39 
40  virtual void OnMouseMove() override;
41  virtual void OnLeftButtonDown() override;
42  virtual void OnLeftButtonUp() override;
43  virtual void OnMiddleButtonDown() override;
44  virtual void OnMiddleButtonUp() override;
45  virtual void OnRightButtonDown() override;
46  virtual void OnRightButtonUp() override;
47  virtual void OnChar() override;
48 
49  inline bool is_changed() {return is_changed_;}
50  inline void blackwire() {black_wire_=true;}
51 
52  protected:
54  virtual ~view_tri_interactor();
55 
59  vtkRenderer * ren_;
60  vtkRenderWindow * renWin_;
61  vtkDataSet * geometry_;
62  vtkCellLocator * locator_;
63  double x_[6]; //the line's points
64  int n_;//the point's teller
65  vtkPoints * points_;
66  vtkActor2D * actor_;
67  float * Zbuffer_;
68  int * size_;
69  bool bg_;
72  bool flat_;
73  void reset();
74 };
75 
76 #endif
vtkTypeMacro(view_tri_interactor, vtkInteractorStyleTrackballCamera)
vtkCellLocator * locator_
void magnification(int val)
vtkRenderWindow * renWin_
void geometry(vtkDataSet *geometry)