4 #ifndef tools_sg_atb_vertices
5 #define tools_sg_atb_vertices
23 static const desc_fields s_v(parent::node_desc_fields(),5,
33 parent::protocol_one_fields(a_fields);
35 removep<field>(a_fields,_draw_edges);
50 std::vector<float> gsto_data;
67 size_t pos_edges = gsto_data.size();
71 float* pedges = vec_data<float>(gsto_data)+pos_edges;
74 for(
size_t itri=0;itri<ntri;itri++) {
76 *pedges = *(pxyz+0);pedges++;
77 *pedges = *(pxyz+1);pedges++;
78 *pedges = *(pxyz+2);pedges++;
80 *pedges = *(pxyz+3);pedges++;
81 *pedges = *(pxyz+4);pedges++;
82 *pedges = *(pxyz+5);pedges++;
85 *pedges = *(pxyz+3);pedges++;
86 *pedges = *(pxyz+4);pedges++;
87 *pedges = *(pxyz+5);pedges++;
89 *pedges = *(pxyz+6);pedges++;
90 *pedges = *(pxyz+7);pedges++;
91 *pedges = *(pxyz+8);pedges++;
94 *pedges = *(pxyz+6);pedges++;
95 *pedges = *(pxyz+7);pedges++;
96 *pedges = *(pxyz+8);pedges++;
98 *pedges = *(pxyz+0);pedges++;
99 *pedges = *(pxyz+1);pedges++;
100 *pedges = *(pxyz+2);pedges++;
129 if(*(it+3)!=1) {m_all_a_one =
false;
break;}
146 bool restore_blend = check_set_blend(a_action);
159 pos_nms = pos_xyzs+sz*
sizeof(float);
160 pos_back_xyzs = pos_nms+sz*
sizeof(float);
161 pos_back_nms = pos_back_xyzs+sz*
sizeof(float);
162 pos_rgbas = pos_back_nms+sz*
sizeof(float);
165 pos_nms = pos_xyzs+sz*
sizeof(float);
166 pos_rgbas = pos_nms+sz*
sizeof(float);
169 pos_edges = pos_rgbas+npt*4*
sizeof(float);
200 bufpos pos_rgbas = npt*3*
sizeof(float);
211 if(restore_blend) a_action.
set_blend(
true);
217 bufpos pos_nms = npt*3*
sizeof(float);
254 bool restore_blend = check_set_blend(a_action);
294 if(restore_blend) a_action.
set_blend(
true);
334 mem::increment(s_class().c_str());
340 mem::decrement(s_class().c_str());
359 mem::increment(s_class().c_str());
364 parent::operator=(a_from);
376 void add_pos_color(
float a_x,
float a_y,
float a_z,
float a_r,
float a_g,
float a_b,
float a_a) {
386 template <
class COLOR>
397 template <
class VEC,
class COLOR>
415 template <
class VEC,
class COLOR>
430 template <
class VEC,
class COLOR>
453 template <
class VEC,
class COLOR>
473 void add_rgba(
float a_r,
float a_g,
float a_b,
float a_a) {
500 v[a_pos] = a_r;a_pos++;
501 v[a_pos] = a_g;a_pos++;
502 v[a_pos] = a_b;a_pos++;
503 v[a_pos] = a_a;a_pos++;
508 v[a_pos] = a_x;a_pos++;
509 v[a_pos] = a_y;a_pos++;
510 v[a_pos] = a_z;a_pos++;
525 float a_ex,
float a_ey,
float a_ez,
526 unsigned int a_num_dash,
527 float a_r,
float a_g,
float a_b,
float a_a) {
528 if(!parent::add_dashed_line(a_bx,a_by,a_bz,a_ex,a_ey,a_ez,a_num_dash))
return false;
529 for(
unsigned int index=0;index<a_num_dash;index++) {
551 if(_xyzs.empty())
return;
564 {std::vector<float>::const_iterator it = _xyzs.begin()+3;
565 std::vector<float>::const_iterator _end = _xyzs.end();
566 std::vector<float>::const_iterator itn = _nms.begin()+3;
567 std::vector<float>::reverse_iterator it2 =
m_back_xyzs.rbegin();
568 for(;it!=_end;it2+=3) {
569 *(it2+2) = *it - *itn * epsil; it++;itn++;
570 *(it2+1) = *it - *itn * epsil; it++;itn++;
571 *(it2+0) = *it - *itn * epsil; it++;itn++;
578 {std::vector<float>::const_iterator it = _nms.begin()+3;
579 std::vector<float>::const_iterator _end = _nms.end();
580 std::vector<float>::reverse_iterator it2 =
m_back_nms.rbegin();
581 for(;it!=_end;it2+=3) {
582 *(it2+2) = *it * -1.0f; it++;
583 *(it2+1) = *it * -1.0f; it++;
584 *(it2+0) = *it * -1.0f; it++;
589 {std::vector<float>::const_iterator it = _xyzs.begin();
590 std::vector<float>::const_iterator _end = _xyzs.end();
591 std::vector<float>::const_iterator itn = _nms.begin();
592 std::vector<float>::reverse_iterator it2 =
m_back_xyzs.rbegin();
593 for(;it!=_end;it2+=3) {
594 *(it2+2) = *it - *itn * epsil; it++;itn++;
595 *(it2+1) = *it - *itn * epsil; it++;itn++;
596 *(it2+0) = *it - *itn * epsil; it++;itn++;
599 {std::vector<float>::const_iterator it = _nms.begin();
600 std::vector<float>::const_iterator _end = _nms.end();
601 std::vector<float>::reverse_iterator it2 =
m_back_nms.rbegin();
602 for(;it!=_end;it2+=3) {
603 *(it2+2) = *it * -1.0f; it++;
604 *(it2+1) = *it * -1.0f; it++;
605 *(it2+0) = *it * -1.0f; it++;
617 if(_xyzs.empty())
return;
619 m_edges.resize(2*_xyzs.size(),0);
622 float* pedges = vec_data<float>(
m_edges);
626 for(
size_t itri=0;itri<ntri;itri++) {
628 *pedges = *(pxyz+0);pedges++;
629 *pedges = *(pxyz+1);pedges++;
630 *pedges = *(pxyz+2);pedges++;
632 *pedges = *(pxyz+3);pedges++;
633 *pedges = *(pxyz+4);pedges++;
634 *pedges = *(pxyz+5);pedges++;
637 *pedges = *(pxyz+3);pedges++;
638 *pedges = *(pxyz+4);pedges++;
639 *pedges = *(pxyz+5);pedges++;
641 *pedges = *(pxyz+6);pedges++;
642 *pedges = *(pxyz+7);pedges++;
643 *pedges = *(pxyz+8);pedges++;
646 *pedges = *(pxyz+6);pedges++;
647 *pedges = *(pxyz+7);pedges++;
648 *pedges = *(pxyz+8);pedges++;
650 *pedges = *(pxyz+0);pedges++;
651 *pedges = *(pxyz+1);pedges++;
652 *pedges = *(pxyz+2);pedges++;
661 bool restore_blend =
false;
677 restore_blend =
true;
680 return restore_blend;