26 #if defined (HAVE_CONFIG_H)
38 GLdouble p_matrix[16];
54 (viewport(3) - 2 * (
yp - viewport(1))) /
size, 0);
77 # define BUFFER_SIZE 128
103 GLuint current_minZ = 0xffffffff;
104 GLuint current_name = 0xffffffff;
106 for (
int i = 0, j = 0; i < hits && j <
BUFFER_SIZE-3; i++)
108 GLuint
n = select_buffer[j++],
109 minZ = select_buffer[j++];
112 if (((flags &
select_last) == 0 && (minZ <= current_minZ))
113 || ((flags &
select_last) != 0 && (minZ >= current_minZ)))
115 bool candidate =
true;
139 if (current_name != 0xffffffff)
143 warning (
"opengl_selector::select: selection buffer overflow");
174 xp2(0) += (bbox(0) + bbox(2));
175 xp2(1) -= (bbox(1) + bbox(3));
195 if (props.get_string ().isempty ())
198 Matrix pos = props.get_data_position ();
199 const Matrix bbox = props.get_extent_matrix ();
201 fake_text (pos(0), pos(1), pos.
numel () > 2 ? pos(2) : 0.0, bbox);
206 double x,
double y,
double z,
207 int halign,
int valign,
double rotation)
223 Matrix xd = props.get_xdata ().matrix_value ();
225 double x_pix_size = (nc == 1 ? 1 : (xd(1) - xd(0)) / (nc - 1));
227 Matrix yd = props.get_ydata ().matrix_value ();
229 double y_pix_size = (nr == 1 ? 1 : (yd(1) - yd(0)) / (nr - 1));
231 ColumnVector p1(3, 0.0), p2(3, 0.0), p3(3, 0.0), p4(3, 0.0);
232 p1(0) = xd(0) - x_pix_size/2;
233 p1(1) = yd(0) - y_pix_size/2;
235 p2(0) = xd(1) + x_pix_size/2;
236 p2(1) = yd(0) - y_pix_size/2;
238 p3(0) = xd(1) + x_pix_size/2;
239 p3(1) = yd(1) + y_pix_size/2;
241 p4(0) = xd(0) - x_pix_size/2;
242 p4(1) = yd(1) + y_pix_size/2;
charNDArray min(char d, const charNDArray &m)
octave_idx_type numel(void) const
Number of elements in the array.
const T * data(void) const
Size of the specified dimension.
base_properties & get_properties(void)
virtual void glGetDoublev(GLenum pname, GLdouble *data)
virtual void glScalef(GLfloat x, GLfloat y, GLfloat z)
virtual void glMultMatrixd(const GLdouble *m)
virtual void glBegin(GLenum mode)
virtual void glSelectBuffer(GLsizei size, GLuint *buffer)
virtual void glDepthFunc(GLenum func)
virtual GLint glRenderMode(GLenum mode)
virtual void glEnable(GLenum cap)
virtual void glInitNames(void)
virtual void glLoadIdentity(void)
virtual void glPopName(void)
virtual void glMatrixMode(GLenum mode)
virtual void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
virtual void glPushName(GLuint name)
virtual void glVertex3dv(const GLdouble *v)
opengl_functions & m_glfcns
virtual void draw(const graphics_object &go, bool toplevel=true)
virtual void init_marker(const std::string &m, double size, float width)
virtual graphics_xform get_transform(void) const
virtual void text_to_pixels(const std::string &txt, uint8NDArray &pixels, Matrix &bbox, int halign=0, int valign=0, double rotation=0.0)
virtual void set_selecting(bool on)
virtual void setup_opengl_transformation(const axes::properties &props)
virtual Matrix get_viewport_scaled(void) const
virtual void init_marker(const std::string &m, double size, float width)
graphics_object select(const graphics_object &ax, int x, int y, int flags=0)
virtual void draw_image(const image::properties &props)
virtual Matrix render_text(const std::string &txt, double x, double y, double z, int halign, int valign, double rotation=0.0)
void apply_pick_matrix(void)
virtual void draw(const graphics_object &go, bool toplevel=true)
virtual void setup_opengl_transformation(const axes::properties &props)
virtual void draw_text(const text::properties &props)
std::map< GLuint, graphics_object > object_map
void fake_text(double x, double y, double z, const Matrix &bbox, bool use_scale=true)
void warning(const char *fmt,...)
F77_RET_T const F77_DBLE * x