Points&Forces (survey)
Software tools facilitating the task of surveying architecture
pixelpos_points.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2019 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 _PIXELPOS_POINTS_H_
17 #define _PIXELPOS_POINTS_H_
18 
19 // .NAME pixelpos_points
20 // .SECTION Author
21 // Pierre Smars
22 
23 #include "vtkRenderer.h"
24 
25 #include <iostream>
26 #include <vector>
27 
29 {
30  public:
31  pixelpos_points(vtkRenderer * ren) : ren_(ren), verbose_(true), selected_(-1) {}
33  int size() {return ref_.size();}
34  void add_point(int ref, double u, double v);
35  void moa_point(int ref, double u, double v);
36  int pick_point(double u, double v);
37  int select_point(double u, double v);
38  void add_or_moa_point(double u, double v);
39  void erase_last_point();
40  void erase_selected_point();
41  void export_selected_point();
42  void redraw();
43  void quiet() {verbose_ = false;}
44  //: input/output
45  friend std::istream& operator>> (std::istream& i, pixelpos_points& l);
46  friend std::ostream& operator<< (std::ostream& o, const pixelpos_points& l);
47 
48  protected:
49  std::vector<int> ref_;
50  std::vector<vtkTransform *> pos_;
51  vtkRenderer * ren_;
52  int selected_;
53  bool verbose_;
54 };
55 
56 #endif
std::vector< vtkTransform * > pos_
friend std::ostream & operator<<(std::ostream &o, const pixelpos_points &l)
std::vector< int > ref_
vtkRenderer * ren_
void moa_point(int ref, double u, double v)
void add_or_moa_point(double u, double v)
int pick_point(double u, double v)
int select_point(double u, double v)
friend std::istream & operator>>(std::istream &i, pixelpos_points &l)
void add_point(int ref, double u, double v)
pixelpos_points(vtkRenderer *ren)
double v(const uint32_t step, const uint32_t n)
Definition: generate.cxx:42
vtkRenderer * ren
Definition: view_li.cxx:81