HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_AgentClip.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_AgentClip_h__
10 #define __HOM_AgentClip_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Module.h"
14 #include "HOM_PtrOrNull.h"
15 
16 class HOM_AgentRig;
17 class HOM_ChopNode;
18 class HOM_Matrix4;
19 
20 SWIGOUT(%rename(AgentClip) HOM_AgentClip;)
21 // Force SWIG to output an __init__ method even though it determines this
22 // class is abstract.
23 SWIGOUT(%feature("notabstract") HOM_AgentClip;)
24 
26 {
27 public:
28 #ifdef SWIG
29 %extend
30 {
31  HOM_AgentClip(const char *name, const char *path, const HOM_AgentRig &rig,
32  bool keep_external_ref = true, bool delay_load = false)
33  {
34  return HOM().newAgentClip(name, path, rig,
35  keep_external_ref, delay_load);
36  }
37 
38  HOM_AgentClip(const char *name, HOM_ChopNode &chop, const HOM_AgentRig &rig,
39  double frame = HOM_AgentClip::currentFrame())
40  { return HOM().newAgentClip(name, chop, rig, frame); }
41 
42  HOM_AgentClip(const char *name, const HOM_AgentRig &rig, int sample_count)
43  { return HOM().newAgentClip(name, rig, sample_count); }
44 
45  HOM_AgentClip(const HOM_AgentClip &clip, const HOM_AgentRig &rig,
46  const char *name = nullptr)
47  { return HOM().newAgentClip(clip, rig, name); }
48 }
49 #else
51  { HOM_CONSTRUCT_OBJECT(this) }
52 #endif
53 
54  virtual ~HOM_AgentClip()
55  { HOM_DESTRUCT_OBJECT(this) }
56 
57  virtual bool operator==(HOM_PtrOrNull<HOM_AgentClip> clip) const = 0;
59  { return !operator==(clip); }
60 
61  virtual int __hash__() const = 0;
62  virtual std::string __repr__() const = 0;
63 
64  SWIGOUT(%newobject freeze;)
65  virtual HOM_AgentClip *freeze() const = 0;
66 
67  virtual std::string name() const = 0;
68  SWIGOUT(%kwargs fileName;)
69  virtual std::string fileName(bool expanded = false) const = 0;
70 
71  virtual bool isLoaded() const = 0;
72  virtual void loadFromFile() = 0;
73 
74  virtual double length() const = 0;
75  virtual double startTime() const = 0;
76  virtual int sampleCount() const = 0;
77  virtual double sampleRate() const = 0;
78 
79  virtual void
80  addChannel(const char *name, const std::vector<float> &samples) = 0;
81 
82  SWIGOUT(%newobject sampleLocal;)
83  virtual HOM_Matrix4 *sampleLocal(double time, int transform) const = 0;
84  SWIGOUT(%newobject sampleWorld;)
85  virtual HOM_Matrix4 *sampleWorld(double time, int transform) const = 0;
86 
87  virtual std::vector<HOM_Matrix4> localTransforms(int sample) const = 0;
88  virtual std::vector<HOM_Matrix4> worldTransforms(int sample) const = 0;
89 
90  virtual void
91  setLocalTransforms(int sample, const std::vector<HOM_Matrix4> &xforms) = 0;
92 
93  virtual double sample(double time, const char *channel) const = 0;
94  virtual std::vector<std::string> channelNames() const = 0;
95 
96  virtual HOM_BinaryString data(bool binary, bool worldspace = false) const = 0;
97 
98  SWIGOUT(%kwargs extractLocomotion;)
99  virtual void
100  extractLocomotion(int cog_transform, int cog_lookat_transform = -1,
101  bool convert_inplace = true,
102  bool project_on_dominant_axis = false) = 0;
103 
104  // Works around Swig errors when directly using HOM().frame() as the value
105  // of a default argument - it seems to think there are nested classes.
106  // We also don't want to add a time dependency here.
107  SWIGOUT(%ignore currentFrame;)
108  static double currentFrame()
109  {
110  return HOM().timeToFrame(HOM().getTimeWithoutAddingDependency());
111  }
112 };
113 
114 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
GLuint const GLchar * name
Definition: glew.h:1814
static double currentFrame()
GLuint GLenum GLenum transform
Definition: glew.h:14742
GT_API const UT_StringHolder time
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
virtual HOM_AgentClip * newAgentClip(const char *name, const char *path, const HOM_AgentRig &rig, bool keep_external_ref, bool delay_load)=0
#define HOM_API
Definition: HOM_API.h:13
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
const GLuint GLenum const void * binary
Definition: glew.h:3502
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1209
int __hash__()
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
virtual ~HOM_AgentClip()
Definition: HOM_AgentClip.h:54
GLsizei const GLchar *const * path
Definition: glew.h:6461
bool operator!=(HOM_PtrOrNull< HOM_AgentClip > clip) const
Definition: HOM_AgentClip.h:58
GLsizei const GLchar *const * string
Definition: glew.h:1844
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
virtual double timeToFrame(double time)=0
GLsizei samples
Definition: glew.h:2998
HOM_API HOM_Module & HOM()
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:549