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 double defaultValue() = 0;
51  virtual void setDefaultValue(double value) = 0;
52 
53  SWIGOUT(%warnfilter(321) eval;)
54  virtual double eval(double frame) = 0;
55  virtual double _evalSlope(double frame) = 0;
56 
57  virtual bool hasKeyAtFrame(double frame) = 0;
58 
59  virtual void insertKey(double frame, bool auto_slope = true) = 0;
60  virtual void destroyKey(double frame) = 0;
61 
62  virtual void clear() = 0;
63 
64  /// Get the index of the key at the given frame. Returns -1 If there is no
65  /// key at that frame.
66  virtual int keyIndex(double frame) = 0;
67 
68  virtual bool setKeyValue(double frame, double value,
69  HOM_EnumValue *key_half=nullptr) = 0;
70  virtual bool setKeySlope(double frame, double slope,
71  HOM_EnumValue *key_half=nullptr) = 0;
72  virtual bool setKeyAccel(double frame, double accel,
73  HOM_EnumValue *key_half=nullptr) = 0;
74 
75  virtual bool setKeyAutoSlope(double frame, bool auto_slope,
76  HOM_EnumValue *key_half = nullptr) = 0;
77 
78  /// Get the type of the segment that starts at the given frame
79  virtual HOM_EnumValue &segmentType(double frame) = 0;
80  /// Set the type of the segment that starts at the given frame
81  virtual void setSegmentType(double frame, HOM_EnumValue &type) = 0;
82 
83  virtual std::vector<double> keyFrames() = 0;
84  virtual std::vector<double> keyValues() = 0;
85 
86  virtual void moveKeyframes(const std::vector<int> &key_indices,
87  const std::vector<double> &frame_offsets) = 0;
88 
89  virtual void smoothAutoSlopes(bool force = false) = 0;
90  virtual void smoothAutoSlopesForKeys(int start_index,
91  int end_index = -1,
92  bool force = false) = 0;
93 };
94 
95 #endif
SIM_API const UT_StringHolder vertex
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GA_API const UT_StringHolder accel
GLuint start
Definition: glcorearb.h:475
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
#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:1302
HUSD_API bool eval(VtValue &val, T &ret_val)
SIM_API const UT_StringHolder force
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
Definition: core.h:1131
type
Definition: core.h:1059