HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_RenderInfo.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_RenderInfo.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Class containing common data to all GR_Primitives that originate from
10  * the same GUI_GeoRender object. Do not cache any of this data, as it may
11  * be deleted.
12  */
13 #ifndef GR_RenderInfo_h
14 #define GR_RenderInfo_h
15 
16 #include "GR_API.h"
17 #include "GR_Defines.h"
18 #include "GR_PickRecord.h"
19 
20 #include <UT/UT_Array.h>
21 #include <UT/UT_StringHolder.h>
22 #include <RE/RE_CachedObject.h>
23 
24 class OP_Node;
25 class RE_OGLTexture;
26 class GR_DisplayOption;
27 class GR_ErrorManager;
28 
30 {
31 public:
33  : myRenderVersion(render_version)
34  {
35  myShowSelections = false;
36  myCanDoInstancing = false;
37  myObjectSelection = 0;
38  myObjectGhosted = false;
39  myCanRenderUV = false;
40  myPostPassID = 0;
41  myDispOpts = NULL;
42  }
43 
44  enum { UNSELECTED = 0, SELECTED_OBJ = 1, CURRENT_OBJ = 2 };
45 
47  { return myRenderVersion; }
48  bool showSelections() const
49  { return myShowSelections; }
50  bool canDoInstancing() const
51  { return myCanDoInstancing; }
52  bool isObjectSelection() const
53  { return (myObjectSelection != UNSELECTED); }
54  bool isObjectCurrent() const
55  { return (myObjectSelection == CURRENT_OBJ); }
56  bool isObjectGhosted() const
57  { return myObjectGhosted; }
58  bool canRenderUV() const
59  { return myCanRenderUV; }
60 
62  { return myCacheTagHandle; }
64  { return myPicks; }
66  { return myDispOpts; }
68  { return theErrorHandler; }
70  { return myNodePath; }
71 
72  // Reserves a post-processing pass for the primitive. Returns an ID that
73  // will uniquely identify the post-pass for the primitive.
75  { myPostPassID++; return myPostPassID; }
76  // When rendering a post pass, check again the post-pass ID to make sure it
77  // is the pass you requested
78  int getPostPassID() const
79  { return myPostPassID; }
80 
81 private:
82  GR_RenderVersion myRenderVersion;
83  bool myShowSelections;
84  bool myCanDoInstancing;
85  bool myObjectGhosted;
86  bool myCanRenderUV;
87 
88  int myObjectSelection;
89  RE_CacheTagHandle myCacheTagHandle;
90  const GR_DisplayOption *myDispOpts;
91  mutable UT_Array<GR_PickRecord> myPicks;
92  mutable int myPostPassID;
93  static GR_ErrorManager *theErrorHandler;
94  UT_StringHolder myNodePath;
95 
96  friend class GUI_GeoRender;
97  friend class DM_VPortAgent;
98  friend class DM_SceneManager;
99  friend class jedi_UsdGLRender;
100 };
101 
102 #endif
103 
bool canRenderUV() const
Definition: GR_RenderInfo.h:58
GR_RenderInfo(GR_RenderVersion render_version)
Definition: GR_RenderInfo.h:32
const GR_DisplayOption * getDisplayOption() const
Definition: GR_RenderInfo.h:65
bool canDoInstancing() const
Definition: GR_RenderInfo.h:50
bool isObjectGhosted() const
Definition: GR_RenderInfo.h:56
GR_RenderVersion getRenderVersion() const
Definition: GR_RenderInfo.h:46
int getPostPassID() const
Definition: GR_RenderInfo.h:78
static GR_ErrorManager * getErrorHandler()
Definition: GR_RenderInfo.h:67
#define GR_API
Definition: GR_API.h:10
GR_RenderVersion
Definition: GR_Defines.h:21
bool isObjectSelection() const
Definition: GR_RenderInfo.h:52
int requestRenderPostPass() const
Definition: GR_RenderInfo.h:74
bool showSelections() const
Definition: GR_RenderInfo.h:48
const UT_StringHolder & getNodePath() const
Definition: GR_RenderInfo.h:69
UT_Array< GR_PickRecord > & getPickArray() const
Definition: GR_RenderInfo.h:63
RE_CacheTagHandle getCacheTag() const
Definition: GR_RenderInfo.h:61
bool isObjectCurrent() const
Definition: GR_RenderInfo.h:54