Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
gvrender_core_pov.c File Reference
#include "config.h"
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <util/agxbuf.h>
#include <util/prisize_t.h>
#include <common/macros.h>
#include <common/const.h>
#include <gvc/gvplugin_render.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <gvc/gvcint.h>
Include dependency graph for gvrender_core_pov.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 
#define POV_VERSION    "#version 3.6;\n"
 
#define POV_GLOBALS    "global_settings { assumed_gamma 1.0 }\n"
 
#define POV_DEFAULT    "#default { finish { ambient 0.1 diffuse 0.9 } }\n"
 
#define POV_INCLUDE
 
#define POV_LIGHT    "light_source { <1500,3000,-2500> color White }\n"
 
#define POV_CAMERA
 
#define POV_SKY_AND_GND
 
#define POV_BOX    "box { <%.3f, %.3f, %.3f>, <%.3f, %.3f, %.3f>\n"
 
#define POV_SCALE1    "scale %.3f\n"
 
#define POV_SCALE3    "scale "POV_VECTOR3"\n"
 
#define POV_ROTATE    "rotate "POV_VECTOR3"\n"
 
#define POV_TRANSLATE    "translate<%9.3f, %9.3f, %d.000>\n"
 
#define END    "}\n"
 
#define POV_TORUS    "torus { %.3f, %.3f\n"
 
#define POV_SPHERE_SWEEP
 
#define POV_SPHERE    "sphere {"POV_VECTOR3", 1.0\n"
 
#define POV_TEXT
 
#define POV_DECLARE    "#declare %s = %s;\n"
 
#define POV_OBJECT    "object { %s }\n"
 
#define POV_VERBATIM    "%s\n"
 
#define POV_DEBUG    "#debug %s\n"
 
#define POV_POLYGON    "polygon { %" PRISIZE_T ",\n"
 
#define POV_VECTOR3    "<%9.3f, %9.3f, %9.3f>"
 
#define POV_PIGMENT_COLOR    "pigment { color %s }\n"
 
#define POV_COLOR_NAME    "%s transmit %.3f"
 
#define POV_COLOR_RGB    "rgb"POV_VECTOR3" transmit %.3f"
 
#define POV_COLORS
 
#define GV_OBJ_EXT(type, obj, name)
 
#define DPI   72.0
 
#define RENDERER_COLOR_TYPE   RGBA_BYTE
 

Enumerations

enum  format_type { FORMAT_POV }
 

Functions

static char * pov_color_as_str (GVJ_t *job, gvcolor_t color, float transparency)
 
static void pov_comment (GVJ_t *job, char *str)
 
static void pov_begin_job (GVJ_t *job)
 
static void pov_begin_graph (GVJ_t *job)
 
static void pov_end_graph (GVJ_t *job)
 
static void pov_begin_layer (GVJ_t *job, char *layername, int layerNum, int numLayers)
 
static void pov_end_layer (GVJ_t *job)
 
static void pov_begin_page (GVJ_t *job)
 
static void pov_end_page (GVJ_t *job)
 
static void pov_begin_cluster (GVJ_t *job)
 
static void pov_end_cluster (GVJ_t *job)
 
static void pov_begin_node (GVJ_t *job)
 
static void pov_end_node (GVJ_t *job)
 
static void pov_begin_edge (GVJ_t *job)
 
static void pov_end_edge (GVJ_t *job)
 
static void pov_textspan (GVJ_t *job, pointf c, textspan_t *span)
 
static void pov_ellipse (GVJ_t *job, pointf *A, int filled)
 
