summaryrefslogtreecommitdiff
path: root/graphics/asymptote/drawpath3.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/drawpath3.cc')
-rw-r--r--graphics/asymptote/drawpath3.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/graphics/asymptote/drawpath3.cc b/graphics/asymptote/drawpath3.cc
index 7a6cf4513e..088d2705db 100644
--- a/graphics/asymptote/drawpath3.cc
+++ b/graphics/asymptote/drawpath3.cc
@@ -18,7 +18,7 @@ namespace camp {
using vm::array;
using namespace prc;
-
+
bool drawPath3::write(prcfile *out, unsigned int *, double, groupsmap&)
{
if(invisible)
@@ -32,7 +32,7 @@ bool drawPath3::write(prcfile *out, unsigned int *, double, groupsmap&)
g.precontrol((Int) 1),g.point((Int) 1)};
out->addBezierCurve(4,controls,diffuse);
}
-
+
return true;
}
@@ -46,15 +46,15 @@ bool drawPath3::write(jsfile *out)
meshinit();
drawElement::centerIndex=centerIndex;
} else drawElement::centerIndex=0;
-
+
setcolors(false,diffuse,emissive,specular,shininess,metallic,fresnel0,out);
-
+
if(straight)
out->addCurve(g.point((Int) 0),g.point((Int) 1),Min,Max);
else
out->addCurve(g.point((Int) 0),g.postcontrol((Int) 0),
g.precontrol((Int) 1),g.point((Int) 1),Min,Max);
-#endif
+#endif
return true;
}
@@ -67,7 +67,7 @@ void drawPath3::render(double size2, const triple& b, const triple& B,
setcolors(false,diffuse,emissive,specular,shininess,metallic,fresnel0);
setMaterial(material1Data,drawMaterial1);
-
+
bool offscreen;
if(billboard) {
drawElement::centerIndex=centerIndex;
@@ -75,7 +75,7 @@ void drawPath3::render(double size2, const triple& b, const triple& B,
offscreen=bbox2(Min,Max,BB).offscreen();
} else
offscreen=bbox2(Min,Max).offscreen();
-
+
if(offscreen) { // Fully offscreen
R.Onscreen=false;
R.data.clear();
@@ -100,9 +100,9 @@ void drawPath3::render(double size2, const triple& b, const triple& B,
}
double s=perspective ? Min.getz()*perspective : 1.0; // Move to glrender
-
+
const pair size3(s*(B.getx()-b.getx()),s*(B.gety()-b.gety()));
-
+
R.queue(controls,straight,size3.length()/size2);
#endif
}
@@ -111,14 +111,14 @@ drawElement *drawPath3::transformed(const double* t)
{
return new drawPath3(t,this);
}
-
+
bool drawNurbsPath3::write(prcfile *out, unsigned int *, double, groupsmap&)
{
if(invisible)
return true;
out->addCurve(degree,n,controls,knots,color,weights);
-
+
return true;
}
@@ -127,7 +127,7 @@ void drawNurbsPath3::bounds(const double* t, bbox3& b)
{
double x,y,z;
double X,Y,Z;
-
+
triple* Controls;
if(t == NULL) Controls=controls;
else {
@@ -135,12 +135,12 @@ void drawNurbsPath3::bounds(const double* t, bbox3& b)
for(size_t i=0; i < n; i++)
Controls[i]=t*controls[i];
}
-
+
boundstriples(x,y,z,X,Y,Z,n,Controls);
-
+
b.add(x,y,z);
b.add(X,Y,Z);
-
+
if(t == NULL) {
Min=triple(x,y,z);
Max=triple(X,Y,Z);
@@ -162,13 +162,13 @@ void drawNurbsPath3::ratio(const double* t, pair &b, double (*m)(double, double)
for(size_t i=0; i < n; i++)
Controls[i]=t*controls[i];
}
-
+
if(first) {
first=false;
triple v=Controls[0];
b=pair(xratio(v),yratio(v));
}
-
+
double x=b.getx();
double y=b.gety();
for(size_t i=0; i < n; ++i) {
@@ -177,7 +177,7 @@ void drawNurbsPath3::ratio(const double* t, pair &b, double (*m)(double, double)
y=m(y,yratio(v));
}
b=pair(x,y);
-
+
if(t != NULL)
delete[] Controls;
}
@@ -196,10 +196,10 @@ void drawNurbsPath3::displacement()
else
for(size_t i=0; i < n; ++i)
store(Controls+3*i,controls[i]);
-
+
for(size_t i=0; i < nknots; ++i)
Knots[i]=knots[i];
-#endif
+#endif
}
void drawNurbsPath3::render(double, const triple&, const triple&,
@@ -207,7 +207,7 @@ void drawNurbsPath3::render(double, const triple&, const triple&,
{
#ifdef HAVE_GL
if(invisible) return;
-
+
// TODO: implement NURBS renderer
#endif
}
@@ -218,10 +218,10 @@ bool drawPixel::write(prcfile *out, unsigned int *, double, groupsmap&)
return true;
out->addPoint(v,color,width);
-
+
return true;
}
-
+
bool drawPixel::write(jsfile *out)
{
#ifdef HAVE_LIBGLM
@@ -230,18 +230,18 @@ bool drawPixel::write(jsfile *out)
RGBAColour Black(0.0,0.0,0.0,color.A);
setcolors(false,color,color,Black,1.0,0.0,0.04,out);
-
+
out->addPixel(v,width,Min,Max);
-#endif
+#endif
return true;
}
void drawPixel::render(double size2, const triple& b, const triple& B,
- double perspective, bool remesh)
+ double perspective, bool remesh)
{
#ifdef HAVE_GL
if(invisible) return;
-
+
RGBAColour Black(0.0,0.0,0.0,color.A);
setcolors(false,color,color,Black,1.0,0.0,0.04);
@@ -260,5 +260,5 @@ drawElement *drawPixel::transformed(const double* t)
{
return new drawPixel(t*v,p,width,KEY);
}
-
+
} //namespace camp