HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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_COLLECT_PRIMS: Collect all (or some) of the
37  /// primitives matching 'type' into a single GR_Primitive
38  /// hook_ver Leave at its default. This will notify you if a hook needs to
39  /// be recompiled.
40  /// returns true if the hook was sucessfully registered.
41  bool registerGTHook(GUI_PrimitiveHook *hook,
43  int priority,
45  int hook_ver = GUI_PRIMITIVE_HOOK_VERSION);
46 
47  /// @brief Register a geometry primitive render hook
48  /// Register a primitive hook that uses a GEO_Primitive as its source.
49  /// geo_type Specifies the geometry type this hook is intended for.
50  /// priority If more than one hook is present for the same GT type, the
51  /// higher of the two priorities is processed first. MAX_INT is
52  /// reserved, otherwise any integer is valid.
53  /// flags Special options for the hook:
54  /// GUI_HOOK_FLAG_COLLECT_PRIMS: Collect all (or some) of the
55  /// primitives matching 'type' into a single GR_Primitive
56  /// hook_ver Leave at its default. This will notify you if a hook needs to
57  /// be recompiled.
58  /// returns true if the hook was sucessfully registered.
59  bool registerGEOHook(GUI_PrimitiveHook *hook,
60  GA_PrimitiveTypeId geo_type,
61  int priority,
63  int hook_ver = GUI_PRIMITIVE_HOOK_VERSION);
64 
65 
66  /// @brief Register a scene render hook
67  /// Register a scene hook that is associated with a specific render pass.
68  /// type The rendering task this hook creates render hooks for.
69  /// policy How the hook interacts with native Houdini rendering
70  /// hook_ver Leave at its default. This will notify you if a hook
71  /// needs to be recompiled.
72  /// returns true if the hook was successfully rgistered.
73  bool registerSceneHook(DM_SceneHook *hook,
74  DM_SceneHookType type,
76  int hook_ver = DM_SCENE_HOOK_VERSION);
77 
78  /// @brief Install a new scene file visualizer for all geometry contexts
79  /// Installs a generic visualizer that can be enabled individually for
80  /// the various contexts, such as Scene Object and Current Geometry.
81  /// The @c vis_name is the name used by commands to reference the option,
82  /// while the @c vis_label is the English readable name. If not given,
83  /// the @c vis_name will be used as the readable name as well.
84  /// If the visualizer already exists, it will not create it and false is
85  /// returned. If successful, true is returned.
86 
87  bool installGeometryOption(const char *vis_name,
88  const char *vis_label = NULL,
91 
92  /// @brief Install a new scene file visualizer for controlling scene hooks
93  /// Install a new scene file generic visualizer untied to any geometry
94  /// context. This can be used to control scene hooks more easily.
95  /// The @c vis_name is the name used by commands to reference the visualizer,
96  /// while the @c vis_label is the English readable name. If not given,
97  /// the @c vis_name will be used as the readable name as well.
98  /// If the visualizer already exists, it will not create it and return
99  /// false. Otherwise true is returned.
100  bool installSceneOption(const char *vis_name,
101  const char *vis_label = NULL);
102 
103 private:
104  DM_RenderTable();
105  virtual ~DM_RenderTable();
106 
107  void installHooks();
108 
109  bool installOption(const char *option_name,
110  const char *option_label,
112 
113  bool registerHook(GUI_PrimitiveHook *hook,
114  GT_PrimitiveType type,
115  int geo_type,
116  int priority,
118  int render_hook_version);
119 
120  static void clearRenderHookTable(void *);
121  static void clearSceneRenderHooks(void *);
122 
123  bool myInitialized;
124 
125  friend class DM_Viewport;
126 };
127 
128 extern "C" {
129  /// The plugin entry point for render hook registration
131 };
132 
133 
134 
135 #endif
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
GLbitfield flags
Definition: glcorearb.h:1595
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:28
#define DM_SCENE_HOOK_VERSION
Definition: DM_SceneHook.h:25
GT_PrimitiveType
A Scene Hook creates new scene render hooks when new viewports are created.
Definition: DM_SceneHook.h:121
SYS_VISIBILITY_EXPORT void newRenderHook(DM_RenderTable *table)
The plugin entry point for render hook registration.
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
DM_SceneHookPolicy
How the hook augments or replaces the native Houdini rendering task.
Definition: DM_SceneHook.h:47
GUI_PrimitiveHookFlags