HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GR_PrimAgents.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: GR_PrimAgents ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Rendering class for agent decorations, bounding boxes
10  */
11 #ifndef GR_PrimAgents_h
12 #define GR_PrimAgents_h
13 
14 #include "GR_Primitive.h"
15 
16 #include <UT/UT_ValArray.h>
17 #include <UT/UT_BoundingBox.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <GT/GT_GEOPackedAgent.h>
20 
22 {
23 public:
24  GR_PrimAgents(const GR_RenderInfo *info,
25  const char *cache_name);
26  virtual ~GR_PrimAgents();
27 
28 
29  virtual const char *className() const { return "GR_PrimAgents"; }
30 
32  const GT_PrimitiveHandle &,
33  const GEO_Primitive *);
34 
36  bool first_init);
37  virtual void update(RE_Render *r,
38  const GT_PrimitiveHandle &primh,
39  const GR_UpdateParms &p);
40 
41  // update the visibility info.
42  virtual bool updateOnViewChange(const GR_DisplayOption &) const
43  { return true; }
44  virtual void viewUpdate(RE_Render *r,
45  const GR_ViewUpdateParms &parms);
46 
47  virtual void render(RE_Render *r,
48  GR_RenderMode render_mode,
49  GR_RenderFlags render_flags,
50  GR_DrawParms dp);
51 
52  virtual int renderPick(RE_Render *r,
53  const GR_DisplayOption *opts,
54  unsigned int pickmask,
55  GR_PickStyle pickstyle,
56  bool has_pick_map);
57 
58  virtual void renderDecoration(RE_Render *r,
59  GR_Decoration decor,
60  const GR_DecorationParms &parms);
61 private:
62 
63  void updateVisibility(RE_Render *r,
64  const GR_FrustumList &view_frustums);
65  void buildSkeleton(RE_Render *r, const GT_GEOPackedAgent *agents);
66  void updateBones(RE_Render *r, const GT_GEOPackedAgent *agent,
67  bool geo_changed);
68  void updateAgentColor(RE_Render *r, const GT_GEOPackedAgent *agent,
69  const RE_CacheVersion &version);
70  void updateSelection(RE_Render *r,
71  const GT_GEOPackedAgent *agent,
72  const GR_UpdateParms &p);
73 
74  GT_PrimitiveHandle myAgent;
75  GT_AgentVisibilityHandle myVisibility;
76  UT_BoundingBox myWorstCaseBounds;
77  UT_Array<UT_BoundingBox> myBounds;
78  UT_Vector3FArray myPos;
79  UT_IntArray myPrimID;
80 
81  UT_Matrix4FArray myMats;
82  UT_IntArray myBoneTransformIndices;
83  UT_ValArray<UT_QuaternionF> myBoneQuats;
84 
85  RE_Geometry *myPoints;
86  RE_Geometry *myPrimAnchors;
87  RE_Geometry *myBBoxes;
88  RE_Geometry *myBaseDisc;
89  RE_Geometry *myBones;
90 
91  RE_VertexArray *myBoneTransformsVA;
92  int myLastTransformSerial;
93  fpreal myWorstCaseOverestimate;
94 
95  unsigned myLastHullDisplay : 1,
96  myLastWireOver:1,
97  myLastWire:1,
98  myBoneRigDirty:1,
99  myBonesVisible:1,
100  myObjectSelected:1,
101  myDiscsDirty:1,
102  myBBoxDirty:1;
103  RE_VertexArray *myColorVA;
104  RE_VertexArray *mySelectionVA;
105  RE_VertexArray *myPointSelectionVA;
106  GR_SelectMode mySelectMode;
107  GR_AgentWireMode myAgentWireMode;
108  UT_IntArray myBoneSerialCounts;
109  int myBoneSerial;
110  int64 myBoneVisibleHash;
111  UT_Matrix4FArray myBoneMatrixBuffer;
112 };
113 
114 #endif
Set of parameters sent to GR_Primitive::viewUpdate().
virtual void update(RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p)
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition: RE_Geometry.h:53
GR_AgentWireMode
Definition: GR_Defines.h:349
GR_Decoration
Definition: GR_Defines.h:137
Contains a list of agents.
set of parameters sent to GR_Primitive::update()
long long int64
Definition: SYS_Types.h:106
GR_RenderMode
Definition: GR_Defines.h:42
virtual void viewUpdate(RE_Render *r, const GR_ViewUpdateParms &parms)
virtual GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t, int, const GT_PrimitiveHandle &, const GEO_Primitive *)
GR_PrimAcceptResult
Definition: GR_Defines.h:320
GR_RenderFlags
Definition: GR_Defines.h:77
virtual int renderPick(RE_Render *r, const GR_DisplayOption *opts, unsigned int pickmask, GR_PickStyle pickstyle, bool has_pick_map)
virtual ~GR_PrimAgents()
virtual const char * className() const
Return a string version of this class's name.
Definition: GR_PrimAgents.h:29
GT_PrimitiveType
virtual bool updateOnViewChange(const GR_DisplayOption &) const
If this primitive requires an update when the view changes, return true.
Definition: GR_PrimAgents.h:42
double fpreal
Definition: SYS_Types.h:269
virtual void renderDecoration(RE_Render *r, GR_Decoration decor, const GR_DecorationParms &parms)
GR_PrimAgents(const GR_RenderInfo *info, const char *cache_name)
virtual void render(RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags render_flags, GR_DrawParms dp)
virtual GR_DispOptChange displayOptionChange(const GR_DisplayOption &opts, bool first_init)
Simple class for a mutli-integer cache tag.
GLboolean r
Definition: glcorearb.h:1221
GR_SelectMode
Definition: GR_Defines.h:215
GR_PickStyle
Definition: GR_Defines.h:226