comparison src/graphics.h.in @ 7855:f317f14516cb

Add zoom stack facility in axes object.
author Michael Goffioul <michael.goffioul@gmail.com>
date Tue, 04 Mar 2008 15:34:38 +0100
parents 228858e69bd1
children 09b1a9c88128
comparison
equal deleted inserted replaced
7854:228858e69bd1 7855:f317f14516cb
2544 Matrix get_opengl_matrix_1 (void) const { return x_gl_mat1; } 2544 Matrix get_opengl_matrix_1 (void) const { return x_gl_mat1; }
2545 Matrix get_opengl_matrix_2 (void) const { return x_gl_mat2; } 2545 Matrix get_opengl_matrix_2 (void) const { return x_gl_mat2; }
2546 Matrix get_transform_zlim (void) const { return x_zlim; } 2546 Matrix get_transform_zlim (void) const { return x_zlim; }
2547 2547
2548 ColumnVector pixel2coord (double px, double py) const 2548 ColumnVector pixel2coord (double px, double py) const
2549 { return get_transform ().untransform (px, py, 0); } 2549 { return get_transform ().untransform (px, py, (x_zlim(0)+x_zlim(1))/2); }
2550 2550
2551 ColumnVector coord2pixel (double x, double y, double z) const 2551 ColumnVector coord2pixel (double x, double y, double z) const
2552 { return get_transform ().transform (x, y, z); } 2552 { return get_transform ().transform (x, y, z); }
2553 2553
2554 void zoom (const Matrix& xl, const Matrix& yl);
2555 void unzoom (void);
2556 void clear_zoom_stack (void);
2554 2557
2555 private: 2558 private:
2556 scaler sx, sy, sz; 2559 scaler sx, sy, sz;
2557 Matrix x_render, x_render_inv; 2560 Matrix x_render, x_render_inv;
2558 Matrix x_gl_mat1, x_gl_mat2; 2561 Matrix x_gl_mat1, x_gl_mat2;
2559 Matrix x_zlim; 2562 Matrix x_zlim;
2563 std::list<octave_value> zoom_stack;
2560 2564
2561 // See the genprops.awk script for an explanation of the 2565 // See the genprops.awk script for an explanation of the
2562 // properties declarations. 2566 // properties declarations.
2563 2567
2564 BEGIN_PROPERTIES(axes) 2568 BEGIN_PROPERTIES(axes)
2731 } 2735 }
2732 } 2736 }
2733 2737
2734 public: 2738 public:
2735 Matrix get_axis_limits (double xmin, double xmax, double min_pos, bool logscale); 2739 Matrix get_axis_limits (double xmin, double xmax, double min_pos, bool logscale);
2736 void update_xlim (void) 2740
2741 void update_xlim (bool do_clr_zoom = true)
2737 { 2742 {
2738 if (xtickmode.is ("auto")) 2743 if (xtickmode.is ("auto"))
2739 calc_ticks_and_lims (xlim, xtick, xlimmode.is ("auto")); 2744 calc_ticks_and_lims (xlim, xtick, xlimmode.is ("auto"));
2745
2740 fix_limits (xlim); 2746 fix_limits (xlim);
2741 } 2747
2742 2748 if (do_clr_zoom)
2743 void update_ylim (void) 2749 zoom_stack.clear ();
2750 }
2751
2752 void update_ylim (bool do_clr_zoom = true)
2744 { 2753 {
2745 if (ytickmode.is ("auto")) 2754 if (ytickmode.is ("auto"))
2746 calc_ticks_and_lims (ylim, ytick, ylimmode.is ("auto")); 2755 calc_ticks_and_lims (ylim, ytick, ylimmode.is ("auto"));
2747 2756
2748 fix_limits (ylim); 2757 fix_limits (ylim);
2758
2759 if (do_clr_zoom)
2760 zoom_stack.clear ();
2749 } 2761 }
2750 2762
2751 void update_zlim (void) 2763 void update_zlim (void)
2752 { 2764 {
2753 if (ztickmode.is ("auto")) 2765 if (ztickmode.is ("auto"))
2754 calc_ticks_and_lims (zlim, ztick, zlimmode.is ("auto")); 2766 calc_ticks_and_lims (zlim, ztick, zlimmode.is ("auto"));
2755 2767
2756 fix_limits (zlim); 2768 fix_limits (zlim);
2769
2770 zoom_stack.clear ();
2757 } 2771 }
2758 2772
2759 }; 2773 };
2760 2774
2761 private: 2775 private: