HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DM_RenderTable.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: DM_RenderTable.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Table for all GL rendering hooks. H11 rendering hooks are handled in
10  * GR_RenderTable, which is the base class of DM_RenderTable.
11  */
12 #ifndef DM_RenderTable_h
13 #define DM_RenderTable_h
14 
15 #include "DM_API.h"
16 #include "DM_SceneHook.h"
17 
18 #include <GUI/GUI_PrimitiveHook.h>
19 #include <GA/GA_PrimitiveTypeId.h>
20 #include <GT/GT_PrimitiveTypes.h>
21 
22 class GR_UserOption;
23 
25 {
26 public:
27  static DM_RenderTable *getTable();
28 
29  /// @brief Register a geometry primitive render hook
30  /// Register a primitive hook that uses a GT_Primitive as its source.
31  /// type Specifies the type of GT primitive this hook is intended for
32  /// priority If more than one hook is present for the same GT type, the
33  /// higher of the two priorities is processed first. MAX_INT is
34  /// reserved, otherwise any integer is valid.
35  /// flags Special options for the hook:
36  /// GUI_HOOK_FLAG_AUGMENT_PRIM: Add additional rendering to the
37  /// Houdini primitive, which still draws.
38  /// GUI_HOOK_FLAG_PRIM_FILTER: Alter or create a new GT_Primitive
39  /// from the GT primitive normally used to render. Does not
40  /// create a GR_Primitive.
41  /// hook_ver Leave at its default. This will notify you if a hook needs to
42  /// be recompiled.
43  /// returns true if the hook was sucessfully registered.
44  bool registerGTHook(GUI_PrimitiveHook *hook,
46  int priority,
48  int hook_ver = GUI_PRIMITIVE_HOOK_VERSION);
49 
50  /// @brief Register a geometry primitive render hook
51  /// Register a primitive hook that uses a GEO_Primitive as its source.
52  /// geo_type Specifies the geometry type this hook is intended for.
53  /// priority If more than one hook is present for the same GT type, the
54  /// higher of the two priorities is processed first. MAX_INT is
55  /// reserved, otherwise any integer is valid.
56  /// flags Special options for the hook:
57  /// GUI_HOOK_FLAG_AUGMENT_PRIM: Add additional rendering to the
58  /// Houdini primitive, which still draws.
59  /// GUI_HOOK_FLAG_PRIM_FILTER: Alter or create a new GT_Primitive
60  /// from the GT primitive normally used to render. Does not
61  /// create a GR_Primitive.
62  /// hook_ver Leave at its default. This will notify you if a hook needs to
63  /// be recompiled.
64  /// returns true if the hook was sucessfully registered.
65  bool registerGEOHook(GUI_PrimitiveHook *hook,
66  GA_PrimitiveTypeId geo_type,
67  int priority,
69  int hook_ver = GUI_PRIMITIVE_HOOK_VERSION);
70 
71 
72  /// @brief Register a scene render hook
73  /// Register a scene hook that is associated with a specific render pass.
74  /// type The rendering task this hook creates render hooks for.
75  /// policy How the hook interacts with native Houdini rendering
76  /// hook_ver Leave at its default. This will notify you if a hook
77  /// needs to be recompiled.
78  /// returns true if the hook was successfully rgistered.
79  bool registerSceneHook(DM_SceneHook *hook,
80  DM_SceneHookType type,
82  int hook_ver = DM_SCENE_HOOK_VERSION);
83 
84  /// @brief Install a new scene file visualizer for all geometry contexts
85  /// Installs a generic visualizer that can be enabled individually for
86  /// the various contexts, such as Scene Object and Current Geometry.
87  /// The @c vis_name is the name used by commands to reference the option,
88  /// while the @c vis_label is the English readable name. If not given,
89  /// the @c vis_name will be used as the readable name as well.
90  /// If the visualizer already exists, it will not create it and false is
91  /// returned. If successful, true is returned.
92 
93  bool installGeometryOption(const char *vis_name,
94  const char *vis_label = NULL,
97 
98  /// @brief Install a new scene file visualizer for controlling scene hooks
99  /// Install a new scene file generic visualizer untied to any geometry
100  /// context. This can be used to control scene hooks more easily.
101  /// The @c vis_name is the name used by commands to reference the visualizer,
102  /// while the @c vis_label is the English readable name. If not given,
103  /// the @c vis_name will be used as the readable name as well.
104  /// If the visualizer already exists, it will not create it and return
105  /// false. Otherwise true is returned.
106  bool installSceneOption(const char *vis_name,
107  const char *vis_label = NULL);
108 
109 private:
110  DM_RenderTable();
111  virtual ~DM_RenderTable();
112 
113  void installHooks();
114 
115  bool installOption(const char *option_name,
116  const char *option_label,
118 
119  bool registerHook(GUI_PrimitiveHook *hook,
120  GT_PrimitiveType type,
121  int geo_type,
122  int priority,
124  int render_hook_version);
125 
126  static void clearRenderHookTable(void *);
127  static void clearSceneRenderHooks(void *);
128 
129  bool myInitialized;
130 
131  friend class DM_Viewport;
132 };
133 
134 extern "C" {
135  /// The plugin entry point for render hook registration
137 };
138 
139 
140 
141 #endif
GLbitfield flags
Definition: glcorearb.h:1596
hboost::math::policies::policy< hboost::math::policies::domain_error< hboost::math::policies::ignore_error >, hboost::math::policies::pole_error< hboost::math::policies::ignore_error >, hboost::math::policies::overflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::underflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::denorm_error< hboost::math::policies::ignore_error >, hboost::math::policies::rounding_error< hboost::math::policies::ignore_error >, hboost::math::policies::evaluation_error< hboost::math::policies::ignore_error >, hboost::math::policies::indeterminate_result_error< hboost::math::policies::ignore_error > > policy
Definition: SYS_MathCbrt.h:35
#define SYS_VISIBILITY_EXPORT
#define GUI_PRIMITIVE_HOOK_VERSION
GUI_GeometryOptionFlags
#define DM_API
Definition: DM_API.h:10
Hook has no special behaviour.
DM_SceneHookType
The rendering task that the hook performs.
Definition: DM_SceneHook.h:32
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
#define DM_SCENE_HOOK_VERSION
Definition: DM_SceneHook.h:29
GT_PrimitiveType
A Scene Hook creates new scene render hooks when new viewports are created.
Definition: DM_SceneHook.h:158
SYS_VISIBILITY_EXPORT void newRenderHook(DM_RenderTable *table)
The plugin entry point for render hook registration.
DM_SceneHookPolicy
How the hook augments or replaces the native Houdini rendering task.
Definition: DM_SceneHook.h:55
type
Definition: core.h:1059
GUI_PrimitiveHookFlags