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