HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Ramp.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_Ramp_h__
10 #define __HOM_Ramp_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_EnumModules.h"
16 #include "HOM_Module.h"
17 #include <UT/UT_Ramp.h>
18 
19 
20 SWIGOUT(%rename(Ramp) HOM_Ramp;)
21 
23 {
24 public:
26  : myIsColor(false)
27  { HOM_CONSTRUCT_OBJECT(this) }
28 
29  HOM_Ramp(std::vector<HOM_EnumValue *> basis,
30  const std::vector<double> &keys,
31  const std::vector<double> &values);
32 
33  HOM_Ramp(std::vector<HOM_EnumValue *> basis,
34  const std::vector<double> &keys,
35  const std::vector<std::vector<double> > &values);
36 
38  { HOM_DESTRUCT_OBJECT(this) }
39 
40 
41  SWIGOUT(%ignore operator=;)
42  HOM_Ramp &operator=(const HOM_Ramp& ramp)
43  {
44  if (this != &ramp)
45  myRamp = ramp.myRamp;
46  return *this;
47  }
48 
50 
51  bool isColor()
52  { return myIsColor; }
53 
54  HOM_EnumValue &colorType();
55  void setColorType(HOM_EnumValue &enum_value);
56 
57 
58  std::vector<HOM_EnumValue *> basis();
59 
60  std::vector<double> keys();
61 
63  { return &myRamp; }
64 
65 
66  SWIGOUT(%ignore getUTRamp;)
68  { return myRamp; }
69 
70  SWIGOUT(%ignore setIsColor;)
71  void setIsColor(bool is_color)
72  { myIsColor = is_color; }
73 
74  SWIGOUT(%ignore rampLookup;)
75  hboost::any rampLookup(double pos);
76 
77  SWIGOUT(%ignore rampValues;)
78  hboost::any rampValues();
79 
80  // Internal converters
81  SWIGOUT(%ignore splineBasisForEnumValue;)
82  static UT_SPLINE_BASIS splineBasisForEnumValue(
83  HOM_EnumValue &enum_value);
84  SWIGOUT(%ignore splineBasisToEnumValue;)
85  static HOM_EnumValue & splineBasisToEnumValue(UT_SPLINE_BASIS basis);
86 
87 #ifdef SWIG
88 %extend
89 {
90  InterpreterObject lookup(double pos)
91  {
92  return HOMboostAnyToInterpreterObject(self->rampLookup(pos));
93  }
94 
95  InterpreterObject values()
96  {
97  return HOMboostAnyToInterpreterObject(self->rampValues());
98  }
99 }
100 #endif
101 
102 private:
103  UT_Ramp myRamp;
104  bool myIsColor;
105 };
106 
107 #endif
#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
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
UT_SPLINE_BASIS
Definition: UT_Spline.h:31
UT_Ramp & getUTRamp()
Definition: HOM_Ramp.h:67
bool isColor()
Definition: HOM_Ramp.h:51
bool any(const vbool4 &v)
Definition: simd.h:3468
#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_Ramp()
Definition: HOM_Ramp.h:25
void setIsColor(bool is_color)
Definition: HOM_Ramp.h:71
void * _asVoidPointer()
Definition: HOM_Ramp.h:62
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
~HOM_Ramp()
Definition: HOM_Ramp.h:37