The new agg-plot architecture is now functional and linked with Lua. More debug to be done and more graphical elements should be added. - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/plot.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2009年12月17日 11:02:22 +0000
committerFrancesco Abbate <francesco.bbt@gmail.com>2009年12月17日 11:02:22 +0000
commit720b18d7f1a5dba6ebc4c4f4ea4a5c2e1a8b74d4 (patch)
tree1f6da5d02f842a1866f3cb78dd12f37332473d66 /agg-plot/plot.cpp
parentd00328bd46965223c83f3880204943d8e5844034 (diff)
downloadgsl-shell-720b18d7f1a5dba6ebc4c4f4ea4a5c2e1a8b74d4.tar.gz
The new agg-plot architecture is now functional and linked with Lua. More debug to be done and more graphical elements should be added.
Diffstat (limited to 'agg-plot/plot.cpp')
-rw-r--r--agg-plot/plot.cpp 75
1 files changed, 0 insertions, 75 deletions
diff --git a/agg-plot/plot.cpp b/agg-plot/plot.cpp
index 6c908c8c..32a37bff 100644
--- a/agg-plot/plot.cpp
+++ b/agg-plot/plot.cpp
@@ -7,78 +7,3 @@
#include "agg_conv_contour.h"
#include "agg_vcgen_markers_term.h"
#include "agg_bounding_rect.h"
-
-void
-plot::bounding_box(double *px1, double *py1, double *px2, double *py2)
-{
- bool is_set = false;
- double& m_x1 = *px1;
- double& m_y1 = *py1;
- double& m_x2 = *px2;
- double& m_y2 = *py2;
-
- for (unsigned j = 0; j < m_elements.size(); j++)
- {
- drawable& d = m_elements[j];
-
- double x1, y1, x2, y2;
- d.vs->bounding_box(&x1, &y1, &x2, &y2);
-
- if (! is_set)
- {
- m_x1 = x1;
- m_x2 = x2;
- m_y1 = y1;
- m_y2 = y2;
-
- is_set = true;
- }
- else if (x2 > m_x2 || x1 < m_x1 || y2 > m_y2 || y1 < m_y1)
- {
- m_x1 = min(x1, m_x1);
- m_y1 = min(y1, m_y1);
- m_x2 = max(x2, m_x2);
- m_y2 = max(y2, m_y2);
- }
- }
-}
-
-void
-plot::trans_matrix_update()
-{
- if (! m_bbox_updated)
- {
- double x1, y1, x2, y2;
- bounding_box(&x1, &y1, &x2, &y2);
-
- double fx = x2 - x1, fy = y2 - y1;
- m_trans.reset();
- m_trans.scale(1/fx, 1/fy);
- m_trans.translate(-x1/fx, -y1/fy);
- m_bbox_updated = true;
- }
-}
-
-void
-plot::draw_elements(canvas &canvas)
-{
- agg::trans_affine m = m_trans;
- viewport_scale(m);
- canvas.scale(m);
-
- for (unsigned j = 0; j < m_elements.size(); j++)
- {
- drawable& d = m_elements[j];
- vertex_source& vs = d.get_vertex_source();
- vs.apply_transform(m, 1.0);
- canvas.draw(vs, d.color);
- }
-}
-
-void
-plot::viewport_scale(agg::trans_affine& m)
-{
- const double xoffs = 0.09375, yoffs = 0.09375;
- static agg::trans_affine rsz(1-2*xoffs, 0.0, 0.0, 1-2*yoffs, xoffs, yoffs);
- trans_affine_compose (m, rsz);
-}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月16日 08:00:47 +0000

AltStyle によって変換されたページ (->オリジナル) /