17 typedef typename VEC3::elem_t
T_t;
38 if(
is_empty()) {a_center.set_value(0,0,0);
return false;}
46 if( a_mn[0]>a_mx[0] || a_mn[1]>a_mx[1] || a_mn[2]>a_mx[2])
return false;
53 if( a_mn_x>a_mx_x || a_mn_y>a_mx_y || a_mn_z>a_mx_z )
return false;
54 m_min.set_value(a_mn_x,a_mn_y,a_mn_z);
55 m_max.set_value(a_mx_x,a_mx_y,a_mx_z);
60 if(
is_empty()) {a_dx = 0;a_dy = 0;a_dz = 0;
return false;}
72 bool back(VEC3& a_min,VEC3& a_min_y,VEC3& a_min_xy,VEC3& a_min_x)
const {
74 if(!
get_size(dx,dy,dz))
return false;
83 bool front(VEC3& a_max,VEC3& a_max_x,VEC3& a_max_xy,VEC3& a_max_y)
const {
85 if(!
get_size(dx,dy,dz))
return false;
100 m_min.set_value(min_of<T_t>(a_point[0],
m_min[0]),
101 min_of<T_t>(a_point[1],
m_min[1]),
102 min_of<T_t>(a_point[2],
m_min[2]));
103 m_max.set_value(max_of<T_t>(a_point[0],
m_max[0]),
104 max_of<T_t>(a_point[1],
m_max[1]),
105 max_of<T_t>(a_point[2],
m_max[2]));
116 min_of<T_t>(a_y,
m_min[1]),
117 min_of<T_t>(a_z,
m_min[2]));
119 max_of<T_t>(a_y,
m_max[1]),
120 max_of<T_t>(a_z,
m_max[2]));
125 if(!
get_size(a_dx,a_dy,a_dz))
return false;
126 if((a_dx<=
zero())&&(a_dy<=
zero())&&(a_dz<=
zero()))
return false;
127 if((a_dx<=
zero())&&(a_dy<=
zero())) {
128 a_dx =
T_t(0.1)*a_dz;
129 a_dy =
T_t(0.1)*a_dz;
130 }
else if((a_dy<=
zero())&&(a_dz<=
zero())) {
131 a_dy =
T_t(0.1)*a_dx;
132 a_dz =
T_t(0.1)*a_dx;
133 }
else if((a_dz<=
zero())&&(a_dx<=
zero())) {
134 a_dz =
T_t(0.1)*a_dy;
135 a_dx =
T_t(0.1)*a_dy;
137 }
else if(a_dx<=
zero()) {
138 a_dx =
T_t(0.1)*a_sqrt(a_dy*a_dy+a_dz*a_dz);
139 }
else if(a_dy<=
zero()) {
140 a_dy =
T_t(0.1)*a_sqrt(a_dx*a_dx+a_dz*a_dz);
141 }
else if(a_dz<=
zero()) {
142 a_dz =
T_t(0.1)*a_sqrt(a_dx*a_dx+a_dy*a_dy);
148 void dump(std::ostream& a_out) {
151 a_out <<
"box is empty." << std::endl;
153 a_out <<
" size " << dx <<
" " << dy <<
" " << dz << std::endl;
155 a_out <<
" min " <<
m_min[0] <<
" " <<
m_min[1] <<
" " <<
m_min[2] << std::endl;
156 a_out <<
" max " <<
m_max[0] <<
" " <<
m_max[1] <<
" " <<
m_max[2] << std::endl;
159 a_out <<
" center " << c[0] <<
" " << c[1] <<
" " << c[2] << std::endl;