38 #ifndef FCL_CCD_INTERVAL_VECTOR_INL_H
39 #define FCL_CCD_INTERVAL_VECTOR_INL_H
48 struct IVector3<double>;
52 IVector3<double>
bound(
const IVector3<double>& i,
const Vector3<double>& v);
56 IVector3<double>
bound(
const IVector3<double>& i,
const IVector3<double>& v);
83 setValue(xl, xu, yl, yu, zl, zu);
101 template <
typename S>
104 setValue(v1, v2, v3);
108 template <
typename S>
115 template <
typename S>
124 template <
typename S>
133 template <
typename S>
136 i_[0].setValue(xl, xu);
137 i_[1].setValue(yl, yu);
138 i_[2].setValue(zl, zu);
142 template <
typename S>
145 i_[0].setValue(v[0][0], v[0][1]);
146 i_[1].setValue(v[1][0], v[1][1]);
147 i_[2].setValue(v[2][0], v[2][1]);
151 template <
typename S>
160 template <
typename S>
169 template <
typename S>
172 i_[0].setValue(v[0]);
173 i_[1].setValue(v[1]);
174 i_[2].setValue(v[2]);
178 template <
typename S>
181 i_[0].setValue(v[0]);
182 i_[1].setValue(v[1]);
183 i_[2].setValue(v[2]);
187 template <
typename S>
194 template <
typename S>
197 return IVector3(i_[0] + other.
i_[0], i_[1] + other.
i_[1], i_[2] + other.
i_[2]);
201 template <
typename S>
211 template <
typename S>
214 return IVector3(i_[0] - other.
i_[0], i_[1] - other.
i_[1], i_[2] - other.
i_[2]);
218 template <
typename S>
228 template <
typename S>
231 return i_[0] * other.
i_[0] + i_[1] * other.
i_[1] + i_[2] * other.
i_[2];
235 template <
typename S>
238 return IVector3(i_[1] * other.
i_[2] - i_[2] * other.
i_[1],
239 i_[2] * other.
i_[0] - i_[0] * other.
i_[2],
240 i_[0] * other.
i_[1] - i_[1] * other.
i_[0]);
244 template <
typename S>
247 return i_[0] * other[0] + i_[1] * other[1] + i_[2] * other[2];
251 template <
typename S>
258 template <
typename S>
265 template <
typename S>
268 return Vector3<S>(i_[0][0], i_[1][0], i_[2][0]);
272 template <
typename S>
275 return Vector3<S>(i_[0][1], i_[1][1], i_[2][1]);
279 template <
typename S>
282 return IVector3(i_[1] * other[2] - i_[2] * other[1],
283 i_[2] * other[0] - i_[0] * other[2],
284 i_[0] * other[1] - i_[1] * other[0]);
288 template <
typename S>
291 return i_[0].diameter() * i_[1].diameter() * i_[2].diameter();
295 template <
typename S>
298 std::cout <<
"[" << i_[0][0] <<
"," << i_[0][1] <<
"]" << std::endl;
299 std::cout <<
"[" << i_[1][0] <<
"," << i_[1][1] <<
"]" << std::endl;
300 std::cout <<
"[" << i_[2][0] <<
"," << i_[2][1] <<
"]" << std::endl;
304 template <
typename S>
307 return Vector3<S>(i_[0].center(), i_[1].center(), i_[2].center());
311 template <
typename S>
314 if(v[0][0] < i_[0][0]) i_[0][0] = v[0][0];
315 if(v[1][0] < i_[1][0]) i_[1][0] = v[1][0];
316 if(v[2][0] < i_[2][0]) i_[2][0] = v[2][0];
318 if(v[0][1] > i_[0][1]) i_[0][1] = v[0][1];
319 if(v[1][1] > i_[1][1]) i_[1][1] = v[1][1];
320 if(v[2][1] > i_[2][1]) i_[2][1] = v[2][1];
324 template <
typename S>
327 if(v[0] < i_[0][0]) i_[0][0] = v[0];
328 if(v[1] < i_[1][0]) i_[1][0] = v[1];
329 if(v[2] < i_[2][0]) i_[2][0] = v[2];
331 if(v[0] > i_[0][1]) i_[0][1] = v[0];
332 if(v[1] > i_[1][1]) i_[1][1] = v[1];
333 if(v[2] > i_[2][1]) i_[2][1] = v[2];
337 template <
typename S>
341 if(v[0][0] < res.
i_[0][0]) res.
i_[0][0] = v[0][0];
342 if(v[1][0] < res.
i_[1][0]) res.
i_[1][0] = v[1][0];
343 if(v[2][0] < res.
i_[2][0]) res.
i_[2][0] = v[2][0];
345 if(v[0][1] > res.
i_[0][1]) res.
i_[0][1] = v[0][1];
346 if(v[1][1] > res.
i_[1][1]) res.
i_[1][1] = v[1][1];
347 if(v[2][1] > res.
i_[2][1]) res.
i_[2][1] = v[2][1];
353 template <
typename S>
357 if(v[0] < res.
i_[0][0]) res.
i_[0][0] = v[0];
358 if(v[1] < res.
i_[1][0]) res.
i_[1][0] = v[1];
359 if(v[2] < res.
i_[2][0]) res.
i_[2][0] = v[2];
361 if(v[0] > res.
i_[0][1]) res.
i_[0][1] = v[0];
362 if(v[1] > res.
i_[1][1]) res.
i_[1][1] = v[1];
363 if(v[2] > res.
i_[2][1]) res.
i_[2][1] = v[2];
369 template <
typename S>
372 if(v[0][1] < i_[0][0])
return false;
373 if(v[1][1] < i_[1][0])
return false;
374 if(v[2][1] < i_[2][0])
return false;
376 if(v[0][0] > i_[0][1])
return false;
377 if(v[1][0] > i_[1][1])
return false;
378 if(v[2][0] > i_[2][1])
return false;
384 template <
typename S>
387 if(v[0][0] < i_[0][0])
return false;
388 if(v[1][0] < i_[1][0])
return false;
389 if(v[2][0] < i_[2][0])
return false;
391 if(v[0][1] > i_[0][1])
return false;
392 if(v[1][1] > i_[1][1])
return false;
393 if(v[2][1] > i_[2][1])
return false;