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:
59 
60  enum BlendMode
61  {
64  NUM_BLEND_MODES
65  };
66 
67  struct ClipLayer
68  {
69  ClipLayer(BlendMode blend_mode, fpreal64 weight = 0.0,
70  int64 parent = -1)
71  : myBlendMode(blend_mode), myWeight(weight), myParent(parent)
72  {
73  }
74 
78  };
79 
80  /// State of the primitive
81  struct State
82  {
88 
90  };
91 
92  GU_Agent();
93  GU_Agent(const GU_Agent &src);
94  virtual ~GU_Agent();
95 
96  /// Register the packed primitive type
97  static void install(GA_PrimitiveFactory *pfact);
98 
99  /// Get the type ID for the GU_Agent primitive type.
101  {
102  return theTypeId;
103  }
104 
105  /// Convenience method to create a packed agent primitive
106  static GU_PrimPacked *agent(GU_Detail &dest,
107  const StringType &default_layer
109  const StringType &collision_layer
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  virtual GU_PackedFactory *getFactory() const;
120  virtual GU_Agent *copy() const;
121  virtual bool isValid() const;
122  virtual void clearData();
123 
124  virtual bool supportsJSONLoad() const
125  { return true; }
126  virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
127  { return loadFrom(prim, options, map); }
128  virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options,
129  const GA_LoadMap &map)
130  { return loadFrom(prim, options, map); }
131 
132  virtual void update(GU_PrimPacked *prim, const UT_Options &options)
133  { updateFrom(prim, options); }
134  virtual bool saveSharedData(UT_JSONWriter &w, GA_SaveMap &map,
135  GA_GeometryIndex *geometryIndex) const;
136  virtual bool loadSharedData(int load_data_type,
137  const GA_SharedLoadData *item);
138  virtual bool save(UT_Options &options,
139  const GA_SaveMap &map) const;
140  virtual bool getBounds(UT_BoundingBox &box) const;
141  virtual bool getRenderingBounds(UT_BoundingBox &box) const;
142  virtual void getVelocityRange(
143  UT_Vector3 &vmin,
144  UT_Vector3 &vmax) const;
145  virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const;
146  virtual bool unpack(GU_Detail &destgdp, const UT_Matrix4D *transform) const;
147  virtual bool unpackWithStyler(
148  GU_Detail &destgdp,
149  STY_StylerGroup &prim_styler_group,
150  const STY_Styler &parent_styler,
151  const GU_PrimPacked *prim) const;
152  virtual GU_ConstDetailHandle getPackedDetail(GU_PackedContext *context = 0) const;
153 
154  /// Report memory usage (includes all shared memory)
155  virtual int64 getMemoryUsage(bool inclusive) const;
156 
157  /// Count memory usage using a UT_MemoryCounter in order to count
158  /// shared memory correctly.
159  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
160  /// @}
161 
162  /// Return the agent's definition (which contains e.g. available clips and
163  /// layers).
165  {
166  loadDefinitionIfNeeded();
167  return *myDefinition;
168  }
169 
171  {
172  loadDefinitionIfNeeded();
173  return *myDefinition;
174  }
175 
176  void setDefinition(GU_PrimPacked *prim, const GU_AgentDefinitionPtr &definition);
177 
178  /// Rig Accessor
179  /// @{
180  const GU_AgentRigConstPtr &getRig() const { return definition().rig(); }
181  /// @}
182 
183  /// @{
184  /// Packed implementation for specific layers
185  bool layerBounds(const GU_AgentLayer &layer,
186  UT_BoundingBox &box) const;
187  void layerVelocityRange(const GU_AgentLayer &layer,
188  UT_Vector3 &vmin, UT_Vector3 &vmax) const;
189  void layerWidthRange(const GU_AgentLayer &layer,
190  fpreal &wmin, fpreal &wmax) const;
191  bool layerUnpack(
192  const GU_AgentLayer &layer,
193  GU_Detail &destgdp,
194  const UT_Matrix4D *transform,
195  STY_StylerGroup *prim_styler_group=nullptr,
196  const STY_Styler *parent_styler=nullptr,
197  const GU_PrimPacked *prim=nullptr) const;
199  layerPackedDetail(const GU_AgentLayer &layer) const;
200  /// @}
201 
202  /// Return the current layer. This may be a NULL pointer.
203  const GU_AgentLayer *getCurrentLayer() const;
204  /// Return the current collision layer. This may be a NULL pointer.
205  const GU_AgentLayer *getCollisionLayer() const;
206 
207  /// @{
208  /// Set the default layer (for packing, bounds, etc)
209  StringType currentLayerName() const { return myCurrentLayer; }
210  StringType intrinsicCurrentLayerName(const GU_PrimPacked *prim) const { return currentLayerName(); }
211  void setCurrentLayerName(GU_PrimPacked *prim, const StringType &name);
212  /// @}
213 
214  /// @{
215  /// Set the collision layer.
216  StringType collisionLayerName() const { return myCollisionLayer; }
217  StringType intrinsicCollisionLayerName(const GU_PrimPacked *prim) const { return collisionLayerName(); }
218  void setCollisionLayerName(GU_PrimPacked *prim, const StringType &name);
219  /// @}
220 
221  /// Array of clips used for transform evaluation
222  /// @{
223  const GU_AgentClipPtrArray& clips() const;
224  void setClips(GU_PrimPacked *prim, const GU_AgentClipPtrArray& clips);
225  void setClipsByNames(GU_PrimPacked *prim, const UT_StringArray& clip_names);
226  /// @}
227 
228  /// Return the number of clips used for transform evaluation
229  exint numClips() const
230  { return clips().entries(); }
232  { return numClips(); }
233 
234  /// Names of the clips used for transform evaluation
235  const char* clipName(exint i) const;
236  const char* intrinsicClipName(const GU_PrimPacked *prim, exint i) const
237  { return clipName(i); }
238 
239  /// Set a clip by name
240  void setClipByName(GU_PrimPacked *prim, exint i, const char *clip_name);
241 
242  /// Array of times in seconds to evaluate the clips.
243  /// Indices in [0,numClips()-1] inclusively.
244  /// @{
246  { return myState.myClipTimes(i); }
248  { return clipTime(i); }
249  void setClipTime(GU_PrimPacked *prim, exint i, fpreal seconds);
250  /// @}
251 
252  /// Array of weights to evaluate the corresponding clips. Assumes they are
253  /// normalized.
254  /// @{
256  { return myState.myClipWeights(i); }
258  { return clipWeight(i); }
259  void setClipWeight(GU_PrimPacked *prim, exint i, fpreal weight);
260  /// @}
261 
262  /// The subset of transforms in the rig that each clip should be applied
263  /// to.
264  /// @{
265  const char* clipTransformGroupName(exint i) const;
266  const char* intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
267  { return clipTransformGroupName(i); }
268  void setClipTransformGroupByName(GU_PrimPacked *prim, exint i, const char *name);
269  /// @}
270 
271  /// The layer that each clip belongs to.
272  /// @{
274  { return myState.myClipLayerIds(i); }
276  { return clipLayerId(i); }
277  void setClipLayerId(GU_PrimPacked *prim, exint i, exint layer_id);
278  /// @}
279 
280  /// List of clip layers and their blend modes.
281  /// @{
282  void setClipLayers(GU_PrimPacked *prim, const UT_Array<ClipLayer> &clip_layers);
284  { return myState.myClipLayers.entries(); }
285  /// @}
286 
287  /// Get the world transforms for this agent. Disabling interpolation can
288  /// improve performance if the clip time falls between two samples.
290  bool interpolate_samples = true) const
291  { return computeTransforms(xforms,
292  /* world_space */ true,
293  interpolate_samples); }
294  /// Get the local transforms for this agent.
296  bool interpolate_samples = true) const
297  { return computeTransforms(xforms,
298  /* world_space */ false,
299  interpolate_samples); }
300  /// Get a specific world transform for the agent.
302  bool interpolate_samples = true) const
303  { return computeWorldTransformInternal(xform, i, interpolate_samples); }
304  /// Get a specific local transform for the agent.
306  bool interpolate_samples = true) const
307  { return computeLocalTransformInternal(xform, i, interpolate_samples); }
308 
309  /// Override the world transforms for this agent.
310  void setWorldTransforms(const Matrix4Array &xforms)
311  { setTransforms(xforms, /* world_space */ true); }
312  /// Override the local transforms for this agent.
313  void setLocalTransforms(const Matrix4Array &xforms)
314  { setTransforms(xforms, /* world_space */ false); }
315  /// Override a specific world transform for this agent.
316  void setWorldTransform(const Matrix4Type &xform, exint i);
317  /// Override a specific local transform for this agent.
318  void setLocalTransform(const Matrix4Type &xform, exint i);
319  /// Returns whether the agent's transforms have been overridden from the
320  /// blended clips.
321  bool hasCustomTransforms() const { return myHasCustomXforms; }
323  { return hasCustomTransforms(); }
324  /// Number of transforms in the rig.
326  { return getRig() ? getRig()->transformCount() : 0; }
328  { return transformCount(); }
329  /// Return the name of the given transform.
330  const char* transformName(exint i) const;
331  const char* intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
332  { return transformName(i); }
333 
334  /// Functions for the 'agentworldtransforms' and 'agentlocaltransforms'
335  /// intrinsics to manipulate the transforms as an array of floats.
336  exint transformsArraySize() const;
338  { return transformsArraySize(); }
340  { transformsArray(data, n, /* world_space */ true); }
342  exint n)
343  { setTransformsFromArray(data, n,
344  /* world_space */ true); }
346  { transformsArray(data, n,
347  /* world_space */ false); }
349  exint n)
350  { setTransformsFromArray(data, n,
351  /* world_space */ false); }
352 
353  /// Functions for the 'agentrigparents' intrinsic.
354  exint intrinsicParentIndex(const GU_PrimPacked *prim, exint i) const;
355  /// Functions for the 'agentlayers' intrinsic.
356  exint intrinsicNumLayers(const GU_PrimPacked *prim) const;
357  const char* intrinsicLayerName(const GU_PrimPacked *prim, exint i) const;
358 
359  /// Used by the 'agentcliptimes', 'agentclipnames', and 'agentclipweights'
360  /// intrinsics to grow or shrink the number of clips.
361  void intrinsicSetNumClips(GU_PrimPacked *prim, GA_Size n);
362 
363  /// Functions for the 'agentclipcatalog' intrinsic.
364  exint intrinsicCatalogNumClips(const GU_PrimPacked *prim) const;
365  const char* intrinsicCatalogClipName(const GU_PrimPacked *prim, exint i) const;
366  const char* intrinsicClipCatalogFilenames(const GU_PrimPacked *prim, exint i) const;
367 
368  /// Functions for the 'agentshapelibrary' intrinsic.
369  exint intrinsicNumShapes(const GU_PrimPacked *prim) const;
370  void intrinsicShapeNames(const GU_PrimPacked *prim, UT_StringArray &values) const;
371 
372  /// Functions for the 'agenttransformgroups' intrinsic.
373  /// @{
374  exint intrinsicNumTransformGroups(const GU_PrimPacked *prim) const;
375  const char* intrinsicTransformGroupName(const GU_PrimPacked *prim, exint i) const;
376  /// @}
377 
378  /// Functions for the clip layer intrinsics.
379  /// @{
380  const char* intrinsicClipLayerMode(const GU_PrimPacked *prim, exint i) const;
381  exint intrinsicClipLayerParent(const GU_PrimPacked *prim, exint i) const;
382  fpreal intrinsicClipLayerWeight(const GU_PrimPacked *prim, exint i) const;
384  { return numClipLayers(); }
385  /// @}
386 
387 private:
388  GU_Agent& operator=(const GU_Agent& copy); // DISALLOWED
389 
390 private:
391  void dirtyBlendedTransforms(GU_PrimPacked *prim);
392  void loadDefinition() const;
393  SYS_FORCE_INLINE void loadDefinitionIfNeeded() const
394  {
395  if (!myDefinition)
396  loadDefinition();
397  }
398 
399  template <typename T>
400  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
401  template <typename T>
402  void updateFrom(GU_PrimPacked *prim, const T &options);
403 
404  /// Get the agent's current transforms, in local or world space.
405  /// Disabling interpolation can improve performance if the clip time falls
406  /// between two samples.
407  bool computeTransforms(Matrix4ArrayConstPtr &matrices,
408  bool world_space,
409  bool interpolate_samples = true,
410  bool acquire_xform_lock = true) const;
411 
412  /// Internal version of computeWorldTransform(), which allows controlling
413  /// whether myXformLock needs to be acquired.
414  bool computeWorldTransformInternal(Matrix4Type &xform,
415  exint i,
416  bool interpolate_samples,
417  bool acquire_xform_lock = true) const;
418 
419  /// Internal version of computeLocalTransform(), which allows controlling
420  /// whether myXformLock needs to be acquired.
421  bool computeLocalTransformInternal(Matrix4Type &xform,
422  exint i,
423  bool interpolate_samples,
424  bool acquire_xform_lock = true) const;
425 
426  /// Override the current transforms of the agent.
427  void setTransforms(const Matrix4Array &xforms,
428  bool world_space);
429  void transformsArray(FloatType *buf, exint n,
430  bool world_space) const;
431  void setTransformsFromArray(const FloatType *data, exint n,
432  bool world_space);
433 
434  /// Resize the clip arrays to n elements.
435  void changeNumClips(GU_PrimPacked *prim, exint n, bool fill_valid_clips = false);
436 
437  /// Convert the cached transforms from local to world space (or vice versa).
438  void convertCachedTransforms(bool world_space) const;
439 
440  struct DelayLoadData
441  {
442  DelayLoadData(const GA_SharedDataHandlePtr &definition,
444  : myDefinition(definition), myTransforms(transforms)
445  {
446  }
447 
448  DelayLoadData(const DelayLoadData &src)
449  : myDefinition(src.myDefinition),
450  myTransforms(src.myTransforms),
451  myClipNames(src.myClipNames),
452  myClipXformGroupNames(src.myClipXformGroupNames)
453  {
454  }
455 
456  /// Return whether the shared data has been loaded.
457  bool isLoaded() const { return !myDefinition && !myTransforms; }
458 
459  int64 getMemoryUsage(bool inclusive) const;
460 
461  UT_Lock myLock;
462  /// Shared agent definition.
463  GA_SharedDataHandlePtr myDefinition;
464  /// Shared transforms.
465  GA_SharedDataHandlePtr myTransforms;
466  /// Names of the clips that this agent will use after the shared
467  /// definition has been loaded.
468  UT_StringArray myClipNames;
469  /// Names of the transform groups that this agent will use after the
470  /// shared definition has been loaded.
471  UT_StringArray myClipXformGroupNames;
472  };
473 
474  GU_AgentDefinitionPtr myDefinition;
475  StringType myCurrentLayer;
476  StringType myCollisionLayer;
477  State myState;
478 
479  mutable Matrix4ArrayPtr myCachedTransforms;
480  /// Tracks which entries of myCachedTransforms are in local or world space.
481  mutable UT_BitArray myWorldSpace;
482 
483  /// Whether or not myCachedTransforms matches the clip intrinsics.
484  mutable bool myHasCustomXforms;
485 
486  using XformLock = UT_TBBSpinLock;
487  using XformLockScope = UT_TBBSpinLock::Scope;
488  mutable XformLock myXformLock;
489 
490  mutable UT_UniquePtr<DelayLoadData> myDelayLoadData;
491 
492  static GA_PrimitiveTypeId theTypeId;
493 };
494 
495 #endif
UT_Int64Array myClipLayerIds
Definition: GU_Agent.h:87
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:348
virtual bool saveSharedData(UT_JSONWriter &w, GA_SaveMap &map, GA_GeometryIndex *geometryIndex) const
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
const char * intrinsicTransformName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:331
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
png_infop int transforms
Definition: png.h:2591
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1298
fpreal64 myWeight
Definition: GU_Agent.h:76
State of the primitive.
Definition: GU_Agent.h:81
void setWorldTransformsFromArray(GU_PrimPacked *prim, const FloatType *data, exint n)
Definition: GU_Agent.h:341
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_Agent.h:57
exint intrinsicTransformsArraySize(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:337
fpreal32 FloatType
Definition: GU_Agent.h:54
GU_AgentClipPtrArray myClips
Definition: GU_Agent.h:83
virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
Definition: GU_Agent.h:126
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:321
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
exint transformCount() const
Number of transforms in the rig.
Definition: GU_Agent.h:325
3D Vector class.
UT_SharedPtr< GA_SharedDataHandle > GA_SharedDataHandlePtr
UT_Array< ClipLayer > myClipLayers
Definition: GU_Agent.h:89
png_uint_32 i
Definition: png.h:2877
exint intrinsicTransformCount(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:327
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
StringType intrinsicCollisionLayerName(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:217
fpreal intrinsicClipTime(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:247
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
exint numClips() const
Return the number of clips used for transform evaluation.
Definition: GU_Agent.h:229
StringType collisionLayerName() const
Definition: GU_Agent.h:216
BlendMode myBlendMode
Definition: GU_Agent.h:75
virtual bool getRenderingBounds(UT_BoundingBox &box) const =0
exint intrinsicNumClips(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:231
GA_Size GA_Offset
Definition: GA_Types.h:617
fpreal intrinsicClipWeight(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:257
long long int64
Definition: SYS_Types.h:107
GU_AgentTransformGroupArray myClipXformGroups
Definition: GU_Agent.h:86
StringType intrinsicCurrentLayerName(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:210
GLdouble n
Definition: glcorearb.h:2007
void localTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:345
const char * intrinsicClipTransformGroupName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:266
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
StringType currentLayerName() const
Definition: GU_Agent.h:209
int64 exint
Definition: SYS_Types.h:116
virtual void clearData()=0
double fpreal64
Definition: SYS_Types.h:192
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:310
virtual int64 getMemoryUsage(bool inclusive) const =0
Report memory usage (includes all shared memory)
SYS_FORCE_INLINE const UT_StringHolder & UTmakeUnsafeRef(const UT_StringRef &ref)
Convert a UT_StringRef into a UT_StringHolder that is a shallow reference.
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
const char * intrinsicClipName(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:236
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
virtual GU_PackedFactory * getFactory() const =0
Get the factory associated with this procedural.
UT_Fpreal64Array myClipTimes
Definition: GU_Agent.h:84
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:305
Options during loading.
Definition: GA_LoadMap.h:42
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1601
UT_Matrix4T< FloatType > Matrix4Type
Definition: GU_Agent.h:55
#define GU_API
Definition: GU_API.h:12
#define GU_AGENT_LAYER_COLLISION
Definition: GU_Agent.h:33
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
void worldTransformsArray(const GU_PrimPacked *prim, FloatType *data, exint n) const
Definition: GU_Agent.h:339
const GU_AgentRigConstPtr & getRig() const
Definition: GU_Agent.h:180
GA_API const UT_StringHolder transform
fpreal clipTime(exint i) const
Definition: GU_Agent.h:245
virtual bool isValid() const =0
Test whether the deferred load primitive data is valid.
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
exint intrinsicNumClipLayers(const GU_PrimPacked *prim) const
Definition: GU_Agent.h:383
SYS_FORCE_INLINE const GU_AgentDefinition & definition() const
Definition: GU_Agent.h:170
bool computeWorldTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Definition: GU_Agent.h:289
double fpreal
Definition: SYS_Types.h:270
A map of string to various well defined value types.
Definition: UT_Options.h:42
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
fpreal clipWeight(exint i) const
Definition: GU_Agent.h:255
bool unpack(GU_Detail &destgdp, const GU_PrimPacked *prim) const
virtual bool supportsJSONLoad() const
Definition: GU_Agent.h:124
#define GU_AGENT_LAYER_DEFAULT
Definition: GU_Agent.h:32
SYS_FORCE_INLINE GU_AgentDefinition & definition()
Definition: GU_Agent.h:164
bool computeWorldTransform(Matrix4Type &xform, exint i, bool interpolate_samples=true) const
Get a specific world transform for the agent.
Definition: GU_Agent.h:301
virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map)
Definition: GU_Agent.h:128
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:856
bool computeLocalTransforms(Matrix4ArrayConstPtr &xforms, bool interpolate_samples=true) const
Get the local transforms for this agent.
Definition: GU_Agent.h:295
exint numClipLayers() const
Definition: GU_Agent.h:283
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
Definition: GU_Agent.h:58
virtual void update(GU_PrimPacked *prim, const UT_Options &options)
Definition: GU_Agent.h:132
virtual bool loadSharedData(int load_data_type, const GA_SharedLoadData *item)
bool intrinsicHasCustomTransforms(const GU_PrimPacked *) const
Definition: GU_Agent.h:322
ClipLayer(BlendMode blend_mode, fpreal64 weight=0.0, int64 parent=-1)
Definition: GU_Agent.h:69
UT_Array< Matrix4Type > Matrix4Array
Definition: GU_Agent.h:56
virtual bool save(UT_Options &options, const GA_SaveMap &map) const =0
Copy the resolver data into the UT_Options for saving.
float fpreal32
Definition: SYS_Types.h:191
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_Agent primitive type.
Definition: GU_Agent.h:100
void setLocalTransforms(const Matrix4Array &xforms)
Override the local transforms for this agent.
Definition: GU_Agent.h:313
exint intrinsicClipLayerId(const GU_PrimPacked *prim, exint i) const
Definition: GU_Agent.h:275
UT_Fpreal64Array myClipWeights
Definition: GU_Agent.h:85
exint clipLayerId(exint i) const
Definition: GU_Agent.h:273
GLenum src
Definition: glcorearb.h:1792
virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const =0