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
GR_PrimTetra.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024
3
* Side Effects Software Inc. All rights reserved.
4
*
5
* Redistribution and use of Houdini Development Kit samples in source and
6
* binary forms, with or without modification, are permitted provided that the
7
* following conditions are met:
8
* 1. Redistributions of source code must retain the above copyright notice,
9
* this list of conditions and the following disclaimer.
10
* 2. The name of Side Effects Software may not be used to endorse or
11
* promote products derived from this software without specific prior
12
* written permission.
13
*
14
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
*/
25
26
#ifndef __GR_PrimTetra__
27
#define __GR_PrimTetra__
28
29
#include <
GUI/GUI_PrimitiveHook.h
>
30
#include <
GR/GR_Primitive.h
>
31
#include <
RE/RE_RenderContext.h
>
32
33
namespace
HDK_Sample
34
{
35
36
/// The primitive render hook which creates GR_PrimTetra objects.
37
class
GR_PrimTetraHook
:
public
GUI_PrimitiveHook
38
{
39
public
:
40
GR_PrimTetraHook
();
41
~GR_PrimTetraHook
()
override
;
42
43
/// This is called when a new GR_Primitive is required for a tetra.
44
/// gt_prim or geo_prim contains the GT or GEO primitive this object is being
45
/// created for, depending on whether this hook is registered to capture
46
/// GT or GEO primitives.
47
/// info and cache_name should be passed down to the GR_Primitive
48
/// constructor.
49
/// processed should return GR_PROCESSED or GR_PROCESSED_NON_EXCLUSIVE if
50
/// a primitive is created. Non-exclusive allows other render hooks or the
51
/// native Houdini primitives to be created for the same primitive, which is
52
/// useful for support hooks (drawing decorations, bounding boxes, etc).
53
GR_Primitive
*
createPrimitive
(
const
GT_PrimitiveHandle
>_prim,
54
const
GEO_Primitive
*geo_prim,
55
const
GR_RenderInfo
*info,
56
const
char
*
cache_name
,
57
GR_PrimAcceptResult
&processed
58
)
override
;
59
};
60
61
/// Primitive object that is created by GR_PrimTetraHook whenever a
62
/// tetrahedron primitive is found. This object can be persistent between
63
/// renders, though display flag changes or navigating though SOPs can cause
64
/// it to be deleted and recreated later.
65
class
GR_PrimTetra
:
public
GR_Primitive
66
{
67
public
:
68
GR_PrimTetra
(
const
GR_RenderInfo
*info,
69
const
char
*
cache_name
,
70
const
GEO_Primitive
*prim);
71
~GR_PrimTetra
()
override
;
72
73
const
char
*
className
()
const override
{
return
"GR_PrimTetra"
; }
74
75
/// See if the tetra primitive can be consumed by this primitive. Only
76
/// tetra from the same detail will ever be passed in.
77
GR_PrimAcceptResult
acceptPrimitive
(
GT_PrimitiveType
t
,
78
int
geo_type,
79
const
GT_PrimitiveHandle
&ph,
80
const
GEO_Primitive
*prim)
override
;
81
82
/// Called whenever the parent detail is changed, draw modes are changed,
83
/// selection is changed, or certain volatile display options are changed
84
/// (such as level of detail).
85
void
update
(
RE_RenderContext
r
,
86
const
GT_PrimitiveHandle
&primh,
87
const
GR_UpdateParms
&p)
override
;
88
89
/// Called whenever the primitive is required to render, which may be more
90
/// than one time per viewport redraw (beauty, shadow passes, wireframe-over)
91
/// It also may be called outside of a viewport redraw to do picking of the
92
/// geometry.
93
void
render
(
RE_RenderContext
r
,
94
GR_RenderMode
render_mode,
95
GR_RenderFlags
flags
,
96
GR_DrawParms
dp)
override
;
97
void
renderDecoration
(
98
RE_RenderContext
r
,
99
GR_Decoration
decor,
100
const
GR_DecorationParms
&parms)
override
;
101
int
renderPick
(
RE_RenderContext
r
,
102
const
GR_DisplayOption
*opt,
103
unsigned
int
pick_type,
104
GR_PickStyle
pick_style,
105
bool
has_pick_map)
override
;
106
private
:
107
int
myID;
108
RE_Geometry
*myGeo;
109
bool
myInstancedFlag;
110
};
111
112
113
114
}
// End HDK_Sample namespace.
115
116
#endif
RE_RenderContext.h
flags
GLbitfield flags
Definition:
glcorearb.h:1596
GR_DecorationParms
Definition:
GR_DecorationRender.h:56
HDK_Sample::GR_PrimTetra
Definition:
GR_PrimTetra.h:65
GR_DisplayOption
Definition:
GR_DisplayOption.h:35
RE_Geometry
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
Definition:
RE_Geometry.h:53
GT_Names::cache_name
GT_API const UT_StringHolder cache_name
HDK_Sample::GR_PrimTetra::~GR_PrimTetra
~GR_PrimTetra() override
Definition:
GR_PrimTetra.C:73
GR_Primitive.h
HDK_Sample::GR_PrimTetra::renderDecoration
void renderDecoration(RE_RenderContext r, GR_Decoration decor, const GR_DecorationParms &parms) override
Definition:
GR_PrimTetra.C:398
GR_Decoration
GR_Decoration
Definition:
GR_Defines.h:162
RE_RenderContext
Temporary container for either a RV_Render and an RE_Render.
Definition:
RE_RenderContext.h:23
GUI_PrimitiveHook
Definition:
GUI_PrimitiveHook.h:66
HDK_Sample::GR_PrimTetraHook::GR_PrimTetraHook
GR_PrimTetraHook()
Definition:
GR_PrimTetra.C:44
GR_UpdateParms
set of parameters sent to GR_Primitive::update()
Definition:
GR_UpdateParms.h:37
HDK_Sample::GR_PrimTetra::acceptPrimitive
GR_PrimAcceptResult acceptPrimitive(GT_PrimitiveType t, int geo_type, const GT_PrimitiveHandle &ph, const GEO_Primitive *prim) override
Definition:
GR_PrimTetra.C:80
GR_Primitive
Definition:
GR_Primitive.h:55
HDK_Sample::GR_PrimTetraHook::~GR_PrimTetraHook
~GR_PrimTetraHook() override
Definition:
GR_PrimTetra.C:49
GR_RenderMode
GR_RenderMode
Definition:
GR_Defines.h:48
HDK_Sample::GR_PrimTetraHook
The primitive render hook which creates GR_PrimTetra objects.
Definition:
GR_PrimTetra.h:37
GR_DrawParms
Definition:
GR_DrawParms.h:19
HDK_Sample::GR_PrimTetra::renderPick
int renderPick(RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map) override
Definition:
GR_PrimTetra.C:409
HDK_Sample::GR_PrimTetra::className
const char * className() const override
Return a string version of this class's name.
Definition:
GR_PrimTetra.h:73
UT_IntrusivePtr< GT_Primitive >
GR_PrimAcceptResult
GR_PrimAcceptResult
Definition:
GR_Defines.h:359
GR_RenderFlags
GR_RenderFlags
Definition:
GR_Defines.h:86
GR_RenderInfo
Definition:
GR_RenderInfo.h:29
HDK_Sample::GR_PrimTetra::render
void render(RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp) override
Definition:
GR_PrimTetra.C:275
t
GLdouble t
Definition:
glad.h:2397
GT_PrimitiveType
GT_PrimitiveType
Definition:
GT_PrimitiveTypes.h:16
HDK_Sample::GR_PrimTetra::update
void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p) override
Definition:
GR_PrimTetra.C:93
HDK_Sample::GR_PrimTetraHook::createPrimitive
GR_Primitive * createPrimitive(const GT_PrimitiveHandle >_prim, const GEO_Primitive *geo_prim, const GR_RenderInfo *info, const char *cache_name, GR_PrimAcceptResult &processed) override
Definition:
GR_PrimTetra.C:54
GUI_PrimitiveHook.h
HDK_Sample::GR_PrimTetra::GR_PrimTetra
GR_PrimTetra(const GR_RenderInfo *info, const char *cache_name, const GEO_Primitive *prim)
Definition:
GR_PrimTetra.C:63
r
GLboolean r
Definition:
glcorearb.h:1222
GEO_Primitive
Definition:
GEO_Primitive.h:41
GR_PickStyle
GR_PickStyle
Definition:
GR_Defines.h:252
samples
tetprim
GR_PrimTetra.h
Generated on Sat Dec 21 2024 02:49:58 for HDK by
1.8.6