Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SbBox.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul S. Strauss (MMM yyyy)
25** Modified by : Nick Thompson (MMM yyyy)
26** Modified by : David Mott (MMM yyyy)
27**=======================================================================*/
28/*=======================================================================
29 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
30 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
31 *** ***
32 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
33 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
34 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
35 *** ***
36 *** RESTRICTED RIGHTS LEGEND ***
37 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
38 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
39 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
40 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
41 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
42 *** ***
43 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
44 *** BORDEAUX, FRANCE ***
45 *** ALL RIGHTS RESERVED ***
46**=======================================================================*/
47/*=======================================================================
48** Modified by : VSG (MMM YYYY)
49**=======================================================================*/
50
51
52
53#ifndef _SB_BOX_
54#define _SB_BOX_
55
56#include <Inventor/SbBase.h>
57#include <Inventor/SbVec.h>
58#include <Inventor/SbMatrix.h>
59#include <Inventor/STL/iostream>
60
61class SbBox3s;
62class SbBox3i32;
63class SbBox3f;
64class SbBox3d;
65
66class SbXfBox3d;
67class SbXfBox3f;
68
96class SbBox3i32 {
97
98 public:
103 { makeEmpty(); }
104
109 SbBox3i32(int xmin, int ymin, int zmin,
110 int xmax, int ymax, int zmax)
111 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
112
117 SbBox3i32(const SbVec3i32 &_min, const SbVec3i32 &_max)
118 { m_min = _min; m_max = _max; }
119
123 SbBox3i32( const SbBox3s &box );
124
129 {}
130
136 const SbVec3i32 &getMin() const
137 { return m_min; }
138
144 const SbVec3i32 &getMax() const
145 { return m_max; }
146
152 { return m_min; }
153
159 { return m_max; }
160
165
169 void extendBy(const SbVec3f &pt);
170
174 void extendBy(const SbBox3i32 &bb);
175
179 SbBool intersect(const SbVec3f &pt) const;
180
184 SbBool intersect(const SbBox3i32 &bb) const;
185
189 SbBool intersect(const SbVec3i32 &pt) const;
190
196
200 inline SbBool contains(const SbBox3i32 &bb) const
201 {
202 SbBool contained = true;
203 for( int i = 0; i < 3 && contained; i++ )
204 {
205 contained &= bb.m_min[i] >= m_min[i] &&
206 bb.m_min[i] <= m_max[i] &&
207 bb.m_max[i] <= m_max[i];
208 }
209
210 return contained;
211 }
212
226 SbBool outside(const SbMatrix &MVP, int &cullBits) const;
227
231 void setBounds(int xmin, int ymin, int zmin,
232 int xmax, int ymax, int zmax)
233 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
234
238 void setBounds(const SbVec3i32 &_min, const SbVec3i32 &_max)
239 { m_min = _min; m_max = _max; }
240
244 void getBounds(int &xmin, int &ymin, int &zmin,
245 int &xmax, int &ymax, int &zmax) const
246 { m_min.getValue(xmin, ymin, zmin); m_max.getValue(xmax, ymax, zmax); }
247
252 void getBounds(SbVec3i32 &_min, SbVec3i32 &_max) const
253 { _min = m_min; _max = m_max; }
254
259 SbVec3f getClosestPoint(const SbVec3f &point) const;
260
264 void getOrigin(int &originX, int &originY, int &originZ) const
265 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
266
271 void getSize(int &sizeX, int &sizeY, int &sizeZ) const {
272 if ( m_max[0] < m_min[0] ) {
273 sizeX = 0;
274 sizeY = 0;
275 sizeZ = 0;
276 }
277 else {
278 sizeX = m_max[0] - m_min[0];
279 sizeY = m_max[1] - m_min[1];
280 sizeZ = m_max[2] - m_min[2];
281 }
282 }
283
288 {
289 if ( m_max[0] < m_min[0] )
290 return SbVec3i32(0, 0, 0);
291
292 return m_max-m_min;
293 }
294
298 void makeEmpty();
299
306 { return m_max[0] < m_min[0]; }
307
313 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2]); }
314
322 void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const;
323
327 void transform(const SbMatrix &m);
328
332 float getVolume() const;
333
338
342 friend inline std::ostream& operator << (std::ostream& os, const SbBox3i32& b);
343
347 friend int operator ==(const SbBox3i32 &b1, const SbBox3i32 &b2);
348
352 friend int operator !=(const SbBox3i32 &b1, const SbBox3i32 &b2)
353 { return !(b1 == b2); }
354
355 private:
356 // Minimum and maximum points
357 SbVec3i32 m_min, m_max;
358};
359
383class SbBox3s {
384
385 public:
390 { makeEmpty(); }
391
396 SbBox3s(short xmin, short ymin, short zmin,
397 short xmax, short ymax, short zmax)
398 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
399
404 SbBox3s(const SbVec3s &_min, const SbVec3s &_max)
405 { m_min = _min; m_max = _max; }
406
411 SbBox3s(const SbBox3i32 &box);
412
417 {}
418
424 const SbVec3s &getMin() const
425 { return m_min; }
426
432 const SbVec3s &getMax() const
433 { return m_max; }
434
440 { return m_min; }
441
447 { return m_max; }
448
453
457 void extendBy(const SbVec3f &pt);
458
462 void extendBy(const SbBox3s &bb);
463
467 SbBool intersect(const SbVec3f &pt) const;
468
472 SbBool intersect(const SbBox3s &bb) const;
473
478 SbBox3s intersection(const SbBox3s& box) const;
479
484 inline SbBool contains(const SbBox3s &bb) const
485 {
486 SbBool contained = true;
487 for( int i = 0; i < 3 && contained; i++ )
488 {
489 contained &= bb.m_min[i] >= m_min[i] &&
490 bb.m_min[i] <= m_max[i] &&
491 bb.m_max[i] <= m_max[i];
492 }
493
494 return contained;
495 }
496
510 SbBool outside(const SbMatrix &MVP, int &cullBits) const;
511
515 void setBounds(short xmin, short ymin, short zmin,
516 short xmax, short ymax, short zmax)
517 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
518
522 void setBounds(const SbVec3s &_min, const SbVec3s &_max)
523 { m_min = _min; m_max = _max; }
524
528 void getBounds(short &xmin, short &ymin, short &zmin,
529 short &xmax, short &ymax, short &zmax) const
530 { m_min.getValue(xmin, ymin, zmin); m_max.getValue(xmax, ymax, zmax); }
531
536 void getBounds(SbVec3s &_min, SbVec3s &_max) const
537 { _min = m_min; _max = m_max; }
538
543 SbVec3f getClosestPoint(const SbVec3f &point) const;
544
548 void getOrigin(short &originX, short &originY, short &originZ) const
549 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
550
554 void getSize(short &sizeX, short &sizeY, short &sizeZ) const {
555 if ( m_max[0] < m_min[0] ) {
556 sizeX = 0;
557 sizeY = 0;
558 sizeZ = 0;
559 }
560 else {
561 sizeX = m_max[0] - m_min[0];
562 sizeY = m_max[1] - m_min[1];
563 sizeZ = m_max[2] - m_min[2];
564 }
565 }
566
570 void makeEmpty();
571
576 { return m_max[0] < m_min[0]; }
577
583 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2]); }
584
592 void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const;
593
597 void transform(const SbMatrix &m);
598
602 float getVolume() const;
603
609
613 friend int operator ==(const SbBox3s &b1, const SbBox3s &b2);
614
618 friend int operator !=(const SbBox3s &b1, const SbBox3s &b2)
619 { return !(b1 == b2); }
620
621 private:
622 // Minimum and maximum points
623 SbVec3s m_min, m_max;
624};
625
649class SbBox3f {
650
651 public:
656 { makeEmpty(); }
657
662 SbBox3f(float xmin, float ymin, float zmin,
663 float xmax, float ymax, float zmax)
664 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
665
670 SbBox3f(const SbVec3f &_min, const SbVec3f &_max)
671 { m_min = _min; m_max = _max; }
672
677 {}
678
684 inline const SbVec3f & getMin() const
685 { return m_min; }
686
691 inline SbVec3f &getMin()
692 { return m_min; }
693
699 inline const SbVec3f & getMax() const
700 { return m_max; }
701
706 inline SbVec3f &getMax()
707 { return m_max; }
708
713
717 inline void extendBy(const SbVec3f &pt)
718 {
719 if (pt[0] < m_min[0]) m_min[0] = pt[0];
720 if (pt[1] < m_min[1]) m_min[1] = pt[1];
721 if (pt[2] < m_min[2]) m_min[2] = pt[2];
722 if (pt[0] > m_max[0]) m_max[0] = pt[0];
723 if (pt[1] > m_max[1]) m_max[1] = pt[1];
724 if (pt[2] > m_max[2]) m_max[2] = pt[2];
725 }
726
730 void extendBy(const SbBox3f &bb);
731
735 SbBool intersect(const SbVec3f &pt) const;
736
740 inline SbBool intersect(const SbBox3f &bb) const
741 {
742 return ((bb.m_max[0] >= m_min[0]) && (bb.m_min[0] <= m_max[0]) &&
743 (bb.m_max[1] >= m_min[1]) && (bb.m_min[1] <= m_max[1]) &&
744 (bb.m_max[2] >= m_min[2]) && (bb.m_min[2] <= m_max[2]));
745 }
746
751 SbBox3f intersection(const SbBox3f& box) const;
752
757 inline SbBool contains(const SbBox3f &bb) const
758 {
759 SbBool contained = true;
760 for( int i = 0; i < 3 && contained; i++ )
761 {
762 contained &= bb.m_min[i] >= m_min[i] &&
763 bb.m_min[i] <= m_max[i] &&
764 bb.m_max[i] <= m_max[i];
765 }
766
767 return contained;
768 }
769
770
784 SbBool outside(const SbMatrix &MVP, int &cullBits) const;
785
789 void setBounds(float xmin, float ymin, float zmin,
790 float xmax, float ymax, float zmax)
791 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
792
796 void setBounds(const SbVec3f &_min, const SbVec3f &_max)
797 { m_min = _min; m_max = _max; }
798
802 void getBounds(float &xmin, float &ymin, float &zmin,
803 float &xmax, float &ymax, float &zmax) const
804 { m_min.getValue(xmin, ymin, zmin); m_max.getValue(xmax, ymax, zmax); }
805
810 void getBounds(SbVec3f &_min, SbVec3f &_max) const
811 { _min = m_min; _max = m_max; }
812
817 SbVec3f getClosestPoint(const SbVec3f &point) const;
818
822 void getOrigin(float &originX, float &originY, float &originZ) const
823 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
824
829 void getSize(float &sizeX, float &sizeY, float &sizeZ) const {
830 if ( m_max[0] < m_min[0] ) {
831 sizeX = 0.0f;
832 sizeY = 0.0f;
833 sizeZ = 0.0f;
834 }
835 else {
836 sizeX = m_max[0] - m_min[0];
837 sizeY = m_max[1] - m_min[1];
838 sizeZ = m_max[2] - m_min[2];
839 }
840 }
841
846 {
847 if ( m_max[0] < m_min[0] )
848 return SbVec3f(0, 0, 0);
849
850 return m_max-m_min;
851 }
852
856 inline void makeEmpty()
857 {
858 m_min.setValue(FLT_MAX, FLT_MAX, FLT_MAX);
859 m_max.setValue(- FLT_MAX, - FLT_MAX, - FLT_MAX);
860 }
861
865 inline SbBool isEmpty() const
866 { return m_max[0] < m_min[0]; }
867
873 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2] ); }
874
882 void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const;
883
887 void transform(const SbMatrix &m);
888
892 float getVolume() const;
893
897 friend int operator ==(const SbBox3f &b1, const SbBox3f &b2);
898
902 friend int operator !=(const SbBox3f &b1, const SbBox3f &b2)
903 { return !(b1 == b2); }
904
908 friend inline std::ostream& operator << (std::ostream& os, const SbBox3f& b);
909
913 template<typename T>
914 explicit SbBox3f(const T& b)
915 {
916 m_min = SbVec3f(b.getMin());
917 m_max = SbVec3f(b.getMax());
918 }
919
923 float computeMaxDistance2(const SbVec3f& p) const;
924
931 SbBool triangleBoxOverlap(const SbVec3f& u0, const SbVec3f& u1, const SbVec3f& u2) const;
932
933 private:
934
938 SbBool lineSegmentBoxOverlap(const SbVec3f& u0, const SbVec3f& u1) const;
939
940private:
941 // Minimum and maximum points
942 SbVec3f m_min, m_max;
943};
944
945
946// P.Vigneras Adding support for double precision bounding box 3
947// Feb 15 2000
948
972class SbBox3d {
973
974 public:
979 { makeEmpty(); }
980
985 SbBox3d(double xmin, double ymin, double zmin,
986 double xmax, double ymax, double zmax)
987 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
988
993 SbBox3d(const SbVec3d &_min, const SbVec3d &_max)
994 { m_min = _min; m_max = _max; }
995
1000 {}
1001
1007 const SbVec3d & getMin() const
1008 { return m_min; }
1009
1015 const SbVec3d & getMax() const
1016 { return m_max; }
1017
1023 { return m_min; }
1024
1030 { return m_max; }
1031
1036
1040 void extendBy(const SbVec3d &pt);
1041
1045 void extendBy(const SbBox3d &bb);
1046
1050 SbBool intersect(const SbVec3d &pt) const;
1051
1055 SbBool intersect(const SbBox3d &bb) const;
1056
1061 SbBox3d intersection(const SbBox3d& box) const;
1062
1067 inline SbBool contains(const SbBox3d &bb) const
1068 {
1069 SbBool contained = true;
1070 for( int i = 0; i < 3 && contained; i++ )
1071 {
1072 contained &= bb.m_min[i] >= m_min[i] &&
1073 bb.m_min[i] <= m_max[i] &&
1074 bb.m_max[i] <= m_max[i];
1075 }
1076
1077 return contained;
1078 }
1079
1093 SbBool outside(const SbMatrixd &MVP, int &cullBits) const;
1094
1098 void setBounds(double xmin, double ymin, double zmin,
1099 double xmax, double ymax, double zmax)
1100 { m_min.setValue(xmin, ymin, zmin); m_max.setValue(xmax, ymax, zmax); }
1101
1105 void setBounds(const SbVec3d &_min, const SbVec3d &_max)
1106 { m_min = _min; m_max = _max; }
1107
1111 void getBounds(double &xmin, double &ymin, double &zmin,
1112 double &xmax, double &ymax, double &zmax) const
1113 { m_min.getValue(xmin, ymin, zmin); m_max.getValue(xmax, ymax, zmax); }
1114
1119 void getBounds(SbVec3d &_min, SbVec3d &_max) const
1120 { _min = m_min; _max = m_max; }
1121
1126 SbVec3d getClosestPoint(const SbVec3d &point) const;
1127
1131 void getOrigin(double &originX, double &originY, double &originZ) const
1132 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
1133
1137 void getSize(double &sizeX, double &sizeY, double &sizeZ) const {
1138 if ( m_max[0] < m_min[0] ) {
1139 sizeX = 0.0;
1140 sizeY = 0.0;
1141 sizeZ = 0.0;
1142 }
1143 else {
1144 sizeX = m_max[0] - m_min[0];
1145 sizeY = m_max[1] - m_min[1];
1146 sizeZ = m_max[2] - m_min[2];
1147 }
1148 }
1149
1155 {
1156 if ( m_max[0] < m_min[0] )
1157 return SbVec3d(0, 0, 0);
1158
1159 return m_max-m_min;
1160 }
1161
1166
1171 { return m_max[0] < m_min[0]; }
1172
1178 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2] ); }
1179
1187 void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const;
1188
1192 void transform(const SbMatrixd &m);
1193
1197 double getVolume() const;
1198
1202 friend int operator ==(const SbBox3d &b1, const SbBox3d &b2);
1203
1207 friend int operator !=(const SbBox3d &b1, const SbBox3d &b2)
1208 { return !(b1 == b2); }
1209
1213 template<typename T>
1214 explicit SbBox3d(const T& b)
1215 {
1216 m_min = SbVec3d(b.getMin());
1217 m_max = SbVec3d(b.getMax());
1218 }
1219
1220 private:
1221 // Minimum and maximum points
1222 SbVec3d m_min, m_max;
1223};
1224
1250class SbXfBox3f : public SbBox3f {
1251
1252 public:
1257
1261 SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max);
1262
1266 SbXfBox3f(const SbBox3f &box);
1267
1272 {}
1273
1277 void setTransform(const SbMatrix &m);
1278
1282 const SbMatrix & getTransform() const
1283 { return xform; }
1284
1288 const SbMatrix & getInverse( ) const
1289 { return xformInv; }
1290
1295
1334 void extendBy(const SbVec3f &pt);
1335
1341 void extendBy(const SbBox3f &bb)
1342 { extendBy(SbXfBox3f(bb)); }
1343
1347 void extendBy(const SbXfBox3f &bb);
1348
1352 SbBool intersect(const SbVec3f &pt) const;
1353
1357 SbBool intersect(const SbBox3f &bb) const
1358 { return project().intersect(bb); }
1359
1363 SbXfBox3f &setValue(const SbXfBox3d &xfbox3d);
1364
1368 void setBounds(float xmin, float ymin, float zmin,
1369 float xmax, float ymax, float zmax)
1370 { SbBox3f::setBounds(xmin, ymin, zmin, xmax, ymax, zmax); }
1371
1375 void setBounds(const SbVec3f &_min, const SbVec3f &_max)
1376 { SbBox3f::setBounds(_min, _max); }
1377
1381 void getBounds(float &xmin, float &ymin, float &zmin,
1382 float &xmax, float &ymax, float &zmax) const
1383 { SbBox3f::getBounds(xmin, ymin, zmin, xmax, ymax, zmax); }
1384
1389 void getBounds(SbVec3f &_min, SbVec3f &_max) const
1390 { SbBox3f::getBounds(_min, _max); }
1391
1395 void getOrigin(float &originX, float &originY, float &originZ)
1396 { SbBox3f::getOrigin(originX, originY, originZ); }
1397
1402 void getSize(float &sizeX, float &sizeY, float &sizeZ)
1403 { SbBox3f::getSize(sizeX, sizeY, sizeZ); }
1404
1408 float getVolume() const;
1409
1414
1418 SbBool isEmpty() const { return SbBox3f::isEmpty(); }
1419
1424
1428 void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
1429 { project().getSpan(direction, dMin, dMax); }
1430
1434 void transform(const SbMatrix &m);
1435
1440
1445 SbVec3f getClosestPoint(const SbVec3f& point) const;
1446
1450 float computeMaxDistance2(const SbVec3f& p) const;
1451
1455 friend int operator ==(const SbXfBox3f &b1, const SbXfBox3f &b2);
1456
1460 friend int operator !=(const SbXfBox3f &b1, const SbXfBox3f &b2)
1461 { return !(b1 == b2); }
1462
1463
1464 private:
1468 inline bool isXFormDegenerate() const
1469 {
1470 // test whether first item in matrix is a signalingNaN
1471 return xformInv[0][0] != xformInv[0][0];
1472 }
1473
1474
1475 private:
1476 // These are incorrect for SbXfBox3f, so we hide them
1477 const SbVec3f &getMin() const
1478 { return SbBox3f::getMin(); }
1479
1480 const SbVec3f &getMax() const
1481 { return SbBox3f::getMax(); }
1482
1483 // The box is transformed by this xform
1484 SbMatrix xform;
1485 SbMatrix xformInv;
1486};
1487
1513class SbXfBox3d : public SbBox3d {
1514
1515 public:
1520
1524 SbXfBox3d(const SbVec3d &_min, const SbVec3d &_max);
1525
1529 SbXfBox3d(const SbBox3d &box);
1530
1535 {}
1536
1540 void setTransform(const SbMatrixd &m);
1541
1545 const SbMatrixd & getTransform() const
1546 { return xform; }
1547
1551 const SbMatrixd & getInverse( ) const
1552 { return xformInv; }
1553
1558
1597 void extendBy(const SbVec3d &pt);
1598
1602 void extendBy(const SbBox3d &bb)
1603 { extendBy(SbXfBox3d(bb)); }
1604
1608 void extendBy(const SbXfBox3d &bb);
1609
1613 SbBool intersect(const SbVec3d &pt) const;
1614
1618 SbBool intersect(const SbBox3d &bb) const
1619 { return project().intersect(bb); }
1620
1624 SbXfBox3d &setValue(const SbXfBox3f &xfbox3f);
1625
1629 void setBounds(double xmin, double ymin, double zmin,
1630 double xmax, double ymax, double zmax)
1631 { SbBox3d::setBounds(xmin, ymin, zmin, xmax, ymax, zmax); }
1632
1636 void setBounds(const SbVec3d &_min, const SbVec3d &_max)
1637 { SbBox3d::setBounds(_min, _max); }
1638
1642 void getBounds(double &xmin, double &ymin, double &zmin,
1643 double &xmax, double &ymax, double &zmax) const
1644 { SbBox3d::getBounds(xmin, ymin, zmin, xmax, ymax, zmax); }
1645
1650 void getBounds(SbVec3d &_min, SbVec3d &_max) const
1651 { SbBox3d::getBounds(_min, _max); }
1652
1656 void getOrigin(double &originX, double &originY, double &originZ) const
1657 { SbBox3d::getOrigin(originX, originY, originZ); }
1658
1662 void getSize(double &sizeX, double &sizeY, double &sizeZ) const
1663 { SbBox3d::getSize(sizeX, sizeY, sizeZ); }
1664
1668 double getVolume() const;
1669
1674
1678 SbBool isEmpty() const { return SbBox3d::isEmpty(); }
1679
1684
1688 void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const
1689 { project().getSpan(direction, dMin, dMax); }
1690
1694 void transform(const SbMatrixd &m);
1695
1700
1704 friend int operator ==(const SbXfBox3d &b1, const SbXfBox3d &b2);
1705
1709 friend int operator !=(const SbXfBox3d &b1, const SbXfBox3d &b2)
1710 { return !(b1 == b2); }
1711
1712 private:
1716 inline bool isXFormDegenerate() const
1717 {
1718 // test whether first item in matrix is a signalingNaN
1719 return xformInv[0][0] != xformInv[0][0];
1720 }
1721
1722 private:
1723 // These are incorrect for SbXfBox3d, so we hide them
1724 const SbVec3d & getMin() const
1725 { return SbBox3d::getMin(); }
1726
1727 const SbVec3d & getMax() const
1728 { return SbBox3d::getMax(); }
1729
1730 // The box is transformed by this xform
1731 SbMatrixd xform;
1732 SbMatrixd xformInv;
1733};
1734
1735// Note: This implementation must appear after the declaration of SbXfBox3d!
1737{
1738 // set float transform
1739 SbMatrixd dtrans = xfbox3d.getTransform();
1740 SbMatrix ftrans;
1741 ftrans.setValue(dtrans);
1742 setTransform(ftrans);
1743
1744 // set float bounds
1745 SbVec3d dmin,dmax;
1746 xfbox3d.getBounds(dmin,dmax);
1747 SbVec3f _min,_max;
1748 _min.setValue(dmin);
1749 _max.setValue(dmax);
1750 setBounds((_min),(_max));
1751
1752 return (*this);
1753}
1754
1755// Note: This implementation must appear after the declaration of SbXfBox3d!
1757{
1758 // set float transform
1759 SbMatrix ftrans = xfbox3f.getTransform();
1760 SbMatrixd dtrans;
1761 dtrans.setValue(ftrans);
1762 setTransform(dtrans);
1763
1764 // set float bounds
1765 SbVec3f fmin,fmax;
1766 xfbox3f.getBounds(fmin,fmax);
1767 SbVec3d _min,_max;
1768 _min.setValue(fmin);
1769 _max.setValue(fmax);
1770 setBounds((_min),(_max));
1771
1772 return (*this);
1773}
1774
1775
1798class SbBox2f {
1799
1800 public:
1805 { makeEmpty(); };
1806
1811 SbBox2f(float xmin, float ymin, float xmax, float ymax)
1812 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
1813
1818 SbBox2f(const SbVec2f &_min, const SbVec2f &_max)
1819 { m_min = _min; m_max = _max; }
1820
1825 {}
1826
1830 const SbVec2f & getMin() const
1831 { return m_min; }
1832
1836 const SbVec2f & getMax() const
1837 { return m_max; }
1838
1843
1847 void extendBy(const SbVec2f &pt);
1848
1852 void extendBy(const SbBox2f &r);
1853
1857 SbBool intersect(const SbVec2f &pt) const;
1858
1862 SbBool intersect(const SbBox2f &bb) const;
1863
1868 SbBox2f intersection(const SbBox2f& box) const;
1869
1873 void setBounds(float xmin, float ymin, float xmax, float ymax)
1874 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
1875
1879 void setBounds(const SbVec2f &_min, const SbVec2f &_max)
1880 { m_min = _min; m_max = _max; }
1881
1885 void getBounds(float &xmin, float &ymin,
1886 float &xmax, float &ymax) const
1887 { m_min.getValue(xmin, ymin); m_max.getValue(xmax, ymax); }
1888
1893 void getBounds(SbVec2f &_min, SbVec2f &_max) const
1894 { _min = m_min; _max = m_max; }
1895
1900 SbVec2f getClosestPoint(const SbVec2f &point) const;
1901
1905 void getOrigin(float &originX, float &originY) const
1906 { originX = m_min[0]; originY = m_min[1]; }
1907
1911 void getSize(float &sizeX, float &sizeY) const
1912 {
1913 if ( m_max[0] < m_min[0] ) {
1914 sizeX = 0.0f;
1915 sizeY = 0.0f;
1916 }
1917 else {
1918 sizeX = m_max[0] - m_min[0];
1919 sizeY = m_max[1] - m_min[1];
1920 }
1921 }
1922
1928 {
1929 if ( m_max[0] < m_min[0] )
1930 return SbVec2f(0, 0);
1931
1932 return m_max-m_min;
1933 }
1934
1938 float getAspectRatio() const
1939 { return (m_max[0] - m_min[0]) / (m_max[1] - m_min[1]); }
1940
1945
1949 SbBool isEmpty() const { return m_max[0] < m_min[0]; }
1950
1956 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
1957
1961 friend int operator ==(const SbBox2f &b1, const SbBox2f &b2);
1962
1966 friend int operator !=(const SbBox2f &b1, const SbBox2f &b2)
1967 { return !(b1 == b2); }
1968
1969 private:
1970 // Minimum and maximum points
1971 SbVec2f m_min, m_max;
1972};
1973
1996class SbBox2d {
1997
1998 public:
2003 { makeEmpty(); };
2004
2009 SbBox2d(double xmin, double ymin, double xmax, double ymax)
2010 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2011
2016 SbBox2d(const SbVec2d &_min, const SbVec2d &_max)
2017 { m_min = _min; m_max = _max; }
2018
2023 {}
2024
2028 const SbVec2d & getMin() const
2029 { return m_min; }
2030
2034 const SbVec2d & getMax() const
2035 { return m_max; }
2036
2041
2045 void extendBy(const SbVec2d &pt);
2046
2050 void extendBy(const SbBox2d &r);
2051
2055 SbBool intersect(const SbVec2d &pt) const;
2056
2060 SbBool intersect(const SbBox2d &bb) const;
2061
2066 SbBox2d intersection(const SbBox2d& box) const;
2067
2071 void setBounds(double xmin, double ymin, double xmax, double ymax)
2072 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2073
2077 void setBounds(const SbVec2d &_min, const SbVec2d &_max)
2078 { m_min = _min; m_max = _max; }
2079
2083 void getBounds(double &xmin, double &ymin,
2084 double &xmax, double &ymax) const
2085 { m_min.getValue(xmin, ymin); m_max.getValue(xmax, ymax); }
2086
2091 void getBounds(SbVec2d &_min, SbVec2d &_max) const
2092 { _min = m_min; _max = m_max; }
2093
2098 SbVec2d getClosestPoint(const SbVec2d &point) const;
2099
2103 void getOrigin(double &originX, double &originY) const
2104 { originX = m_min[0]; originY = m_min[1]; }
2105
2109 void getSize(double &sizeX, double &sizeY) const
2110 {
2111 if ( m_max[0] < m_min[0] ) {
2112 sizeX = 0.0;
2113 sizeY = 0.0;
2114 }
2115 else {
2116 sizeX = m_max[0] - m_min[0];
2117 sizeY = m_max[1] - m_min[1];
2118 }
2119 }
2120
2126 {
2127 if ( m_max[0] < m_min[0] )
2128 return SbVec2d(0, 0);
2129
2130 return m_max-m_min;
2131 }
2132
2136 double getAspectRatio() const
2137 { return (m_max[0] - m_min[0]) / (m_max[1] - m_min[1]); }
2138
2143
2147 SbBool isEmpty() const { return m_max[0] < m_min[0]; }
2148
2154 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
2155
2159 friend int operator ==(const SbBox2d &b1, const SbBox2d &b2);
2160
2164 friend int operator !=(const SbBox2d &b1, const SbBox2d &b2)
2165 { return !(b1 == b2); }
2166
2167 private:
2168 // Minimum and maximum points
2169 SbVec2d m_min, m_max;
2170};
2171
2194class SbBox2s {
2195
2196 public:
2201 { makeEmpty(); };
2202
2207 SbBox2s(short xmin, short ymin, short xmax, short ymax)
2208 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2209
2214 SbBox2s(const SbVec2s &_min, const SbVec2s &_max)
2215 { m_min = _min; m_max = _max; }
2216
2221 {}
2222
2226 const SbVec2s & getMin() const
2227 { return m_min; }
2228
2232 const SbVec2s & getMax() const
2233 { return m_max; }
2234
2238 void extendBy(const SbVec2s &pt);
2239
2243 void extendBy(const SbBox2s &r);
2244
2248 SbBool intersect(const SbVec2s &pt) const;
2249
2253 SbBool intersect(const SbBox2s &bb) const;
2254
2259 SbBox2s intersection(const SbBox2s& box) const;
2260
2264 void setBounds(short xmin, short ymin, short xmax, short ymax)
2265 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2266
2270 void setBounds(const SbVec2s &_min, const SbVec2s &_max)
2271 { m_min = _min; m_max = _max; }
2272
2276 void getBounds(short &xmin, short &ymin,
2277 short &xmax, short &ymax) const
2278 { m_min.getValue(xmin, ymin); m_max.getValue(xmax, ymax); }
2279
2284 void getBounds(SbVec2s &_min, SbVec2s &_max) const
2285 { _min = m_min; _max = m_max; }
2286
2290 void getOrigin(short &originX, short &originY) const
2291 { originX = m_min[0]; originY = m_min[1]; }
2292
2296 void getSize(short &sizeX, short &sizeY) const
2297 {
2298 if ( m_max[0] < m_min[0] ) {
2299 sizeX = 0;
2300 sizeY = 0;
2301 }
2302 else {
2303 sizeX = m_max[0] - m_min[0];
2304 sizeY = m_max[1] - m_min[1];
2305 }
2306 }
2307
2313 {
2314 if ( m_max[0] < m_min[0] )
2315 return SbVec2s(0, 0);
2316
2317 return m_max-m_min;
2318 }
2319
2323 float getAspectRatio() const
2324 { return float(m_max[0] - m_min[0]) / float(m_max[1] - m_min[1]); }
2325
2330
2334 SbBool isEmpty() const { return m_max[0] < m_min[0]; }
2335
2341 { return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
2342
2343
2347 friend int operator ==(const SbBox2s &b1, const SbBox2s &b2);
2348
2352 friend int operator !=(const SbBox2s &b1, const SbBox2s &b2)
2353 { return !(b1 == b2); }
2354
2355 private:
2356 // Minimum and maximum points
2357 SbVec2s m_min, m_max;
2358};
2359
2384
2385 public:
2390 { makeEmpty(); };
2391
2396 SbBox2i32(int xmin, int ymin, int xmax, int ymax)
2397 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2398
2403 SbBox2i32(const SbVec2i32 &_min, const SbVec2i32 &_max)
2404 { m_min = _min; m_max = _max; }
2405
2410 {}
2411
2415 const SbVec2i32 & getMin() const
2416 { return m_min; }
2417
2421 const SbVec2i32 & getMax() const
2422 { return m_max; }
2423
2427 void extendBy(const SbVec2i32 &pt);
2428
2432 void extendBy(const SbBox2i32 &r);
2433
2437 SbBool intersect(const SbVec2i32 &pt) const;
2438
2442 SbBool intersect(const SbBox2i32 &bb) const;
2443
2449
2453 void setBounds(int xmin, int ymin, int xmax, int ymax)
2454 { m_min.setValue(xmin, ymin); m_max.setValue(xmax, ymax); }
2455
2459 void setBounds(const SbVec2i32 &_min, const SbVec2i32 &_max)
2460 { m_min = _min; m_max = _max; }
2461
2465 void getBounds(int &xmin, int &ymin,
2466 int &xmax, int &ymax) const
2467 { m_min.getValue(xmin, ymin); m_max.getValue(xmax, ymax); }
2468
2473 void getBounds(SbVec2i32 &_min, SbVec2i32 &_max) const
2474 { _min = m_min; _max = m_max; }
2475
2479 void getOrigin(int &originX, int &originY) const
2480 { originX = m_min[0]; originY = m_min[1]; }
2481
2485 void getSize(int &sizeX, int &sizeY) const
2486 {
2487 if ( m_max[0] < m_min[0] ) {
2488 sizeX = 0;
2489 sizeY = 0;
2490 }
2491 else {
2492 sizeX = m_max[0] - m_min[0];
2493 sizeY = m_max[1] - m_min[1];
2494 }
2495 }
2496
2502 {
2503 if ( m_max[0] < m_min[0] )
2504 return SbVec2i32(0, 0);
2505
2506 return m_max-m_min;
2507 }
2508
2512 float getAspectRatio() const
2513 { return float(m_max[0] - m_min[0]) / float(m_max[1] - m_min[1]); }
2514
2519
2523 friend int operator ==(const SbBox2i32 &b1, const SbBox2i32 &b2);
2524
2528 friend int operator !=(const SbBox2i32 &b1, const SbBox2i32 &b2)
2529 { return !(b1 == b2); }
2530
2531 private:
2532 // Minimum and maximum points
2533 SbVec2i32 m_min, m_max;
2534};
2535
2539inline std::ostream& operator << (std::ostream& os, const SbBox3f& b)
2540{
2541 return os << b.getMin() << " - " << b.getMax();
2542}
2543
2547inline std::ostream& operator << (std::ostream& os, const SbBox3i32& b)
2548{
2549 return os << b.getMin() << " - " << b.getMax();
2550}
2551
2555inline std::ostream& operator << (std::ostream& os, const SbBox2f& b)
2556{
2557 return os << b.getMin() << " - " << b.getMax();
2558}
2559
2587
2588 public:
2593 {
2594 makeEmpty();
2595 }
2596
2601 SbBox4i32(const SbVec4i32 &_min, const SbVec4i32 &_max)
2602 { m_min = _min; m_max = _max; }
2603
2608 {}
2609
2615 const SbVec4i32 &getMin() const
2616 { return m_min; }
2617
2623 const SbVec4i32 &getMax() const
2624 { return m_max; }
2625
2631 { return m_min; }
2632
2638 { return m_max; }
2639
2643 void extendBy(const SbVec4i32 &pt)
2644 {
2645 for ( int i = 0; i < 4; i++ )
2646 {
2647 if (pt[i] < m_min[i])
2648 m_min[i] = pt[i];
2649 if (pt[i] > m_max[i])
2650 m_max[i] = pt[i];
2651 }
2652 }
2653
2657 SbBool intersect(const SbVec4i32 &pt) const
2658 {
2659 return ((pt[0] >= m_min[0]) &&
2660 (pt[1] >= m_min[1]) &&
2661 (pt[2] >= m_min[2]) &&
2662 (pt[3] >= m_min[3]) &&
2663 (pt[0] <= m_max[0]) &&
2664 (pt[1] <= m_max[1]) &&
2665 (pt[2] <= m_max[2]) &&
2666 (pt[3] <= m_max[3]));
2667 }
2668
2673 {
2674 if ( m_max[0] < m_min[0] )
2675 return SbVec4i32(0, 0, 0, 0);
2676
2677 return m_max-m_min + SbVec4i32(1, 1, 1, 1);
2678 }
2679
2684
2689 { return m_max[0] < m_min[0]; }
2690
2694 friend inline std::ostream& operator << (std::ostream& os, const SbBox4i32& b)
2695 {
2696 return os << b.getMin() << " - " << b.getMax();
2697 }
2698
2702 friend int operator ==(const SbBox4i32 &b1, const SbBox4i32 &b2)
2703 {
2704 return ( (b1.m_min == b2.m_min) && (b1.m_max == b2.m_max ) );
2705 }
2706
2710 friend int operator !=(const SbBox4i32 &b1, const SbBox4i32 &b2)
2711 { return !(b1 == b2); }
2712
2713 private:
2714 // Minimum and maximum points
2715 SbVec4i32 m_min, m_max;
2716};
2717
2718#endif /* _SB_BOX_ */
2719
2720
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 2D box class.
Definition SbBox.h:1996
void setBounds(const SbVec2d &_min, const SbVec2d &_max)
Sets the corners of the box.
Definition SbBox.h:2077
void getBounds(SbVec2d &_min, SbVec2d &_max) const
Gets the corners of the box.
Definition SbBox.h:2091
void setBounds(double xmin, double ymin, double xmax, double ymax)
Sets the corners of the box.
Definition SbBox.h:2071
void extendBy(const SbVec2d &pt)
Extends this box (if necessary) to contain the specified point .
friend int operator!=(const SbBox2d &b1, const SbBox2d &b2)
Inequality comparison.
Definition SbBox.h:2164
SbBox2d intersection(const SbBox2d &box) const
Returns the intersection of the specified box with this box.
void getSize(double &sizeX, double &sizeY) const
Gets box size.
Definition SbBox.h:2109
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:2153
void getBounds(double &xmin, double &ymin, double &xmax, double &ymax) const
Gets the corners of the box.
Definition SbBox.h:2083
void getOrigin(double &originX, double &originY) const
Gets box origin.
Definition SbBox.h:2103
SbBool intersect(const SbBox2d &bb) const
Returns TRUE if the specified box intersects this box.
void extendBy(const SbBox2d &r)
Extends this box (if necessary) to contain the specified box.
~SbBox2d()
Destructor.
Definition SbBox.h:2022
SbVec2d getSize() const
Return box size.
Definition SbBox.h:2125
SbBool intersect(const SbVec2d &pt) const
Returns TRUE if the specified point intersects this box.
SbVec2d getCenter() const
Returns the center of the box.
const SbVec2d & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:2028
SbBox2d(double xmin, double ymin, double xmax, double ymax)
Constructor for a 2D double box.
Definition SbBox.h:2009
SbBox2d(const SbVec2d &_min, const SbVec2d &_max)
Constructor for a 2D double box.
Definition SbBox.h:2016
friend int operator==(const SbBox2d &b1, const SbBox2d &b2)
Equality comparison.
const SbVec2d & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:2034
SbBox2d()
Constructor for a 2D double box.
Definition SbBox.h:2002
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:2147
double getAspectRatio() const
Gets box aspect ratio.
Definition SbBox.h:2136
void makeEmpty()
Makes an empty box.
SbVec2d getClosestPoint(const SbVec2d &point) const
Returns the closest point on the box to the given point.
2D box class.
Definition SbBox.h:1798
~SbBox2f()
Destructor.
Definition SbBox.h:1824
float getAspectRatio() const
Gets box aspect ratio.
Definition SbBox.h:1938
SbBox2f()
Constructor for a 2D float box.
Definition SbBox.h:1804
void setBounds(const SbVec2f &_min, const SbVec2f &_max)
Sets the corners of the box.
Definition SbBox.h:1879
void getSize(float &sizeX, float &sizeY) const
Gets box size.
Definition SbBox.h:1911
const SbVec2f & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:1836
SbVec2f getCenter() const
Returns the center of the box.
friend int operator==(const SbBox2f &b1, const SbBox2f &b2)
Equality comparison.
SbVec2f getSize() const
Return box size.
Definition SbBox.h:1927
SbBox2f(float xmin, float ymin, float xmax, float ymax)
Constructor for a 2D float box.
Definition SbBox.h:1811
SbBox2f(const SbVec2f &_min, const SbVec2f &_max)
Constructor for a 2D float box.
Definition SbBox.h:1818
const SbVec2f & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:1830
SbVec2f getClosestPoint(const SbVec2f &point) const
Returns the closest point on the box to the given point.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:1949
void setBounds(float xmin, float ymin, float xmax, float ymax)
Sets the corners of the box.
Definition SbBox.h:1873
SbBool intersect(const SbBox2f &bb) const
Returns TRUE if the specified box intersects this box.
void getBounds(SbVec2f &_min, SbVec2f &_max) const
Gets the corners of the box.
Definition SbBox.h:1893
void getOrigin(float &originX, float &originY) const
Gets box origin.
Definition SbBox.h:1905
SbBox2f intersection(const SbBox2f &box) const
Returns the intersection of the specified box with this box.
void getBounds(float &xmin, float &ymin, float &xmax, float &ymax) const
Gets the corners of the box.
Definition SbBox.h:1885
friend int operator!=(const SbBox2f &b1, const SbBox2f &b2)
Inequality comparison.
Definition SbBox.h:1966
void makeEmpty()
Makes an empty box.
void extendBy(const SbVec2f &pt)
Extends this box (if necessary) to contain the specified point.
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:1955
void extendBy(const SbBox2f &r)
Extends this box (if necessary) to contain the specified box.
SbBool intersect(const SbVec2f &pt) const
Returns TRUE if the specified point intersects this box.
2D box class.
Definition SbBox.h:2383
void extendBy(const SbBox2i32 &r)
Extends this box (if necessary) to contain the specified box.
~SbBox2i32()
Destructor.
Definition SbBox.h:2409
SbBool intersect(const SbBox2i32 &bb) const
Returns TRUE if the specified box intersects this box.
void extendBy(const SbVec2i32 &pt)
Extends this box (if necessary) to contain the specified point.
void getSize(int &sizeX, int &sizeY) const
Returns box size.
Definition SbBox.h:2485
SbBox2i32()
Constructor for a 2D integer box.
Definition SbBox.h:2389
void setBounds(const SbVec2i32 &_min, const SbVec2i32 &_max)
Sets the corners of the box.
Definition SbBox.h:2459
const SbVec2i32 & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:2421
void setBounds(int xmin, int ymin, int xmax, int ymax)
Sets the corners of the box.
Definition SbBox.h:2453
SbBox2i32 intersection(const SbBox2i32 &box) const
Returns the intersection of the specified box with this box.
void getOrigin(int &originX, int &originY) const
Returns origin (minimum point) of box.
Definition SbBox.h:2479
void getBounds(SbVec2i32 &_min, SbVec2i32 &_max) const
Gets the corners of the box.
Definition SbBox.h:2473
SbBool intersect(const SbVec2i32 &pt) const
Returns TRUE if the specified point intersects this box.
friend int operator==(const SbBox2i32 &b1, const SbBox2i32 &b2)
Equality comparison.
void makeEmpty()
Makes an empty box.
friend int operator!=(const SbBox2i32 &b1, const SbBox2i32 &b2)
Inequality comparison.
Definition SbBox.h:2528
SbBox2i32(const SbVec2i32 &_min, const SbVec2i32 &_max)
Constructor for a 2D integer box.
Definition SbBox.h:2403
const SbVec2i32 & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:2415
float getAspectRatio() const
Returns aspect ratio (ratio of width to height) of box.
Definition SbBox.h:2512
void getBounds(int &xmin, int &ymin, int &xmax, int &ymax) const
Gets the corners of the box.
Definition SbBox.h:2465
SbVec2i32 getSize() const
Return box size.
Definition SbBox.h:2501
SbBox2i32(int xmin, int ymin, int xmax, int ymax)
Constructor for a 2D integer box.
Definition SbBox.h:2396
2D box class.
Definition SbBox.h:2194
~SbBox2s()
Destructor.
Definition SbBox.h:2220
friend int operator==(const SbBox2s &b1, const SbBox2s &b2)
Equality comparison.
SbBool intersect(const SbVec2s &pt) const
Returns TRUE if the specified point intersects this box.
SbBox2s intersection(const SbBox2s &box) const
Returns the intersection of the specified box with this box.
friend int operator!=(const SbBox2s &b1, const SbBox2s &b2)
Inequality comparison.
Definition SbBox.h:2352
SbVec2s getSize() const
Return box size.
Definition SbBox.h:2312
void getBounds(short &xmin, short &ymin, short &xmax, short &ymax) const
Gets the corners of the box.
Definition SbBox.h:2276
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:2340
void setBounds(short xmin, short ymin, short xmax, short ymax)
Sets the corners of the box.
Definition SbBox.h:2264
SbBool intersect(const SbBox2s &bb) const
Returns TRUE if the specified box intersects this box.
void setBounds(const SbVec2s &_min, const SbVec2s &_max)
Sets the corners of the box.
Definition SbBox.h:2270
void extendBy(const SbBox2s &r)
Extends this box (if necessary) to contain the specified box.
void getOrigin(short &originX, short &originY) const
Returns origin (minimum point) of box.
Definition SbBox.h:2290
SbBox2s(const SbVec2s &_min, const SbVec2s &_max)
Constructor for a 2D integer box.
Definition SbBox.h:2214
float getAspectRatio() const
Returns aspect ratio (ratio of width to height) of box.
Definition SbBox.h:2323
void getSize(short &sizeX, short &sizeY) const
Returns box size.
Definition SbBox.h:2296
SbBox2s()
Constructor for a 2D integer box.
Definition SbBox.h:2200
void makeEmpty()
Makes an empty box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:2334
void getBounds(SbVec2s &_min, SbVec2s &_max) const
Gets the corners of the box.
Definition SbBox.h:2284
const SbVec2s & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:2232
SbBox2s(short xmin, short ymin, short xmax, short ymax)
Constructor for a 2D integer box.
Definition SbBox.h:2207
void extendBy(const SbVec2s &pt)
Extends this box (if necessary) to contain the specified point.
const SbVec2s & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:2226
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:972
SbBox3d(const T &b)
Constructor that converts an arbitrary SbBox3 to an SbBox3f.
Definition SbBox.h:1214
SbBox3d intersection(const SbBox3d &box) const
Returns the intersection of the specified box with this box.
SbBool intersect(const SbVec3d &pt) const
Returns TRUE if the specified point intersects this box.
const SbVec3d & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:1015
void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Sets the corners of the box.
Definition SbBox.h:1098
void makeEmpty()
Makes an empty box.
SbBool contains(const SbBox3d &bb) const
Returns TRUE if the specified box is fully contained inside this box.
Definition SbBox.h:1067
SbVec3d & getMax()
Returns the maximum point of the box.
Definition SbBox.h:1029
~SbBox3d()
Destructor.
Definition SbBox.h:999
SbBox3d(const SbVec3d &_min, const SbVec3d &_max)
Constructor for a 3D double box.
Definition SbBox.h:993
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
Sets the corners of the box.
Definition SbBox.h:1105
void getBounds(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
Gets the corners of the box.
Definition SbBox.h:1111
void getOrigin(double &originX, double &originY, double &originZ) const
Gets box origin which is the same as the minimum corner of the box.
Definition SbBox.h:1131
void getBounds(SbVec3d &_min, SbVec3d &_max) const
Gets the corners of the box.
Definition SbBox.h:1119
SbBox3d()
Constructor for a 3D double box.
Definition SbBox.h:978
void getSize(double &sizeX, double &sizeY, double &sizeZ) const
Gets box size.
Definition SbBox.h:1137
SbVec3d getClosestPoint(const SbVec3d &point) const
Returns the closest point on the box to the given point.
const SbVec3d & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:1007
SbVec3d getSize() const
Gets box size.
Definition SbBox.h:1154
SbVec3d & getMin()
Returns the minimum point of the box.
Definition SbBox.h:1022
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:1170
friend int operator==(const SbBox3d &b1, const SbBox3d &b2)
Equality comparison.
SbBox3d(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Constructor for a 3D double box.
Definition SbBox.h:985
SbBool outside(const SbMatrixd &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
SbVec3d getCenter() const
Returns the center of the box.
void transform(const SbMatrixd &m)
Transforms box by matrix, enlarging box to contain result.
friend int operator!=(const SbBox3d &b1, const SbBox3d &b2)
Inequality comparison.
Definition SbBox.h:1207
void extendBy(const SbVec3d &pt)
Extends this box (if necessary) to contain the specified point.
SbBool intersect(const SbBox3d &bb) const
Returns TRUE if the specified box intersects this box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:1177
void extendBy(const SbBox3d &bb)
Extends this box (if necessary) to contain the specified box.
void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const
Finds the span of a box along a specified direction.
double getVolume() const
Returns the volume of the box.
3D box class.
Definition SbBox.h:649
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:865
float computeMaxDistance2(const SbVec3f &p) const
Returns the squared maximum distance between a point and the 8 bounding box's vertices.
~SbBox3f()
Destructor.
Definition SbBox.h:676
float getVolume() const
Returns the volume of the box.
void getOrigin(float &originX, float &originY, float &originZ) const
Gets box origin which is the same as the minimum corner of the box.
Definition SbBox.h:822
SbBool intersect(const SbBox3f &bb) const
Returns TRUE if the specified box intersects this box.
Definition SbBox.h:740
void makeEmpty()
Makes an empty box.
Definition SbBox.h:856
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the corners of the box.
Definition SbBox.h:789
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
void setBounds(const SbVec3f &_min, const SbVec3f &_max)
Sets the corners of the box.
Definition SbBox.h:796
const SbVec3f & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:684
friend int operator!=(const SbBox3f &b1, const SbBox3f &b2)
Inequality comparison.
Definition SbBox.h:902
SbBox3f intersection(const SbBox3f &box) const
Returns the intersection of the specified box with this box.
friend std::ostream & operator<<(std::ostream &os, const SbBox3f &b)
Writes the box to the specified output stream.
Definition SbBox.h:2539
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Gets the corners of the box.
Definition SbBox.h:802
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
SbBool triangleBoxOverlap(const SbVec3f &u0, const SbVec3f &u1, const SbVec3f &u2) const
Return true if the given triangle intersects the bounding box.
SbBox3f(const T &b)
Constructor that converts an arbitrary SbBox3 to an SbBox3f.
Definition SbBox.h:914
SbVec3f & getMax()
Returns the maximum point of the box.
Definition SbBox.h:706
void getSize(float &sizeX, float &sizeY, float &sizeZ) const
Gets box size.
Definition SbBox.h:829
void getBounds(SbVec3f &_min, SbVec3f &_max) const
Gets the corners of the box.
Definition SbBox.h:810
void extendBy(const SbBox3f &bb)
Extends this box (if necessary) to contain the specified box.
SbBox3f(const SbVec3f &_min, const SbVec3f &_max)
Constructor for a 3D float box.
Definition SbBox.h:670
SbVec3f getCenter() const
Returns the center of the box.
friend int operator==(const SbBox3f &b1, const SbBox3f &b2)
Equality comparison.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:872
SbBox3f(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Constructor for a 3D float box.
Definition SbBox.h:662
SbVec3f & getMin()
Returns the minimum point of the box.
Definition SbBox.h:691
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
SbBool contains(const SbBox3f &bb) const
Returns TRUE if the specified box is fully contained inside this box.
Definition SbBox.h:757
SbVec3f getSize() const
Gets box size.
Definition SbBox.h:845
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
Definition SbBox.h:717
SbBox3f()
Constructor for a 3D float box.
Definition SbBox.h:655
const SbVec3f & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:699
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:96
friend std::ostream & operator<<(std::ostream &os, const SbBox3i32 &b)
Writes the box to the specified output stream.
Definition SbBox.h:2547
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
void getBounds(SbVec3i32 &_min, SbVec3i32 &_max) const
Gets the corners of the box.
Definition SbBox.h:252
~SbBox3i32()
Destructor.
Definition SbBox.h:128
SbBool intersect(const SbBox3i32 &bb) const
Returns TRUE if the specified box intersects this box.
SbVec3i32 & getMin()
Returns the minimum point of the box.
Definition SbBox.h:151
void makeEmpty()
Makes an empty box.
void getSize(int &sizeX, int &sizeY, int &sizeZ) const
Gets box size.
Definition SbBox.h:271
SbBox3i32(const SbVec3i32 &_min, const SbVec3i32 &_max)
Constructor for a 3D integer32 box.
Definition SbBox.h:117
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
SbBox3i32 intersection(const SbBox3i32 &box) const
Returns the intersection of the specified box with this box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:305
SbVec3i32 & getMax()
Returns the maximum point of the box.
Definition SbBox.h:158
SbBox3i32(const SbBox3s &box)
Constructor given an SbBox3s (adapter).
friend int operator==(const SbBox3i32 &b1, const SbBox3i32 &b2)
Equality comparison.
SbVec3f getCenter() const
Returns the center of the box.
SbVec3i32 getSize() const
Gets box size.
Definition SbBox.h:287
SbBox3i32 operator=(const SbBox3s &box)
Assignment operator given an SbBox3s (adapter).
SbBool contains(const SbBox3i32 &bb) const
Returns TRUE if the specified box is fully contained inside this box.
Definition SbBox.h:200
void getOrigin(int &originX, int &originY, int &originZ) const
Gets box origin which is the same as the minimum corner of the box.
Definition SbBox.h:264
float getVolume() const
Returns the volume of the box.
friend int operator!=(const SbBox3i32 &b1, const SbBox3i32 &b2)
Inequality comparison.
Definition SbBox.h:352
SbBox3i32()
Constructor for a 3D integer32 box.
Definition SbBox.h:102
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBool intersect(const SbVec3i32 &pt) const
Returns TRUE if the specified point intersects this box.
const SbVec3i32 & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:136
void getBounds(int &xmin, int &ymin, int &zmin, int &xmax, int &ymax, int &zmax) const
Gets the corners of the box.
Definition SbBox.h:244
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:312
SbBox3i32(int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
Constructor for a 3D integer32 box.
Definition SbBox.h:109
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
void setBounds(int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
Sets the corners of the box.
Definition SbBox.h:231
void setBounds(const SbVec3i32 &_min, const SbVec3i32 &_max)
Sets the corners of the box.
Definition SbBox.h:238
const SbVec3i32 & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:144
void extendBy(const SbBox3i32 &bb)
Extends this box (if necessary) to contain the specified box.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:383
const SbVec3s & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:424
void getBounds(short &xmin, short &ymin, short &zmin, short &xmax, short &ymax, short &zmax) const
Gets the corners of the box.
Definition SbBox.h:528
SbVec3f getCenter() const
Returns the center of the box.
SbBool contains(const SbBox3s &bb) const
Returns TRUE if the specified box is fully contained inside this box.
Definition SbBox.h:484
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBox3s(const SbBox3i32 &box)
Constructor given an SbBox3i32 (adapter).
void getBounds(SbVec3s &_min, SbVec3s &_max) const
Gets the corners of the box.
Definition SbBox.h:536
SbVec3s & getMax()
Returns the maximum point of the box.
Definition SbBox.h:446
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
SbVec3s & getMin()
Returns the minimum point of the box.
Definition SbBox.h:439
SbBox3s operator=(const SbBox3i32 &box)
Assignment operator given an SbBox3i32 (adapter).
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
void setBounds(short xmin, short ymin, short zmin, short xmax, short ymax, short zmax)
Sets the corners of the box.
Definition SbBox.h:515
SbBox3s()
Constructor for a 3D short box.
Definition SbBox.h:389
~SbBox3s()
Destructor.
Definition SbBox.h:416
float getVolume() const
Returns the volume of the box.
friend int operator==(const SbBox3s &b1, const SbBox3s &b2)
Equality comparison.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
friend int operator!=(const SbBox3s &b1, const SbBox3s &b2)
Inequality comparison.
Definition SbBox.h:618
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
void extendBy(const SbBox3s &bb)
Extends this box (if necessary) to contain the specified box.
SbBool intersect(const SbBox3s &bb) const
Returns TRUE if the specified box intersects this box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:575
void setBounds(const SbVec3s &_min, const SbVec3s &_max)
Sets the corners of the box.
Definition SbBox.h:522
SbBox3s intersection(const SbBox3s &box) const
Returns the intersection of the specified box with this box.
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
void getOrigin(short &originX, short &originY, short &originZ) const
Gets box origin which is the same as the minimum corner of the box.
Definition SbBox.h:548
SbBox3s(const SbVec3s &_min, const SbVec3s &_max)
Constructor for a 3D short box.
Definition SbBox.h:404
const SbVec3s & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:432
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
Definition SbBox.h:582
SbBox3s(short xmin, short ymin, short zmin, short xmax, short ymax, short zmax)
Constructor for a 3D short box.
Definition SbBox.h:396
void makeEmpty()
Makes an empty box.
void getSize(short &sizeX, short &sizeY, short &sizeZ) const
Gets box size.
Definition SbBox.h:554
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 4D box class.
Definition SbBox.h:2586
SbVec4i32 & getMin()
Returns the minimum point of the box.
Definition SbBox.h:2630
SbBox4i32(const SbVec4i32 &_min, const SbVec4i32 &_max)
Constructor for a 4D integer32 box.
Definition SbBox.h:2601
friend std::ostream & operator<<(std::ostream &os, const SbBox4i32 &b)
Writes the box to the specified output stream.
Definition SbBox.h:2694
void makeEmpty()
Makes an empty box.
const SbVec4i32 & getMin() const
Returns the minimum point of the box.
Definition SbBox.h:2615
const SbVec4i32 & getMax() const
Returns the maximum point of the box.
Definition SbBox.h:2623
SbBox4i32()
Constructor for a 4D integer32 box.
Definition SbBox.h:2592
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:2688
SbVec4i32 & getMax()
Returns the maximum point of the box.
Definition SbBox.h:2637
SbBool intersect(const SbVec4i32 &pt) const
Returns TRUE if the specified point intersects this box.
Definition SbBox.h:2657
void extendBy(const SbVec4i32 &pt)
Extends this box (if necessary) to contain the specified point.
Definition SbBox.h:2643
SbVec4i32 getSize() const
Gets box size.
Definition SbBox.h:2672
friend int operator==(const SbBox4i32 &b1, const SbBox4i32 &b2)
Equality comparison.
Definition SbBox.h:2702
friend int operator!=(const SbBox4i32 &b1, const SbBox4i32 &b2)
Inequality comparison.
Definition SbBox.h:2710
~SbBox4i32()
Destructor.
Definition SbBox.h:2607
4x4 matrix class.
Definition SbMatrix.h:309
void setValue(const SbMat &m)
Sets matrix from a 4x4 array of elements.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 4x4 matrix class...
Definition SbMatrix.h:756
void setValue(const SbMatd &m)
Sets value from 4x4 array of elements.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 2D vector class ...
Definition SbVec.h:314
SbVec2d & setValue(const double v[2])
Sets the vector components.
const double * getValue() const
Returns vector components.
Definition SbVec.h:341
2D vector class.
Definition SbVec.h:76
const float * getValue() const
Returns vector components.
Definition SbVec.h:108
SbVec2f & setValue(const float v[2])
Sets the vector components.
2D vector class.
Definition SbVec.h:517
SbVec2i32 & setValue(const int32_t v[2])
Sets value of vector from array of 2 components.
const int32_t * getValue() const
Returns pointer to array of 2 components.
Definition SbVec.h:539
2D vector class.
Definition SbVec.h:700
SbVec2s & setValue(const short v[2])
Sets vector components.
const short * getValue() const
Returns vector components.
Definition SbVec.h:734
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class ...
Definition SbVec.h:1214
SbVec3d & setValue(const double v[3])
Sets the vector components.
Definition SbVec.h:1292
const double * getValue() const
Returns vector components.
Definition SbVec.h:1259
3D vector class.
Definition SbVec.h:932
SbVec3f & setValue(const float v[3])
Sets the vector components.
Definition SbVec.h:1010
const float * getValue() const
Returns vector components.
Definition SbVec.h:977
3D vector class.
Definition SbVec.h:1517
const int32_t * getValue() const
Returns pointer to array of 3 components.
Definition SbVec.h:1546
SbVec3i32 & setValue(const int32_t v[3])
Sets value of vector from array of 3 components.
Definition SbVec.h:1558
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class.
Definition SbVec.h:1797
SbVec3s & setValue(const short v[3])
Sets vector components.
const short * getValue() const
Returns vector components.
Definition SbVec.h:1832
4D vector class.
Definition SbVec.h:2639
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box with an a...
Definition SbBox.h:1513
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
Sets the bounds of the box.
Definition SbBox.h:1636
void extendBy(const SbXfBox3d &bb)
Extends the box (if necessary) to contain the given box.
void makeEmpty()
Sets the box to contain nothing.
Definition SbBox.h:1673
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:1678
~SbXfBox3d()
Destructor.
Definition SbBox.h:1534
friend int operator==(const SbXfBox3d &b1, const SbXfBox3d &b2)
Equality comparison.
SbBool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.
Definition SbBox.h:1683
void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Sets the bounds of the box.
Definition SbBox.h:1629
const SbMatrixd & getTransform() const
Gets the transformation on the box.
Definition SbBox.h:1545
void getOrigin(double &originX, double &originY, double &originZ) const
Returns origin (minimum point) of the box.
Definition SbBox.h:1656
void transform(const SbMatrixd &m)
Transforms the box by the given matrix.
void setTransform(const SbMatrixd &m)
Sets the transformation on the box.
friend int operator!=(const SbXfBox3d &b1, const SbXfBox3d &b2)
Inequality comparison.
Definition SbBox.h:1709
void extendBy(const SbBox3d &bb)
Extends the box (if necessary) to contain the given box.
Definition SbBox.h:1602
double getVolume() const
Gives the volume of the box (0 for an empty box).
SbXfBox3d()
Constructor.
SbXfBox3d(const SbBox3d &box)
Constructor.
SbBool intersect(const SbBox3d &bb) const
Returns TRUE if intersection of this XfBox3d and the given Box3d is not empty.
Definition SbBox.h:1618
void extendBy(const SbVec3d &pt)
Extends the box (if necessary) to contain the given 3D point.
const SbMatrixd & getInverse() const
Gets the inverse of the transformation on the box.
Definition SbBox.h:1551
SbBox3d project() const
Projects an SbXfBox3d to an SbBox3d.
void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const
Finds the extent of the box along a particular direction.
Definition SbBox.h:1688
SbBool intersect(const SbVec3d &pt) const
Returns TRUE if intersection of given point and this box is not empty.
SbVec3d getCenter() const
Returns the center of the box.
void getBounds(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
Gets the bounds of the box.
Definition SbBox.h:1642
SbXfBox3d(const SbVec3d &_min, const SbVec3d &_max)
Constructor.
SbXfBox3d & setValue(const SbXfBox3f &xfbox3f)
Sets value of the box from a single precision box.
Definition SbBox.h:1756
void getSize(double &sizeX, double &sizeY, double &sizeZ) const
Returns size of the box.
Definition SbBox.h:1662
void getBounds(SbVec3d &_min, SbVec3d &_max) const
Gets the bounds of the box.
Definition SbBox.h:1650
3D box with an associated transformation matrix.
Definition SbBox.h:1250
void transform(const SbMatrix &m)
Transforms the box by the given matrix.
const SbMatrix & getInverse() const
Gets the inverse of the transformation on the box.
Definition SbBox.h:1288
SbXfBox3f(const SbBox3f &box)
Constructor.
void extendBy(const SbXfBox3f &bb)
Extends the box (if necessary) to contain the given box.
float getVolume() const
Gives the volume of the box (0 for an empty box).
float computeMaxDistance2(const SbVec3f &p) const
Returns the squared maximum distance between a point and the 8 bounding box's vertices.
SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)
Constructor.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
Definition SbBox.h:1418
SbBox3f project() const
Projects an SbXfBox3f to an SbBox3f.
void getOrigin(float &originX, float &originY, float &originZ)
Returns origin (minimum point) of the box.
Definition SbBox.h:1395
SbBool intersect(const SbBox3f &bb) const
Returns TRUE if intersection of given box and this box is not empty.
Definition SbBox.h:1357
SbXfBox3f()
Constructor.
friend int operator!=(const SbXfBox3f &b1, const SbXfBox3f &b2)
Inequality comparison.
Definition SbBox.h:1460
SbVec3f getCenter() const
Returns the center of the box.
~SbXfBox3f()
Destructor.
Definition SbBox.h:1271
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Gets the bounds of the box.
Definition SbBox.h:1381
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the extent of the box along a particular direction.
Definition SbBox.h:1428
void setBounds(const SbVec3f &_min, const SbVec3f &_max)
Sets the bounds of the box.
Definition SbBox.h:1375
SbXfBox3f & setValue(const SbXfBox3d &xfbox3d)
Sets value of the box from a double precision box.
Definition SbBox.h:1736
void getSize(float &sizeX, float &sizeY, float &sizeZ)
Returns size of the box.
Definition SbBox.h:1402
void setTransform(const SbMatrix &m)
Sets the transformation on the box.
void getBounds(SbVec3f &_min, SbVec3f &_max) const
Gets the bounds of the box.
Definition SbBox.h:1389
void makeEmpty()
Sets the box to contain nothing.
Definition SbBox.h:1413
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the bounds of the box.
Definition SbBox.h:1368
friend int operator==(const SbXfBox3f &b1, const SbXfBox3f &b2)
Equality comparison.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if intersection of given point and this box is not empty.
void extendBy(const SbBox3f &bb)
Extends the box (if necessary) to contain the given box.
Definition SbBox.h:1341
const SbMatrix & getTransform() const
Gets the transformation on the box.
Definition SbBox.h:1282
SbBool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.
Definition SbBox.h:1423
void extendBy(const SbVec3f &pt)
Extends the box (if necessary) to contain the given 3D point.
int SbBool
Boolean type.
Definition SbBase.h:87