g4tools  5.4.0
markers
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_markers
5 #define tools_sg_markers
6 
7 #include "node"
8 
9 #include "sf_enum"
10 #include "mf"
11 #include "render_action"
12 #include "pick_action"
13 #include "bbox_action"
14 #include "../mathf"
15 #include "../lina/vec2f"
16 #include "../lina/geom2"
17 
18 namespace tools {
19 namespace sg {
20 
21 class markers : public node {
23 public:
25  mf<float> xyzs; //[x,y,z]
26  sf<float> size; //horizontal size in pixels.
27 public:
28  virtual const desc_fields& node_desc_fields() const {
30  static const desc_fields s_v(parent::node_desc_fields(),3, //WARNING : take care of count.
34  );
35  return s_v;
36  }
37 private:
38  void add_fields(){
39  add_field(&style);
40  add_field(&xyzs);
41  add_field(&size);
42  }
43 public:
44  virtual bool draw_in_frame_buffer() const {return true;}
45 
46  virtual void render(render_action& a_action) {
47  size_t num = xyzs.size()/3;
48  if(!num) return;
49 
50  //NOTE : gstos would not work because of project_point() that must be done at each render().
51 
52  const state& state = a_action.state();
53 
54  const std::vector<float>& _xyzs = xyzs.values();
55 
56  std::vector<float> pts;
57 
58  float sx = size.value()/float(state.m_ww); //in [-1,1]
59  float hsx = sx*0.5f;
60 
61  float sy = size.value()/float(state.m_wh); //in [-1,1]
62  float hsy = sy*0.5f;
63 
64  float rad = hsx;
65  float hsx2 = hsx*0.5f;
66  float hsy2 = hsy*0.5f;
67 
68  float x,y,z,w;
69 
70  bool filled = false;
71  if(style.value()==marker_circle_line) {
72  unsigned int segs = 16;
73  float _cos[16];float _sin[16];
74  float dtheta = ftwo_pi()/float(segs);
75  float theta = dtheta;
76  {for(unsigned int i=0;i<segs;i++,theta+=dtheta) {_cos[i] = rad*fcos(theta);_sin[i] = rad*fsin(theta);}}
77  float xprev,yprev,xnext,ynext;
78  std::vector<float>::const_iterator it;
79  for(it=_xyzs.begin();it!=_xyzs.end();){
80  x = *it;it++;
81  y = *it;it++;
82  z = *it;it++;
83  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
84  xprev = x+rad;
85  yprev = y;
86  for(unsigned int i=0;i<segs;i++) {
87  xnext = x+_cos[i];
88  ynext = y+_sin[i];
89  _add(pts,xprev,yprev,z);
90  _add(pts,xnext,ynext,z);
91  xprev = xnext;
92  yprev = ynext;
93  }
94  }
95 
96  } else if(style.value()==marker_circle_filled) {
97  //} else if((style.value()==marker_circle_filled)||(style.value()==marker_dot)) {
98  filled = true;
99  unsigned int segs = 16;
100  float _cos[16];float _sin[16];
101  float dtheta = ftwo_pi()/float(segs);
102  float theta = dtheta;
103  {for(unsigned int i=0;i<segs;i++,theta+=dtheta) {_cos[i] = rad*fcos(theta);_sin[i] = rad*fsin(theta);}}
104  float xprev,yprev,xnext,ynext;
105  std::vector<float>::const_iterator it;
106  for(it=_xyzs.begin();it!=_xyzs.end();){
107  x = *it;it++;
108  y = *it;it++;
109  z = *it;it++;
110  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
111  xprev = x+rad;
112  yprev = y;
113  for(unsigned int i=0;i<segs;i++) {
114  xnext = x+_cos[i];
115  ynext = y+_sin[i];
116  _add(pts,x ,y ,z);
117  _add(pts,xprev,yprev,z);
118  _add(pts,xnext,ynext,z);
119  xprev = xnext;
120  yprev = ynext;
121  }
122  }
123 
124  } else if(style.value()==marker_square_line) {
125  std::vector<float>::const_iterator it;
126  for(it=_xyzs.begin();it!=_xyzs.end();){
127  x = *it;it++;
128  y = *it;it++;
129  z = *it;it++;
130  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
131  _add(pts, x-hsx,y-hsy,z);
132  _add(pts, x+hsx,y-hsy,z);
133 
134  _add(pts, x+hsx,y-hsy,z);
135  _add(pts, x+hsx,y+hsy,z);
136 
137  _add(pts, x+hsx,y+hsy,z);
138  _add(pts, x-hsx,y+hsy,z);
139 
140  _add(pts, x-hsx,y+hsy,z);
141  _add(pts, x-hsx,y-hsy,z);
142  }
143  //} else if(style.value()==marker_square_filled) {
144  } else if((style.value()==marker_square_filled)||(style.value()==marker_dot)) {
145  filled = true;
146  std::vector<float>::const_iterator it;
147  for(it=_xyzs.begin();it!=_xyzs.end();){
148  x = *it;it++;
149  y = *it;it++;
150  z = *it;it++;
151  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
152  _add(pts, x-hsx,y-hsy,z);
153  _add(pts, x+hsx,y-hsy,z);
154  _add(pts, x+hsx,y+hsy,z);
155 
156  _add(pts, x-hsx,y-hsy,z);
157  _add(pts, x+hsx,y+hsy,z);
158  _add(pts, x-hsx,y+hsy,z);
159  }
160 
161  } else if(style.value()==marker_triangle_up_line) {
162  std::vector<float>::const_iterator it;
163  for(it=_xyzs.begin();it!=_xyzs.end();){
164  x = *it;it++;
165  y = *it;it++;
166  z = *it;it++;
167  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
168  _add(pts, x-hsx,y-hsy,z);
169  _add(pts, x+hsx,y-hsy,z);
170 
171  _add(pts, x+hsx,y-hsy,z);
172  _add(pts, x ,y+hsy,z);
173 
174  _add(pts, x ,y+hsy,z);
175  _add(pts, x-hsx,y-hsy,z);
176  }
177  } else if(style.value()==marker_triangle_up_filled) {
178  filled = true;
179  std::vector<float>::const_iterator it;
180  for(it=_xyzs.begin();it!=_xyzs.end();){
181  x = *it;it++;
182  y = *it;it++;
183  z = *it;it++;
184  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
185  _add(pts, x-hsx,y-hsy,z);
186  _add(pts, x+hsx,y-hsy,z);
187  _add(pts, x ,y+hsy,z);
188  }
189 
190  } else if(style.value()==marker_triangle_down_line) {
191  std::vector<float>::const_iterator it;
192  for(it=_xyzs.begin();it!=_xyzs.end();){
193  x = *it;it++;
194  y = *it;it++;
195  z = *it;it++;
196  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
197  _add(pts, x-hsx,y+hsy,z);
198  _add(pts, x ,y-hsy,z);
199 
200  _add(pts, x ,y-hsy,z);
201  _add(pts, x+hsx,y+hsy,z);
202 
203  _add(pts, x+hsx,y+hsy,z);
204  _add(pts, x-hsx,y+hsy,z);
205  }
206  } else if(style.value()==marker_triangle_down_filled) {
207  filled = true;
208  std::vector<float>::const_iterator it;
209  for(it=_xyzs.begin();it!=_xyzs.end();){
210  x = *it;it++;
211  y = *it;it++;
212  z = *it;it++;
213  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
214  _add(pts, x-hsx,y+hsy,z);
215  _add(pts, x ,y-hsy,z);
216  _add(pts, x+hsx,y+hsy,z);
217  }
218 
219  } else if(style.value()==marker_diamond_line) {
220  std::vector<float>::const_iterator it;
221  for(it=_xyzs.begin();it!=_xyzs.end();){
222  x = *it;it++;
223  y = *it;it++;
224  z = *it;it++;
225  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
226  _add(pts, x ,y-hsy,z);
227  _add(pts, x+hsx, y,z);
228 
229  _add(pts, x+hsx, y,z);
230  _add(pts, x ,y+hsy,z);
231 
232  _add(pts, x ,y+hsy,z);
233  _add(pts, x-hsx,y ,z);
234 
235  _add(pts, x-hsx,y ,z);
236  _add(pts, x ,y-hsy,z);
237  }
238  } else if(style.value()==marker_diamond_filled) {
239  filled = true;
240  std::vector<float>::const_iterator it;
241  for(it=_xyzs.begin();it!=_xyzs.end();){
242  x = *it;it++;
243  y = *it;it++;
244  z = *it;it++;
245  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
246  _add(pts, x ,y-hsy,z);
247  _add(pts, x+hsx, y,z);
248  _add(pts, x ,y+hsy,z);
249 
250  _add(pts, x ,y+hsy,z);
251  _add(pts, x-hsx,y ,z);
252  _add(pts, x ,y-hsy,z);
253  }
254 
255  } else if(style.value()==marker_swiss_cross_line) {
256  std::vector<float>::const_iterator it;
257  for(it=_xyzs.begin();it!=_xyzs.end();){
258  x = *it;it++;
259  y = *it;it++;
260  z = *it;it++;
261  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
262  _add(pts, x-hsx2,y-hsy,z);
263  _add(pts, x+hsx2,y-hsy,z);
264 
265  _add(pts, x+hsx2,y-hsy ,z);
266  _add(pts, x+hsx2,y-hsy2,z);
267 
268  _add(pts, x+hsx2,y-hsy2,z);
269  _add(pts, x+hsx ,y-hsy2,z);
270 
271  _add(pts, x+hsx ,y-hsy2,z);
272  _add(pts, x+hsx ,y+hsy2,z);
273 
274  _add(pts, x+hsx ,y+hsy2,z);
275  _add(pts, x+hsx2,y+hsy2,z);
276 
277  _add(pts, x+hsx2,y+hsy2,z);
278  _add(pts, x+hsx2,y+hsy ,z);
279 
280  _add(pts, x+hsx2,y+hsy ,z);
281  _add(pts, x-hsx2,y+hsy ,z);
282 
283  _add(pts, x-hsx2,y+hsy ,z);
284  _add(pts, x-hsx2,y+hsy2,z);
285 
286  _add(pts, x-hsx2,y+hsy2,z);
287  _add(pts, x-hsx ,y+hsy2,z);
288 
289  _add(pts, x-hsx ,y+hsy2,z);
290  _add(pts, x-hsx ,y-hsy2,z);
291 
292  _add(pts, x-hsx ,y-hsy2,z);
293  _add(pts, x-hsx2,y-hsy2,z);
294 
295  _add(pts, x-hsx2,y-hsy2,z);
296  _add(pts, x-hsx2,y-hsy, z);
297  }
298  } else if(style.value()==marker_swiss_cross_filled) {
299  filled = true;
300  std::vector<float>::const_iterator it;
301  for(it=_xyzs.begin();it!=_xyzs.end();){
302  x = *it;it++;
303  y = *it;it++;
304  z = *it;it++;
305  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
306  _add(pts, x-hsx2,y-hsy,z);
307  _add(pts, x+hsx2,y-hsy,z);
308  _add(pts, x+hsx2,y+hsy,z);
309 
310  _add(pts, x+hsx2,y+hsy,z);
311  _add(pts, x-hsx2,y+hsy,z);
312  _add(pts, x-hsx2,y-hsy,z);
313 
314  _add(pts, x-hsx ,y-hsy2,z);
315  _add(pts, x+hsx ,y-hsy2,z);
316  _add(pts, x+hsx ,y+hsy2,z);
317 
318  _add(pts, x+hsx ,y+hsy2,z);
319  _add(pts, x-hsx ,y+hsy2,z);
320  _add(pts, x-hsx ,y-hsy2,z);
321  }
322 
323  } else if(style.value()==marker_david_star_line) {
324  std::vector<float>::const_iterator it;
325  for(it=_xyzs.begin();it!=_xyzs.end();){
326  x = *it;it++;
327  y = *it;it++;
328  z = *it;it++;
329  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
330  _add(pts, x-hsx,y-hsy2,z);
331  _add(pts, x+hsx,y-hsy2,z);
332 
333  _add(pts, x+hsx,y-hsy2,z);
334  _add(pts, x ,y+hsy ,z);
335 
336  _add(pts, x ,y+hsy ,z);
337  _add(pts, x-hsx,y-hsy2,z);
338 
339  _add(pts, x+hsx,y+hsy2,z);
340  _add(pts, x-hsx,y+hsy2,z);
341 
342  _add(pts, x-hsx,y+hsy2,z);
343  _add(pts, x ,y-hsy ,z);
344 
345  _add(pts, x ,y-hsy ,z);
346  _add(pts, x+hsx,y+hsy2,z);
347  }
348  } else if(style.value()==marker_david_star_filled) {
349  filled = true;
350  std::vector<float>::const_iterator it;
351  for(it=_xyzs.begin();it!=_xyzs.end();){
352  x = *it;it++;
353  y = *it;it++;
354  z = *it;it++;
355  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
356  _add(pts, x-hsx,y-hsy2,z);
357  _add(pts, x+hsx,y-hsy2,z);
358  _add(pts, x ,y+hsy ,z);
359 
360  _add(pts, x+hsx,y+hsy2,z);
361  _add(pts, x-hsx,y+hsy2,z);
362  _add(pts, x ,y-hsy ,z);
363  }
364 
365  } else if(style.value()==marker_penta_star_line) {
366  float _cos[5];float _sin[5];
367  float dtheta = ftwo_pi()/5.0f;
368  float theta = fhalf_pi();
369  {for(unsigned int i=0;i<5;i++,theta+=dtheta) {_cos[i] = rad*fcos(theta);_sin[i] = rad*fsin(theta);}}
370  std::vector<float>::const_iterator it;
371  for(it=_xyzs.begin();it!=_xyzs.end();){
372  x = *it;it++;
373  y = *it;it++;
374  z = *it;it++;
375  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
376  _add(pts, x+_cos[0],y+_sin[0] ,z);
377  _add(pts, x+_cos[2],y+_sin[2] ,z);
378 
379  _add(pts, x+_cos[2],y+_sin[2] ,z);
380  _add(pts, x+_cos[4],y+_sin[4] ,z);
381 
382  _add(pts, x+_cos[4],y+_sin[4] ,z);
383  _add(pts, x+_cos[1],y+_sin[1] ,z);
384 
385  _add(pts, x+_cos[1],y+_sin[1] ,z);
386  _add(pts, x+_cos[3],y+_sin[3] ,z);
387 
388  _add(pts, x+_cos[3],y+_sin[3] ,z);
389  _add(pts, x+_cos[0],y+_sin[0] ,z);
390  }
391  } else if(style.value()==marker_penta_star_filled) {
392  filled = true;
393  float _cos[5];float _sin[5];
394  float dtheta = ftwo_pi()/5.0f;
395  float theta = fhalf_pi();
396  {for(unsigned int i=0;i<5;i++,theta+=dtheta) {_cos[i] = rad*fcos(theta);_sin[i] = rad*fsin(theta);}}
397  vec2f i3;
398  {vec2f p1(_cos[2],_sin[2]);
399  vec2f q1(_cos[4],_sin[4]);
400  vec2f p2(_cos[3],_sin[3]);
401  vec2f q2(_cos[0],_sin[0]);
402  if(!intersect(p1,q1,p2,q2,i3)) {}}
403  vec2f i4;
404  {vec2f p1(_cos[1],_sin[1]);
405  vec2f q1(_cos[4],_sin[4]);
406  vec2f p2(_cos[3],_sin[3]);
407  vec2f q2(_cos[0],_sin[0]);
408  if(!intersect(p1,q1,p2,q2,i4)) {}}
409  vec2f i0;
410  {vec2f p1(_cos[1],_sin[1]);
411  vec2f q1(_cos[4],_sin[4]);
412  vec2f p2(_cos[0],_sin[0]);
413  vec2f q2(_cos[2],_sin[2]);
414  if(!intersect(p1,q1,p2,q2,i0)) {}}
415  std::vector<float>::const_iterator it;
416  for(it=_xyzs.begin();it!=_xyzs.end();){
417  x = *it;it++;
418  y = *it;it++;
419  z = *it;it++;
420  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
421  _add(pts, x+_cos[0],y+_sin[0] ,z);
422  _add(pts, x+_cos[2],y+_sin[2] ,z);
423  _add(pts, x+ i3.x(),y+ i3.y() ,z);
424 
425  _add(pts, x+_cos[1],y+_sin[1] ,z);
426  _add(pts, x+_cos[3],y+_sin[3] ,z);
427  _add(pts, x+ i4.x(),y+ i4.y() ,z);
428 
429  _add(pts, x+ i0.x(),y+ i0.y() ,z);
430  _add(pts, x+_cos[2],y+_sin[2] ,z);
431  _add(pts, x+_cos[4],y+_sin[4] ,z);
432  }
433 
434  } else if(style.value()==marker_plus) {
435  std::vector<float>::const_iterator it;
436  for(it=_xyzs.begin();it!=_xyzs.end();){
437  x = *it;it++;
438  y = *it;it++;
439  z = *it;it++;
440  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
441  _add(pts, x-hsx,y,z);
442  _add(pts, x+hsx,y,z);
443  _add(pts, x ,y-hsy,z);
444  _add(pts, x ,y+hsy,z);
445  }
446  } else if(style.value()==marker_asterisk) {
447  std::vector<float>::const_iterator it;
448  for(it=_xyzs.begin();it!=_xyzs.end();){
449  x = *it;it++;
450  y = *it;it++;
451  z = *it;it++;
452  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
453  _add(pts, x ,y-hsy ,z);
454  _add(pts, x ,y+hsy ,z);
455  _add(pts, x-hsx,y-hsy2,z);
456  _add(pts, x+hsx,y+hsy2,z);
457  _add(pts, x-hsx,y+hsy2,z);
458  _add(pts, x+hsx,y-hsy2,z);
459  }
460  } else if(style.value()==marker_star) {
461  std::vector<float>::const_iterator it;
462  for(it=_xyzs.begin();it!=_xyzs.end();){
463  x = *it;it++;
464  y = *it;it++;
465  z = *it;it++;
466  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
467  _add(pts, x ,y-hsy ,z);
468  _add(pts, x ,y+hsy ,z);
469  _add(pts, x-hsx,y-hsy2,z);
470  _add(pts, x+hsx,y+hsy2,z);
471  _add(pts, x-hsx,y+hsy2,z);
472  _add(pts, x+hsx,y-hsy2,z);
473  _add(pts, x-hsx,y ,z);
474  _add(pts, x+hsx,y ,z);
475  }
476  } else if(style.value()==marker_minus) {
477  std::vector<float>::const_iterator it;
478  for(it=_xyzs.begin();it!=_xyzs.end();){
479  x = *it;it++;
480  y = *it;it++;
481  z = *it;it++;
482  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
483  _add(pts, x-hsx,y,z);
484  _add(pts, x+hsx,y,z);
485  }
486  } else { //marker_cross.
487  std::vector<float>::const_iterator it;
488  for(it=_xyzs.begin();it!=_xyzs.end();){
489  x = *it;it++;
490  y = *it;it++;
491  z = *it;it++;
492  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
493  _add(pts, x-hsx,y-hsy,z);
494  _add(pts, x+hsx,y+hsy,z);
495  _add(pts, x+hsx,y-hsy,z);
496  _add(pts, x-hsx,y+hsy,z);
497  }
498  }
499 
500  a_action.load_matrices_to_identity();
501 
502  //Same logic as Inventor SoLightModel.model = BASE_COLOR.
503  a_action.set_lighting(false);
504  a_action.draw_vertex_array(filled?gl::triangles():gl::lines(),pts);
505  a_action.set_lighting(a_action.state().m_GL_LIGHTING);
506  a_action.load_matrices_from_state();
507  }
508 
509  virtual void pick(pick_action& a_action) {
510  size_t num = xyzs.size()/3;
511  if(!num) return;
512 
513  state& state = a_action.state();
514 
515  const std::vector<float>& _xyzs = xyzs.values();
516 
517  std::vector<float> pts;
518 
519  float sx = size.value()/float(state.m_ww); //in [-1,1]
520  float hsx = sx*0.5f;
521 
522  float sy = size.value()/float(state.m_wh); //in [-1,1]
523  float hsy = sy*0.5f;
524 
525  float x,y,z,w;
526 
527  std::vector<float>::const_iterator it;
528  for(it=_xyzs.begin();it!=_xyzs.end();){
529  x = *it;it++;
530  y = *it;it++;
531  z = *it;it++;
532 
533  a_action.project_point(x,y,z,w); //in [-1,1][-1,1]
534 
535  _add(pts, x-hsx,y-hsy,z); //in [-1,1][-1,1]
536  _add(pts, x+hsx,y+hsy,z);
537  _add(pts, x+hsx,y-hsy,z);
538  _add(pts, x-hsx,y+hsy,z);
539  }
540 
541  a_action.set_matrices_to_identity();
542  a_action.add__lines(*this,pts);
543  a_action.set_matrices_from_state();
544  }
545 
546  virtual void bbox(bbox_action& a_action) {
547  const std::vector<float>& _xyzs = xyzs.values();
548  float x,y,z;
549  std::vector<float>::const_iterator it;
550  for(it=_xyzs.begin();it!=_xyzs.end();){
551  x = *it;it++;
552  y = *it;it++;
553  z = *it;it++;
554  a_action.add_one_point(x,y,z);
555  }
556  }
557 public:
559  :parent()
561  ,size(10)
562  {
563 #ifdef TOOLS_MEM
564  mem::increment(s_class().c_str());
565 #endif
566  add_fields();
567  }
568  virtual ~markers(){
569 #ifdef TOOLS_MEM
570  mem::decrement(s_class().c_str());
571 #endif
572  }
573 public:
574  markers(const markers& a_from)
575  :parent(a_from)
576  ,style(a_from.style)
577  ,xyzs(a_from.xyzs)
578  ,size(a_from.size)
579  {
580 #ifdef TOOLS_MEM
581  mem::increment(s_class().c_str());
582 #endif
583  add_fields();
584  }
585  markers& operator=(const markers& a_from){
586  parent::operator=(a_from);
587  style = a_from.style;
588  xyzs = a_from.xyzs;
589  size = a_from.size;
590  return *this;
591  }
592 public:
593  template <class VEC>
594  void add(const VEC& a_v) {
595  xyzs.add(a_v.x());
596  xyzs.add(a_v.y());
597  xyzs.add(a_v.z());
598  }
599  void add(float a_x,float a_y,float a_z) {
600  xyzs.add(a_x);
601  xyzs.add(a_y);
602  xyzs.add(a_z);
603  }
604  bool add(const std::vector<float>& a_v) {
605  std::vector<float>::size_type _number = a_v.size()/3;
606  if(3*_number!=a_v.size()) return false;
607  std::vector<float>::const_iterator it;
608  for(it=a_v.begin();it!=a_v.end();it+=3) {
609  xyzs.add(*(it+0));
610  xyzs.add(*(it+1));
611  xyzs.add(*(it+2));
612  }
613  return true;
614  }
615  size_t number() const {return xyzs.size()/3;}
616  void clear() {xyzs.clear();}
617 protected:
618  void _add(std::vector<float>& a_v,float a_x,float a_y,float a_z) {
619  a_v.push_back(a_x);
620  a_v.push_back(a_y);
621  a_v.push_back(a_z);
622  }
623 };
624 
625 }}
626 
627 #endif
tools::sg::marker_swiss_cross_filled
@ marker_swiss_cross_filled
Definition: enums:32
tools::sg::marker_plus
@ marker_plus
Definition: enums:19
tools::sg::markers::add
void add(const VEC &a_v)
Definition: markers:594
node
tools::sg::markers
Definition: markers:21
tools::sg::marker_david_star_filled
@ marker_david_star_filled
Definition: enums:30
tools::vec2f
Definition: vec2f:13
tools::sg::marker_circle_line
@ marker_circle_line
Definition: enums:23
tools::sg::render_action::draw_vertex_array
virtual void draw_vertex_array(gl::mode_t, size_t, const float *)=0
tools::sg::state
Definition: state:25
tools::sg::render_action::set_lighting
virtual void set_lighting(bool)=0
tools::sg::state::m_GL_LIGHTING
bool m_GL_LIGHTING
Definition: state:248
tools::sg::marker_minus
@ marker_minus
Definition: enums:39
tools::gl::triangles
mode_t triangles()
Definition: glprims:20
tools::vec2::x
const T & x() const
Definition: vec2:73
tools::sg::bmf::add
void add(const T &a_value)
Definition: bmf:73
tools::sg::marker_triangle_up_filled
@ marker_triangle_up_filled
Definition: enums:26
tools::sg::markers::_add
void _add(std::vector< float > &a_v, float a_x, float a_y, float a_z)
Definition: markers:618
pick_action
tools::sg::marker_penta_star_filled
@ marker_penta_star_filled
Definition: enums:38
render_action
tools::sg::marker_triangle_down_line
@ marker_triangle_down_line
Definition: enums:27
tools::sg::marker_cross
@ marker_cross
Definition: enums:21
tools::sg::node
Definition: node:28
tools::gl::lines
mode_t lines()
Definition: glprims:17
tools::sg::bbox_action
Definition: bbox_action:15
TOOLS_NODE
#define TOOLS_NODE(a__class, a__sclass, a__parent)
Definition: node:324
tools::sg::primitive_visitor::add_one_point
void add_one_point(float a_x, float a_y, float a_z)
Definition: primitive_visitor:63
mf
tools::sg::marker_swiss_cross_line
@ marker_swiss_cross_line
Definition: enums:31
tools::sg::marker_star
@ marker_star
Definition: enums:22
tools::fcos
float fcos(const float &x)
Definition: mathf:42
tools::sg::marker_triangle_down_filled
@ marker_triangle_down_filled
Definition: enums:28
tools::sg::marker_dot
@ marker_dot
Definition: enums:18
tools::sg::pick_action::set_matrices_from_state
void set_matrices_from_state()
Definition: pick_action:330
tools::sg::marker_penta_star_line
@ marker_penta_star_line
Definition: enums:37
tools::sg::desc_fields
Definition: field_desc:148
tools::sg::bmf::values
const std::vector< T > & values() const
Definition: bmf:71
tools::intersect
bool intersect(const VEC2 &P1, const VEC2 &Q1, const VEC2 &P2, const VEC2 &Q2, VEC2 &a_out)
Definition: geom2:93
tools::sg::markers::operator=
markers & operator=(const markers &a_from)
Definition: markers:585
tools::sg::pick_action
Definition: pick_action:59
tools::sg::pick_action::set_matrices_to_identity
void set_matrices_to_identity()
Definition: pick_action:326
tools::sg::state::m_wh
unsigned int m_wh
Definition: state:242
tools::sg::mf< float >
tools::sg::markers::number
size_t number() const
Definition: markers:615
tools::sg::style
Definition: style:19
tools::sg::sf_enum< marker_style >
tools::sg::markers::clear
void clear()
Definition: markers:616
tools::sg::markers::size
sf< float > size
Definition: markers:26
tools::sg::marker_circle_filled
@ marker_circle_filled
Definition: enums:24
tools::sg::markers::pick
virtual void pick(pick_action &a_action)
Definition: markers:509
tools::sg::marker_square_line
@ marker_square_line
Definition: enums:35
tools::sg::render_action
Definition: render_action:24
tools::sg::markers::bbox
virtual void bbox(bbox_action &a_action)
Definition: markers:546
tools::sg::marker_david_star_line
@ marker_david_star_line
Definition: enums:29
tools::sg::markers::markers
markers()
Definition: markers:558
tools::sg::matrix_action::project_point
bool project_point(float &a_x, float &a_y, float &a_z, float &a_w)
Definition: matrix_action:78
sf_enum
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::sg::bmf::clear
void clear()
Definition: bmf:108
tools::sg::marker_diamond_filled
@ marker_diamond_filled
Definition: enums:34
tools::sg::node::add_field
void add_field(field *a_field)
Definition: node:128
tools::sg::markers::markers
markers(const markers &a_from)
Definition: markers:574
tools::fhalf_pi
float fhalf_pi()
Definition: mathf:13
tools::ftwo_pi
float ftwo_pi()
Definition: mathf:12
tools::sg::markers::~markers
virtual ~markers()
Definition: markers:568
tools::vec2::y
const T & y() const
Definition: vec2:74
tools::sg::state::m_ww
unsigned int m_ww
Definition: state:241
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::pick_action::add__lines
bool add__lines(sg::node &a_node, const std::vector< float > &a_xyzs, bool a_stop=false)
Definition: pick_action:518
tools::sg::render_action::load_matrices_from_state
void load_matrices_from_state()
Definition: render_action:95
tools::sg::markers::render
virtual void render(render_action &a_action)
Definition: markers:46
tools::sg::marker_triangle_up_line
@ marker_triangle_up_line
Definition: enums:25
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::fsin
float fsin(const float &x)
Definition: mathf:43
tools::sg::markers::add
void add(float a_x, float a_y, float a_z)
Definition: markers:599
tools::sg::bmf::size
size_t size() const
Definition: bmf:69
tools::sg::states::state
const sg::state & state() const
Definition: states:76
tools::sg::marker_diamond_line
@ marker_diamond_line
Definition: enums:33
tools::sg::markers::node_desc_fields
virtual const desc_fields & node_desc_fields() const
Definition: markers:28
tools::sg::marker_asterisk
@ marker_asterisk
Definition: enums:20
tools::sg::render_action::load_matrices_to_identity
void load_matrices_to_identity()
Definition: render_action:91
tools::sg::marker_square_filled
@ marker_square_filled
Definition: enums:36
tools::sg::markers::draw_in_frame_buffer
virtual bool draw_in_frame_buffer() const
Definition: markers:44
tools::sg::sf< float >
tools::sg::markers::add
bool add(const std::vector< float > &a_v)
Definition: markers:604
tools::sg::markers::style
sf_enum< marker_style > style
Definition: markers:24
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71
bbox_action
tools::sg::markers::xyzs
mf< float > xyzs
Definition: markers:25