g4tools  5.4.0
gl2ps_action
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_sg_gl2ps_action
5 #define tools_sg_gl2ps_action
6 
7 #include "gl2ps_manager"
8 #include "../gl2ps"
9 
10 #include "render_action"
11 #include "primitive_visitor"
12 #include "../colorfs"
13 
14 #include <cstdio> //FILE
15 
16 namespace tools {
17 namespace sg {
18 
19 class gl2ps_action : public render_action {
21 private:
22  gl2ps_action& get_me() {return *this;}
23 
24  static unsigned int _GL2PS_POINT() {return 2;}
25  static unsigned int _GL2PS_LINE() {return 3;}
26  static unsigned int _GL2PS_TRIANGLE() {return 5;}
27 public:
28  virtual void draw_vertex_array(gl::mode_t a_mode,
29  size_t a_floatn,
30  const float* a_xyzs){
31  m_pv.add_primitive(a_mode,a_floatn,a_xyzs);
32  }
33 
34  virtual void draw_vertex_array_xy(gl::mode_t a_mode,
35  size_t a_floatn,
36  const float* a_xys){
37  m_pv.add_primitive_xy(a_mode,a_floatn,a_xys);
38  }
39 
40  virtual void draw_vertex_color_array(gl::mode_t a_mode,
41  size_t a_floatn,
42  const float* a_xyzs,
43  const float* a_rgbas){
44  m_pv.add_primitive_rgba(a_mode,a_floatn,a_xyzs,a_rgbas);
45  }
46 
47  virtual void draw_vertex_normal_array(gl::mode_t a_mode,
48  size_t a_floatn,
49  const float* a_xyzs,
50  const float* a_nms){
51  m_pv.add_primitive_normal(a_mode,a_floatn,a_xyzs,a_nms);
52  }
53 
55  size_t a_floatn,
56  const float* a_xyzs,
57  const float* a_rgbas,
58  const float* a_nms){
59  // We expect a_nms of size : 3*(a_floatn/3)
60  // (then one normal per 3D point).
61  m_pv.add_primitive_normal_rgba(a_mode,a_floatn,a_xyzs,a_nms,a_rgbas);
62  }
63 
64  virtual void clear_color(float a_r,float a_g,float a_b,float /*a_a*/){
65  //a_a ?
66  set_background(a_r,a_g,a_b);
67  }
68  virtual void color4f(float a_r,float a_g,float a_b,float a_a){
69  m_color.set_value(a_r,a_g,a_b,a_a);
70  }
71  virtual void line_width(float a_v){m_line_width = a_v;}
72  virtual void point_size(float a_v) {m_point_size = a_v;}
73  virtual void set_polygon_offset(bool a_v) {m_POLYGON_OFFSET_FILL = a_v;}
74  virtual void normal(float a_x,float a_y,float a_z) {
75  m_normal.set_value(a_x,a_y,a_z);
76  }
77 
78  virtual void set_winding(winding_type a_v) {
79  m_ccw = (a_v==winding_ccw?true:false);
80  }
81 
82  virtual void set_shade_model(shade_type a_v) {
83  if(a_v==shade_smooth) {}
84  else {}
85  }
86 
87  virtual void set_depth_test(bool a_on) {m_DEPTH_TEST = a_on;}
88 
89  virtual void set_cull_face(bool a_on) {m_CULL_FACE = a_on;}
90  virtual void set_point_smooth(bool a_on) {m_POINT_SMOOTH = a_on;}
91  virtual void set_line_smooth(bool a_on) {m_LINE_SMOOTH = a_on;}
92 
93  virtual void load_proj_matrix(const mat4f& a_mtx) {m_proj = a_mtx;}
94  virtual void load_model_matrix(const mat4f& a_mtx) {
95  m_model = a_mtx;
97  }
98 
99  virtual unsigned int max_lights() {return 1000;}
100 
101  virtual void enable_light(unsigned int,
102  float a_dx,float a_dy,float a_dz,
103  float a_r,float a_g,float a_b,float a_a){
104  m_light_color.set_value(a_r,a_g,a_b,a_a);
105  m_light_direction.set_value(a_dx,a_dy,a_dz);
106  m_light_on = true;
107  }
108 
109  virtual void set_lighting(bool a_on) {m_light_on = a_on;}
110  virtual void set_blend(bool) {}
111 
112  virtual void restore_state(unsigned int /*a_ret_num_light*/) {
113  const sg::state& _state = state();
114  m_proj = _state.m_proj;
115  m_model = _state.m_model;
117 
118  m_color = _state.m_color;
119  m_ccw = (_state.m_winding==winding_ccw?true:false);
121  m_CULL_FACE = _state.m_GL_CULL_FACE;
124  m_point_size = _state.m_point_size;
125  m_line_width = _state.m_line_width;
126  m_light_on = _state.m_GL_LIGHTING;
127  m_DEPTH_TEST = _state.m_GL_DEPTH_TEST;
128  }
129 
133  virtual void draw_vertex_array_texture(gl::mode_t,size_t a_xyzn,const float* a_xyzs,
134  gstoid a_id,const float* a_tcs) {
135  img_byte img;
136  if(!m_mgr.find(a_id,img)) return;
137  m_pv.add_texture(m_out,a_xyzn,a_xyzs,img,a_tcs);
138  }
139 
141  size_t a_xyzn,
142  const float* a_xyzs,
143  const float* /*a_nms*/,
144  gstoid a_id,
145  const float* a_tcs) {
146  draw_vertex_array_texture(a_mode,a_xyzn,a_xyzs,a_id,a_tcs);
147  }
148 
152  virtual void begin_gsto(gstoid) {}
153  virtual void draw_gsto_v(gl::mode_t,size_t,bufpos){}
154  virtual void draw_gsto_vc(gl::mode_t,size_t,bufpos,bufpos) {}
155  virtual void draw_gsto_vn(gl::mode_t,size_t,bufpos,bufpos) {}
156  virtual void draw_gsto_vcn(gl::mode_t,size_t,bufpos,bufpos,bufpos) {}
157  virtual void end_gsto() {}
162 public:
163  gl2ps_action(gl2ps_manager& a_mgr,std::ostream& a_out,unsigned int a_ww,unsigned int a_wh)
164  :parent(a_out,a_ww,a_wh)
165  ,m_mgr(a_mgr)
166  ,m_FILE(0)
167  ,m_pv(get_me())
168  ,m_light_color(colorf_white())
169  ,m_light_direction(vec3f(0,0,-1))
170 
171  ,m_ccw(true)
172  ,m_POLYGON_OFFSET_FILL(false)
173  ,m_CULL_FACE(true)
174  ,m_POINT_SMOOTH(false)
175  ,m_LINE_SMOOTH(false)
176  ,m_point_size(1)
177  ,m_line_width(1)
178  ,m_light_on(false)
179  ,m_DEPTH_TEST(true)
180  {
181  m_back[0] = 1;
182  m_back[1] = 1;
183  m_back[2] = 1;
184 
185  m_vp_mtx.set_identity();
186  m_vp_mtx.mul_translate(float(m_ww)/2,float(m_wh)/2,0);
187  m_vp_mtx.mul_scale(float(m_ww)/2,float(m_wh)/2,1);
188 
189  //m_zb.change_size(a_ww,a_wh);
190 // m_zb.clear_color_buffer(0);
191 // m_zb.clear_depth_buffer();
192  m_proj.set_identity();
193  m_model.set_identity();
194  m_normal_matrix.set_identity();
195  }
196  virtual ~gl2ps_action(){}
197 protected:
198  gl2ps_action(const gl2ps_action& a_from)
199  :parent(a_from)
200  ,m_mgr(a_from.m_mgr)
201  ,m_FILE(0)
202 
203  ,m_vp_mtx(a_from.m_vp_mtx)
204  ,m_pv(a_from.m_pv)
207  ,m_normal(a_from.m_normal)
208 
209  ,m_proj(a_from.m_proj)
210  ,m_model(a_from.m_model)
212  ,m_color(a_from.m_color)
213  ,m_ccw(a_from.m_ccw)
215  ,m_CULL_FACE(a_from.m_CULL_FACE)
218  ,m_point_size(a_from.m_point_size)
219  ,m_line_width(a_from.m_line_width)
220  ,m_light_on(a_from.m_light_on)
221  ,m_DEPTH_TEST(a_from.m_DEPTH_TEST)
222  {
223  m_back[0] = a_from.m_back[0];
224  m_back[1] = a_from.m_back[1];
225  m_back[2] = a_from.m_back[2];
226  }
228  parent::operator=(a_from);
229  if(&a_from==this) return *this;
230  close();
231  m_back[0] = a_from.m_back[0];
232  m_back[1] = a_from.m_back[1];
233  m_back[2] = a_from.m_back[2];
234 
235  m_vp_mtx = a_from.m_vp_mtx;
236  m_pv = a_from.m_pv;
237  m_light_color = a_from.m_light_color;
239  m_normal = a_from.m_normal;
240 
241  m_proj = a_from.m_proj;
242  m_model = a_from.m_model;
244  m_color = a_from.m_color;
245  m_ccw = a_from.m_ccw;
247  m_CULL_FACE = a_from.m_CULL_FACE;
249  m_LINE_SMOOTH = a_from.m_LINE_SMOOTH;
250  m_point_size = a_from.m_point_size;
251  m_line_width = a_from.m_line_width;
252  m_light_on = a_from.m_light_on;
253  m_DEPTH_TEST = a_from.m_DEPTH_TEST;
254  return *this;
255  }
256 public:
257  bool open(const std::string& a_name,int a_format = TOOLS_GL2PS_EPS) {
258  if(m_FILE) return false;
259  m_FILE = ::fopen(a_name.c_str(),"w");
260  if(!m_FILE) {
261  m_out << "tools::sg::gl2ps_action::open :"
262  << " can't open file " << a_name << "."
263  << std::endl;
264  return false;
265  }
266 
267  int options = TOOLS_GL2PS_OCCLUSION_CULL
271  //int sort = TOOLS_GL2PS_NO_SORT;
272  //int sort = TOOLS_GL2PS_SIMPLE_SORT;
273  int sort = TOOLS_GL2PS_BSP_SORT;
274 
275  tools_GLint vp[4];
276  vp[0] = 0;
277  vp[1] = 0;
278  vp[2] = m_ww;
279  vp[3] = m_wh;
280 
281  int bufsize = 0;
282  ::tools_gl2psBeginPage("","tools_sg_write_gl2ps",
283  vp,a_format,sort,options,
284  TOOLS_GL_RGBA,0, NULL,0,0,0,bufsize,
285  m_FILE,a_name.c_str());
286 
287  ::tools_gl2psSetBackgroundColor(m_back[0],m_back[1],m_back[2]);
288 
289  m_vp_mtx.set_identity();
290  m_vp_mtx.mul_translate(float(m_ww)/2,float(m_wh)/2,0);
291  m_vp_mtx.mul_scale(float(m_ww)/2,float(m_wh)/2,1);
292 
293  return true;
294  }
295 
296  bool close() {
297  if(!m_FILE) return false;
299  ::fclose(m_FILE);
300  m_FILE = 0;
301  return true;
302  }
303  void set_background(float a_r,float a_g,float a_b) {
304  m_back[0] = a_r;
305  m_back[1] = a_g;
306  m_back[2] = a_b;
307  }
308 protected:
310  mat4f tmp(m_model);
311  tmp.no_translate();
312  if(!tmp.invert(m_normal_matrix)) {
313  m_out << "mem_action::set_normal_matrix : can't invert model matrix." << std::endl;
314  }
315  m_normal_matrix.transpose();
316  }
317 
318  bool project_point(float& a_x,float& a_y,float& a_z,float& a_w) {
319  a_w = 1;
320  m_model.mul_4f(a_x,a_y,a_z,a_w);
321  m_proj.mul_4f(a_x,a_y,a_z,a_w);
322  if(a_w==0) return false;
323  a_x /= a_w;
324  a_y /= a_w;
325  a_z /= a_w;
326  return true;
327  }
328 // bool project_normal(float& a_x,float& a_y,float& a_z) {
329 // m_normal_matrix.mul_dir_3f(a_x,a_y,a_z);
330 // //m_proj.mul_dir_3f(a_x,a_y,a_z); //?
331 // return true;
332 // }
333 
334  static void set_vtx(tools_GL2PSvertex* a_vs,unsigned int a_index,
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;
344  }
345 
346  class primvis : public primitive_visitor {
347  protected:
348  virtual bool project(float& a_x,float& a_y,float& a_z,float& a_w) {
349  return m_this.project_point(a_x,a_y,a_z,a_w);
350  }
351  virtual bool add_point(float a_x,float a_y,float a_z,float) {
352  float r = m_this.m_color[0];
353  float g = m_this.m_color[1];
354  float b = m_this.m_color[2];
355  float a = m_this.m_color[3];
356 
357  tools_GLint offset = 0;
358  tools_GLfloat ofactor = 0; //
359  tools_GLfloat ounits = 0; //
360  tools_GLushort pattern = 0;
361  tools_GLint factor = 0;
363  tools_GLint linecap = 0; //
364  tools_GLint linejoin = 0; //
365  char boundary = 0; //
366 
368 
369  m_this.m_vp_mtx.mul_3f(a_x,a_y,a_z);
370 
371  m_this.set_vtx(vertices,0, a_x,a_y,a_z, r,g,b,a);
372 
373  ::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
374  return true;
375  }
376 
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) {
379  tools_GLint offset = 0;
380  tools_GLfloat ofactor = 0; //
381  tools_GLfloat ounits = 0; //
382  tools_GLushort pattern = 0;
383  tools_GLint factor = 0;
385  tools_GLint linecap = 0; //
386  tools_GLint linejoin = 0; //
387  char boundary = 0; //
388 
390 
391  m_this.m_vp_mtx.mul_3f(a_x,a_y,a_z);
392 
393  m_this.set_vtx(vertices,0, a_x,a_y,a_z, a_r,a_g,a_b,a_a);
394 
395  //::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,0,pattern,factor,sz,0);
396  ::tools_gl2psAddPolyPrimitive(_GL2PS_POINT(),1,vertices,offset,ofactor,ounits,pattern,factor,sz,linecap,linejoin,boundary);
397  return true;
398  }
399 
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) {
402  float r = m_this.m_color[0];
403  float g = m_this.m_color[1];
404  float b = m_this.m_color[2];
405  float a = m_this.m_color[3];
406 
407  tools_GLint offset = 0;
408  tools_GLfloat ofactor = 0; //
409  tools_GLfloat ounits = 0; //
410  tools_GLushort pattern = 0;
411  tools_GLint factor = 0;
413  tools_GLint linecap = 0; //
414  tools_GLint linejoin = 0; //
415  char boundary = 0; //
416 
418 
419  m_this.m_vp_mtx.mul_3f(a_bx,a_by,a_bz);
420  m_this.m_vp_mtx.mul_3f(a_ex,a_ey,a_ez);
421 
422  m_this.set_vtx(vertices,0, a_bx,a_by,a_bz, r,g,b,a);
423  m_this.set_vtx(vertices,1, a_ex,a_ey,a_ez, r,g,b,a);
424 
425  //::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
426  ::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
427 
428  return true;
429  }
430 
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){
435 
436  tools_GLint offset = 0;
437  tools_GLfloat ofactor = 0; //
438  tools_GLfloat ounits = 0; //
439  tools_GLushort pattern = 0;
440  tools_GLint factor = 0;
442  tools_GLint linecap = 0; //
443  tools_GLint linejoin = 0; //
444  char boundary = 0; //
445 
447 
448  m_this.m_vp_mtx.mul_3f(a_bx,a_by,a_bz);
449  m_this.m_vp_mtx.mul_3f(a_ex,a_ey,a_ez);
450 
451  m_this.set_vtx(vertices,0, a_bx,a_by,a_bz, a_br,a_bg,a_bb,a_ba);
452  m_this.set_vtx(vertices,1, a_ex,a_ey,a_ez, a_er,a_eg,a_eb,a_ea);
453 
454  //tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,0,pattern,factor,lwidth,0);
455  ::tools_gl2psAddPolyPrimitive(_GL2PS_LINE(),2,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
456 
457  return true;
458  }
459 
460  virtual bool add_triangle(float a_p1x,float a_p1y,float a_p1z,float,
461  float a_p2x,float a_p2y,float a_p2z,float,
462  float a_p3x,float a_p3y,float a_p3z,float){
463  float r = m_this.m_color[0];
464  float g = m_this.m_color[1];
465  float b = m_this.m_color[2];
466  float a = m_this.m_color[3];
467 
468  tools_GLint offset = 0;
469  tools_GLfloat ofactor = 0; //
470  tools_GLfloat ounits = 0; //
471  tools_GLushort pattern = 0;
472  tools_GLint factor = 0;
474  tools_GLint linecap = 0; //
475  tools_GLint linejoin = 0; //
476  char boundary = 0; //
477 
479 
480  m_this.m_vp_mtx.mul_3f(a_p1x,a_p1y,a_p1z);
481  m_this.m_vp_mtx.mul_3f(a_p2x,a_p2y,a_p2z);
482  m_this.m_vp_mtx.mul_3f(a_p3x,a_p3y,a_p3z);
483 
484  m_this.set_vtx(vertices,0, a_p1x,a_p1y,a_p1z, r,g,b,a);
485  m_this.set_vtx(vertices,1, a_p2x,a_p2y,a_p2z, r,g,b,a);
486  m_this.set_vtx(vertices,2, a_p3x,a_p3y,a_p3z, r,g,b,a);
487 
488  //tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
489  ::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
490 
491  return true;
492  }
493 
494  virtual bool add_triangle(
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){
501 
502  tools_GLint offset = 0;
503  tools_GLfloat ofactor = 0; //
504  tools_GLfloat ounits = 0; //
505  tools_GLushort pattern = 0;
506  tools_GLint factor = 0;
508  tools_GLint linecap = 0; //
509  tools_GLint linejoin = 0; //
510  char boundary = 0; //
511 
513 
514  m_this.m_vp_mtx.mul_3f(a_p1x,a_p1y,a_p1z);
515  m_this.m_vp_mtx.mul_3f(a_p2x,a_p2y,a_p2z);
516  m_this.m_vp_mtx.mul_3f(a_p3x,a_p3y,a_p3z);
517 
518  m_this.set_vtx(vertices,0, a_p1x,a_p1y,a_p1z, a_r1,a_g1,a_b1,a_a1);
519  m_this.set_vtx(vertices,1, a_p2x,a_p2y,a_p2z, a_r2,a_g2,a_b2,a_a2);
520  m_this.set_vtx(vertices,2, a_p3x,a_p3y,a_p3z, a_r3,a_g3,a_b3,a_a3);
521 
522  //tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,0,pattern,factor,lwidth,0);
523  ::tools_gl2psAddPolyPrimitive(_GL2PS_TRIANGLE(),3,vertices,offset,ofactor,ounits,pattern,factor,lwidth,linecap,linejoin,boundary);
524 
525  return true;
526  }
527 
528  virtual bool project_normal(float& /*a_x*/,float& /*a_y*/,float& /*a_z*/) {
529  //return m_this.project_normal(a_x,a_y,a_z);
530  return true;
531  }
532  virtual bool add_point_normal(float a_x,float a_y,float a_z,float a_w,
533  float /*a_nx*/,float /*a_ny*/,float /*a_nz*/) {
534  add_point(a_x,a_y,a_z,a_w);
535  //m_this.m_points.add_normal(a_nx,a_ny,a_nz);
536  return true;
537  }
538  virtual bool add_point_normal(float a_x,float a_y,float a_z,float a_w,
539  float /*a_nx*/,float /*a_ny*/,float /*a_nz*/,
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);
542  //m_this.m_points.add_normal(a_nx,a_ny,a_nz);
543  return true;
544  }
545  virtual bool add_line_normal(float a_bx,float a_by,float a_bz,float a_bw,
546  float /*a_bnx*/,float /*a_bny*/,float /*a_bnz*/,
547  float a_ex,float a_ey,float a_ez,float a_ew,
548  float /*a_enx*/,float /*a_eny*/,float /*a_enz*/) {
549  add_line(a_bx,a_by,a_bz,a_bw, a_ex,a_ey,a_ez,a_ew);
550  //m_this.m_lines.add_normal(a_bnx,a_bny,a_bnz);
551  //m_this.m_lines.add_normal(a_enx,a_eny,a_enz);
552  return true;
553  }
554  virtual bool add_line_normal(float a_bx,float a_by,float a_bz,float a_bw,
555  float /*a_bnx*/,float /*a_bny*/,float /*a_bnz*/,
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 /*a_enx*/,float /*a_eny*/,float /*a_enz*/,
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);
561  //m_this.m_lines.add_normal(a_bnx,a_bny,a_bnz);
562  //m_this.m_lines.add_normal(a_enx,a_eny,a_enz);
563  return true;
564  }
565  virtual bool add_triangle_normal(
566  float a_p1x,float a_p1y,float a_p1z,float a_p1w,
567  float /*a_n1x*/,float /*a_n1y*/,float /*a_n1z*/,
568  float a_p2x,float a_p2y,float a_p2z,float a_p2w,
569  float /*a_n2x*/,float /*a_n2y*/,float /*a_n2z*/,
570  float a_p3x,float a_p3y,float a_p3z,float a_p3w,
571  float /*a_n3x*/,float /*a_n3y*/,float /*a_n3z*/) {
572  add_triangle(a_p1x,a_p1y,a_p1z,a_p1w,
573  a_p2x,a_p2y,a_p2z,a_p2w,
574  a_p3x,a_p3y,a_p3z,a_p3w);
575  //m_this.m_triangles.add_normal(a_n1x,a_n1y,a_n1z);
576  //m_this.m_triangles.add_normal(a_n2x,a_n2y,a_n2z);
577  //m_this.m_triangles.add_normal(a_n3x,a_n3y,a_n3z);
578  return true;
579  }
580  virtual bool add_triangle_normal(
581  float a_p1x,float a_p1y,float a_p1z,float a_p1w,
582  float /*a_n1x*/,float /*a_n1y*/,float /*a_n1z*/,
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 /*a_n2x*/,float /*a_n2y*/,float /*a_n2z*/,
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 /*a_n3x*/,float /*a_n3y*/,float /*a_n3z*/,
589  float a_r3,float a_g3,float a_b3,float a_a3){
590  add_triangle(a_p1x,a_p1y,a_p1z,a_p1w,
591  a_r1,a_g1,a_b1,a_a1,
592  a_p2x,a_p2y,a_p2z,a_p2w,
593  a_r2,a_g2,a_b2,a_a2,
594  a_p3x,a_p3y,a_p3z,a_p3w,
595  a_r3,a_g3,a_b3,a_a3);
596  //m_this.m_triangles.add_normal(a_n1x,a_n1y,a_n1z);
597  //m_this.m_triangles.add_normal(a_n2x,a_n2y,a_n2z);
598  //m_this.m_triangles.add_normal(a_n3x,a_n3y,a_n3z);
599  return true;
600  }
601  public:
602  primvis(gl2ps_action& a_this):m_this(a_this){}
603  virtual ~primvis(){}
604  public:
605  primvis(const primvis& a_from)
606  :primitive_visitor(a_from)
607  ,m_this(a_from.m_this)
608  {}
609  primvis& operator=(const primvis& a_from){
611  return *this;
612  }
613  protected:
615  };
616 
617 protected:
619  FILE* m_FILE;
620  float m_back[3];
623 
627 
628  // to be restored in restore_state() :
633  bool m_ccw;
642 };
643 
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;}
651  return false;
652 }
653 
654 }}
655 
656 #endif
tools::sg::gl2ps_manager::find
bool find(unsigned int a_id, img_byte &a_img)
Definition: gl2ps_manager:79
tools::sg::gl2ps_action::close
bool close()
Definition: gl2ps_action:296
tools::sg::gl2ps_action::restore_state
virtual void restore_state(unsigned int)
Definition: gl2ps_action:112
tools::sg::primitive_visitor::add_primitive_normal_rgba
bool add_primitive_normal_rgba(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_nms, const float *a_rgbas, bool a_stop=false)
Definition: primitive_visitor:1604
TOOLS_GL2PS_PGF
#define TOOLS_GL2PS_PGF
Definition: gl2ps_def.h:39
tools::img< unsigned char >
tools::sg::gl2ps_action::m_model
mat4f m_model
Definition: gl2ps_action:630
tools::sg::state
Definition: state:25
tools::sg::gl2ps_action::primvis::add_triangle
virtual bool add_triangle(float a_p1x, float a_p1y, float a_p1z, float, float a_r1, float a_g1, float a_b1, float a_a1, float a_p2x, float a_p2y, float a_p2z, float, float a_r2, float a_g2, float a_b2, float a_a2, float a_p3x, float a_p3y, float a_p3z, float, float a_r3, float a_g3, float a_b3, float a_a3)
Definition: gl2ps_action:494
tools::sg::gl2ps_action::m_back
float m_back[3]
Definition: gl2ps_action:620
primitive_visitor
tools::sg::gl2ps_action::end_gsto
virtual void end_gsto()
Definition: gl2ps_action:157
tools::sg::state::m_GL_LIGHTING
bool m_GL_LIGHTING
Definition: state:248
tools::sg::state::m_GL_DEPTH_TEST
bool m_GL_DEPTH_TEST
Definition: state:247
tools::sg::gl2ps_action::m_vp_mtx
mat4f m_vp_mtx
Definition: gl2ps_action:621
tools::sg::gl2ps_action::set_depth_test
virtual void set_depth_test(bool a_on)
Definition: gl2ps_action:87
tools::mat4f::mul_3f
void mul_3f(float &a_x, float &a_y, float &a_z) const
Definition: mat4f:58
TOOLS_GL2PS_EPS
#define TOOLS_GL2PS_EPS
Definition: gl2ps_def.h:35
tools::sg::gl2ps_action::primvis::add_point
virtual bool add_point(float a_x, float a_y, float a_z, float, float a_r, float a_g, float a_b, float a_a)
Definition: gl2ps_action:377
tools::sg::gl2ps_action::draw_vertex_normal_array
virtual void draw_vertex_normal_array(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_nms)
Definition: gl2ps_action:47
tools::sg::gl2ps_action::operator=
gl2ps_action & operator=(const gl2ps_action &a_from)
Definition: gl2ps_action:227
tools::sg::winding_ccw
@ winding_ccw
Definition: enums:105
tools::sg::gl2ps_action::begin_gsto
virtual void begin_gsto(gstoid)
VBO /////////////////////////////////////////////////////////.
Definition: gl2ps_action:152
tools::sg::gl2ps_action::primvis::operator=
primvis & operator=(const primvis &a_from)
Definition: gl2ps_action:609
tools::sg::state::m_point_size
float m_point_size
Definition: state:269
tools::sg::gl2ps_action::draw_vertex_array
virtual void draw_vertex_array(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs)
Definition: gl2ps_action:28
tools::sg::gl2ps_action::set_normal_matrix
void set_normal_matrix()
Definition: gl2ps_action:309
tools_gl2psBeginPage
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)
Definition: gl2ps:5927
tools::colorf
Definition: colorf:11
tools::sg::gl2ps_action::set_blend
virtual void set_blend(bool)
Definition: gl2ps_action:110
tools::vec3::set_value
void set_value(const T &a0, const T &a1, const T &a2)
Definition: vec3:92
tools::sg::gl2ps_action::render_manager
virtual sg::render_manager & render_manager()
Definition: gl2ps_action:161
tools::sg::gl2ps_action::primvis::add_line
virtual bool add_line(float a_bx, float a_by, float a_bz, float, float a_ex, float a_ey, float a_ez, float)
Definition: gl2ps_action:400
tools::sg::gl2ps_action::primvis
Definition: gl2ps_action:346
TOOLS_GL2PS_SILENT
#define TOOLS_GL2PS_SILENT
Definition: gl2ps_def.h:62
render_action
tools::sg::primitive_visitor::add_primitive
bool add_primitive(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, bool a_stop=false)
Definition: primitive_visitor:1518
tools::sg::state::m_GL_POLYGON_OFFSET_FILL
bool m_GL_POLYGON_OFFSET_FILL
Definition: state:250
tools::sg::gl2ps_action::draw_vertex_color_normal_array
virtual void draw_vertex_color_normal_array(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_rgbas, const float *a_nms)
Definition: gl2ps_action:54
tools::sg::gl2ps_action::m_line_width
float m_line_width
Definition: gl2ps_action:639
tools::sg::primitive_visitor::add_primitive_normal
bool add_primitive_normal(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_nms, bool a_stop=false)
Definition: primitive_visitor:1576
tools::sg::gl2ps_manager
Definition: gl2ps_manager:14
tools::sg::gl2ps_action::m_pv
primvis m_pv
Definition: gl2ps_action:622
tools::sg::state::m_GL_CULL_FACE
bool m_GL_CULL_FACE
Definition: state:249
tools::sg::gl2ps_action::m_point_size
float m_point_size
Definition: gl2ps_action:638
tools::sg::win_action::m_wh
unsigned int m_wh
Definition: win_action:38
tools::sg::gl2ps_action::color4f
virtual void color4f(float a_r, float a_g, float a_b, float a_a)
Definition: gl2ps_action:68
tools::sg::gl2ps_action::draw_gsto_vc
virtual void draw_gsto_vc(gl::mode_t, size_t, bufpos, bufpos)
Definition: gl2ps_action:154
tools::sg::shade_type
shade_type
Definition: enums:197
tools::mat4::mul_translate
void mul_translate(const T &a_x, const T &a_y, const T &a_z)
Definition: mat4:272
tools::sg::gl2ps_action::max_lights
virtual unsigned int max_lights()
Definition: gl2ps_action:99
tools::sg::gl2ps_action::primvis::~primvis
virtual ~primvis()
Definition: gl2ps_action:603
tools::sg::gl2ps_action::m_POINT_SMOOTH
bool m_POINT_SMOOTH
Definition: gl2ps_action:636
tools::sg::state::m_winding
winding_type m_winding
Definition: state:258
tools::sg::win_action::m_ww
unsigned int m_ww
Definition: win_action:37
tools::sg::s2format
bool s2format(const std::string &a_format, int &a_gl2ps_format)
Definition: gl2ps_action:644
tools::sg::gl2ps_action::draw_vertex_color_array
virtual void draw_vertex_color_array(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_rgbas)
Definition: gl2ps_action:40
tools::sg::primitive_visitor::add_primitive_rgba
bool add_primitive_rgba(gl::mode_t a_mode, size_t a_floatn, const float *a_xyzs, const float *a_rgbas, bool a_stop=false)
Definition: primitive_visitor:1546
tools::sg::primitive_visitor::add_texture
void add_texture(std::ostream &a_out, size_t a_xyzn, const float *a_xyzs, const img_byte &a_img, const float *a_tcs)
Definition: primitive_visitor:2047
tools::sg::gl2ps_action::~gl2ps_action
virtual ~gl2ps_action()
Definition: gl2ps_action:196
tools::sg::state::m_GL_POINT_SMOOTH
bool m_GL_POINT_SMOOTH
Definition: state:252
tools::sg::gl2ps_action::point_size
virtual void point_size(float a_v)
Definition: gl2ps_action:72
tools::sg::gl2ps_action::primvis::primvis
primvis(gl2ps_action &a_this)
Definition: gl2ps_action:602
TOOLS_GL2PS_TEX
#define TOOLS_GL2PS_TEX
Definition: gl2ps_def.h:36
tools::mat4f::mul_4f
void mul_4f(float &a_x, float &a_y, float &a_z, float &a_w) const
Definition: mat4f:61
tools::sg::render_action::gstoid
unsigned int gstoid
Definition: render_action:27
tools::sg::gl2ps_action::gl2ps_action
gl2ps_action(const gl2ps_action &a_from)
Definition: gl2ps_action:198
tools::sg::gl2ps_action::primvis::add_triangle_normal
virtual bool add_triangle_normal(float a_p1x, float a_p1y, float a_p1z, float a_p1w, float, float, float, float a_r1, float a_g1, float a_b1, float a_a1, float a_p2x, float a_p2y, float a_p2z, float a_p2w, float, float, float, float a_r2, float a_g2, float a_b2, float a_a2, float a_p3x, float a_p3y, float a_p3z, float a_p3w, float, float, float, float a_r3, float a_g3, float a_b3, float a_a3)
Definition: gl2ps_action:580
tools_GL2PSvertex
Definition: gl2ps_def.h:112
tools_GL2PSvertex::rgba
tools_GL2PSrgba rgba
Definition: gl2ps_def.h:114
tools::sg::gl2ps_action::draw_gsto_vn
virtual void draw_gsto_vn(gl::mode_t, size_t, bufpos, bufpos)
Definition: gl2ps_action:155
tools_GLfloat
float tools_GLfloat
Definition: gl2ps_def.h:9
tools::sg::action::m_out
std::ostream & m_out
Definition: action:55
tools::sg::gl2ps_action::draw_vertex_array_texture
virtual void draw_vertex_array_texture(gl::mode_t, size_t a_xyzn, const float *a_xyzs, gstoid a_id, const float *a_tcs)
texture /////////////////////////////////////////////////////
Definition: gl2ps_action:133
tools::sg::gl2ps_action::primvis::project
virtual bool project(float &a_x, float &a_y, float &a_z, float &a_w)
Definition: gl2ps_action:348
TOOLS_GL2PS_BSP_SORT
#define TOOLS_GL2PS_BSP_SORT
Definition: gl2ps_def.h:45
tools_gl2psEndPage
TOOLS_GL2PSDLL_API tools_GLint tools_gl2psEndPage(void)
Definition: gl2ps:6119
tools::sg::gl2ps_action::m_DEPTH_TEST
bool m_DEPTH_TEST
Definition: gl2ps_action:641
tools::sg::gl2ps_action::gl2ps_action
gl2ps_action(gl2ps_manager &a_mgr, std::ostream &a_out, unsigned int a_ww, unsigned int a_wh)
Definition: gl2ps_action:163
tools::sg::render_manager
Definition: render_manager:16
tools::sg::gl2ps_action::draw_vertex_normal_array_texture
virtual void draw_vertex_normal_array_texture(gl::mode_t a_mode, size_t a_xyzn, const float *a_xyzs, const float *, gstoid a_id, const float *a_tcs)
Definition: gl2ps_action:140
TOOLS_GL2PS_DRAW_BACKGROUND
#define TOOLS_GL2PS_DRAW_BACKGROUND
Definition: gl2ps_def.h:60
tools::sg::primitive_visitor::operator=
primitive_visitor & operator=(const primitive_visitor &)
Definition: primitive_visitor:61
tools::sg::gl2ps_action::m_CULL_FACE
bool m_CULL_FACE
Definition: gl2ps_action:635
TOOLS_ACTION
#define TOOLS_ACTION(a__class, a__sclass, a__parent)
Definition: action:60
tools::sg::gl2ps_action::line_width
virtual void line_width(float a_v)
Definition: gl2ps_action:71
tools::sg::state::m_GL_LINE_SMOOTH
bool m_GL_LINE_SMOOTH
Definition: state:253
tools::sg::gl2ps_action::m_color
colorf m_color
Definition: gl2ps_action:632
tools::sg::gl2ps_action::draw_gsto_v
virtual void draw_gsto_v(gl::mode_t, size_t, bufpos)
Definition: gl2ps_action:153
tools::sg::gl2ps_action::set_background
void set_background(float a_r, float a_g, float a_b)
Definition: gl2ps_action:303
tools::sg::gl2ps_action::primvis::primvis
primvis(const primvis &a_from)
Definition: gl2ps_action:605
tools::sg::gl2ps_action::m_light_color
colorf m_light_color
Definition: gl2ps_action:624
tools::sg::gl2ps_action::load_proj_matrix
virtual void load_proj_matrix(const mat4f &a_mtx)
Definition: gl2ps_action:93
tools::sg::gl2ps_action
Definition: gl2ps_action:19
tools::vec3f
Definition: vec3f:13
tools::sg::render_action
Definition: render_action:24
TOOLS_GL2PS_PS
#define TOOLS_GL2PS_PS
Definition: gl2ps_def.h:34
tools::sg::gl2ps_action::m_light_on
bool m_light_on
Definition: gl2ps_action:640
tools::gl::mode_t
unsigned char mode_t
Definition: glprims:14
tools::sg::gl2ps_action::primvis::add_line
virtual bool add_line(float a_bx, float a_by, float a_bz, float, float a_br, float a_bg, float a_bb, float a_ba, float a_ex, float a_ey, float a_ez, float, float a_er, float a_eg, float a_eb, float a_ea)
Definition: gl2ps_action:431
tools::sg::gl2ps_action::primvis::add_point_normal
virtual bool add_point_normal(float a_x, float a_y, float a_z, float a_w, float, float, float, float a_r, float a_g, float a_b, float a_a)
Definition: gl2ps_action:538
tools::sg::gl2ps_action::primvis::add_triangle_normal
virtual bool add_triangle_normal(float a_p1x, float a_p1y, float a_p1z, float a_p1w, float, float, float, float a_p2x, float a_p2y, float a_p2z, float a_p2w, float, float, float, float a_p3x, float a_p3y, float a_p3z, float a_p3w, float, float, float)
Definition: gl2ps_action:565
tools::sg::gl2ps_action::set_shade_model
virtual void set_shade_model(shade_type a_v)
Definition: gl2ps_action:82
gl2ps_manager
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::mat4::mul_scale
void mul_scale(const T &a_sx, const T &a_sy, const T &a_sz)
Definition: mat4:234
tools::sg::gl2ps_action::m_light_direction
vec3f m_light_direction
Definition: gl2ps_action:625
tools::sg::gl2ps_action::draw_gsto_vcn
virtual void draw_gsto_vcn(gl::mode_t, size_t, bufpos, bufpos, bufpos)
Definition: gl2ps_action:156
tools::sg::state::m_proj
mat4f m_proj
Definition: state:244
tools::sg::gl2ps_action::set_winding
virtual void set_winding(winding_type a_v)
Definition: gl2ps_action:78
tools::vec4::set_value
void set_value(const T &a0, const T &a1, const T &a2, const T &a3)
Definition: vec4:100
tools::sg::winding_type
winding_type
Definition: enums:104
tools::sg::state::m_model
mat4f m_model
Definition: state:245
tools::mat4f
Definition: mat4f:12
tools::sg::gl2ps_action::set_point_smooth
virtual void set_point_smooth(bool a_on)
Definition: gl2ps_action:90
tools::sg::gl2ps_action::set_polygon_offset
virtual void set_polygon_offset(bool a_v)
Definition: gl2ps_action:73
tools::sg::gl2ps_action::set_lighting
virtual void set_lighting(bool a_on)
Definition: gl2ps_action:109
tools::sg::gl2ps_action::primvis::add_triangle
virtual bool add_triangle(float a_p1x, float a_p1y, float a_p1z, float, float a_p2x, float a_p2y, float a_p2z, float, float a_p3x, float a_p3y, float a_p3z, float)
Definition: gl2ps_action:460
tools::sg::gl2ps_action::load_model_matrix
virtual void load_model_matrix(const mat4f &a_mtx)
Definition: gl2ps_action:94
TOOLS_GL2PS_PDF
#define TOOLS_GL2PS_PDF
Definition: gl2ps_def.h:37
tools::sg::gl2ps_action::m_proj
mat4f m_proj
Definition: gl2ps_action:629
tools::sg::gl2ps_action::m_LINE_SMOOTH
bool m_LINE_SMOOTH
Definition: gl2ps_action:637
tools::sg::bufpos
size_t bufpos
Definition: render_action:22
tools::sg::gl2ps_action::m_normal_matrix
mat4f m_normal_matrix
Definition: gl2ps_action:631
tools::sg::state::m_line_width
float m_line_width
Definition: state:267
tools::sg::gl2ps_action::m_normal
vec3f m_normal
Definition: gl2ps_action:626
tools::sg::state::m_color
colorf m_color
Definition: state:259
tools::sg::gl2ps_action::open
bool open(const std::string &a_name, int a_format=TOOLS_GL2PS_EPS)
Definition: gl2ps_action:257
tools::sg::gl2ps_action::draw_vertex_array_xy
virtual void draw_vertex_array_xy(gl::mode_t a_mode, size_t a_floatn, const float *a_xys)
Definition: gl2ps_action:34
tools::sg::gl2ps_action::primvis::add_line_normal
virtual bool add_line_normal(float a_bx, float a_by, float a_bz, float a_bw, float, float, float, float a_br, float a_bg, float a_bb, float a_ba, float a_ex, float a_ey, float a_ez, float a_ew, float, float, float, float a_er, float a_eg, float a_eb, float a_ea)
Definition: gl2ps_action:554
tools_GL2PSvertex::xyz
tools_GL2PSxyz xyz
Definition: gl2ps_def.h:113
tools::sg::states::state
const sg::state & state() const
Definition: states:76
tools::sg::gl2ps_action::set_line_smooth
virtual void set_line_smooth(bool a_on)
Definition: gl2ps_action:91
tools::sg::gl2ps_action::primvis::add_point_normal
virtual bool add_point_normal(float a_x, float a_y, float a_z, float a_w, float, float, float)
Definition: gl2ps_action:532
tools::sg::gl2ps_action::primvis::m_this
gl2ps_action & m_this
Definition: gl2ps_action:614
tools::mat4::no_translate
void no_translate()
Definition: mat4:155
tools::sg::gl2ps_action::primvis::add_line_normal
virtual bool add_line_normal(float a_bx, float a_by, float a_bz, float a_bw, float, float, float, float a_ex, float a_ey, float a_ez, float a_ew, float, float, float)
Definition: gl2ps_action:545
tools::sg::gl2ps_action::primvis::add_point
virtual bool add_point(float a_x, float a_y, float a_z, float)
Definition: gl2ps_action:351
tools::sg::shade_smooth
@ shade_smooth
Definition: enums:199
TOOLS_GL2PS_SVG
#define TOOLS_GL2PS_SVG
Definition: gl2ps_def.h:38
TOOLS_GL2PS_OCCLUSION_CULL
#define TOOLS_GL2PS_OCCLUSION_CULL
Definition: gl2ps_def.h:64
tools::sg::gl2ps_action::enable_light
virtual void enable_light(unsigned int, float a_dx, float a_dy, float a_dz, float a_r, float a_g, float a_b, float a_a)
Definition: gl2ps_action:101
tools::sg::gl2ps_action::project_point
bool project_point(float &a_x, float &a_y, float &a_z, float &a_w)
Definition: gl2ps_action:318
TOOLS_GL_RGBA
#define TOOLS_GL_RGBA
Definition: gl2ps_def.h:143
tools::sg::gl2ps_action::primvis::project_normal
virtual bool project_normal(float &, float &, float &)
Definition: gl2ps_action:528
tools::sg::primitive_visitor
Definition: primitive_visitor:20
tools::sg::gl2ps_action::m_FILE
FILE * m_FILE
Definition: gl2ps_action:619
tools::sg::gl2ps_action::m_mgr
gl2ps_manager & m_mgr
Definition: gl2ps_action:618
tools::sg::gl2ps_action::m_ccw
bool m_ccw
Definition: gl2ps_action:633
tools::sg::gl2ps_action::m_POLYGON_OFFSET_FILL
bool m_POLYGON_OFFSET_FILL
Definition: gl2ps_action:634
tools_GLushort
unsigned short tools_GLushort
Definition: gl2ps_def.h:12
tools::sg::gl2ps_action::clear_color
virtual void clear_color(float a_r, float a_g, float a_b, float)
Definition: gl2ps_action:64
tools::sg::primitive_visitor::add_primitive_xy
bool add_primitive_xy(gl::mode_t a_mode, size_t a_floatn, const float *a_xys, bool a_stop=false, bool a_triangle_revert=false)
Definition: primitive_visitor:1937
TOOLS_GL2PS_BEST_ROOT
#define TOOLS_GL2PS_BEST_ROOT
Definition: gl2ps_def.h:63
tools::sg::gl2ps_action::set_vtx
static void set_vtx(tools_GL2PSvertex *a_vs, unsigned int a_index, float a_x, float a_y, float a_z, float a_r, float a_g, float a_b, float a_a)
Definition: gl2ps_action:334
tools::sg::gl2ps_action::set_cull_face
virtual void set_cull_face(bool a_on)
Definition: gl2ps_action:89
tools_GLint
int tools_GLint
Definition: gl2ps_def.h:7
tools_gl2psAddPolyPrimitive
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)
Definition: gl2ps:2231
tools::sg::vertices
Definition: vertices:22
tools::sg::gl2ps_action::normal
virtual void normal(float a_x, float a_y, float a_z)
Definition: gl2ps_action:74