HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Volume.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_Volume_h__
10 #define __HOM_Volume_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_BinaryString.h"
14 #include "HOM_Prim.h"
15 
16 SWIGOUT(%rename(Volume) HOM_Volume;)
17 
18 class HOM_API HOM_Volume : virtual public HOM_Prim
19 {
20 public:
22  { HOM_CONSTRUCT_OBJECT(this) }
23 
24  // Because the lowermost base classes initialize the virtual bases
25  // before any non-virtual bases, the correct thing to do here is
26  // explicitly call the constructor for HOM_Prim.
27  HOM_Volume(const HOM_Volume &volume)
28  : HOM_Prim(volume)
29  { HOM_CONSTRUCT_OBJECT(this) }
30 
31  ~HOM_Volume() override
32  { HOM_DESTRUCT_OBJECT(this) }
33 
34  // Let swig know we're overriding __repr__ for this class so it doesn't
35  // provide its own __repr__.
36  SWIGOUT(virtual std::string __repr__() = 0;)
37 
38  virtual double sample(const std::vector<double> &position) = 0;
39 
40  SWIGOUT(%newobject gradient;)
41  virtual HOM_Vector3 *gradient(const std::vector<double> &position) = 0;
42 
43  virtual double voxel(const std::vector<int> &index) = 0;
44 
45  virtual void setVoxel(const std::vector<int> &index, double value) = 0;
46 
47  virtual std::vector<float> allVoxels() = 0;
48 
49  virtual HOM_BinaryString allVoxelsAsString() = 0;
50 
51  virtual void setAllVoxels(const std::vector<float> &values) = 0;
52 
53  SWIGOUT(%ignore opaqueSetAllVoxelsFromString);
54  virtual void opaqueSetAllVoxelsFromString(const char *values, int64 length) = 0;
55 
56 #ifdef SWIG
57 %extend
58 {
59  void setAllVoxelsFromString(InterpreterObject values)
60  {
61  HOM_PyBuffer buffer(values);
62  self->opaqueSetAllVoxelsFromString(
63  (const char *)buffer.myData, buffer.myLength);
64  }
65 }
66 #endif
67 
68  virtual std::vector<float> voxelSlice(const char *plane, int index) = 0;
69 
70  virtual HOM_BinaryString voxelSliceAsString(const char *plane, int index) = 0;
71 
72  virtual void setVoxelSlice(
73  const std::vector<float> &values, const char *plane, int index) = 0;
74 
75  SWIGOUT(%ignore opaqueSetVoxelSliceFromString);
76  virtual void opaqueSetVoxelSliceFromString(
77  const char *values, int64 length, const char *plane, int index) = 0;
78 
79 #ifdef SWIG
80 %extend
81 {
82  void setVoxelSliceFromString(
83  InterpreterObject values, const char *plane, int index)
84  {
85  HOM_PyBuffer buffer(values);
86  self->opaqueSetVoxelSliceFromString(
87  (const char *)buffer.myData, buffer.myLength, plane, index);
88  }
89 }
90 #endif
91 
92  virtual std::vector<int> resolution() = 0;
93 
94  SWIGOUT(%newobject indexToPos;)
95  virtual HOM_Vector3 *indexToPos(const std::vector<int> &index) = 0;
96 
97  virtual std::vector<int> posToIndex(const std::vector<double> &position) = 0;
98 
99  virtual bool isValidIndex(const std::vector<int> &index) = 0;
100 
101  virtual bool isSDF() = 0;
102 
103  virtual bool isHeightField() = 0;
104 
105  virtual double volumeMax() = 0;
106 
107  virtual double volumeMin() = 0;
108 
109  virtual double volumeAverage() = 0;
110 
111  SWIGOUT(%newobject transform;)
112  virtual HOM_Matrix3 *transform() = 0;
113 
114  virtual void setTransform(HOM_Matrix4 &transform) = 0;
115 
116  virtual double taperX() = 0;
117  virtual double taperY() = 0;
118 
119  SWIGOUT(%newobject vertex;)
120  virtual HOM_Vertex *vertex(int index) = 0;
121 
122  virtual HOM_Vector3 voxelSize() = 0;
123 };
124 
125 #endif
SIM_API const UT_StringHolder vertex
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
GLuint buffer
Definition: glcorearb.h:660
~HOM_Volume() override
Definition: HOM_Volume.h:31
Definition: core.h:760
#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
long long int64
Definition: SYS_Types.h:116
HOM_Volume(const HOM_Volume &volume)
Definition: HOM_Volume.h:27
HUSD_API const char * resolution()
GA_API const UT_StringHolder transform
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
GLuint index
Definition: glcorearb.h:786
ScalarToVectorConverter< GridType >::Type::Ptr gradient(const GridType &grid, bool threaded, InterruptT *interrupt)
Compute the gradient of the given scalar grid.
SIM_API const UT_StringHolder position
Definition: core.h:1131