26 #if defined (HAVE_CONFIG_H)
37 GLdouble p_matrix[16];
53 (viewport(3) - 2 * (
yp - viewport(1))) /
size, 0);
76 # define BUFFER_SIZE 128
102 GLuint current_minZ = 0xffffffff;
103 GLuint current_name = 0xffffffff;
105 for (
int i = 0, j = 0; i < hits && j <
BUFFER_SIZE-3; i++)
107 GLuint
n = select_buffer[j++],
108 minZ = select_buffer[j++];
111 if (((flags &
select_last) == 0 && (minZ <= current_minZ))
112 || ((flags &
select_last) != 0 && (minZ >= current_minZ)))
114 bool candidate =
true;
122 if (! go.get_properties ().is_hittest ())
138 if (current_name != 0xffffffff)
142 warning (
"opengl_selector::select: selection buffer overflow");
173 xp2(0) += (bbox(0) + bbox(2));
174 xp2(1) -= (bbox(1) + bbox(3));
178 p1 =
get_transform ().untransform (xp1(0), xp1(1), xp1(2),
false);
179 p2 =
get_transform ().untransform (xp2(0), xp1(1), xp1(2),
false);
180 p3 =
get_transform ().untransform (xp2(0), xp2(1), xp1(2),
false);
181 p4 =
get_transform ().untransform (xp1(0), xp2(1), xp1(2),
false);
194 if (props.get_string ().isempty ())
197 Matrix pos = props.get_data_position ();
198 const Matrix bbox = props.get_extent_matrix ();
200 fake_text (pos(0), pos(1), pos.
numel () > 2 ? pos(2) : 0.0, bbox);
205 double x,
double y,
double z,
206 int halign,
int valign,
double rotation)
222 Matrix xd = props.get_xdata ().matrix_value ();
224 double x_pix_size = (nc == 1 ? 1 : (xd(1) - xd(0)) / (nc - 1));
226 Matrix yd = props.get_ydata ().matrix_value ();
228 double y_pix_size = (nr == 1 ? 1 : (yd(1) - yd(0)) / (nr - 1));
230 ColumnVector p1(3, 0.0), p2(3, 0.0), p3(3, 0.0), p4(3, 0.0);
231 p1(0) = xd(0) - x_pix_size/2;
232 p1(1) = yd(0) - y_pix_size/2;
234 p2(0) = xd(1) + x_pix_size/2;
235 p2(1) = yd(0) - y_pix_size/2;
237 p3(0) = xd(1) + x_pix_size/2;
238 p3(1) = yd(1) + y_pix_size/2;
240 p4(0) = xd(0) - x_pix_size/2;
241 p4(1) = yd(1) + y_pix_size/2;
charNDArray min(char d, const charNDArray &m)
OCTARRAY_OVERRIDABLE_FUNC_API const T * data(void) const
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
virtual void glPushName(GLuint name)
virtual void glInitNames(void)
virtual void glBegin(GLenum mode)
virtual void glMatrixMode(GLenum mode)
virtual void glSelectBuffer(GLsizei size, GLuint *buffer)
virtual void glScalef(GLfloat x, GLfloat y, GLfloat z)
virtual GLint glRenderMode(GLenum mode)
virtual void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
virtual void glDepthFunc(GLenum fcn)
virtual void glVertex3dv(const GLdouble *v)
virtual void glLoadIdentity(void)
virtual void glEnable(GLenum cap)
virtual void glGetDoublev(GLenum pname, GLdouble *data)
virtual void glMultMatrixd(const GLdouble *m)
virtual void glPopName(void)
virtual graphics_xform get_transform(void) const
opengl_functions & m_glfcns
virtual void init_marker(const std::string &m, double size, float width)
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 draw(const graphics_object &go, bool toplevel=true)
virtual void set_selecting(bool on)
virtual Matrix get_viewport_scaled(void) const
virtual void setup_opengl_transformation(const axes::properties &props)
virtual void draw_image(const image::properties &props)
virtual void draw(const graphics_object &go, bool toplevel=true)
virtual void setup_opengl_transformation(const axes::properties &props)
virtual Matrix render_text(const std::string &txt, double x, double y, double z, int halign, int valign, double rotation=0.0)
graphics_object select(const graphics_object &ax, int x, int y, int flags=0)
std::map< GLuint, graphics_object > object_map
void apply_pick_matrix(void)
virtual void draw_text(const text::properties &props)
virtual void init_marker(const std::string &m, double size, float width)
void fake_text(double x, double y, double z, const Matrix &bbox, bool use_scale=true)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void warning(const char *fmt,...)
F77_RET_T const F77_DBLE * x
T::properties & properties(graphics_object obj)