new C++ class hierarchy for graphical object - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/wtest.cpp
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年07月27日 15:34:41 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年07月27日 15:34:41 +0200
commit5b7cd1356fb503390febbc21b2d535e98de7f776 (patch)
tree27a1131ef6d25892fc5aa771130a2a1144765975 /agg-plot/wtest.cpp
parent73378bdf0eddb1003fb3ad17e047da717b29a009 (diff)
downloadgsl-shell-5b7cd1356fb503390febbc21b2d535e98de7f776.tar.gz
new C++ class hierarchy for graphical object
Now the design of the class hierarchy is ok. The code is still not working.
Diffstat (limited to 'agg-plot/wtest.cpp')
-rw-r--r--agg-plot/wtest.cpp 40
1 files changed, 40 insertions, 0 deletions
diff --git a/agg-plot/wtest.cpp b/agg-plot/wtest.cpp
new file mode 100644
index 00000000..f527ae8c
--- /dev/null
+++ b/agg-plot/wtest.cpp
@@ -0,0 +1,40 @@
+
+#include "trans.h"
+#include "window-trans.h"
+#include "path.h"
+
+int
+main()
+{
+ draw::path *p = new draw::path();
+
+ agg::path_storage& pc = p->get_base();
+ pc.move_to(0.0, 0.0);
+ pc.line_to(1.0, 0.0);
+ pc.line_to(1.0, 1.0);
+ pc.line_to(0.0, 1.0);
+ pc.close_polygon();
+
+ trans::stroke *s1 = new trans::stroke(p);
+ s1->self().width(10.0);
+ s1->self().line_cap(agg::round_cap);
+
+ window_scalable *ws1 = new window_scalable(s1);
+
+ window::stroke *s2 = new window::stroke(ws1);
+ s2->self().width(1.0);
+ s2->self().line_cap(agg::round_cap);
+
+ double x1, y1, x2, y2;
+ s2->bounding_box(&x1, &y1, &x2, &y2);
+
+ agg::trans_affine mtx(200.0, 0.0, 0.0, 100.0, 0.0, 0.0);
+ s2->apply_transform(mtx);
+
+ if (s2->dispose())
+ delete s2;
+
+ delete p;
+
+ return 0;
+}
generated by cgit v1.2.3 (git 2.46.0) at 2025年09月30日 03:58:29 +0000

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