HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_BoundingBox.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_BoundingBox_h__
10 #define __HOM_BoundingBox_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Module.h"
16 #include "HOM_Vector3.h"
17 #include "HOM_PtrOrNull.h"
18 #include <UT/UT_BoundingBox.h>
19 #include <vector>
20 
21 class HOM_Matrix4;
22 
23 SWIGOUT(%rename(BoundingBox) HOM_BoundingBox;)
24 
26 {
27 public:
29  : myBoundingBox(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)
30  { HOM_CONSTRUCT_OBJECT(this) }
31 
33  double xmin, double ymin, double zmin,
34  double xmax, double ymax, double zmax)
35  : myBoundingBox(xmin, ymin, zmin, xmax, ymax, zmax)
36  { HOM_CONSTRUCT_OBJECT(this) }
37 
39  : myBoundingBox(src.myBoundingBox)
40  { HOM_CONSTRUCT_OBJECT(this) }
41 
44  : myBoundingBox(bbox)
45  { HOM_CONSTRUCT_OBJECT(this) }
46 
48  { HOM_DESTRUCT_OBJECT(this) }
49 
51  { return bbox.myPointer && myBoundingBox == bbox.myPointer->myBoundingBox; }
52 
54  { return !operator==(bbox); }
55 
56  bool isAlmostEqual(HOM_BoundingBox &bbox, double tolerance=0.00001);
57 
58  // This method is deprecated.
59  bool almostEqual(HOM_BoundingBox &bbox, double tolerance=0.00001)
60  { return isAlmostEqual(bbox, tolerance); }
61 
62  int __hash__();
65 
66  HOM_BoundingBox __mul__(const HOM_Matrix4 &matrix4);
67 
68  bool isValid()
69  { return myBoundingBox.isValid(); }
70 
71  void setTo(const std::vector<double> &tuple);
72 
74  { return myBoundingBox.minvec(); }
76  { return myBoundingBox.maxvec(); }
78  { return myBoundingBox.size(); }
79 
81  { return myBoundingBox.center(); }
82 
83  void enlargeToContain(const std::vector<double> &point);
85  { myBoundingBox.enlargeBounds(bbox.myBoundingBox); }
86 
87  bool contains(const std::vector<double> &point);
88 
89  SWIGOUT(%ignore operator=;)
90  HOM_BoundingBox &operator=(const HOM_BoundingBox& bbox)
91  {
92  myBoundingBox = bbox.myBoundingBox;
93  return *this;
94  }
95 
97  { return &myBoundingBox; }
98 
99 
100  SWIGOUT(%ignore myBoundingBox;)
101  UT_BoundingBoxD myBoundingBox;
102 };
103 
104 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
bool almostEqual(HOM_BoundingBox &bbox, double tolerance=0.00001)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
bool operator!=(HOM_PtrOrNull< HOM_BoundingBox > bbox)
void * _asVoidPointer()
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
HOM_Vector3 sizevec()
HOM_Vector3 maxvec()
HOM_Vector3 center()
HOM_Vector3 minvec()
GLfloat f
Definition: glcorearb.h:1926
UT_BoundingBoxD myBoundingBox
std::string __str__()
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
HOM_BoundingBox(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
bool operator==(HOM_PtrOrNull< HOM_BoundingBox > bbox)
void enlargeToContain(const HOM_BoundingBox &bbox)
int __hash__()
HOM_BoundingBox(const UT_BoundingBoxD &bbox)
void setTo(const std::vector< double > &sequence)
HOM_BoundingBox(const HOM_BoundingBox &src)
HOM_Matrix4 __mul__(HOM_Matrix4 &matrix4)
Definition: HOM_Matrix4.h:108
bool isAlmostEqual(HOM_Matrix4 &matrix4, double tolerance=0.00001)
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
GLenum src
Definition: glcorearb.h:1793