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  HOM_AgentClip(const char *name, InterpreterObject stage,
50  const char *prim_path, const HOM_AgentRig &rig)
51  { return HOM().newAgentClip(name, stage, prim_path, rig); }
52 }
53 #else
55  { HOM_CONSTRUCT_OBJECT(this) }
56 #endif
57 
58  virtual ~HOM_AgentClip()
59  { HOM_DESTRUCT_OBJECT(this) }
60 
61  virtual bool operator==(HOM_PtrOrNull<HOM_AgentClip> clip) const = 0;
63  { return !operator==(clip); }
64 
65  virtual int __hash__() const = 0;
66  virtual std::string __repr__() const = 0;
67 
68  SWIGOUT(%newobject freeze;)
69  virtual HOM_AgentClip *freeze() const = 0;
70 
71  virtual std::string name() const = 0;
72  SWIGOUT(%kwargs fileName;)
73  virtual std::string fileName(bool expanded = false) const = 0;
74 
75  virtual bool isLoaded() const = 0;
76  virtual void loadFromFile() = 0;
77 
78  virtual double length() const = 0;
79  virtual double startTime() const = 0;
80  virtual int sampleCount() const = 0;
81  virtual double sampleRate() const = 0;
82 
83  virtual void
84  addChannel(const char *name, const std::vector<float> &samples) = 0;
85 
86  SWIGOUT(%newobject sampleLocal;)
87  virtual HOM_Matrix4 *sampleLocal(double time, int transform) const = 0;
88  SWIGOUT(%newobject sampleWorld;)
89  virtual HOM_Matrix4 *sampleWorld(double time, int transform) const = 0;
90 
91  virtual std::vector<HOM_Matrix4> localTransforms(int sample) const = 0;
92  virtual std::vector<HOM_Matrix4> worldTransforms(int sample) const = 0;
93 
94  virtual std::vector<double> allLocalTransformValues() const = 0;
95  virtual void setAllLocalTransformValues(const std::vector<double> &values) = 0;
96 
97  virtual void
98  setLocalTransforms(int sample, const std::vector<HOM_Matrix4> &xforms) = 0;
99 
100  virtual double sample(double time, const char *channel) const = 0;
101  virtual std::vector<std::string> channelNames() const = 0;
102 
103  virtual HOM_BinaryString data(bool binary, bool worldspace = false) const = 0;
104 
105  SWIGOUT(%kwargs extractLocomotion;)
106  virtual void
107  extractLocomotion(int cog_transform, int cog_lookat_transform = -1,
108  bool convert_inplace = true,
109  bool project_on_dominant_axis = false) = 0;
110 
111  // Works around Swig errors when directly using HOM().frame() as the value
112  // of a default argument - it seems to think there are nested classes.
113  // We also don't want to add a time dependency here.
114  SWIGOUT(%ignore currentFrame;)
115  static double currentFrame()
116  {
117  return HOM().timeToFrame(HOM().getTimeWithoutAddingDependency());
118  }
119 };
120 
121 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
static double currentFrame()
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#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
virtual double timeToFrame(double time, bool full_precision=false)=0
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
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
int & sampleCount(char *base, int xStride, int yStride, int x, int y)
Definition: ImfMisc.h:62
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
int __hash__()
GLuint const GLchar * name
Definition: glcorearb.h:786
GA_API const UT_StringHolder transform
virtual ~HOM_AgentClip()
Definition: HOM_AgentClip.h:58
GLsizei samples
Definition: glcorearb.h:1298
bool operator!=(HOM_PtrOrNull< HOM_AgentClip > clip) const
Definition: HOM_AgentClip.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)
HOM_API HOM_Module & HOM()
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
Definition: ImathBoxAlgo.h:29
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542