diff options
Diffstat (limited to 'graphics/asymptote/drawpath3.h')
-rw-r--r-- | graphics/asymptote/drawpath3.h | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/graphics/asymptote/drawpath3.h b/graphics/asymptote/drawpath3.h index 84456ad6f5..3209493bf2 100644 --- a/graphics/asymptote/drawpath3.h +++ b/graphics/asymptote/drawpath3.h @@ -29,11 +29,11 @@ protected: Interaction interaction; triple Min,Max; bool billboard; - size_t centerIndex; + size_t centerIndex; public: #ifdef HAVE_GL BezierCurve R; -#endif +#endif void init() { #ifdef HAVE_LIBOSMESA billboard=false; @@ -42,7 +42,7 @@ public: #endif centerIndex=0; } - + drawPath3(path3 g, triple center, const vm::array& p, double opacity, double shininess, double metallic, double fresnel0, Interaction interaction, const string& key="") : @@ -58,7 +58,7 @@ public: emissive=rgba(vm::read<camp::pen>(p,1)); specular=rgba(vm::read<camp::pen>(p,2)); } - + drawPath3(const double* t, const drawPath3 *s) : drawElement(s->KEY), g(camp::transformed(t,s->g)), straight(s->straight), diffuse(s->diffuse), emissive(s->emissive), specular(s->specular), @@ -69,11 +69,11 @@ public: init(); center=t*s->center; } - + virtual ~drawPath3() {} bool is3D() {return true;} - + void bounds(const double* t, bbox3& B) { if(t != NULL) { const path3 tg(camp::transformed(t,g)); @@ -84,7 +84,7 @@ public: B.add(Max); } } - + void ratio(const double* t, pair &b, double (*m)(double, double), double, bool &first) { pair z; @@ -98,15 +98,15 @@ public: first=false; } 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 remesh); @@ -123,78 +123,78 @@ protected: prc::RGBAColour color; bool invisible; triple Min,Max; - + #ifdef HAVE_LIBGLM GLfloat *Controls; GLfloat *Knots; -#endif - +#endif + public: drawNurbsPath3(const vm::array& g, const vm::array* knot, const vm::array* weight, const pen& p, const string& key="") : drawElement(key), color(rgba(p)), invisible(p.invisible()) { size_t weightsize=checkArray(weight); - + string wrongsize="Inconsistent NURBS data"; n=checkArray(&g); - + if(n == 0 || (weightsize != 0 && weightsize != n)) reportError(wrongsize); - + controls=new(UseGC) triple[n]; - + size_t k=0; for(size_t i=0; i < n; ++i) controls[k++]=vm::read<triple>(g,i); - + if(weightsize > 0) { size_t k=0; weights=new(UseGC) double[n]; for(size_t i=0; i < n; ++i) weights[k++]=vm::read<double>(weight,i); } else weights=NULL; - + size_t nknots=checkArray(knot); - + if(nknots <= n+1 || nknots > 2*n) reportError(wrongsize); degree=nknots-n-1; - + run::copyArrayC(knots,knot,0,NoGC); - + #ifdef HAVE_LIBGLM Controls=NULL; -#endif +#endif } - + drawNurbsPath3(const double* t, const drawNurbsPath3 *s) : drawElement(s->KEY), degree(s->degree), n(s->n), weights(s->weights), knots(s->knots), color(s->color), invisible(s->invisible) { controls=new(UseGC) triple[n]; for(unsigned int i=0; i < n; ++i) controls[i]=t*s->controls[i]; - + #ifdef HAVE_LIBGLM Controls=NULL; -#endif +#endif } - + bool is3D() {return true;} - + void bounds(const double* t, bbox3& b); - + virtual ~drawNurbsPath3() {} bool write(prcfile *out, unsigned int *, double, groupsmap&); - + void displacement(); void ratio(const double* t, pair &b, double (*m)(double, double), double fuzz, bool &first); - + void render(double size2, const triple& Min, const triple& Max, double perspective, bool remesh); - + drawElement *transformed(const double* t); }; @@ -209,7 +209,7 @@ class drawPixel : public drawElement { public: #ifdef HAVE_GL Pixel R; -#endif +#endif drawPixel(const triple& v, const pen& p, double width, const string& key="") : drawElement(key), v(v), p(p), color(rgba(p)), width(width), invisible(p.invisible()) {} @@ -218,24 +218,24 @@ public: Min=Max=(t != NULL) ? t*v : v; B.add(Min); } - + void ratio(const double* t, pair &b, double (*m)(double, double), double, bool &first) { triple V=(t != NULL) ? t*v : v; pair z=pair(xratio(V),yratio(V)); - + if(first) { b=z; first=false; } else b=pair(m(b.getx(),z.getx()),m(b.gety(),z.gety())); } - + void render(double size2, const triple& b, const triple& B, double perspective, bool remesh); - + bool write(prcfile *out, unsigned int *, double, groupsmap&); bool write(jsfile *out); - + drawElement *transformed(const double* t); }; |