HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_ChannelPrim.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_ChannelPrim_h__
10 #define __HOM_ChannelPrim_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Prim.h"
16 #include "HOM_IterableList.h"
17 #include <vector>
18 #include <stdexcept>
19 
20 SWIGOUT(%rename(ChannelPrim) HOM_ChannelPrim;)
21 
22 class HOM_API HOM_ChannelPrim : virtual public HOM_Prim
23 {
24 public:
26  { HOM_CONSTRUCT_OBJECT(this) }
28  : HOM_Prim(face)
29  { HOM_CONSTRUCT_OBJECT(this) }
30  ~HOM_ChannelPrim() override
31  { HOM_DESTRUCT_OBJECT(this) }
32 
33  // TODO: Do we need to explicitly add operator== and operator!=, or
34  // does swig pick up the base class ones?
35 
36  // Let swig know we're overriding __repr__ for this class so it doesn't
37  // provide its own __repr__.
38  SWIGOUT(virtual std::string __repr__() = 0;)
39 
40  SWIGOUT(%newobject vertex;)
41  virtual HOM_Vertex *vertex(int index) = 0;
42 
43  SWIGOUT(%newobject addVertex;)
44  virtual HOM_Vertex *addVertex(HOM_Point &point) = 0;
45 
46  virtual double start() = 0;
47  virtual double end() = 0;
48  virtual double length() = 0;
49 
50  virtual void setStart(double frame) = 0;
51 
52  virtual double defaultValue() = 0;
53  virtual void setDefaultValue(double value) = 0;
54 
55  SWIGOUT(%warnfilter(321) eval;)
56  virtual double eval(double frame) = 0;
57  virtual double _evalSlope(double frame) = 0;
58 
59  virtual bool hasKeyAtFrame(double frame) = 0;
60 
61  virtual void insertKey(double frame, bool auto_slope = true) = 0;
62  virtual void destroyKey(double frame) = 0;
63  virtual void destroyKeys(double frame_start, double frame_end) = 0;
64 
65  virtual void clear() = 0;
66 
67  /// Get the index of the key at the given frame. Returns -1 If there is no
68  /// key at that frame.
69  virtual int keyIndex(double frame) = 0;
70 
71  virtual bool setKeyValue(double frame, double value,
72  HOM_EnumValue *key_half=nullptr) = 0;
73  virtual bool setKeySlope(double frame, double slope,
74  HOM_EnumValue *key_half=nullptr) = 0;
75  virtual bool setKeyAccel(double frame, double accel,
76  HOM_EnumValue *key_half=nullptr) = 0;
77 
78  virtual double keyValue(double frame, HOM_EnumValue *key_half=nullptr) = 0;
79  virtual double keySlope(double frame, HOM_EnumValue *key_half=nullptr) = 0;
80  virtual double keyAccel(double frame, HOM_EnumValue *key_half=nullptr) = 0;
81 
82  virtual bool setKeyAutoSlope(double frame, bool auto_slope,
83  HOM_EnumValue *key_half = nullptr) = 0;
84 
85  /// Get the type of the segment that starts at the given frame
86  virtual HOM_EnumValue &segmentType(double frame) = 0;
87  /// Set the type of the segment that starts at the given frame
88  virtual void setSegmentType(double frame, HOM_EnumValue &type) = 0;
89 
90  virtual std::vector<double> keyFrames() = 0;
91  virtual std::vector<double> keyValues(HOM_EnumValue *key_half=nullptr) = 0;
92  virtual std::vector<double> keySlopes(HOM_EnumValue *key_half=nullptr) = 0;
93  virtual std::vector<double> keyAccels(HOM_EnumValue *key_half=nullptr) = 0;
94 
95  virtual void setKeyValues(const std::vector<double> &values,
96  HOM_EnumValue *key_half = nullptr) = 0;
97  virtual void setKeySlopes(const std::vector<double> &slopes,
98  HOM_EnumValue *key_half = nullptr) = 0;
99  virtual void setKeyAccels(const std::vector<double> &accels,
100  HOM_EnumValue *key_half = nullptr) = 0;
101 
102  virtual void moveKeyframes(const std::vector<int> &key_indices,
103  const std::vector<double> &frame_offsets) = 0;
104 
105  virtual void smoothAutoSlopes(bool force = false) = 0;
106  virtual void smoothAutoSlopesForKeys(int start_index,
107  int end_index = -1,
108  bool force = false) = 0;
109 };
110 
111 #endif
SIM_API const UT_StringHolder vertex
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1343
GA_API const UT_StringHolder accel
GLuint start
Definition: glcorearb.h:475
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
#define HOM_API
Definition: HOM_API.h:13
~HOM_ChannelPrim() override
GLuint GLuint end
Definition: glcorearb.h:475
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1342
HUSD_API bool eval(VtValue &val, T &ret_val)
SIM_API const UT_StringHolder force
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
HOM_ChannelPrim(const HOM_ChannelPrim &face)
GLuint index
Definition: glcorearb.h:786