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