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