HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_PrimCharacterScene.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: GT_CharacterScene.h (GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 #ifndef GT_PrimCharacterScene_h
11 #define GT_PrimCharacterScene_h
12 
13 #include "GT_API.h"
14 #include "GT_Primitive.h"
15 
16 #include <GU/GU_DetailHandle.h>
17 #include <UT/UT_NonCopyable.h>
18 #include <UT/UT_Pair.h>
19 #include <UT/UT_Array.h>
20 
21 class GU_PrimPacked;
22 
24 {
25 public:
26  /// Contains a list of either shape, skel, or rig prims
27  using Component = std::pair<UT_StringHolder, GU_ConstDetailHandle>;
28  /// A character will have a name and at least one shape, skel, and rig prim
29  struct Character {
34 
36  const UT_StringHolder &name,
37  const UT_Array<Component> &shapes,
38  const UT_Array<Component> &skels,
39  const UT_Array<Component> &rigs)
40  : name(name)
41  , shapes(shapes)
42  , skels(skels)
43  , rigs(rigs)
44  {}
45  };
46 
48  ~GT_PrimCharacterScene() override;
49 
51 
52  void addPrim(const GU_PrimPacked *prim);
53 
54  int getPrimitiveType() const override { return GT_PRIM_CHARACTER_SCENE; }
55 
56  const char *className() const override { return "gt_CharacterScene"; }
57 
58  /// An array of bounding boxes is passed in. There is a bounding box for
59  /// each segement. Each bounding box should be enlarged appropriately.
61  int nsegments) const override { /* TODO */ }
62  /// Return the number of motion segments defined on the geometry
63  /// By default, this simply returns the number of segments on P.
64  int getMotionSegments() const override { return 0; /* TODO */ }
65 
66  /// Return an approximate memory usage. Since data may be shared, this
67  /// will always be an over-estimation.
68  int64 getMemoryUsage() const override { return 0; /* TODO */ }
69 
70  /// Create a copy of the primitive, referencing all the source data
71  /// This can return a NULL pointer, but it would be better to implement it
72  /// properly.
73  GT_PrimitiveHandle doSoftCopy() const override { return nullptr; /* TODO */ }
74 
75  GU_ConstDetailHandle findAShape() const;
76 
77  // array contains a shape, a skel, and a rig in that order
78  Character findACharacter() const;
79  UT_Array<Character> findAllCharacters() const;
80 
81  GU_ConstDetailHandle getDetail() const {return myPrimDetail;}
82 
83  bool hasScenePrim() const;
84  bool hasConstraintsPrim() const;
85  GU_ConstDetailHandle getScenePrim() const;
86  GU_ConstDetailHandle getConstraintsPrim() const;
87 
88 private:
89  struct Tree;
90 
91  GU_ConstDetailHandle myPrimDetail;
92  Tree *mySceneTree = nullptr;
93 };
94 
95 #endif
A character will have a name and at least one shape, skel, and rig prim.
#define GT_API
Definition: GT_API.h:13
void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override
int64 getMemoryUsage() const override
std::pair< UT_StringHolder, GU_ConstDetailHandle > Component
Contains a list of either shape, skel, or rig prims.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
int getMotionSegments() const override
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
GU_ConstDetailHandle getDetail() const
GT_PrimitiveHandle doSoftCopy() const override
Character(const UT_StringHolder &name, const UT_Array< Component > &shapes, const UT_Array< Component > &skels, const UT_Array< Component > &rigs)
int getPrimitiveType() const override
const char * className() const override