HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AgentShapeDeformer.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_AgentShapeDeformer.h (GU Library, C++)
7  *
8  */
9 
10 #ifndef __GU_AgentShapeDeformer__
11 #define __GU_AgentShapeDeformer__
12 
13 #include "GU_API.h"
14 #include "GU_AgentShapeLib.h"
15 
16 #include <SYS/SYS_Types.h>
17 #include <UT/UT_BoundingBox.h>
18 #include <UT/UT_IntrusivePtr.h>
19 #include <UT/UT_NonCopyable.h>
20 #include <UT/UT_StringHolder.h>
21 
22 class GU_Agent;
23 class GU_Detail;
24 
29 
30 /// Defines a deformer for an agent shape.
32  : public UT_IntrusiveRefCounter<GU_AgentShapeDeformer>
33 {
34 public:
36 
37  virtual ~GU_AgentShapeDeformer() = default;
38 
40 
41  /// Unique identifier for the deformer. This is used when serializing
42  /// layers to JSON.
43  const UT_StringHolder &name() const { return myName; }
44 
45  /// Deform the provided detail, which was unpacked from the given shape
46  /// binding (shape & transform index) and agent.
47  ///
48  /// The transform index can be used for deformers that need to know the
49  /// shape's transform in order to perform the deformation correctly (e.g.
50  /// for skinning). Deformers are not responsible for applying the transform
51  /// to the geometry - this is performed after the deformer is executed.
52  /// Note that the transform index may be -1 if the shape was not attached
53  /// to a joint.
54  virtual void deform(GU_Detail &gdp,
55  const GU_AgentShapeLib::Shape &src_shape,
56  exint xform_idx,
57  const GU_Agent &src_agent) const = 0;
58 
59  /// Compute an approximate bounding box for the deformed shape.
60  /// Similar to deform(), the shape binding's transform and bounds scale are
61  /// applied after calling this method.
62  ///
63  /// The default implementation just uses the bounding box of the source
64  /// shape (equivalent to how bounds would be computed for a static shape
65  /// binding).
66  virtual void computeBounds(UT_BoundingBox &box,
67  const GU_AgentShapeLib::Shape &src_shape,
68  exint xform_idx,
69  const GU_Agent &src_agent) const;
70 
71 private:
72  UT_StringHolder myName;
73 };
74 
75 #endif
const UT_StringHolder & name() const
int64 exint
Definition: SYS_Types.h:125
void deform(OUTPOS &newposdata, const INPOS &points, const DEFRESTPOS &constrestpos, const DEFANIMPOS &constanimpos, const GU_Detail &defgdp, const GA_ROHandleV3 restnmlattrib, const GA_ROHandleV3 resttanattrib, const GA_ROHandleV3 animnmlattrib, const GA_ROHandleV3 animtanattrib, const UT_IntArray &primptstarts, const GA_OffsetArray &ptoffsets, const UT_FloatArray &ptweights)
A reference counter base class for use with UT_IntrusivePtr.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
Shape(GA_Offset offset)
Wrapper around hboost::intrusive_ptr.
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
Defines a deformer for an agent shape.