Go to the documentation of this file.
4 #ifndef tools_sg_vertices
5 #define tools_sg_vertices
31 static const desc_fields s_v(parent::node_desc_fields(),2,
60 bool restore_blend = check_set_blend(a_action);
75 if(restore_blend) a_action.
set_blend(
true);
87 bool restore_blend = check_set_blend(a_action);
101 if(restore_blend) a_action.
set_blend(
true);
123 mem::increment(s_class().c_str());
129 mem::decrement(s_class().c_str());
140 mem::increment(s_class().c_str());
145 parent::operator=(a_from);
155 void add(
const VEC& a_v) {
160 void add(
float a_x,
float a_y,
float a_z) {
167 v[a_pos] = a_x;a_pos++;
168 v[a_pos] = a_y;a_pos++;
169 v[a_pos] = a_z;a_pos++;
172 bool add(
const std::vector<float>& a_v) {
173 std::vector<float>::size_type _number = a_v.size()/3;
174 if(3*_number!=a_v.size())
return false;
175 std::vector<float>::const_iterator it;
176 for(it=a_v.begin();it!=a_v.end();it+=3) {
188 float a_ex,
float a_ey,
float a_ez,
189 unsigned int a_num_dash) {
191 if(!a_num_dash)
return false;
194 float fac = 1.0f/float(2*a_num_dash-1);
195 float sx = (a_ex-a_bx)*fac;
196 float sy = (a_ey-a_by)*fac;
197 float sz = (a_ez-a_bz)*fac;
199 float two_sx = sx*2.0f;
200 float two_sy = sy*2.0f;
201 float two_sz = sz*2.0f;
207 for(
unsigned int idash=0;idash<a_num_dash;idash++) {
209 add(px+sx,py+sy,pz+sz);
218 std::vector<float>::size_type _number = v.size()/3;
219 if(!_number)
return true;
220 if(3*_number!=v.size())
return false;
224 {
for(std::vector<float>::const_iterator it=v.begin();it!=v.end();it+=3) {
229 x_mean /= float(_number);
230 y_mean /= float(_number);
231 z_mean /= float(_number);
232 {
for(std::vector<float>::iterator it=v.begin();it!=v.end();it+=3) {
246 action.set_stop_at_first(
true);
247 action.matrix_action::operator=(a_action);
248 int old_cur =
action.cur();
250 if(
action.cur()!=old_cur)
return false;
251 if(!
action.node())
return false;
258 bool restore_blend =
false;
263 restore_blend =
true;
266 return restore_blend;
#define TOOLS_NODE(a__class, a__sclass, a__parent)
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
#define TOOLS_ARG_FIELD_DESC(a__field)