diff src/gl-render.h @ 12321:6ba28900706b

opengl_renderer::draw_axes: simplify with subfunctions
author John W. Eaton <jwe@octave.org>
date Tue, 01 Feb 2011 04:39:21 -0500
parents 85f9a5b211fd
children 85934e0fcce9
line wrap: on
line diff
--- a/src/gl-render.h	Tue Feb 01 04:34:28 2011 -0500
+++ b/src/gl-render.h	Tue Feb 01 04:39:21 2011 -0500
@@ -117,21 +117,22 @@
   virtual void draw_pixels (GLsizei w, GLsizei h, GLenum format,
                             GLenum type, const GLvoid *data);
 
-  virtual void render_grid (std::string& gridstyle, Matrix& ticks,
+  virtual void render_grid (const std::string& gridstyle, const Matrix& ticks,
                             double lim1, double lim2,
                             double p1, double p1N, double p2, double p2N,
                             int xyz, bool is_3D);
 
-  virtual void render_tickmarks(Matrix& ticks, double lim1, double lim2,
-                                double p1, double p1N, double p2, double p2N,
-                                double dx, double dy, double dz,
-                                int xyz, bool doubleside);
+  virtual void render_tickmarks (const Matrix& ticks, double lim1, double lim2,
+                                 double p1, double p1N, double p2, double p2N,
+                                 double dx, double dy, double dz,
+                                 int xyz, bool doubleside);
 
-  virtual void render_ticktexts(Matrix& ticks, string_vector& ticklabels,
-                                double lim1, double lim2,
-                                double p1, double p2,
-                                int xyz, int ha, int va,
-                                int& wmax, int& hmax);
+  virtual void render_ticktexts (const Matrix& ticks,
+                                 const string_vector& ticklabels,
+                                 double lim1, double lim2,
+                                 double p1, double p2,
+                                 int xyz, int ha, int va,
+                                 int& wmax, int& hmax);
 
 private:
   opengl_renderer (const opengl_renderer&)
@@ -166,6 +167,67 @@
   unsigned int make_marker_list (const std::string& m, double size,
                                  bool filled) const;
 
+  void setup_opengl_transformation (const axes::properties& props);
+
+  void draw_axes_planes (bool visible, const Matrix& axe_color,
+                         const Matrix& xlim, const Matrix& ylim,
+                         const Matrix& zlim, double x_plane,
+                         double y_plane, double z_plane);
+
+  void draw_axes_boxes (const axes::properties& props,
+                        bool visible, bool box, bool xySym,
+                        double xPlane, double yPlane, double zPlane,
+                        double xPlaneN, double yPlaneN, double zPlaneN,
+                        double xpTick, double ypTick, double zpTick,
+                        double xpTickN, double ypTickN, double zpTickN);
+
+  void draw_axes_x_grid (const axes::properties& props,
+                         bool visible, bool box,
+                         const std::string& gridstyle,
+                         const std::string& minorgridstyle,
+                         bool nearhoriz, double tickdir,
+                         bool xyzSym, bool layer2Dtop,
+                         bool x2Dtop, int xstate,
+                         double x_min, double x_max,
+                         double xticklen, double xtickoffset,
+                         double fy, double yPlane, double yPlaneN,
+                         double ypTick, double ypTickN,
+                         double fz, int zstate, double zPlane,
+                         double zPlaneN, double zpTick,
+                         double zpTickN);
+
+  void draw_axes_y_grid (const axes::properties& props,
+                         bool visible, bool box,
+                         const std::string& gridstyle,
+                         const std::string& minorgridstyle,
+                         bool nearhoriz, double tickdir,
+                         bool xyzSym, bool layer2Dtop,
+                         bool y2Dright, int ystate,
+                         double y_min, double y_max,
+                         double yticklen, double ytickoffset,
+                         double fx, double xPlane, double xPlaneN,
+                         double xpTick, double xpTickN,
+                         double fz, int zstate, double zPlane,
+                         double zPlaneN, double zpTick,
+                         double zpTickN);
+
+  void draw_axes_z_grid (const axes::properties& props,
+                         bool visible, bool box,
+                         const std::string& gridstyle,
+                         const std::string& minorgridstyle,
+                         double tickdir, bool xySym, bool zSign,
+                         int zstate, double z_min, double z_max,
+                         double zticklen, double ztickoffset,
+                         double fx, double xPlane, double xPlaneN,
+                         double fy, double yPlane, double yPlaneN);
+
+  void draw_axes_title (const axes::properties& props,
+                        double x_min, double x_max,
+                        double y_min, double y_max,
+                        double z_min, double z_max);
+
+  void draw_axes_children (const axes::properties& props);
+
 private:
   // The graphics toolkit associated with the figure being rendered.
   graphics_toolkit toolkit;