40 "global_settings { assumed_gamma 1.0 }\n"
43 "#default { finish { ambient 0.1 diffuse 0.9 } }\n"
46 "#include \"colors.inc\"\n"\
47 "#include \"textures.inc\"\n"\
48 "#include \"shapes.inc\"\n"
51 "light_source { <1500,3000,-2500> color White }\n"
54 "camera { location <%.3f , %.3f , -500.000>\n"\
55 " look_at <%.3f , %.3f , 0.000>\n"\
56 " right x * image_width / image_height\n"\
60#define POV_SKY_AND_GND \
62 "plane { <0, 1, 0>, 1 hollow\n"\
64 " pigment { bozo turbulence 0.95\n"\
66 " [0.00 rgb <0.05, 0.20, 0.50>]\n"\
67 " [0.50 rgb <0.05, 0.20, 0.50>]\n"\
68 " [0.75 rgb <1.00, 1.00, 1.00>]\n"\
69 " [0.75 rgb <0.25, 0.25, 0.25>]\n"\
70 " [1.00 rgb <0.50, 0.50, 0.50>]\n"\
72 " scale <1.00, 1.00, 1.50> * 2.50\n"\
73 " translate <0.00, 0.00, 0.00>\n"\
75 " finish { ambient 1 diffuse 0 }\n"\
82 " color rgb <1.00, 1.00, 1.00> * 0.75\n"\
88 "plane { <0.00, 1.00, 0.00>, 0\n"\
90 " pigment{ color rgb <0.25, 0.45, 0.00> }\n"\
91 " normal { bumps 0.75 scale 0.01 }\n"\
92 " finish { phong 0.10 }\n"\
97 "box { <%.3f, %.3f, %.3f>, <%.3f, %.3f, %.3f>\n"
103 "scale "POV_VECTOR3"\n"
106 "rotate "POV_VECTOR3"\n"
108#define POV_TRANSLATE \
109 "translate<%9.3f, %9.3f, %d.000>\n"
115 "torus { %.3f, %.3f\n"
117#define POV_SPHERE_SWEEP \
123 "sphere {"POV_VECTOR3", 1.0\n"
128 " \"%s\", %.3f, %.3f\n"
131 "#declare %s = %s;\n"
136#define POV_VERBATIM \
143 "polygon { %" PRISIZE_T ",\n"
146 "<%9.3f, %9.3f, %9.3f>"
148#define POV_PIGMENT_COLOR \
149 "pigment { color %s }\n"
151#define POV_COLOR_NAME \
154#define POV_COLOR_RGB \
155 "rgb"POV_VECTOR3" transmit %.3f"
283#define GV_OBJ_EXT(type, obj, name) \
285 char debug_str[256]; \
286 gvprintf(job, POV_DECLARE, type, obj); \
287 gvprintf(job, POV_OBJECT, type); \
288 gvprintf(job, POV_DECLARE, "Min", "min_extent("type")"); \
289 gvprintf(job, POV_DECLARE, "Max", "max_extent("type")"); \
290 snprintf(debug_str, 256, \
291 "concat(\"Dim = \" , vstr(3, Max - Min, \", \", 0, 3)," \
292 " \" "type": %s\", \"\\n\")", name); \
293 gvprintf(job, POV_DEBUG, debug_str); \
297#define RENDERER_COLOR_TYPE RGBA_BYTE
321 switch (
color.type) {
328 if (!strcmp(
color.u.string,
"red"))
330 else if (!strcmp(
color.u.string,
"green"))
332 else if (!strcmp(
color.u.string,
"blue"))
339 gvprintf(job,
"// type = %d, color = %d, %d, %d\n",
345 color.
u.rgba[2] / 256.0, transparency);
349 "oops, internal error: unhandled color type=%d %s\n",
378 gvprintf(job,
"// graph_index = %d, pages = %d, layer = %d/%d\n",
383 gvprintf(job,
"// pagesArrayFirst.x,y = %d,%d\n",
387 gvprintf(job,
"// bb.LL,UR = %.3f,%.3f, %.3f,%.3f\n", job->
bb.
LL.
x,
389 gvprintf(job,
"// pageBox in graph LL,UR = %.3f,%.3f, %.3f,%.3f\n",
395 gvprintf(job,
"// zoom = %.3f, rotation = %d\n", job->
zoom,
399 gvprintf(job,
"// canvasBox LL,UR = %.3f,%.3f, %.3f,%.3f\n",
402 gvprintf(job,
"// pageBoundingBox LL,UR = %d,%d, %d,%d\n",
405 gvprintf(job,
"// boundingBox (all pages) LL,UR = %d,%d, %d,%d\n",
423 double px = atan(x / d) * 180.0 /
M_PI * 2.0;
424 double py = atan(y / d) * 180.0 /
M_PI * 2.0;
432 gvputs(job,
"//*** end_graph\n");
437 gvprintf(job,
"//*** begin_layer: %s, %d/%d\n", layername, layerNum,
444 gvputs(job,
"//*** end_layer\n");
449 gvputs(job,
"//*** begin_page\n");
454 gvputs(job,
"//*** end_page\n");
459 gvputs(job,
"//*** begin_cluster\n");
465 gvputs(job,
"//*** end_cluster\n");
475 gvputs(job,
"//*** end_node\n");
480 gvputs(job,
"//*** begin_edge\n");
489 gvputs(job,
"//*** end_edge\n");
498 gvprintf(job,
"//*** textspan: %s, fontsize = %.3f, fontname = %s\n",
504 gvputs(job,
"// Warning: postscript_alias not handled!\n");
508 switch (span->
just) {
516 c.
x = c.
x - span->
size.
x / 2.0;
536 gvprintf(job,
"sphere{<0, 0, 0>, 2\ntranslate<%f, %f, %d>\n"
537 "pigment{color Red}\nno_shadow\n}\n", x, y,
z - 1);
548 gvputs(job,
"//*** ellipse\n");
554 const double rx = (
A[1].x -
A[0].x) * job->
scale.
x;
555 const double ry = (
A[1].y -
A[0].y) * job->
scale.
y;
556 const double w = job->
obj->
penwidth / (rx + ry) / 2.0 * 5;
570 gvprintf(job,
"sphere{<0, 0, 0>, 2\ntranslate<%f, %f, %d>\n"
571 "pigment{color Green}\nno_shadow\n}\n", cx, cy,
z - 1);
596 gvputs(job,
"//*** bezier\n");
604 for (
size_t i = 0; i < n; i++) {
610 if (i == 0 || i + 1 == n) {
615 gvprintf(job,
"sphere{<0, 0, 0>, 2\ntranslate<%f, %f, %d>\n"
616 "pigment{color Yellow}\nno_shadow\n}\n",
633 gvputs(job,
"//*** polygon\n");
640 for (
size_t i = 0; i < n; i++) {
649 gvputs(job,
" tolerance 0.1\n");
663 for (
size_t i = 0; i < n; i++) {
680 gvputs(job,
"//*** polyline\n");
687 for (
size_t i = 0; i < n; i++) {
692 gvputs(job,
" tolerance 0.01\n");
static void agxbfree(agxbuf *xb)
free any malloced resources
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static WUR char * agxbuse(agxbuf *xb)
static char * agxbdisown(agxbuf *xb)
char * agnameof(void *)
returns a string descriptor for the object.
#define GVRENDER_DOES_MAP_ELLIPSE
#define GVRENDER_NO_WHITE_BG
#define GVDEVICE_DOES_LAYERS
#define GVDEVICE_DOES_TRUECOLOR
#define GVRENDER_DOES_MAP_BSPLINE
#define GVRENDER_DOES_TRANSFORM
#define GVRENDER_DOES_MAP_POLYGON
#define GVRENDER_DOES_MAP_RECTANGLE
#define GVRENDER_DOES_MAP_CIRCLE
static void color(Agraph_t *g)
int gvputs(GVJ_t *job, const char *s)
void gvprintf(GVJ_t *job, const char *format,...)
gvdevice_features_t device_features_pov
static void pov_textspan(GVJ_t *job, pointf c, textspan_t *span)
gvplugin_installed_t gvrender_pov_types[]
static void pov_begin_job(GVJ_t *job)
static void pov_end_node(GVJ_t *job)
static void pov_end_graph(GVJ_t *job)
static void pov_begin_cluster(GVJ_t *job)
static void pov_bezier(GVJ_t *job, pointf *A, size_t n, int filled)
static void pov_begin_page(GVJ_t *job)
gvrender_features_t render_features_pov
static void pov_polyline(GVJ_t *job, pointf *A, size_t n)
#define GV_OBJ_EXT(type, obj, name)
static void pov_begin_graph(GVJ_t *job)
static void pov_begin_layer(GVJ_t *job, char *layername, int layerNum, int numLayers)
static void pov_comment(GVJ_t *job, char *str)
static void pov_end_edge(GVJ_t *job)
static void pov_end_page(GVJ_t *job)
#define POV_PIGMENT_COLOR
static char * pov_knowncolors[]
static void pov_end_layer(GVJ_t *job)
static void pov_polygon(GVJ_t *job, pointf *A, size_t n, int filled)
static void pov_ellipse(GVJ_t *job, pointf *A, int filled)
gvplugin_installed_t gvdevice_pov_types[]
static char * pov_color_as_str(GVJ_t *job, gvcolor_t color, float transparency)
static void pov_begin_edge(GVJ_t *job)
static void pov_begin_node(GVJ_t *job)
#define RENDERER_COLOR_TYPE
static void pov_end_cluster(GVJ_t *job)
gvrender_engine_t pov_engine
textitem scanner parser str
PostscriptAlias * postscript_alias