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