HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~HOM_Volume()
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 
123 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:973
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLuint buffer
Definition: glcorearb.h:659
virtual std::string __repr__()=0
long long int64
Definition: SYS_Types.h:100
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:972
HOM_Volume(const HOM_Volume &volume)
Definition: HOM_Volume.h:27
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1601
GA_API const UT_StringHolder transform
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GLuint index
Definition: glcorearb.h:785
ScalarToVectorConverter< GridType >::Type::Ptr gradient(const GridType &grid, bool threaded, InterruptT *interrupt)
Compute the gradient of the given scalar grid.
virtual ~HOM_Volume()
Definition: HOM_Volume.h:31
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794