static void pov_bezier (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void pov_polygon (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void pov_polyline (GVJ_t *job, pointf *A, size_t n)
 

Variables

static char * pov_knowncolors [] = { POV_COLORS }
 
static int layerz = 0
 
static int z = 0
 
gvrender_engine_t pov_engine
 
gvrender_features_t render_features_pov
 
gvdevice_features_t device_features_pov
 
gvplugin_installed_t gvrender_pov_types []
 
gvplugin_installed_t gvdevice_pov_types []
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 16 of file gvrender_core_pov.c.

◆ DPI

#define DPI   72.0

Definition at line 296 of file gvrender_core_pov.c.

◆ END

#define END    "}\n"

Definition at line 111 of file gvrender_core_pov.c.

◆ GV_OBJ_EXT

#define GV_OBJ_EXT (   type,
  obj,
  name 
)
Value:
do { \
char debug_str[256]; \
gvprintf(job, POV_DECLARE, type, obj); \
gvprintf(job, POV_OBJECT, type); \
gvprintf(job, POV_DECLARE, "Min", "min_extent("type")"); \
gvprintf(job, POV_DECLARE, "Max", "max_extent("type")"); \
snprintf(debug_str, 256, \
"concat(\"Dim = \" , vstr(3, Max - Min, \", \", 0, 3)," \
" \" "type": %s\", \"\\n\")", name); \
gvprintf(job, POV_DEBUG, debug_str); \
} while (0)
expr procedure type
Definition exparse.y:208
#define POV_DEBUG
#define POV_OBJECT
#define POV_DECLARE

Definition at line 283 of file gvrender_core_pov.c.

◆ POV_BOX

#define POV_BOX    "box { <%.3f, %.3f, %.3f>, <%.3f, %.3f, %.3f>\n"

Definition at line 96 of file gvrender_core_pov.c.

◆ POV_CAMERA

#define POV_CAMERA
Value:
"camera { location <%.3f , %.3f , -500.000>\n"\
" look_at <%.3f , %.3f , 0.000>\n"\
" right x * image_width / image_height\n"\
" angle %.3f\n"\
"}\n"

Definition at line 53 of file gvrender_core_pov.c.

◆ POV_COLOR_NAME

#define POV_COLOR_NAME    "%s transmit %.3f"

Definition at line 151 of file gvrender_core_pov.c.

◆ POV_COLOR_RGB

#define POV_COLOR_RGB    "rgb"POV_VECTOR3" transmit %.3f"

Definition at line 154 of file gvrender_core_pov.c.

◆ POV_COLORS

#define POV_COLORS

Definition at line 159 of file gvrender_core_pov.c.

◆ POV_DEBUG

#define POV_DEBUG    "#debug %s\n"

Definition at line 139 of file gvrender_core_pov.c.

◆ POV_DECLARE

#define POV_DECLARE    "#declare %s = %s;\n"

Definition at line 130 of file gvrender_core_pov.c.

◆ POV_DEFAULT

#define POV_DEFAULT    "#default { finish { ambient 0.1 diffuse 0.9 } }\n"

Definition at line 42 of file gvrender_core_pov.c.

◆ POV_GLOBALS

#define POV_GLOBALS    "global_settings { assumed_gamma 1.0 }\n"

Definition at line 39 of file gvrender_core_pov.c.

◆ POV_INCLUDE

#define POV_INCLUDE
Value:
"#include \"colors.inc\"\n"\
"#include \"textures.inc\"\n"\
"#include \"shapes.inc\"\n"

Definition at line 45 of file gvrender_core_pov.c.

◆ POV_LIGHT

#define POV_LIGHT    "light_source { <1500,3000,-2500> color White }\n"

Definition at line 50 of file gvrender_core_pov.c.

◆ POV_OBJECT

#define POV_OBJECT    "object { %s }\n"

Definition at line 133 of file gvrender_core_pov.c.

◆ POV_PIGMENT_COLOR

#define POV_PIGMENT_COLOR    "pigment { color %s }\n"

Definition at line 148 of file gvrender_core_pov.c.

◆ POV_POLYGON

#define POV_POLYGON    "polygon { %" PRISIZE_T ",\n"

Definition at line 142 of file gvrender_core_pov.c.

◆ POV_ROTATE

#define POV_ROTATE    "rotate "POV_VECTOR3"\n"

Definition at line 105 of file gvrender_core_pov.c.

◆ POV_SCALE1

#define POV_SCALE1    "scale %.3f\n"

Definition at line 99 of file gvrender_core_pov.c.

◆ POV_SCALE3

#define POV_SCALE3    "scale "POV_VECTOR3"\n"

Definition at line 102 of file gvrender_core_pov.c.

◆ POV_SKY_AND_GND

#define POV_SKY_AND_GND

Definition at line 60 of file gvrender_core_pov.c.

◆ POV_SPHERE

#define POV_SPHERE    "sphere {"POV_VECTOR3", 1.0\n"

Definition at line 122 of file gvrender_core_pov.c.

◆ POV_SPHERE_SWEEP

#define POV_SPHERE_SWEEP
Value:
"sphere_sweep {\n"\
" %s\n"\
" %" PRISIZE_T ",\n"
#define PRISIZE_T
PRIu64 alike for printing size_t
Definition prisize_t.h:27

Definition at line 117 of file gvrender_core_pov.c.

◆ POV_TEXT

#define POV_TEXT
Value:
"text {\n"\
" ttf \"%s\",\n"\
" \"%s\", %.3f, %.3f\n"

Definition at line 125 of file gvrender_core_pov.c.

◆ POV_TORUS

#define POV_TORUS    "torus { %.3f, %.3f\n"

Definition at line 114 of file gvrender_core_pov.c.

◆ POV_TRANSLATE

#define POV_TRANSLATE    "translate<%9.3f, %9.3f, %d.000>\n"

Definition at line 108 of file gvrender_core_pov.c.

◆ POV_VECTOR3

#define POV_VECTOR3    "<%9.3f, %9.3f, %9.3f>"

Definition at line 145 of file gvrender_core_pov.c.

◆ POV_VERBATIM

#define POV_VERBATIM    "%s\n"

Definition at line 136 of file gvrender_core_pov.c.

◆ POV_VERSION

#define POV_VERSION    "#version 3.6;\n"

Definition at line 36 of file gvrender_core_pov.c.

◆ RENDERER_COLOR_TYPE

#define RENDERER_COLOR_TYPE   RGBA_BYTE

Definition at line 297 of file gvrender_core_pov.c.

Enumeration Type Documentation

◆ format_type

Enumerator
FORMAT_POV 

Definition at line 298 of file gvrender_core_pov.c.

Function Documentation

◆ pov_begin_cluster()

static void pov_begin_cluster ( GVJ_t job)
static

Definition at line 457 of file gvrender_core_pov.c.

References gvputs(), and layerz.

Here is the call graph for this function:

◆ pov_begin_edge()

static void pov_begin_edge ( GVJ_t job)
static

Definition at line 478 of file gvrender_core_pov.c.

References gvprintf(), gvputs(), and layerz.

Here is the call graph for this function:

◆ pov_begin_graph()

◆ pov_begin_job()

static void pov_begin_job ( GVJ_t job)
static

Definition at line 364 of file gvrender_core_pov.c.

References gvprintf(), gvputs(), POV_DECLARE, POV_DEFAULT, POV_GLOBALS, POV_INCLUDE, and POV_VERSION.

Here is the call graph for this function:

◆ pov_begin_layer()

static void pov_begin_layer ( GVJ_t job,
char *  layername,
int  layerNum,
int  numLayers 
)
static

Definition at line 435 of file gvrender_core_pov.c.

References gvprintf(), and layerz.

Here is the call graph for this function:

◆ pov_begin_node()

static void pov_begin_node ( GVJ_t job)
static

Definition at line 468 of file gvrender_core_pov.c.

References agnameof(), gvprintf(), obj_state_s::n, GVJ_s::obj, and obj_state_s::u.

Here is the call graph for this function:

◆ pov_begin_page()

static void pov_begin_page ( GVJ_t job)
static

Definition at line 447 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_bezier()

static void pov_bezier ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 593 of file gvrender_core_pov.c.

References A, agxbfree(), agxbprint(), agxbuse(), END, obj_state_s::fillcolor, free(), gvprintf(), gvputs(), layerz, GVJ_s::obj, obj_state_s::penwidth, pov_color_as_str(), POV_ROTATE, POV_SCALE3, POV_SPHERE_SWEEP, POV_TRANSLATE, POV_VECTOR3, GVJ_s::rotation, GVJ_s::scale, GVJ_s::translation, pointf_s::x, pointf_s::y, and z.

Here is the call graph for this function:

◆ pov_color_as_str()

static char * pov_color_as_str ( GVJ_t job,
gvcolor_t  color,
float  transparency 
)
static

Definition at line 318 of file gvrender_core_pov.c.

References agxbdisown(), agxbfree(), agxbprint(), agxbuse(), color(), COLOR_STRING, gvprintf(), POV_COLOR_NAME, POV_COLOR_RGB, POV_PIGMENT_COLOR, RENDERER_COLOR_TYPE, and agxbuf::u.

Referenced by pov_bezier(), pov_ellipse(), pov_polygon(), pov_polyline(), and pov_textspan().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pov_comment()

static void pov_comment ( GVJ_t job,
char *  str 
)
static

Definition at line 359 of file gvrender_core_pov.c.

References gvprintf(), and str.

Here is the call graph for this function:

◆ pov_ellipse()

static void pov_ellipse ( GVJ_t job,
pointf A,
int  filled 
)
static

Definition at line 546 of file gvrender_core_pov.c.

References A, agxbfree(), agxbprint(), agxbuse(), END, obj_state_s::fillcolor, free(), GV_OBJ_EXT, gvprintf(), gvputs(), layerz, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, pov_color_as_str(), POV_ROTATE, POV_SCALE3, POV_SPHERE, POV_TORUS, POV_TRANSLATE, GVJ_s::rotation, GVJ_s::scale, GVJ_s::translation, pointf_s::x, pointf_s::y, and z.

Here is the call graph for this function:

◆ pov_end_cluster()

static void pov_end_cluster ( GVJ_t job)
static

Definition at line 463 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_end_edge()

static void pov_end_edge ( GVJ_t job)
static

Definition at line 487 of file gvrender_core_pov.c.

References gvprintf(), gvputs(), and layerz.

Here is the call graph for this function:

◆ pov_end_graph()

static void pov_end_graph ( GVJ_t job)
static

Definition at line 430 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_end_layer()

static void pov_end_layer ( GVJ_t job)
static

Definition at line 442 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_end_node()

static void pov_end_node ( GVJ_t job)
static

Definition at line 473 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_end_page()

static void pov_end_page ( GVJ_t job)
static

Definition at line 452 of file gvrender_core_pov.c.

References gvputs().

Here is the call graph for this function:

◆ pov_polygon()

static void pov_polygon ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 632 of file gvrender_core_pov.c.

References A, END, obj_state_s::fillcolor, free(), gvprintf(), gvputs(), layerz, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, pov_color_as_str(), POV_POLYGON, POV_ROTATE, POV_SCALE3, POV_SPHERE_SWEEP, POV_TRANSLATE, POV_VECTOR3, GVJ_s::rotation, GVJ_s::scale, GVJ_s::translation, pointf_s::x, pointf_s::y, and z.

Here is the call graph for this function:

◆ pov_polyline()

static void pov_polyline ( GVJ_t job,
pointf A,
size_t  n 
)
static

Definition at line 679 of file gvrender_core_pov.c.

References A, END, free(), gvprintf(), gvputs(), layerz, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, pov_color_as_str(), POV_ROTATE, POV_SCALE3, POV_SPHERE_SWEEP, POV_TRANSLATE, POV_VECTOR3, GVJ_s::rotation, GVJ_s::scale, GVJ_s::translation, pointf_s::x, pointf_s::y, and z.

Here is the call graph for this function:

◆ pov_textspan()

static void pov_textspan ( GVJ_t job,
pointf  c,
textspan_t span 
)
static

Variable Documentation

◆ device_features_pov

gvdevice_features_t device_features_pov
Initial value:
= {
{0.0, 0.0},
{0.0, 0.0},
{DPI, DPI},
}
#define GVDEVICE_DOES_TRUECOLOR
Definition gvcjob.h:90
#define DPI

Definition at line 751 of file gvrender_core_pov.c.

◆ gvdevice_pov_types

gvplugin_installed_t gvdevice_pov_types[]
Initial value:
= {
{FORMAT_POV, "pov:pov", 1, NULL, &device_features_pov},
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:163
gvdevice_features_t device_features_pov
@ FORMAT_POV

Definition at line 763 of file gvrender_core_pov.c.

◆ gvrender_pov_types

gvplugin_installed_t gvrender_pov_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
gvrender_features_t render_features_pov
gvrender_engine_t pov_engine

Definition at line 758 of file gvrender_core_pov.c.

◆ layerz

◆ pov_engine

gvrender_engine_t pov_engine

Definition at line 701 of file gvrender_core_pov.c.

◆ pov_knowncolors

char* pov_knowncolors[] = { POV_COLORS }
static

Definition at line 313 of file gvrender_core_pov.c.

◆ render_features_pov

gvrender_features_t render_features_pov
Initial value:
= {
4.0,
sizeof(pov_knowncolors) / sizeof(char *),
}
#define GVRENDER_DOES_MAP_ELLIPSE
Definition gvcjob.h:101
#define GVRENDER_DOES_Z
Definition gvcjob.h:105
#define GVRENDER_NO_WHITE_BG
Definition gvcjob.h:106
#define GVDEVICE_DOES_LAYERS
Definition gvcjob.h:88
#define GVRENDER_DOES_MAP_BSPLINE
Definition gvcjob.h:102
#define GVRENDER_DOES_TRANSFORM
Definition gvcjob.h:95
#define GVRENDER_DOES_MAP_POLYGON
Definition gvcjob.h:100
#define GVRENDER_DOES_MAP_RECTANGLE
Definition gvcjob.h:98
#define GVRENDER_DOES_MAP_CIRCLE
Definition gvcjob.h:99
static char * pov_knowncolors[]
#define RENDERER_COLOR_TYPE

Definition at line 734 of file gvrender_core_pov.c.

◆ z