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:1291
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:352
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
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1290
int __hash__()
GLuint const GLchar * name
Definition: glcorearb.h:786
GA_API const UT_StringHolder transform
virtual ~HOM_AgentClip()
Definition: HOM_AgentClip.h:54
GLsizei samples
Definition: glcorearb.h:1298
bool operator!=(HOM_PtrOrNull< HOM_AgentClip > clip) const
Definition: HOM_AgentClip.h:58
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