Go to the documentation of this file.
4 #ifndef tools_sg_gl2ps_action
5 #define tools_sg_gl2ps_action
24 static unsigned int _GL2PS_POINT() {
return 2;}
25 static unsigned int _GL2PS_LINE() {
return 3;}
26 static unsigned int _GL2PS_TRIANGLE() {
return 5;}
43 const float* a_rgbas){
64 virtual void clear_color(
float a_r,
float a_g,
float a_b,
float ){
68 virtual void color4f(
float a_r,
float a_g,
float a_b,
float a_a){
74 virtual void normal(
float a_x,
float a_y,
float a_z) {
102 float a_dx,
float a_dy,
float a_dz,
103 float a_r,
float a_g,
float a_b,
float a_a){
134 gstoid a_id,
const float* a_tcs) {
145 const float* a_tcs) {
164 :parent(a_out,a_ww,a_wh)
228 parent::operator=(a_from);
229 if(&a_from==
this)
return *
this;
259 m_FILE = ::fopen(a_name.c_str(),
"w");
261 m_out <<
"tools::sg::gl2ps_action::open :"
262 <<
" can't open file " << a_name <<
"."
283 vp,a_format,sort,options,
313 m_out <<
"mem_action::set_normal_matrix : can't invert model matrix." << std::endl;
322 if(a_w==0)
return false;
335 float a_x,
float a_y,
float a_z,
336 float a_r,
float a_g,
float a_b,
float a_a){
337 a_vs[a_index].
xyz[0] = a_x;
338 a_vs[a_index].
xyz[1] = a_y;
339 a_vs[a_index].
xyz[2] = a_z;
340 a_vs[a_index].
rgba[0] = a_r;
341 a_vs[a_index].
rgba[1] = a_g;
342 a_vs[a_index].
rgba[2] = a_b;
343 a_vs[a_index].
rgba[3] = a_a;
348 virtual bool project(
float& a_x,
float& a_y,
float& a_z,
float& a_w) {
351 virtual bool add_point(
float a_x,
float a_y,
float a_z,
float) {
373 ::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,
vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
377 virtual bool add_point(
float a_x,
float a_y,
float a_z,
float,
378 float a_r,
float a_g,
float a_b,
float a_a) {
396 ::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,
vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
400 virtual bool add_line(
float a_bx,
float a_by,
float a_bz,
float,
401 float a_ex,
float a_ey,
float a_ez,
float) {
426 ::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,
vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
431 virtual bool add_line(
float a_bx,
float a_by,
float a_bz,
float,
432 float a_br,
float a_bg,
float a_bb,
float a_ba,
433 float a_ex,
float a_ey,
float a_ez,
float,
434 float a_er,
float a_eg,
float a_eb,
float a_ea){
455 ::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,
vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
461 float a_p2x,
float a_p2y,
float a_p2z,
float,
462 float a_p3x,
float a_p3y,
float a_p3z,
float){
489 ::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,
vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
495 float a_p1x,
float a_p1y,
float a_p1z,
float,
496 float a_r1,
float a_g1,
float a_b1,
float a_a1,
497 float a_p2x,
float a_p2y,
float a_p2z,
float,
498 float a_r2,
float a_g2,
float a_b2,
float a_a2,
499 float a_p3x,
float a_p3y,
float a_p3z,
float,
500 float a_r3,
float a_g3,
float a_b3,
float a_a3){
523 ::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,
vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
533 float ,
float ,
float ) {
539 float ,
float ,
float ,
540 float a_r,
float a_g,
float a_b,
float a_a) {
541 add_point(a_x,a_y,a_z,a_w,a_r,a_g,a_b,a_a);
546 float ,
float ,
float ,
547 float a_ex,
float a_ey,
float a_ez,
float a_ew,
548 float ,
float ,
float ) {
549 add_line(a_bx,a_by,a_bz,a_bw, a_ex,a_ey,a_ez,a_ew);
555 float ,
float ,
float ,
556 float a_br,
float a_bg,
float a_bb,
float a_ba,
557 float a_ex,
float a_ey,
float a_ez,
float a_ew,
558 float ,
float ,
float ,
559 float a_er,
float a_eg,
float a_eb,
float a_ea){
560 add_line(a_bx,a_by,a_bz,a_bw, a_br,a_bg,a_bb,a_ba, a_ex,a_ey,a_ez,a_ew, a_er,a_eg,a_eb,a_ea);
566 float a_p1x,
float a_p1y,
float a_p1z,
float a_p1w,
567 float ,
float ,
float ,
568 float a_p2x,
float a_p2y,
float a_p2z,
float a_p2w,
569 float ,
float ,
float ,
570 float a_p3x,
float a_p3y,
float a_p3z,
float a_p3w,
571 float ,
float ,
float ) {
573 a_p2x,a_p2y,a_p2z,a_p2w,
574 a_p3x,a_p3y,a_p3z,a_p3w);
581 float a_p1x,
float a_p1y,
float a_p1z,
float a_p1w,
582 float ,
float ,
float ,
583 float a_r1,
float a_g1,
float a_b1,
float a_a1,
584 float a_p2x,
float a_p2y,
float a_p2z,
float a_p2w,
585 float ,
float ,
float ,
586 float a_r2,
float a_g2,
float a_b2,
float a_a2,
587 float a_p3x,
float a_p3y,
float a_p3z,
float a_p3w,
588 float ,
float ,
float ,
589 float a_r3,
float a_g3,
float a_b3,
float a_a3){
592 a_p2x,a_p2y,a_p2z,a_p2w,
594 a_p3x,a_p3y,a_p3z,a_p3w,
595 a_r3,a_g3,a_b3,a_a3);
644 inline bool s2format(
const std::string& a_format,
int& a_gl2ps_format) {
645 if(a_format==
"gl2ps_eps") {a_gl2ps_format =
TOOLS_GL2PS_EPS;
return true;}
646 if(a_format==
"gl2ps_ps") {a_gl2ps_format =
TOOLS_GL2PS_PS;
return true;}
647 if(a_format==
"gl2ps_pdf") {a_gl2ps_format =
TOOLS_GL2PS_PDF;
return true;}
648 if(a_format==
"gl2ps_svg") {a_gl2ps_format =
TOOLS_GL2PS_SVG;
return true;}
649 if(a_format==
"gl2ps_tex") {a_gl2ps_format =
TOOLS_GL2PS_TEX;
return true;}
650 if(a_format==
"gl2ps_pgf") {a_gl2ps_format =
TOOLS_GL2PS_PGF;
return true;}
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psBeginPage(const char *title, const char *producer, tools_GLint viewport[4], tools_GLint format, tools_GLint sort, tools_GLint options, tools_GLint colormode, tools_GLint colorsize, tools_GL2PSrgba *colormap, tools_GLint nr, tools_GLint ng, tools_GLint nb, tools_GLint buffersize, FILE *stream, const char *filename)
#define TOOLS_GL2PS_SILENT
#define TOOLS_GL2PS_BSP_SORT
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndPage(void)
#define TOOLS_GL2PS_DRAW_BACKGROUND
#define TOOLS_ACTION(a__class, a__sclass, a__parent)
#define TOOLS_GL2PS_OCCLUSION_CULL
unsigned short tools_GLushort
#define TOOLS_GL2PS_BEST_ROOT
TOOLS_GL2PSDLL_API void tools_gl2psAddPolyPrimitive(tools_GLshort type, tools_GLshort numverts, tools_GL2PSvertex *verts, tools_GLint offset, tools_GLfloat ofactor, tools_GLfloat ounits, tools_GLushort pattern, tools_GLint factor, tools_GLfloat width, tools_GLint linecap, tools_GLint linejoin, char boundary)