diff options
Diffstat (limited to 'Build/source/utils/asymptote/runpicture.cc')
-rw-r--r-- | Build/source/utils/asymptote/runpicture.cc | 109 |
1 files changed, 61 insertions, 48 deletions
diff --git a/Build/source/utils/asymptote/runpicture.cc b/Build/source/utils/asymptote/runpicture.cc index 00b77c4fa53..a950c28b15a 100644 --- a/Build/source/utils/asymptote/runpicture.cc +++ b/Build/source/utils/asymptote/runpicture.cc @@ -898,7 +898,20 @@ void gen_runpicture45(stack *Stack) b=group->bounds(); b *= magnification; + const char *oldlocale=setlocale(LC_NUMERIC,NULL); + bool override=oldlocale && strcmp(oldlocale,"C") != 0; + if(override) { + oldlocale=StrdupNoGC(oldlocale); + setlocale(LC_NUMERIC,"C"); + } + fprintf(pipeout,"%g %g %g %g\n",b.left,b.right,b.bottom,b.top); + + if(override) { + setlocale(LC_NUMERIC,oldlocale); + delete[] oldlocale; + } + fflush(pipeout); ++n; ++p; @@ -934,7 +947,7 @@ void gen_runpicture45(stack *Stack) // Three-dimensional picture and surface operations // Bezier curve -#line 615 "runpicture.in" +#line 628 "runpicture.in" // void _draw(picture *f, path3 g, triple center=Zero, pen p, Int interaction=0); void gen_runpicture46(stack *Stack) { @@ -943,13 +956,13 @@ void gen_runpicture46(stack *Stack) triple center=vm::pop<triple>(Stack,Zero); path3 g=vm::pop<path3>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 616 "runpicture.in" +#line 629 "runpicture.in" if(g.size() > 0) f->append(new drawPath3(g,center,p,(Interaction) intcast(interaction))); } // Bezier patch -#line 622 "runpicture.in" +#line 635 "runpicture.in" // void draw(picture *f, triplearray2 *P, triple center, bool straight, penarray *p, real opacity, real shininess, real PRCshininess, triple normal, penarray *colors, Int interaction, bool prc=true); void gen_runpicture47(stack *Stack) { @@ -965,14 +978,14 @@ void gen_runpicture47(stack *Stack) triple center=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 625 "runpicture.in" +#line 638 "runpicture.in" f->append(new drawSurface(*P,center,straight,*p,opacity,shininess, PRCshininess,normal,*colors, (Interaction) intcast(interaction),prc)); } // General NURBS curve -#line 632 "runpicture.in" +#line 645 "runpicture.in" // void draw(picture *f, triplearray *P, realarray *knot, realarray *weights=emptyarray, pen p); void gen_runpicture48(stack *Stack) { @@ -981,12 +994,12 @@ void gen_runpicture48(stack *Stack) realarray * knot=vm::pop<realarray *>(Stack); triplearray * P=vm::pop<triplearray *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 634 "runpicture.in" +#line 647 "runpicture.in" f->append(new drawNurbsPath3(*P,knot,weights,p)); } // General NURBS surface -#line 639 "runpicture.in" +#line 652 "runpicture.in" // void draw(picture *f, triplearray2 *P, realarray *uknot, realarray *vknot, realarray2 *weights=emptyarray, penarray *p, real opacity, real shininess, real PRCshininess, penarray *colors); void gen_runpicture49(stack *Stack) { @@ -1000,13 +1013,13 @@ void gen_runpicture49(stack *Stack) realarray * uknot=vm::pop<realarray *>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 642 "runpicture.in" +#line 655 "runpicture.in" f->append(new drawNurbs(*P,uknot,vknot,weights,*p,opacity,shininess, PRCshininess,*colors)); } // PRC unit sphere -#line 648 "runpicture.in" +#line 661 "runpicture.in" // void drawPRCsphere(picture *f, realarray2 *t, bool half=false, penarray *p, real opacity, real shininess, Int type); void gen_runpicture50(stack *Stack) { @@ -1017,12 +1030,12 @@ void gen_runpicture50(stack *Stack) bool half=vm::pop<bool>(Stack,false); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 650 "runpicture.in" +#line 663 "runpicture.in" f->append(new drawSphere(*t,half,*p,opacity,shininess,intcast(type))); } // PRC unit cylinder -#line 655 "runpicture.in" +#line 668 "runpicture.in" // void drawPRCcylinder(picture *f, realarray2 *t, penarray *p, real opacity, real shininess); void gen_runpicture51(stack *Stack) { @@ -1031,12 +1044,12 @@ void gen_runpicture51(stack *Stack) penarray * p=vm::pop<penarray *>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 657 "runpicture.in" +#line 670 "runpicture.in" f->append(new drawCylinder(*t,*p,opacity,shininess)); } // PRC unit disk -#line 662 "runpicture.in" +#line 675 "runpicture.in" // void drawPRCdisk(picture *f, realarray2 *t, penarray *p, real opacity, real shininess); void gen_runpicture52(stack *Stack) { @@ -1045,12 +1058,12 @@ void gen_runpicture52(stack *Stack) penarray * p=vm::pop<penarray *>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 664 "runpicture.in" +#line 677 "runpicture.in" f->append(new drawDisk(*t,*p,opacity,shininess)); } // General PRC tube -#line 669 "runpicture.in" +#line 682 "runpicture.in" // void drawPRCtube(picture *f, path3 center, path3 g, penarray *p, real opacity, real shininess); void gen_runpicture53(stack *Stack) { @@ -1060,12 +1073,12 @@ void gen_runpicture53(stack *Stack) path3 g=vm::pop<path3>(Stack); path3 center=vm::pop<path3>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 671 "runpicture.in" +#line 684 "runpicture.in" f->append(new drawTube(center,g,*p,opacity,shininess)); } // Draw pixel -#line 676 "runpicture.in" +#line 689 "runpicture.in" // void drawpixel(picture *f, triple v, pen p, real width=1.0); void gen_runpicture54(stack *Stack) { @@ -1073,12 +1086,12 @@ void gen_runpicture54(stack *Stack) pen p=vm::pop<pen>(Stack); triple v=vm::pop<triple>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 677 "runpicture.in" +#line 690 "runpicture.in" f->append(new drawPixel(v,p,width)); } // Draw triangles -#line 682 "runpicture.in" +#line 695 "runpicture.in" // void draw(picture *f, triplearray *v, Intarray2 *vi, triplearray *n, Intarray2 *ni, penarray *p, real opacity, real shininess, real PRCshininess, penarray *c=emptyarray, Intarray2 *ci=emptyarray); void gen_runpicture55(stack *Stack) { @@ -1093,63 +1106,63 @@ void gen_runpicture55(stack *Stack) Intarray2 * vi=vm::pop<Intarray2 *>(Stack); triplearray * v=vm::pop<triplearray *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 686 "runpicture.in" +#line 699 "runpicture.in" f->append(new drawTriangles(*v,*vi,*n,*ni,*p,opacity,shininess,PRCshininess, *c,*ci)); } -#line 691 "runpicture.in" +#line 704 "runpicture.in" // triple min3(picture *f); void gen_runpicture56(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 692 "runpicture.in" +#line 705 "runpicture.in" {Stack->push<triple>(f->bounds3().Min()); return;} } -#line 696 "runpicture.in" +#line 709 "runpicture.in" // triple max3(picture *f); void gen_runpicture57(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 697 "runpicture.in" +#line 710 "runpicture.in" {Stack->push<triple>(f->bounds3().Max()); return;} } -#line 701 "runpicture.in" +#line 714 "runpicture.in" // triple size3(picture *f); void gen_runpicture58(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 702 "runpicture.in" +#line 715 "runpicture.in" bbox3 b=f->bounds3(); {Stack->push<triple>(b.Max()-b.Min()); return;} } -#line 707 "runpicture.in" +#line 720 "runpicture.in" // pair minratio(picture *f); void gen_runpicture59(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 708 "runpicture.in" +#line 721 "runpicture.in" {Stack->push<pair>(f->ratio(::min)); return;} } -#line 712 "runpicture.in" +#line 725 "runpicture.in" // pair maxratio(picture *f); void gen_runpicture60(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 713 "runpicture.in" +#line 726 "runpicture.in" {Stack->push<pair>(f->ratio(::max)); return;} } -#line 717 "runpicture.in" +#line 730 "runpicture.in" // bool is3D(picture *f); void gen_runpicture61(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 718 "runpicture.in" +#line 731 "runpicture.in" {Stack->push<bool>(f->have3D()); return;} } @@ -1251,37 +1264,37 @@ void gen_runpicture_venv(venv &ve) addFunc(ve, run::gen_runpicture44, primVoid(), SYM(shipout3), formal(primString() , SYM(prefix), false, false), formal(primPicture(), SYM(f), false, false)); #line 481 "runpicture.in" addFunc(ve, run::gen_runpicture45, primVoid(), SYM(deconstruct), formal(primPicture(), SYM(f), false, false), formal(primPicture(), SYM(preamble), true, false), formal(primReal(), SYM(magnification), true, false), formal(transformFunction(), SYM(xform), false, false)); -#line 611 "runpicture.in" +#line 624 "runpicture.in" addFunc(ve, run::gen_runpicture46, primVoid(), SYM(_draw), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(g), false, false), formal(primTriple(), SYM(center), true, false), formal(primPen(), SYM(p), false, false), formal(primInt(), SYM(interaction), true, false)); -#line 621 "runpicture.in" +#line 634 "runpicture.in" addFunc(ve, run::gen_runpicture47, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(center), false, false), formal(primBoolean(), SYM(straight), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(prcshininess), false, false), formal(primTriple(), SYM(normal), false, false), formal(penArray() , SYM(colors), false, false), formal(primInt(), SYM(interaction), false, false), formal(primBoolean(), SYM(prc), true, false)); -#line 631 "runpicture.in" +#line 644 "runpicture.in" addFunc(ve, run::gen_runpicture48, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(p), false, false), formal(realArray(), SYM(knot), false, false), formal(realArray(), SYM(weights), true, false), formal(primPen(), SYM(p), false, false)); -#line 638 "runpicture.in" +#line 651 "runpicture.in" addFunc(ve, run::gen_runpicture49, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(realArray(), SYM(uknot), false, false), formal(realArray(), SYM(vknot), false, false), formal(realArray2(), SYM(weights), true, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(prcshininess), false, false), formal(penArray() , SYM(colors), false, false)); -#line 647 "runpicture.in" +#line 660 "runpicture.in" addFunc(ve, run::gen_runpicture50, primVoid(), SYM(drawPRCsphere), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(primBoolean(), SYM(half), true, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primInt(), SYM(type), false, false)); -#line 654 "runpicture.in" +#line 667 "runpicture.in" addFunc(ve, run::gen_runpicture51, primVoid(), SYM(drawPRCcylinder), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); -#line 661 "runpicture.in" +#line 674 "runpicture.in" addFunc(ve, run::gen_runpicture52, primVoid(), SYM(drawPRCdisk), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); -#line 668 "runpicture.in" +#line 681 "runpicture.in" addFunc(ve, run::gen_runpicture53, primVoid(), SYM(drawPRCtube), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(center), false, false), formal(primPath3(), SYM(g), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); -#line 675 "runpicture.in" +#line 688 "runpicture.in" addFunc(ve, run::gen_runpicture54, primVoid(), SYM(drawpixel), formal(primPicture(), SYM(f), false, false), formal(primTriple(), SYM(v), false, false), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(width), true, false)); -#line 681 "runpicture.in" +#line 694 "runpicture.in" addFunc(ve, run::gen_runpicture55, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(v), false, false), formal(IntArray2(), SYM(vi), false, false), formal(tripleArray(), SYM(n), false, false), formal(IntArray2(), SYM(ni), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(prcshininess), false, false), formal(penArray() , SYM(c), true, false), formal(IntArray2(), SYM(ci), true, false)); -#line 691 "runpicture.in" +#line 704 "runpicture.in" addFunc(ve, run::gen_runpicture56, primTriple(), SYM(min3), formal(primPicture(), SYM(f), false, false)); -#line 696 "runpicture.in" +#line 709 "runpicture.in" addFunc(ve, run::gen_runpicture57, primTriple(), SYM(max3), formal(primPicture(), SYM(f), false, false)); -#line 701 "runpicture.in" +#line 714 "runpicture.in" addFunc(ve, run::gen_runpicture58, primTriple(), SYM(size3), formal(primPicture(), SYM(f), false, false)); -#line 707 "runpicture.in" +#line 720 "runpicture.in" addFunc(ve, run::gen_runpicture59, primPair(), SYM(minratio), formal(primPicture(), SYM(f), false, false)); -#line 712 "runpicture.in" +#line 725 "runpicture.in" addFunc(ve, run::gen_runpicture60, primPair(), SYM(maxratio), formal(primPicture(), SYM(f), false, false)); -#line 717 "runpicture.in" +#line 730 "runpicture.in" addFunc(ve, run::gen_runpicture61, primBoolean(), SYM(is3D), formal(primPicture(), SYM(f), false, false)); } |