summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/drawpath3.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
committerKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
commitbab45528d65eaafe68a705dbb2a57075c7b7cbd8 (patch)
tree10b4ae2b5195c8dede153ab89359ec00f55f325f /Build/source/utils/asymptote/drawpath3.h
parent8643d90372e9c31e0f461c15c596b60a545bd7d3 (diff)
asymptote 1.72 sources (not integrated into build yet)
git-svn-id: svn://tug.org/texlive/trunk@13110 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/drawpath3.h')
-rw-r--r--Build/source/utils/asymptote/drawpath3.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/drawpath3.h b/Build/source/utils/asymptote/drawpath3.h
new file mode 100644
index 00000000000..25e9ffadf6d
--- /dev/null
+++ b/Build/source/utils/asymptote/drawpath3.h
@@ -0,0 +1,64 @@
+/*****
+ * drawpath3.h
+ *
+ * Stores a path3 that has been added to a picture.
+ *****/
+
+#ifndef DRAWPATH3_H
+#define DRAWPATH3_H
+
+#include "drawelement.h"
+#include "path3.h"
+
+namespace camp {
+
+class drawPath3 : public drawElement {
+protected:
+ const path3 g;
+ bool straight;
+ RGBAColour color;
+ bool invisible;
+ triple Min,Max;
+ Triple *controls;
+public:
+ drawPath3(path3 g, const pen&p) :
+ g(g), straight(g.piecewisestraight()), color(rgba(p)),
+ invisible(p.invisible()), Min(g.min()), Max(g.max()), controls(NULL) {}
+
+ drawPath3(const vm::array& t, const drawPath3 *s) :
+ g(camp::transformed(t,s->g)), straight(s->straight), color(s->color),
+ invisible(s->invisible), Min(g.min()), Max(g.max()), controls(NULL) {}
+
+ virtual ~drawPath3() {
+ if(controls) delete controls;
+ }
+
+ bool is3D() {return true;}
+
+ void bounds(bbox3& B) {
+ B.add(Min);
+ B.add(Max);
+ }
+
+ void bounds(pair &b, double (*m)(double, double),
+ double (*x)(const triple&, double*),
+ double (*y)(const triple&, double*),
+ double *t, bool &first) {
+ pair z=g.bounds(m,x,y,t);
+ if(first) {
+ b=z;
+ first=false;
+ } else b=pair(m(b.getx(),z.getx()),m(b.gety(),z.gety()));
+ }
+
+ bool write(prcfile *out);
+
+ void render(GLUnurbs*, double, const triple&, const triple&, double,
+ bool transparent);
+
+ drawElement *transformed(const vm::array& t);
+};
+
+}
+
+#endif