Go to the documentation of this file.
4 #ifndef tools_sg_polyhedron
5 #define tools_sg_polyhedron
15 #include "../hep/sf_polyhedron"
33 static const desc_fields s_v(parent::node_desc_fields(),4,
65 const std::vector<float>& coords = item.
m_coords;
66 const std::vector<float>& norms = item.
m_norms;
67 if(coords.empty())
continue;
68 if(norms.size()!=coords.size()) {
69 a_out <<
"tools::sg::polyhedron::create_gsto :"
70 <<
" bad number of normals."
74 sz += coords.size()+norms.size();
80 float* buffer =
new float[sz];
81 char* pos = (
char*)buffer;
86 size_t _sz =
m_xyzs.size()*
sizeof(float);
87 ::memcpy(pos,vec_data<float>(
m_xyzs),_sz);
99 const std::vector<float>& coords = item.
m_coords;
100 const std::vector<float>& norms = item.
m_norms;
101 if(coords.empty())
continue;
102 if(norms.size()!=coords.size())
continue;
104 item.
m_size = coords.size();
107 size_t _sz = coords.size()*
sizeof(float);
108 ::memcpy(pos,vec_data<float>(coords),_sz);
113 size_t _sz = norms.size()*
sizeof(float);
114 ::memcpy(pos,vec_data<float>(norms),_sz);
144 bool draw_edges =
false;
151 (draw_edges &&
m_xyzs.empty()) ||
159 unsigned int _id = 0;
177 if(draw_edges &&
m_size) {
223 const std::vector<float>& coords = item.
m_coords;
224 if(coords.empty())
continue;
225 const std::vector<float>& norms = item.
m_norms;
226 if(norms.size()!=coords.size()) {
227 a_action.
out() <<
"tools::sg::polyhedron::render :"
228 <<
" bad number of normals."
264 const std::vector<float>& coords = item.
m_coords;
284 const std::vector<float>& coords = item.
m_coords;
323 parent::operator=(a_from);
357 std::vector<double> doubles;
376 vec3d* vertex = pV+index;
378 doubles.push_back((*vertex)[0]);
379 doubles.push_back((*vertex)[1]);
380 doubles.push_back((*vertex)[2]);
382 }
while (notLastEdge);
393 }
while (notLastFace);
401 float pvex,pvey,pvez;
412 int prevEdgeFlag = edgeFlag;
414 bool firstEdge =
true;
418 vec3d* vertex = pV+index;
423 pvbx = (float)(*vertex)[0];
424 pvby = (float)(*vertex)[1];
425 pvbz = (float)(*vertex)[2];
429 prevEdgeFlag = edgeFlag;
431 if(edgeFlag!=prevEdgeFlag) {
433 pvbx = (float)(*vertex)[0];
434 pvby = (float)(*vertex)[1];
435 pvbz = (float)(*vertex)[2];
437 pvex = (float)(*vertex)[0];
438 pvey = (float)(*vertex)[1];
439 pvez = (float)(*vertex)[2];
449 prevEdgeFlag = edgeFlag;
452 pvex = (float)(*vertex)[0];
453 pvey = (float)(*vertex)[1];
454 pvez = (float)(*vertex)[2];
471 }
while (notLastEdge);
472 }
while (notLastFace);
#define TOOLS_NODE(a__class, a__sclass, a__parent)
#define tools_vforit(a__T, a__v, a__it)
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
#define tools_vforcit(a__T, a__v, a__it)
#define TOOLS_ARG_FIELD_DESC(a__field)