GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
gl-select.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2011-2017 Michael Goffioul
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_gl_select_h)
24 #define octave_gl_select_h 1
25 
26 #include <map>
27 
28 #include "gl-render.h"
29 #include "oct-opengl.h"
30 
31 namespace octave
32 {
33 
35  {
37  select_last = 0x02
38  };
39 
41  {
42  public:
43  opengl_selector (void) : size (5) { }
44 
45  virtual ~opengl_selector (void) { }
46 
47  graphics_object select (const graphics_object& ax, int x, int y,
48  int flags = 0);
49 
50  virtual void draw (const graphics_object& go, bool toplevel = true);
51 
52  protected:
53  virtual void draw_text (const text::properties& props);
54 
55  virtual void draw_image (const image::properties& props);
56 
57  virtual void setup_opengl_transformation (const axes::properties& props);
58 
59  virtual void init_marker (const std::string& m, double size, float width);
60 
61  virtual Matrix render_text (const std::string& txt,
62  double x, double y, double z,
63  int halign, int valign, double rotation = 0.0);
64 
65  private:
66  void apply_pick_matrix (void);
67 
68  void fake_text (double x, double y, double z, const Matrix& bbox,
69  bool use_scale = true);
70 
71  private:
72  // The mouse coordinate of the selection/picking point
73  int xp, yp;
74 
75  // The size (in pixels) of the picking window
76  int size;
77 
78  // The OpenGL name mapping
79  std::map<GLuint, graphics_object> object_map;
80  };
81 
82 }
83 
84 #endif
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
select_flags
Definition: gl-select.h:34
virtual void init_marker(const std::string &m, double size, float width)
Definition: gl-select.cc:57
virtual void setup_opengl_transformation(const axes::properties &props)
Definition: gl-select.cc:50
std::map< GLuint, graphics_object > object_map
Definition: gl-select.h:79
graphics_object select(const graphics_object &ax, int x, int y, int flags=0)
Definition: gl-select.cc:66
void apply_pick_matrix(void)
Definition: gl-select.cc:35
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
void fake_text(double x, double y, double z, const Matrix &bbox, bool use_scale=true)
Definition: gl-select.cc:148
virtual void draw_image(const image::properties &props)
Definition: gl-select.cc:205
Definition: dMatrix.h:37
virtual ~opengl_selector(void)
Definition: gl-select.h:45
virtual void draw(const graphics_object &go, bool toplevel=true)
Definition: gl-select.cc:137
the element is set to zero In other the statement xample y
Definition: data.cc:5342
virtual Matrix render_text(const std::string &txt, double x, double y, double z, int halign, int valign, double rotation=0.0)
Definition: gl-select.cc:189
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
virtual void draw_text(const text::properties &props)
Definition: gl-select.cc:177