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