HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Agent.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  * NAME: GU_Agent.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_Agent__
12 #define __GU_Agent__
13 
14 #include "GU_API.h"
15 #include "GU_AgentClip.h"
16 #include "GU_AgentDefinition.h"
17 #include "GU_PackedImpl.h"
18 
19 #include <GA/GA_PrimitiveTypeId.h>
20 
21 #include <UT/UT_Array.h>
22 #include <UT/UT_BitArray.h>
23 #include <UT/UT_Map.h>
24 #include <UT/UT_UniquePtr.h>
25 #include <UT/UT_SharedPtr.h>
26 #include <UT/UT_StringHolder.h>
27 #include <UT/UT_TBBSpinLock.h>
28 #include <UT/UT_VectorTypes.h>
29 #include <SYS/SYS_Types.h>
30 
31 
32 #define GU_AGENT_LAYER_DEFAULT "default"
33 #define GU_AGENT_LAYER_COLLISION "collision"
34 
35 
36 class UT_Options;
37 
38 
39 /// A packed agent
40 ///
41 /// The agent is composed of multiple named layers. Each layer consists of
42 /// zero or more shapes.
43 ///
44 /// All agents must have a default layer. This is the layer used when a
45 /// specific layer isn't found. Example layers might be: "default", "low-res",
46 /// "medium-res", "high-quality", "collision".
47 ///
48 /// The packed agent conforms to the GU_PackedImpl API, but also provides
49 /// access to the layers/shapes.
51 {
52 public:
62 
63  enum BlendMode
64  {
67  NUM_BLEND_MODES
68  };
69 
70  struct ClipLayer
71  {
72  ClipLayer(BlendMode blend_mode, fpreal64 weight = 0.0,
73  int64 parent = -1)
74  : myBlendMode(blend_mode), myWeight(weight), myParent(parent)
75  {
76  }
77 
81  };
82 
83  /// State of the primitive
84  struct State
85  {
91 
93  };
94 
95  GU_Agent();
96  GU_Agent(const GU_Agent &src);
97  virtual ~GU_Agent();
98 
99  /// Register the packed primitive type
100  static void install(GA_PrimitiveFactory *pfact);
101 
102  /// Get the type ID for the GU_Agent primitive type.
104  {
105  return theTypeId;
106  }
107 
108  /// Convenience method to create a packed agent primitive
109  static GU_PrimPacked *agent(GU_Detail &dest,
110  GA_Offset ptoff = GA_INVALID_OFFSET);
111 
112 
113  static bool hasAgentPackedPrimitives(
114  const GU_Detail &gdp);
115 
116  /// @{
117  /// API defined on GU_PackedImpl
118  virtual GU_PackedFactory *getFactory() const;
119  virtual GU_Agent *copy() const;
120  virtual bool isValid() const;
121  virtual void clearData();
122 
123  virtual bool supportsJSONLoad() const
124  { return true; }
125  virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
126  { return loadFrom(prim, options, map); }
127  virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options,
128  const GA_LoadMap &map)
129  { return loadFrom(prim, options, map); }
130 
131  virtual void update(GU_PrimPacked *prim, const UT_Options &options)
132  { updateFrom(prim, options); }
133  virtual bool saveSharedData(UT_JSONWriter &w, GA_SaveMap &map,
134  GA_GeometryIndex *geometryIndex) const;
135  virtual bool loadSharedData(int load_data_type,
136  const GA_SharedLoadData *item);
137  virtual bool save(UT_Options &options,
138  const GA_SaveMap &map) const;
139  virtual bool getBounds(UT_BoundingBox &box) const;
140  virtual bool getRenderingBounds(UT_BoundingBox &box) const;
141  virtual void getVelocityRange(
142  UT_Vector3 &vmin,
143  UT_Vector3 &vmax) const;
144  virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const;
145  virtual bool unpack(GU_Detail &destgdp, const UT_Matrix4D *transform) const;
146  virtual bool unpackWithStyler(
147  GU_Detail &destgdp,
148  STY_StylerGroup &prim_styler_group,
149  const STY_Styler &parent_styler,
150  const GU_PrimPacked *prim) const;
152 
153  /// Report memory usage (includes all shared memory)
154  virtual int64 getMemoryUsage(bool inclusive) const;
155 
156  /// Count memory usage using a UT_MemoryCounter in order to count
157  /// shared memory correctly.
158  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
159  /// @}
160 
161  /// Return the agent's definition (which contains e.g. available clips and
162  /// layers).
164  {
165  loadDefinitionIfNeeded();
166  return *myDefinition;
167  }
168 
170  {
171  loadDefinitionIfNeeded();
172  return *myDefinition;
173  }
174 
175  void setDefinition(GU_PrimPacked *prim, const GU_AgentDefinitionPtr &definition);
176 
177  /// Rig Accessor
178  /// @{
179  const GU_AgentRigConstPtr &getRig() const { return definition().rig(); }
180  /// @}
181 
182  /// @{
183  /// Packed implementation for specific layers
184  bool layerBounds(const GU_AgentLayer &layer,
185  UT_BoundingBox &box) const;
186  void layerVelocityRange(const GU_AgentLayer &layer,
187  UT_Vector3 &vmin, UT_Vector3 &vmax) const;
188  void layerWidthRange(const GU_AgentLayer &layer,
189  fpreal &wmin, fpreal &wmax) const;
190  bool layerUnpack(
191  const GU_AgentLayer &layer,
192  GU_Detail &destgdp,
193  const UT_Matrix4D *transform,
194  STY_StylerGroup *prim_styler_group=nullptr,
195  const STY_Styler *parent_styler=nullptr,
196  const GU_PrimPacked *prim=nullptr) const;
198  layerPackedDetail(const GU_AgentLayer &layer) const;
199  /// @}
200 
201  /// Return the current layer. This may be a NULL pointer.
202  const GU_AgentLayer *getCurrentLayer() const;
203  /// Sets the agent's display layer.
204  void setCurrentLayer(GU_PrimPacked *prim,
206 
207  /// Return the current collision layer. This may be a NULL pointer.
208  const GU_AgentLayer *getCollisionLayer() const;
209  /// Sets the agent's collision layer.
210  void setCollisionLayer(GU_PrimPacked *prim,
212 
213  /// @{
214  /// Access the default layer by name for intrinsics.
215  StringType intrinsicCurrentLayerName(const GU_PrimPacked *prim) const;
216  void intrinsicSetCurrentLayerByName(GU_PrimPacked *prim, const StringType &name);
217  /// @}
218 
219  /// @{
220  /// Access the collision layer by name for intrinsics.
221  StringType intrinsicCollisionLayerName(const GU_PrimPacked *prim) const;
222  void intrinsicSetCollisionLayerByName(GU_PrimPacked *prim, const StringType &name);
223  /// @}
224 
225  /// Array of clips used for transform evaluation
226  /// @{
227  const GU_AgentClipPtrArray& clips() const;
228  void setClips(GU_PrimPacked *prim, const GU_AgentClipPtrArray& clips);
229  void setClipsByNames(GU_PrimPacked *prim, const UT_StringArray& clip_names);
230  /// @}
231 
232  /// Return the number of clips used for transform evaluation
233  exint numClips() const
234  { return clips().entries(); }
236  { return numClips(); }
237 
238  /// Names of the clips used for transform evaluation
239  const char* clipName(exint i) const;
240  const char* intrinsicClipName(const GU_PrimPacked *prim, exint i) const
241  { return clipName(i); }
242 
243  /// Set a clip by name
244  void setClipByName(GU_PrimPacked *prim, exint i, const char *clip_name);
245 
246  /// Array of times in seconds to evaluate the clips.
247  /// Indices in [0,numClips()-1] inclusively.
248  /// @{
250  { return myState.myClipTimes(i); }
252  { return clipTime(i); }
253  void setClipTime(GU_PrimPacked *prim, exint i, fpreal seconds);
254  /// @}
255 
256  /// Array of weights to evaluate the corresponding clips. Assumes they are
257  /// normalized.
258  /// @{
260  { return myState.myClipWeights(i); }
262  { return clipWeight(i); }
263  void setClipWeight(GU_PrimPacked *prim, exint i, fpreal weight);
264  /// @}
265 
266  /// The subset of transforms in the rig that each clip should be applied
267  /// to.
268  /// @{
269  const char* clipTransformGroupName(exint i) const;
270  const char* intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
271  { return clipTransformGroupName(i); }
272  void setClipTransformGroupByName(GU_PrimPacked *prim, exint i, const char *name);
273  /// @}
274 
275  /// The layer that each clip belongs to.
276  /// @{
278  { return myState.myClipLayerIds(i); }
280  { return clipLayerId(i); }
281  void setClipLayerId(GU_PrimPacked *prim, exint i, exint layer_id);
282  /// @}
283 
284  /// List of clip layers and their blend modes.
285  /// @{
286  void setClipLayers(GU_PrimPacked *prim, const UT_Array<ClipLayer> &clip_layers);
288  { return myState.myClipLayers.entries(); }
289  /// @}
290 
291  /// Get the world transforms for this agent. Disabling interpolation can
292  /// improve performance if the clip time falls between two samples.
294  bool interpolate_samples = true) const
295  { return computeTransforms(xforms,
296  /* world_space */ true,
297  interpolate_samples); }
298  /// Get the local transforms for this agent.
300  bool interpolate_samples = true) const
301  { return computeTransforms(xforms,
302  /* world_space */ false,
303  interpolate_samples); }
304  /// Get a specific world transform for the agent.
306  bool interpolate_samples = true) const
307  { return computeWorldTransformInternal(xform, i, interpolate_samples); }
308  /// Get a specific local transform for the agent.
310  bool interpolate_samples = true) const
311  { return computeLocalTransformInternal(xform, i, interpolate_samples); }
312 
313  /// Override the world transforms for this agent.
314  void setWorldTransforms(const Matrix4Array &xforms)
315  { setTransforms(xforms, /* world_space */ true); }
316  /// Override the local transforms for this agent.
317  void setLocalTransforms(const Matrix4Array &xforms)
318  { setTransforms(xforms, /* world_space */ false); }
319  /// Override a specific world transform for this agent.
320  void setWorldTransform(const Matrix4Type &xform, exint i);
321  /// Override a specific local transform for this agent.
322  void setLocalTransform(const Matrix4Type &xform, exint i);
323  /// Returns whether the agent's transforms have been overridden from the
324  /// blended clips.
325  bool hasCustomTransforms() const { return myHasCustomXforms; }
327  { return hasCustomTransforms(); }
328  /// Number of transforms in the rig.
330  { return getRig() ? getRig()->transformCount() : 0; }
332  { return transformCount(); }
333  /// Return the name of the given transform.
334  const char* transformName(exint i) const;
335  const char* intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
336  { return transformName(i); }
337 
338  /// Functions for the 'agentworldtransforms' and 'agentlocaltransforms'
339  /// intrinsics to manipulate the transforms as an array of floats.
340  exint transformsArraySize() const;
342  { return transformsArraySize(); }
344  { transformsArray(data, n, /* world_space */ true); }
346  exint n)
347  { setTransformsFromArray(data, n,
348  /* world_space */ true); }
350  { transformsArray(data, n,
351  /* world_space */ false); }
353  exint n)
354  { setTransformsFromArray(data, n,
355  /* world_space */ false); }
356 
357  /// Number of transforms in the rig.
359  { return getRig() ? getRig()->channelCount() : 0; }
360 
361  /// Computes the agent's channel values from its clips.
362  bool computeChannelValues(FloatArrayConstPtr &values,
363  bool interpolate_samples = true) const;
364 
365  /// Override a specific channel value for this agent.
366  void setChannelValue(FloatType value, exint i);
367 
368  /// Returns whether the agent's channel values have been overridden from
369  /// the blended clips.
371  { return myHasCustomChannelValues; }
372 
373  /// Functions for the 'agentchannelnames', 'agentchannelvalues', and
374  /// 'agenthascustomchannelvalues' intrinsics.
375  /// @{
377  { return channelCount(); }
378  const StringType& intrinsicChannelName(const GU_PrimPacked *, exint i) const;
379  void intrinsicChannelValuesArray(const GU_PrimPacked *,
380  FloatType *data, exint n) const;
381  void intrinsicSetChannelValuesFromArray(GU_PrimPacked *,
382  const FloatType *data, exint n);
384  { return hasCustomChannelValues(); }
385  /// @}
386 
387  /// Functions for the 'agentrigparents' intrinsic.
388  exint intrinsicParentIndex(const GU_PrimPacked *prim, exint i) const;
389  /// Functions for the 'agentlayers' intrinsic.
390  exint intrinsicNumLayers(const GU_PrimPacked *prim) const;
391  const char* intrinsicLayerName(const GU_PrimPacked *prim, exint i) const;
392 
393  /// Used by the 'agentcliptimes', 'agentclipnames', and 'agentclipweights'
394  /// intrinsics to grow or shrink the number of clips.
395  void intrinsicSetNumClips(GU_PrimPacked *prim, GA_Size n);
396 
397  /// Functions for the 'agentclipcatalog' intrinsic.
398  exint intrinsicCatalogNumClips(const GU_PrimPacked *prim) const;
399  const char* intrinsicCatalogClipName(const GU_PrimPacked *prim, exint i) const;
400  const char* intrinsicClipCatalogFilenames(const GU_PrimPacked *prim, exint i) const;
401 
402  /// Functions for the 'agentshapelibrary' intrinsic.
403  exint intrinsicNumShapes(const GU_PrimPacked *prim) const;
404  void intrinsicShapeNames(const GU_PrimPacked *prim, UT_StringArray &values) const;
405 
406  /// Functions for the 'agenttransformgroups' intrinsic.
407  /// @{
408  exint intrinsicNumTransformGroups(const GU_PrimPacked *prim) const;
409  const char* intrinsicTransformGroupName(const GU_PrimPacked *prim, exint i) const;
410  /// @}
411 
412  /// Functions for the clip layer intrinsics.
413  /// @{
414  const char* intrinsicClipLayerMode(const GU_PrimPacked *prim, exint i) const;
415  exint intrinsicClipLayerParent(const GU_PrimPacked *prim, exint i) const;
416  fpreal intrinsicClipLayerWeight(const GU_PrimPacked *prim, exint i) const;
418  { return numClipLayers(); }
419  /// @}
420 
421 private:
422  GU_Agent& operator=(const GU_Agent& copy); // DISALLOWED
423 
424 private:
425  void dirtyBlendedTransforms(GU_PrimPacked *prim);
426  void loadDefinition() const;
427  SYS_FORCE_INLINE void loadDefinitionIfNeeded() const
428  {
429  if (!myDefinition)
430  loadDefinition();
431  }
432 
433  template <typename T>
434  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
435  template <typename T>
436  void updateFrom(GU_PrimPacked *prim, const T &options);
437 
438  /// Get the agent's current transforms, in local or world space.
439  /// Disabling interpolation can improve performance if the clip time falls
440  /// between two samples.
441  bool computeTransforms(Matrix4ArrayConstPtr &matrices,
442  bool world_space,
443  bool interpolate_samples = true,
444  bool acquire_xform_lock = true) const;
445 
446  /// Internal version of computeWorldTransform(), which allows controlling
447  /// whether myXformLock needs to be acquired.
448  bool computeWorldTransformInternal(Matrix4Type &xform,
449  exint i,
450  bool interpolate_samples,
451  bool acquire_xform_lock = true) const;
452 
453  /// Internal version of computeLocalTransform(), which allows controlling
454  /// whether myXformLock needs to be acquired.
455  bool computeLocalTransformInternal(Matrix4Type &xform,
456  exint i,
457  bool interpolate_samples,
458  bool acquire_xform_lock = true) const;
459 
460  /// Override the current transforms of the agent.
461  void setTransforms(const Matrix4Array &xforms,
462  bool world_space);
463  void transformsArray(FloatType *buf, exint n,
464  bool world_space) const;
465  void setTransformsFromArray(const FloatType *data, exint n,
466  bool world_space);
467 
468  /// Resize the clip arrays to n elements.
469  void changeNumClips(GU_PrimPacked *prim, exint n, bool fill_valid_clips = false);
470 
471  /// Convert the cached transforms from local to world space (or vice versa).
472  void convertCachedTransforms(bool world_space) const;
473 
474  struct DelayLoadData
475  {
476  DelayLoadData(const GA_SharedDataHandlePtr &definition,
477  const GA_SharedDataHandlePtr &transforms,
478  const GA_SharedDataHandlePtr &channel_values)
479  : myDefinition(definition),
480  myTransforms(transforms),
481  myChannelValues(channel_values)
482  {
483  }
484 
485  DelayLoadData(const DelayLoadData &src)
486  : myDefinition(src.myDefinition),
487  myTransforms(src.myTransforms),
488  myChannelValues(src.myChannelValues),
489  myClipNames(src.myClipNames),
490  myClipXformGroupNames(src.myClipXformGroupNames),
491  myCurrentLayerName(src.myCurrentLayerName),
492  myCollisionLayerName(src.myCollisionLayerName)
493  {
494  }
495 
496  /// Return whether the shared data has been loaded.
497  bool isLoaded() const
498  {
499  return !myDefinition && !myTransforms && !myChannelValues;
500  }
501 
502  int64 getMemoryUsage(bool inclusive) const;
503 
504  UT_Lock myLock;
505  /// Shared agent definition.
506  GA_SharedDataHandlePtr myDefinition;
507  /// Shared transforms.
508  GA_SharedDataHandlePtr myTransforms;
509  /// Cached channel values.
510  GA_SharedDataHandlePtr myChannelValues;
511  /// Names of the clips that this agent will use after the shared
512  /// definition has been loaded.
513  UT_StringArray myClipNames;
514  /// Names of the transform groups that this agent will use after the
515  /// shared definition has been loaded.
516  UT_StringArray myClipXformGroupNames;
517 
518  /// Names of the layers to be resolved after the shared definition has
519  /// been loaded.
520  UT_StringHolder myCurrentLayerName;
521  UT_StringHolder myCollisionLayerName;
522  };
523 
524  GU_AgentDefinitionPtr myDefinition;
525  GU_AgentLayerConstPtr myCurrentLayer;
526  GU_AgentLayerConstPtr myCollisionLayer;
527  State myState;
528 
529  mutable FloatArrayPtr myCachedChannelValues;
530  mutable Matrix4ArrayPtr myCachedTransforms;
531  /// Tracks which entries of myCachedTransforms are in local or world space.
532  mutable UT_BitArray myWorldSpace;
533 
534  /// Whether or not myCachedChannelValues matches the clip intrinsics.
535  mutable bool myHasCustomChannelValues;
536  /// Whether or not myCachedTransforms matches the clip intrinsics.
537  mutable bool myHasCustomXforms;
538 
539  using XformLock = UT_TBBSpinLock;
540  using XformLockScope = UT_TBBSpinLock::Scope;
541  /// Lock for myCachedTransforms and myCachedChannelValues.
542  mutable XformLock myXformLock;
543 
544  mutable UT_UniquePtr<DelayLoadData> myDelayLoadData;
545 
546  static GA_PrimitiveTypeId theTypeId;
547 };
548 
549 #endif
UT_Int64Array myClipLayerIds
Definition: GU_Agent.h:90
UT_StringHolder StringType
Definition: GU_Agent.h:53
UT_Lockable< tbb::spin_mutex > UT_TBBSpinLock
virtual void getVelocityRange(UT_Vector3 &min, UT_Vector3 &max) const =0
void setLocalTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
Definition: GU_Agent.h:352
virtual bool saveSharedData(UT_JSONWriter &w, GA_SaveMap &map, GA_GeometryIndex *geometryIndex) const
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
GLenum src
Definition: glew.h:2410
const char * intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:335
GLuint const GLchar * name
Definition: glew.h:1814
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
fpreal64 myWeight
Definition: GU_Agent.h:79
GLuint GLenum GLenum transform
Definition: glew.h:14742
State of the primitive.
Definition: GU_Agent.h:84
GLuint GLuint GLfloat weight
Definition: glew.h:13609
void setWorldTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
Definition: GU_Agent.h:345
GLint GLsizei const GLuint64 * values
Definition: glew.h:3612
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_Agent.h:60
exint intrinsicTransformsArraySize(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:341
fpreal32 FloatType
Definition: GU_Agent.h:54
GU_AgentClipPtrArray myClips
Definition: GU_Agent.h:86
virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
Definition: GU_Agent.h:125
virtual bool getBounds(UT_BoundingBox &box) const =0
Get the bounding box for the geometry (not including transforms)
bool hasCustomTransforms() const
Definition: GU_Agent.h:325
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
exint transformCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:329
bool intrinsicHasCustomChannelValues(const GU_PrimPacked *) const
Definition: GU_Agent.h:383
UT_SharedPtr< GA_SharedDataHandle > GA_SharedDataHandlePtr
UT_Array< ClipLayer > myClipLayers
Definition: GU_Agent.h:92
UT_IntrusiveRefCounter & operator=(const UT_IntrusiveRefCounter &)
Assignment operator: Does not modify counter.
exint intrinsicTransformCount(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:331
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:231
UT_SharedPtr< FloatArray > FloatArrayPtr
Definition: GU_Agent.h:56
fpreal intrinsicClipTime(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:251
#define GA_INVALID_OFFSET
Definition: GA_Types.h:674
exint numClips() const
Return the number of clips used for transform evaluation.
Definition: GU_Agent.h:233
BlendMode myBlendMode
Definition: GU_Agent.h:78
virtual bool getRenderingBounds(UT_BoundingBox &box) const =0
exint intrinsicNumClips(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:235
GA_Size GA_Offset
Definition: GA_Types.h:637
fpreal intrinsicClipWeight(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:261
long long int64
Definition: SYS_Types.h:111
GU_AgentTransformGroupArray myClipXformGroups
Definition: GU_Agent.h:89
void localTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:349
const char * intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:270
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:120
virtual void clearData()=0
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
double fpreal64
Definition: SYS_Types.h:196
UT_LockScopeType< UT_Lockable< tbb::spin_mutex > > Scope
Definition: UT_Lockable.h:29
void setWorldTransforms(const Matrix4Array &xforms)
Override the world transforms for this agent.
Definition: GU_Agent.h:314
virtual int64 getMemoryUsage(bool inclusive) const =0
Report memory usage (includes all shared memory)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
const char * intrinsicClipName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:240
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
virtual GU_PackedFactory * getFactory() const =0
Get the factory associated with this procedural.
GLsizei n
Definition: glew.h:4040
UT_Fpreal64Array myClipTimes
Definition: GU_Agent.h:87
virtual GU_ConstDetailHandle getPackedDetail(GU_PackedContext *context=0) const
bool computeLocalTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific local transform for the agent.
Definition: GU_Agent.h:309
Options during loading.
Definition: GA_LoadMap.h:42
UT_Matrix4T< FloatType > Matrix4Type
Definition: GU_Agent.h:58
#define GU_API
Definition: GU_API.h:14
void worldTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:343
const GU_AgentRigConstPtr & getRig() const
Definition: GU_Agent.h:179
UT_SharedPtr< const FloatArray > FloatArrayConstPtr
Definition: GU_Agent.h:57
exint intrinsicChannelCount(const GU_PrimPacked *) const
Definition: GU_Agent.h:376
fpreal clipTime(exint i) const
Definition: GU_Agent.h:249
virtual bool isValid() const =0
Test whether the deferred load primitive data is valid.
exint intrinsicNumClipLayers(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:417
SYS_FORCE_INLINE const GU_AgentDefinition & definition() const
Definition: GU_Agent.h:169
bool computeWorldTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Definition: GU_Agent.h:293
bool hasCustomChannelValues() const
Definition: GU_Agent.h:370
double fpreal
Definition: SYS_Types.h:276
A map of string to various well defined value types.
Definition: UT_Options.h:42
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
GLuint counter
Definition: glew.h:2740
fpreal clipWeight(exint i) const
Definition: GU_Agent.h:259
bool unpack(GU_Detail &destgdp, const GU_PrimPacked *prim) const
virtual bool supportsJSONLoad() const
Definition: GU_Agent.h:123
SYS_FORCE_INLINE GU_AgentDefinition & definition()
Definition: GU_Agent.h:163
bool computeWorldTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific world transform for the agent.
Definition: GU_Agent.h:305
virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map)
Definition: GU_Agent.h:127
OIIO_API bool copy(string_view from, string_view to, std::string &err)
GLint GLboolean GLint layer
Definition: glew.h:3601
virtual bool unpackWithStyler(GU_Detail &destgdp, STY_StylerGroup &prim_styler_group, const STY_Styler &parent_styler, const GU_PrimPacked *prim) const
bool computeLocalTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Get the local transforms for this agent.
Definition: GU_Agent.h:299
exint numClipLayers() const
Definition: GU_Agent.h:287
GLfloat seconds
Definition: wglew.h:950
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
Definition: GU_Agent.h:61
UT_Array< FloatType > FloatArray
Definition: GU_Agent.h:55
virtual void update(GU_PrimPacked *prim, const UT_Options &options)
Definition: GU_Agent.h:131
virtual bool loadSharedData(int load_data_type, const GA_SharedLoadData *item)
bool intrinsicHasCustomTransforms(const GU_PrimPacked *) const
Definition: GU_Agent.h:326
ClipLayer(BlendMode blend_mode, fpreal64 weight=0.0, int64 parent=-1)
Definition: GU_Agent.h:72
UT_Array< Matrix4Type > Matrix4Array
Definition: GU_Agent.h:59
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
virtual bool save(UT_Options &options, const GA_SaveMap &map) const =0
Copy the resolver data into the UT_Options for saving.
GLsizei const GLfloat * value
Definition: glew.h:1849
float fpreal32
Definition: SYS_Types.h:195
exint channelCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:358
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_Agent primitive type.
Definition: GU_Agent.h:103
void setLocalTransforms(const Matrix4Array &xforms)
Override the local transforms for this agent.
Definition: GU_Agent.h:317
exint intrinsicClipLayerId(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:279
UT_Fpreal64Array myClipWeights
Definition: GU_Agent.h:88
exint clipLayerId(exint i) const
Definition: GU_Agent.h:277
virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const =0