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 HOM_EnumValue &storageType() = 0;
39  virtual int channelCount() = 0;
40 
41  virtual HOM_EnumValue &visualization() = 0;
42 
43  virtual double sample(const std::vector<double> &position) = 0;
44 
45  SWIGOUT(%newobject gradient;)
46  virtual HOM_Vector3 *gradient(const std::vector<double> &position) = 0;
47 
48  virtual double voxel(const std::vector<int> &index) = 0;
49 
50  virtual void setVoxel(const std::vector<int> &index, double value) = 0;
51 
52  virtual std::vector<float> allVoxels() = 0;
53 
54  virtual HOM_BinaryString allVoxelsAsString() = 0;
55 
56  virtual void setAllVoxels(const std::vector<float> &values) = 0;
57 
58  SWIGOUT(%ignore opaqueSetAllVoxelsFromString);
59  virtual void opaqueSetAllVoxelsFromString(const char *values, int64 length) = 0;
60 
61 #ifdef SWIG
62 %extend
63 {
64  void setAllVoxelsFromString(InterpreterObject values)
65  {
66  HOM_PyBuffer buffer(values);
67  self->opaqueSetAllVoxelsFromString(
68  (const char *)buffer.myData, buffer.myLength);
69  }
70 }
71 #endif
72 
73  virtual std::vector<float> voxelSlice(const char *plane, int index) = 0;
74 
75  virtual HOM_BinaryString voxelSliceAsString(const char *plane, int index) = 0;
76 
77  virtual void setVoxelSlice(
78  const std::vector<float> &values, const char *plane, int index) = 0;
79 
80  SWIGOUT(%ignore opaqueSetVoxelSliceFromString);
81  virtual void opaqueSetVoxelSliceFromString(
82  const char *values, int64 length, const char *plane, int index) = 0;
83 
84 #ifdef SWIG
85 %extend
86 {
87  void setVoxelSliceFromString(
88  InterpreterObject values, const char *plane, int index)
89  {
90  HOM_PyBuffer buffer(values);
91  self->opaqueSetVoxelSliceFromString(
92  (const char *)buffer.myData, buffer.myLength, plane, index);
93  }
94 }
95 #endif
96 
97  virtual std::vector<int> resolution() = 0;
98 
99  SWIGOUT(%newobject indexToPos;)
100  virtual HOM_Vector3 *indexToPos(const std::vector<int> &index) = 0;
101 
102  virtual std::vector<int> posToIndex(const std::vector<double> &position) = 0;
103 
104  virtual bool isValidIndex(const std::vector<int> &index) = 0;
105 
106  virtual bool isSDF() = 0;
107 
108  virtual bool isHeightField() = 0;
109 
110  virtual double volumeMax() = 0;
111 
112  virtual double volumeMin() = 0;
113 
114  virtual double volumeAverage() = 0;
115 
116  SWIGOUT(%newobject transform;)
117  virtual HOM_Matrix3 *transform() = 0;
118 
119  virtual void setTransform(HOM_Matrix4 &transform) = 0;
120 
121  virtual double taperX() = 0;
122  virtual double taperY() = 0;
123 
124  SWIGOUT(%newobject vertex;)
125  virtual HOM_Vertex *vertex(int index) = 0;
126 
127  virtual HOM_Vector3 voxelSize() = 0;
128 };
129 
130 #endif
SIM_API const UT_StringHolder vertex
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1343
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#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:312
GLuint buffer
Definition: glcorearb.h:660
~HOM_Volume() override
Definition: HOM_Volume.h:31
#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:1342
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