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  myPostPassID = 0;
40  myDispOpts = NULL;
41  }
42 
43  enum { UNSELECTED = 0, SELECTED_OBJ = 1, CURRENT_OBJ = 2 };
44 
46  { return myRenderVersion; }
47  bool showSelections() const
48  { return myShowSelections; }
49  bool canDoInstancing() const
50  { return myCanDoInstancing; }
51  bool isObjectSelection() const
52  { return (myObjectSelection != UNSELECTED); }
53  bool isObjectCurrent() const
54  { return (myObjectSelection == CURRENT_OBJ); }
55  bool isObjectGhosted() const
56  { return myObjectGhosted; }
58  { return myCacheTagHandle; }
60  { return myPicks; }
62  { return myDispOpts; }
64  { return theErrorHandler; }
66  { return myNodePath; }
67 
68  // Reserves a post-processing pass for the primitive. Returns an ID that
69  // will uniquely identify the post-pass for the primitive.
71  { myPostPassID++; return myPostPassID; }
72  // When rendering a post pass, check again the post-pass ID to make sure it
73  // is the pass you requested
74  int getPostPassID() const
75  { return myPostPassID; }
76 
77 private:
78  GR_RenderVersion myRenderVersion;
79  bool myShowSelections;
80  bool myCanDoInstancing;
81  bool myObjectGhosted;
82  int myObjectSelection;
83  RE_CacheTagHandle myCacheTagHandle;
84  const GR_DisplayOption *myDispOpts;
85  mutable UT_Array<GR_PickRecord> myPicks;
86  mutable int myPostPassID;
87  static GR_ErrorManager *theErrorHandler;
88  UT_StringHolder myNodePath;
89 
90  friend class GUI_GeoRender;
91  friend class DM_VPortAgent;
92  friend class DM_SceneManager;
93  friend class jedi_UsdGLRender;
94 };
95 
96 #endif
97 
GR_RenderInfo(GR_RenderVersion render_version)
Definition: GR_RenderInfo.h:32
const GR_DisplayOption * getDisplayOption() const
Definition: GR_RenderInfo.h:61
bool canDoInstancing() const
Definition: GR_RenderInfo.h:49
bool isObjectGhosted() const
Definition: GR_RenderInfo.h:55
GR_RenderVersion getRenderVersion() const
Definition: GR_RenderInfo.h:45
int getPostPassID() const
Definition: GR_RenderInfo.h:74
static GR_ErrorManager * getErrorHandler()
Definition: GR_RenderInfo.h:63
#define GR_API
Definition: GR_API.h:10
GR_RenderVersion
Definition: GR_Defines.h:21
bool isObjectSelection() const
Definition: GR_RenderInfo.h:51
int requestRenderPostPass() const
Definition: GR_RenderInfo.h:70
bool showSelections() const
Definition: GR_RenderInfo.h:47
const UT_StringHolder & getNodePath() const
Definition: GR_RenderInfo.h:65
UT_Array< GR_PickRecord > & getPickArray() const
Definition: GR_RenderInfo.h:59
RE_CacheTagHandle getCacheTag() const
Definition: GR_RenderInfo.h:57
bool isObjectCurrent() const
Definition: GR_RenderInfo.h:53