diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-30 03:00:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-30 03:00:43 +0000 |
commit | bbbe8128e7ae9d816a221377dbf5ff3969bb203b (patch) | |
tree | 0283a521760b879b30e61872f14f235645745675 /graphics/asymptote/drawpath3.h | |
parent | 14ce8b68fe7df49e8a8891bb94c63b9a846da232 (diff) |
CTAN sync 201909300300
Diffstat (limited to 'graphics/asymptote/drawpath3.h')
-rw-r--r-- | graphics/asymptote/drawpath3.h | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/graphics/asymptote/drawpath3.h b/graphics/asymptote/drawpath3.h index c6515057c9..0df098e84a 100644 --- a/graphics/asymptote/drawpath3.h +++ b/graphics/asymptote/drawpath3.h @@ -22,20 +22,31 @@ protected: bool invisible; Interaction interaction; triple Min,Max; + bool billboard; + size_t centerIndex; public: #ifdef HAVE_GL - static BezierCurve R; + BezierCurve R; #endif + void init() { + billboard=interaction == BILLBOARD && + !settings::getSetting<bool>("offscreen"); + centerIndex=0; + } + drawPath3(path3 g, triple center, const pen& p, Interaction interaction, const string& key="") : drawElement(key), g(g), center(center), straight(g.piecewisestraight()), color(rgba(p)), invisible(p.invisible()), interaction(interaction), - Min(g.min()), Max(g.max()) {} + Min(g.min()), Max(g.max()) { + init(); + } drawPath3(const double* t, const drawPath3 *s) : drawElement(s->KEY), g(camp::transformed(t,s->g)), straight(s->straight), color(s->color), invisible(s->invisible), interaction(s->interaction), Min(g.min()), Max(g.max()) { + init(); center=t*s->center; } @@ -68,10 +79,16 @@ public: } else b=pair(m(b.getx(),z.getx()),m(b.gety(),z.gety())); } + void meshinit() { + if(billboard) + centerIndex=centerindex(center); + } + bool write(prcfile *out, unsigned int *, double, groupsmap&); + bool write(jsfile *out); void render(double, const triple&, const triple&, double, - bool transparent); + bool remesh); drawElement *transformed(const double* t); }; @@ -87,7 +104,7 @@ protected: bool invisible; triple Min,Max; -#ifdef HAVE_GL +#ifdef HAVE_LIBGLM GLfloat *Controls; GLfloat *Knots; #endif @@ -126,7 +143,7 @@ public: run::copyArrayC(knots,knot,0,NoGC); -#ifdef HAVE_GL +#ifdef HAVE_LIBGLM Controls=NULL; #endif } @@ -138,7 +155,7 @@ public: for(unsigned int i=0; i < n; ++i) controls[i]=t*s->controls[i]; -#ifdef HAVE_GL +#ifdef HAVE_LIBGLM Controls=NULL; #endif } @@ -156,7 +173,7 @@ public: bool &first); void render(double size2, const triple& Min, const triple& Max, - double perspective, bool transparent); + double perspective, bool remesh); drawElement *transformed(const double* t); }; @@ -171,7 +188,7 @@ class drawPixel : public drawElement { triple Min,Max; public: #ifdef HAVE_GL - static Pixel R; + Pixel R; #endif drawPixel(const triple& v, const pen& p, double width, const string& key="") : drawElement(key), v(v), p(p), color(rgba(p)), width(width), @@ -194,9 +211,10 @@ public: } void render(double size2, const triple& b, const triple& B, - double perspective, bool transparent); + double perspective, bool remesh); bool write(prcfile *out, unsigned int *, double, groupsmap&); + bool write(jsfile *out); drawElement *transformed(const double* t); }; |