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(
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 
184  {
185  loadDefinitionIfNeeded();
186  return *myDefinition;
187  }
188 
189  void setDefinition(GU_PrimPacked *prim, const GU_AgentDefinitionPtr &definition);
190 
191  /// Rig Accessor
192  /// @{
193  const GU_AgentRigConstPtr &getRig() const { return definition().rig(); }
194  /// @}
195 
196  /// Return the list of the agent's current layers.
197  const UT_Array<GU_AgentLayerConstPtr> &getCurrentLayers() const;
198  /// Sets the agent's display layers.
199  void setCurrentLayers(GU_PrimPacked *prim,
201 
202  /// Return the current layer. This may be a NULL pointer.
203  SYS_DEPRECATED_HDK_REPLACE(19.0, getCurrentLayers)
204  const GU_AgentLayer *getCurrentLayer() const;
205  /// Sets the agent's display layer.
206  SYS_DEPRECATED_HDK_REPLACE(19.0, setCurrentLayers)
207  void setCurrentLayer(GU_PrimPacked *prim,
209 
210  /// Return the list of the agent's collision layers.
211  const UT_Array<GU_AgentLayerConstPtr> &getCollisionLayers() const;
212  /// Sets the agent's collision layers.
213  void setCollisionLayers(GU_PrimPacked *prim,
215 
216  /// Return the current collision layer. This may be a NULL pointer.
217  SYS_DEPRECATED_HDK_REPLACE(19.0, getCollisionLayers)
218  const GU_AgentLayer *getCollisionLayer() const;
219  /// Sets the agent's collision layer.
220  SYS_DEPRECATED_HDK_REPLACE(19.0, setCollisionLayers)
221  void setCollisionLayer(GU_PrimPacked *prim,
222  const GU_AgentLayerConstPtr &layer);
223 
224  /// @{
225  /// Display layer accesssors for intrinsics.
226  exint intrinsicNumCurrentLayers(const GU_PrimPacked *prim) const;
227  void intrinsicCurrentLayerNames(const GU_PrimPacked *prim, UT_StringArray &names) const;
228  void intrinsicSetCurrentLayerNames(GU_PrimPacked *prim, const UT_StringArray &names);
229  /// @}
230 
231  /// @{
232  /// Collision layer accessors for intrinsics.
233  exint intrinsicNumCollisionLayers(const GU_PrimPacked *prim) const;
234  void intrinsicCollisionLayerNames(const GU_PrimPacked *prim, UT_StringArray &names) const;
235  void intrinsicSetCollisionLayerNames(GU_PrimPacked *prim, const UT_StringArray &names);
236  /// @}
237 
238  /// @{
239  /// Deprecated single-layer accessors for intrinsics.
240  StringType intrinsicCurrentLayerName(const GU_PrimPacked *prim) const;
241  void intrinsicSetCurrentLayerByName(GU_PrimPacked *prim, const StringType &name);
242  StringType intrinsicCollisionLayerName(const GU_PrimPacked *prim) const;
243  void intrinsicSetCollisionLayerByName(GU_PrimPacked *prim, const StringType &name);
244  /// @}
245 
246  /// Array of clips used for transform evaluation
247  /// @{
248  const GU_AgentClipPtrArray& clips() const;
249  void setClips(GU_PrimPacked *prim, const GU_AgentClipPtrArray& clips);
250  void setClipsByNames(GU_PrimPacked *prim, const UT_StringArray& clip_names);
251  /// @}
252 
253  /// Return the number of clips used for transform evaluation
254  exint numClips() const
255  { return clips().entries(); }
257  { return numClips(); }
258 
259  /// Names of the clips used for transform evaluation
260  const char* clipName(exint i) const;
261  const char* intrinsicClipName(const GU_PrimPacked *prim, exint i) const
262  { return clipName(i); }
263 
264  /// Set a clip by name
265  void setClipByName(GU_PrimPacked *prim, exint i, const char *clip_name);
266 
267  /// Array of times in seconds to evaluate the clips.
268  /// Indices in [0,numClips()-1] inclusively.
269  /// @{
271  { return myState.myClipTimes(i); }
273  { return clipTime(i); }
274  void setClipTime(GU_PrimPacked *prim, exint i, fpreal seconds);
275  /// @}
276 
277  /// Array of weights to evaluate the corresponding clips. Assumes they are
278  /// normalized.
279  /// @{
281  { return myState.myClipWeights(i); }
283  { return clipWeight(i); }
284  void setClipWeight(GU_PrimPacked *prim, exint i, fpreal weight);
285  /// @}
286 
287  /// The subset of transforms in the rig that each clip should be applied
288  /// to.
289  /// @{
290  const char* clipTransformGroupName(exint i) const;
291  const char* intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
292  { return clipTransformGroupName(i); }
293  void setClipTransformGroupByName(GU_PrimPacked *prim, exint i, const char *name);
294  void setClipTransformGroup(GU_PrimPacked *prim, exint i, const GU_AgentTransformGroupConstPtr &grp);
295  /// @}
296 
297  /// The layer that each clip belongs to.
298  /// @{
300  { return myState.myClipLayerIds(i); }
302  { return clipLayerId(i); }
303  void setClipLayerId(GU_PrimPacked *prim, exint i, exint layer_id);
304  /// @}
305 
306  /// List of clip layers and their blend modes.
307  /// @{
308  void setClipLayers(GU_PrimPacked *prim, const UT_Array<ClipLayer> &clip_layers);
310  { return myState.myClipLayers.entries(); }
311  /// @}
312 
313  /// Get the world transforms for this agent. Disabling interpolation can
314  /// improve performance if the clip time falls between two samples.
316  bool interpolate_samples = true) const
317  { return computeTransforms(xforms,
318  /* world_space */ true,
319  interpolate_samples); }
320  /// Get the local transforms for this agent.
322  bool interpolate_samples = true) const
323  { return computeTransforms(xforms,
324  /* world_space */ false,
325  interpolate_samples); }
326  /// Get a specific world transform for the agent.
328  bool interpolate_samples = true) const
329  { return computeWorldTransformInternal(xform, i, interpolate_samples); }
330  /// Get a specific local transform for the agent.
332  bool interpolate_samples = true) const
333  { return computeLocalTransformInternal(xform, i, interpolate_samples); }
334 
335  /// Override the world transforms for this agent.
336  void setWorldTransforms(const Matrix4Array &xforms)
337  { setTransforms(xforms, /* world_space */ true); }
338  /// Override the local transforms for this agent.
339  void setLocalTransforms(const Matrix4Array &xforms)
340  { setTransforms(xforms, /* world_space */ false); }
341  /// Override a specific world transform for this agent.
342  void setWorldTransform(const Matrix4Type &xform, exint i);
343  /// Override a specific local transform for this agent.
344  void setLocalTransform(const Matrix4Type &xform, exint i);
345  /// Returns whether the agent's transforms have been overridden from the
346  /// blended clips.
347  bool hasCustomTransforms() const { return myHasCustomXforms; }
349  { return hasCustomTransforms(); }
350  /// Number of transforms in the rig.
352  { return getRig() ? getRig()->transformCount() : 0; }
354  { return transformCount(); }
355  /// Return the name of the given transform.
356  const char* transformName(exint i) const;
357  const char* intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
358  { return transformName(i); }
359 
360  /// Functions for the 'agentworldtransforms' and 'agentlocaltransforms'
361  /// intrinsics to manipulate the transforms as an array of floats.
362  exint transformsArraySize() const;
364  { return transformsArraySize(); }
366  { transformsArray(data, n, /* world_space */ true); }
368  exint n)
369  { setTransformsFromArray(data, n,
370  /* world_space */ true); }
372  { transformsArray(data, n,
373  /* world_space */ false); }
375  exint n)
376  { setTransformsFromArray(data, n,
377  /* world_space */ false); }
378 
379  /// Number of transforms in the rig.
381  { return getRig() ? getRig()->channelCount() : 0; }
382 
383  /// Computes the agent's channel values from its clips.
384  bool computeChannelValues(FloatArrayConstPtr &values,
385  bool interpolate_samples = true) const;
386 
387  /// Override a specific channel value for this agent.
388  void setChannelValue(FloatType value, exint i);
389 
390  /// Returns whether the agent's channel values have been overridden from
391  /// the blended clips.
393  { return myHasCustomChannelValues; }
394 
395  /// Functions for the 'agentchannelnames', 'agentchannelvalues', and
396  /// 'agenthascustomchannelvalues' intrinsics.
397  /// @{
399  { return channelCount(); }
400  const StringType& intrinsicChannelName(const GU_PrimPacked *, exint i) const;
401  void intrinsicChannelValuesArray(const GU_PrimPacked *,
402  FloatType *data, exint n) const;
403  void intrinsicSetChannelValuesFromArray(GU_PrimPacked *,
404  const FloatType *data, exint n);
406  { return hasCustomChannelValues(); }
407  /// @}
408 
409  /// Functions for the 'agentrigparents' intrinsic.
410  exint intrinsicParentIndex(const GU_PrimPacked *prim, exint i) const;
411  /// Functions for the 'agentlayers' intrinsic.
412  exint intrinsicNumLayers(const GU_PrimPacked *prim) const;
413  const char* intrinsicLayerName(const GU_PrimPacked *prim, exint i) const;
414 
415  /// Used by the 'agentcliptimes', 'agentclipnames', and 'agentclipweights'
416  /// intrinsics to grow or shrink the number of clips.
417  void intrinsicSetNumClips(GU_PrimPacked *prim, GA_Size n);
418 
419  /// Functions for the 'agentclipcatalog' intrinsic.
420  exint intrinsicCatalogNumClips(const GU_PrimPacked *prim) const;
421  const char* intrinsicCatalogClipName(const GU_PrimPacked *prim, exint i) const;
422  const char* intrinsicClipCatalogFilenames(const GU_PrimPacked *prim, exint i) const;
423 
424  /// Functions for the 'agentshapelibrary' intrinsic.
425  exint intrinsicNumShapes(const GU_PrimPacked *prim) const;
426  void intrinsicShapeNames(const GU_PrimPacked *prim, UT_StringArray &values) const;
427 
428  /// Functions for the 'agenttransformgroups' intrinsic.
429  /// @{
430  exint intrinsicNumTransformGroups(const GU_PrimPacked *prim) const;
431  const char* intrinsicTransformGroupName(const GU_PrimPacked *prim, exint i) const;
432  /// @}
433 
434  /// Functions for the clip layer intrinsics.
435  /// @{
436  const char* intrinsicClipLayerMode(const GU_PrimPacked *prim, exint i) const;
437  exint intrinsicClipLayerParent(const GU_PrimPacked *prim, exint i) const;
438  fpreal intrinsicClipLayerWeight(const GU_PrimPacked *prim, exint i) const;
440  { return numClipLayers(); }
441  /// @}
442 
443  /// The 'agentmetadata' intrinsic. See GU_AgentDefinition::metadata().
444  UT_OptionsHolder intrinsicMetadata(const GU_PrimPacked *prim) const;
445 
446 private:
447  GU_Agent& operator=(const GU_Agent& copy); // DISALLOWED
448 
449 private:
450  void dirtyBlendedTransforms(GU_PrimPacked *prim);
451  void loadDefinition() const;
452  SYS_FORCE_INLINE void loadDefinitionIfNeeded() const
453  {
454  if (!myDefinition)
455  loadDefinition();
456  }
457 
458  template <typename T>
459  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
460  template <typename T>
461  void updateFrom(GU_PrimPacked *prim, const T &options);
462 
463  /// Get the agent's current transforms, in local or world space.
464  /// Disabling interpolation can improve performance if the clip time falls
465  /// between two samples.
466  bool computeTransforms(Matrix4ArrayConstPtr &matrices,
467  bool world_space,
468  bool interpolate_samples = true,
469  bool acquire_xform_lock = true) const;
470 
471  /// Internal version of computeWorldTransform(), which allows controlling
472  /// whether myXformLock needs to be acquired.
473  bool computeWorldTransformInternal(Matrix4Type &xform,
474  exint i,
475  bool interpolate_samples,
476  bool acquire_xform_lock = true) const;
477 
478  /// Internal version of computeLocalTransform(), which allows controlling
479  /// whether myXformLock needs to be acquired.
480  bool computeLocalTransformInternal(Matrix4Type &xform,
481  exint i,
482  bool interpolate_samples,
483  bool acquire_xform_lock = true) const;
484 
485  /// Override the current transforms of the agent.
486  void setTransforms(const Matrix4Array &xforms,
487  bool world_space);
488  void transformsArray(FloatType *buf, exint n,
489  bool world_space) const;
490  void setTransformsFromArray(const FloatType *data, exint n,
491  bool world_space);
492 
493  /// Resize the clip arrays to n elements.
494  void changeNumClips(GU_PrimPacked *prim, exint n, bool fill_valid_clips = false);
495 
496  /// Convert the cached transforms from local to world space (or vice versa).
497  void convertCachedTransforms(bool world_space) const;
498 
499  /// Internal method to set a single current / collision layer for the
500  /// agent.
501  void setLayer(GU_PrimPacked *prim,
504  /// Internal method to set the current / collision layers for the agent.
505  void setLayers(GU_PrimPacked *prim,
507  const UT_Array<GU_AgentLayerConstPtr> &new_layers);
508  /// Internal method to set the agent's current / collision layers by name,
509  /// for use with intrinsics.
510  void setLayerNames(GU_PrimPacked *prim,
512  const UT_StringArray &names);
513 
514  struct DelayLoadData
515  {
516  DelayLoadData(const GA_SharedDataHandlePtr &definition,
517  const GA_SharedDataHandlePtr &transforms,
518  const GA_SharedDataHandlePtr &channel_values)
519  : myDefinition(definition),
520  myTransforms(transforms),
521  myChannelValues(channel_values)
522  {
523  }
524 
525  DelayLoadData(const DelayLoadData &src)
526  : myDefinition(src.myDefinition),
527  myTransforms(src.myTransforms),
528  myChannelValues(src.myChannelValues),
529  myClipNames(src.myClipNames),
530  myClipXformGroupNames(src.myClipXformGroupNames),
531  myCurrentLayerNames(src.myCurrentLayerNames),
532  myCollisionLayerNames(src.myCollisionLayerNames)
533  {
534  }
535 
536  /// Return whether the shared data has been loaded.
537  bool isLoaded() const
538  {
539  return !myDefinition && !myTransforms && !myChannelValues;
540  }
541 
542  int64 getMemoryUsage(bool inclusive) const;
543 
544  UT_Lock myLock;
545  /// Shared agent definition.
546  GA_SharedDataHandlePtr myDefinition;
547  /// Shared transforms.
548  GA_SharedDataHandlePtr myTransforms;
549  /// Cached channel values.
550  GA_SharedDataHandlePtr myChannelValues;
551  /// Names of the clips that this agent will use after the shared
552  /// definition has been loaded.
553  UT_StringArray myClipNames;
554  /// Names of the transform groups that this agent will use after the
555  /// shared definition has been loaded.
556  UT_StringArray myClipXformGroupNames;
557 
558  /// Names of the layers to be resolved after the shared definition has
559  /// been loaded.
560  UT_StringArray myCurrentLayerNames;
561  UT_StringArray myCollisionLayerNames;
562  };
563 
564  GU_AgentDefinitionPtr myDefinition;
565 
566  static constexpr size_t LAYER_CAPACITY = sizeof(GU_AgentLayerConstPtr);
569 
570  State myState;
571 
572  mutable FloatArrayPtr myCachedChannelValues;
573  mutable Matrix4ArrayPtr myCachedTransforms;
574  /// Tracks which entries of myCachedTransforms are in local or world space.
575  mutable UT_BitArray myWorldSpace;
576 
577  /// Whether or not myCachedChannelValues matches the clip intrinsics.
578  mutable bool myHasCustomChannelValues;
579  /// Whether or not myCachedTransforms matches the clip intrinsics.
580  mutable bool myHasCustomXforms;
581 
582  using XformLock = UT_TBBSpinLock;
583  using XformLockScope = UT_TBBSpinLock::Scope;
584  /// Lock for myCachedTransforms and myCachedChannelValues.
585  mutable XformLock myXformLock;
586 
587  mutable UT_UniquePtr<DelayLoadData> myDelayLoadData;
588 
589  static GA_PrimitiveTypeId theTypeId;
590 };
591 
592 #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:374
GLuint counter
Definition: glew.h:2745
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
const char * intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:357
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
fpreal64 myWeight
Definition: GU_Agent.h:80
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
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:367
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_Agent.h:61
exint intrinsicTransformsArraySize(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:363
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:347
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:35
exint transformCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:351
bool intrinsicHasCustomChannelValues(const GU_PrimPacked *) const
Definition: GU_Agent.h:405
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum src
Definition: glcorearb.h:1793
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:353
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:234
GLuint GLuint GLfloat weight
Definition: glew.h:13892
UT_SharedPtr< FloatArray > FloatArrayPtr
Definition: GU_Agent.h:57
fpreal intrinsicClipTime(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:272
#define GA_INVALID_OFFSET
Definition: GA_Types.h:677
BlendMode myBlendMode
Definition: GU_Agent.h:79
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
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
exint intrinsicNumClips(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:256
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
double fpreal64
Definition: SYS_Types.h:201
GLuint GLenum GLenum transform
Definition: glew.h:15055
GA_Size GA_Offset
Definition: GA_Types.h:640
fpreal intrinsicClipWeight(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:282
UT_IntrusiveRefCounter & operator=(const UT_IntrusiveRefCounter &) noexcept
Assignment operator: Does not modify counter.
GU_AgentTransformGroupArray myClipXformGroups
Definition: GU_Agent.h:90
UT_IntrusivePtr< const GU_AgentLayer > GU_AgentLayerConstPtr
Definition: GU_AgentLayer.h:27
void localTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:371
const char * intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:291
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
virtual void clearData()=0
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:336
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:261
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:331
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
GLuint const GLuint * names
Definition: glew.h:2695
UT_Matrix4T< FloatType > Matrix4Type
Definition: GU_Agent.h:59
#define GU_API
Definition: GU_API.h:14
void worldTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:365
const GU_AgentRigConstPtr & getRig() const
Definition: GU_Agent.h:193
UT_SharedPtr< const FloatArray > FloatArrayConstPtr
Definition: GU_Agent.h:58
exint intrinsicChannelCount(const GU_PrimPacked *) const
Definition: GU_Agent.h:398
fpreal clipTime(exint i) const
Definition: GU_Agent.h:270
virtual bool isValid() const =0
Test whether the deferred load primitive data is valid.
GLdouble n
Definition: glcorearb.h:2008
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:611
exint intrinsicNumClipLayers(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:439
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:315
bool hasCustomChannelValues() const
Definition: GU_Agent.h:392
A map of string to various well defined value types.
Definition: UT_Options.h:84
GLsizei const GLint box[]
Definition: glew.h:11654
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
fpreal clipWeight(exint i) const
Definition: GU_Agent.h:280
fpreal64 fpreal
Definition: SYS_Types.h:277
bool unpack(GU_Detail &destgdp, const GU_PrimPacked *prim) const
SYS_FORCE_INLINE GU_AgentDefinition & definition()
Definition: GU_Agent.h:177
bool computeWorldTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific world transform for the agent.
Definition: GU_Agent.h:327
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
bool computeLocalTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Get the local transforms for this agent.
Definition: GU_Agent.h:321
Definition: core.h:1131
exint numClipLayers() const
Definition: GU_Agent.h:309
#define const
Definition: zconf.h:214
GLfloat seconds
Definition: wglew.h:950
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:348
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.
GLenum GLsizei GLsizei GLsizei GLsizei layers
Definition: glew.h:2878
exint channelCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:380
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:339
exint intrinsicClipLayerId(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:301
UT_Fpreal64Array myClipWeights
Definition: GU_Agent.h:89
exint clipLayerId(exint i) const
Definition: GU_Agent.h:299
virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const =0