HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GUI_PrimitiveHook.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: GUI_PrimitiveHook.h ( GR Library, C++)
7
*
8
* COMMENTS:
9
* Base class for generating custom GR primitives.
10
*/
11
#ifndef GUI_PRIMITIVE_HOOK_H
12
#define GUI_PRIMITIVE_HOOK_H
13
14
#include "
GUI_API.h
"
15
#include <
GR/GR_Defines.h
>
16
#include <
GR/GR_RenderInfo.h
>
17
#include <
GT/GT_PrimitiveTypes.h
>
18
#include <
GT/GT_Primitive.h
>
19
#include <
GA/GA_PrimitiveTypes.h
>
20
#include <
UT/UT_ValArray.h
>
21
#include <
UT/UT_String.h
>
22
23
class
GR_Primitive
;
24
class
GEO_Primitive
;
25
26
#define GUI_PRIMITIVE_HOOK_VERSION 3
27
28
/// Special modifiers to primitive hooks which provide different behaviours.
29
/// They may be combined, except for GUI_HOOK_FLAG_PRIM_FILTER which cannot
30
/// have any other flags.
31
enum
GUI_PrimitiveHookFlags
32
{
33
/// Hook has no special behaviour.
34
GUI_HOOK_FLAG_NONE
= 0,
35
36
/// Hook will render extra bits, but still allow lower-priority hooks or
37
/// the native primitive renderer to render as well.
38
GUI_HOOK_FLAG_AUGMENT_PRIM
= 0x2,
39
40
/// Hook will modify the geometry and produce a new GT_Primitive, but not
41
/// do any rendering itself.
42
GUI_HOOK_FLAG_PRIM_FILTER
= 0x4
43
};
44
45
enum
GUI_RenderMask
46
{
47
GUI_RENDER_MASK_GL1
= 0x1,
// Deprecated: GL1 and GL2 are obsolete and
48
GUI_RENDER_MASK_GL2
= 0x2,
// provided only for H13 code compatibility.
49
50
GUI_RENDER_MASK_GL3
= 0x4,
// Hook works with GL3
51
GUI_RENDER_MASK_GL4
= 0x8,
// Hook works only with GL4+
52
GUI_RENDER_MASK_VULKAN
= 0x10,
// Hook works with Vulkan
53
54
GUI_RENDER_MASK_ALL
= 0xFFFFFFFC
// all but GL1/GL2.
55
};
56
57
enum
GUI_GeometryOptionFlags
58
{
59
GUI_GEO_OPT_NONE
= 0,
60
GUI_GEO_OPT_REFINE_ON_ACTIVATION
= 1,
61
GUI_GEO_OPT_REFINE_ON_DEACTIVATION
= 1 << 1,
62
GUI_GEO_OPT_GLOBAL_TOGGLE_VALUE
= 1 << 2
63
};
64
65
66
class
GUI_API
GUI_PrimitiveHook
67
{
68
public
:
69
/// Only one primitive hook will ever be created.
70
/// Each hook requires a name for identification and error reporting.
71
/// A hook can target all renderers, a subset, or a specific renderer.
72
GUI_PrimitiveHook
(
const
char
*hook_name,
73
GUI_RenderMask
mask
=
GUI_RENDER_MASK_ALL
);
74
75
/// Name of this hook
76
const
char
*
getName
()
const
{
return
myName; }
77
78
/// Bitmask of renderers supported by this hook.
79
GUI_RenderMask
getRenderMask
()
const
{
return
myRenderMask; }
80
81
/// Create a new primitive based on the GT or GEO prim. The info and
82
/// cache_name should be passed to the GR_Primitive constructor.
83
/// 'processed' should indicate that the primitive is consumed
84
/// (GR_PROCESSED), or processed but available for further hooks or
85
/// internal Houdini processing (GR_PROCESSED_NON_EXCLUSIVE).
86
/// GR_NOT_PROCESSED should only be returned if a GR_Primitive was not
87
/// created. Hooks with GUI_HOOK_FLAG_PRIM_FILTER do not call this method.
88
virtual
GR_Primitive
*createPrimitive(
const
GT_PrimitiveHandle
>_prim,
89
const
GEO_Primitive
*geo_prim,
90
const
GR_RenderInfo
*info,
91
const
char
*
cache_name
,
92
GR_PrimAcceptResult
&processed);
93
94
/// For hooks with GUI_HOOK_FLAG_PRIM_FILTER, this method is called instead
95
/// of createPrimitive.
96
virtual
GT_PrimitiveHandle
filterPrimitive(
const
GT_PrimitiveHandle
>_prm,
97
const
GEO_Primitive
*geo_prm,
98
const
GR_RenderInfo
*info,
99
GR_PrimAcceptResult
&processed);
100
protected
:
101
virtual
~
GUI_PrimitiveHook
();
102
103
private
:
104
UT_String
myName;
105
GUI_RenderMask
myRenderMask;
106
107
friend
class
DM_RenderTable
;
108
};
109
110
#endif
GR_RenderInfo.h
GA_PrimitiveTypes.h
GUI_RENDER_MASK_GL4
Definition:
GUI_PrimitiveHook.h:51
GT_Primitive.h
GR_Defines.h
GT_Names::cache_name
GT_API const UT_StringHolder cache_name
GUI_PrimitiveHook::getName
const char * getName() const
Name of this hook.
Definition:
GUI_PrimitiveHook.h:76
GUI_RENDER_MASK_GL1
Definition:
GUI_PrimitiveHook.h:47
GUI_HOOK_FLAG_AUGMENT_PRIM
Definition:
GUI_PrimitiveHook.h:38
GUI_PrimitiveHook
Definition:
GUI_PrimitiveHook.h:66
GUI_GeometryOptionFlags
GUI_GeometryOptionFlags
Definition:
GUI_PrimitiveHook.h:57
GUI_RENDER_MASK_VULKAN
Definition:
GUI_PrimitiveHook.h:52
UT_String.h
GUI_HOOK_FLAG_NONE
Hook has no special behaviour.
Definition:
GUI_PrimitiveHook.h:34
GR_Primitive
Definition:
GR_Primitive.h:55
GUI_API
#define GUI_API
Definition:
GUI_API.h:10
UT_ValArray.h
GUI_PrimitiveHook::getRenderMask
GUI_RenderMask getRenderMask() const
Bitmask of renderers supported by this hook.
Definition:
GUI_PrimitiveHook.h:79
GUI_GEO_OPT_REFINE_ON_ACTIVATION
Definition:
GUI_PrimitiveHook.h:60
mask
GLint GLuint mask
Definition:
glcorearb.h:124
UT_IntrusivePtr< GT_Primitive >
GUI_GEO_OPT_GLOBAL_TOGGLE_VALUE
Definition:
GUI_PrimitiveHook.h:62
GUI_RENDER_MASK_GL2
Definition:
GUI_PrimitiveHook.h:48
GR_PrimAcceptResult
GR_PrimAcceptResult
Definition:
GR_Defines.h:359
DM_RenderTable
Definition:
DM_RenderTable.h:24
GR_RenderInfo
Definition:
GR_RenderInfo.h:29
GUI_RENDER_MASK_ALL
Definition:
GUI_PrimitiveHook.h:54
GUI_RENDER_MASK_GL3
Definition:
GUI_PrimitiveHook.h:50
GUI_RenderMask
GUI_RenderMask
Definition:
GUI_PrimitiveHook.h:45
GT_PrimitiveTypes.h
UT_String
Definition:
UT_String.h:73
GUI_GEO_OPT_REFINE_ON_DEACTIVATION
Definition:
GUI_PrimitiveHook.h:61
GUI_API.h
GUI_HOOK_FLAG_PRIM_FILTER
Definition:
GUI_PrimitiveHook.h:42
GEO_Primitive
Definition:
GEO_Primitive.h:41
GUI_PrimitiveHookFlags
GUI_PrimitiveHookFlags
Definition:
GUI_PrimitiveHook.h:31
GUI_GEO_OPT_NONE
Definition:
GUI_PrimitiveHook.h:59
GUI
GUI_PrimitiveHook.h
Generated on Fri Nov 8 2024 03:39:19 for HDK by
1.8.6