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
VISF_Visualizer.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: VISF_Visualizer.h (VISF Library, C++)
7
*
8
* COMMENTS:
9
* A VISF_Visualizer is a custom display option which can be toggled on/off
10
* and contain any arbitrary settings.
11
*/
12
13
#ifndef __VISF_Visualizer__
14
#define __VISF_Visualizer__
15
16
#include "
VISF_API.h
"
17
18
#include "
VISF_PrimitiveType.h
"
19
#include <
GUI/GUI_DisplayOption.h
>
20
#include <
GUI/GUI_VisInterface.h
>
21
#include <
VIS/VIS_Visualizer.h
>
22
#include <
RE/RE_RenderContext.h
>
23
#include <
UT/UT_Array.h
>
24
25
#include <
GR/GR_Defines.h
>
26
#include <
GT/GT_Handles.h
>
27
28
class
GEO_Primitive
;
29
class
GR_Primitive
;
30
class
GR_RenderInfo
;
31
class
GU_Detail
;
32
class
GUI_GeoRender
;
33
class
RE_Render
;
34
class
VISF_Primitive
;
35
36
class
VISF_API
VISF_Visualizer
:
public
VIS_Visualizer
37
{
38
public
:
39
VISF_Visualizer
();
40
~
VISF_Visualizer
()
override
;
41
42
/// Determines which primitive types can be passed to the visualizer
43
/// for filtering or creation.
44
virtual
bool
acceptsPrimitiveType
(
VISF_PrimitiveType
type
)
45
{
return
false
; }
46
47
void
updateForRender(
RE_RenderContext
r
);
48
49
virtual
50
GR_DecorVisibility
getDecorVisibility
()
51
{
return
GR_DECOR_ALWAYS_VISIBLE
; }
52
53
virtual
void
renderDecorations
(
RE_RenderContext
r
,
54
const
UT_Array<GUI_GeoRender *>
&geos,
55
const
GUI_DisplayOption
&disp_opts,
56
GR_DecorRenderFlags
flags
)
const
{}
57
58
virtual
bool
canSetupRenderForGeo(
RE_RenderContext
r
,
59
GUI_DisplaySetType
dset,
60
GR_RenderMode
render_mode,
61
const
GUI_GeoRender
*geo,
62
const
GUI_DisplayOption
&disp_opts);
63
64
virtual
void
setupRender
(
RE_RenderContext
r
,
65
GUI_DisplaySetType
dset,
66
GR_RenderMode
render_mode,
67
const
GUI_GeoRender
*geo,
68
GUI_DisplayOption
&disp_opts)
const
{}
69
70
virtual
void
cleanupRender
(
RE_RenderContext
r
,
71
GUI_DisplaySetType
dset,
72
GR_RenderMode
render_mode,
73
const
GUI_GeoRender
*geo,
74
GUI_DisplayOption
&disp_opts)
const
{}
75
76
virtual
77
GT_PrimitiveHandle
filterPrimitive(
const
GU_Detail
*gdp,
78
const
GT_PrimitiveHandle
>_prm,
79
const
GEO_Primitive
*geo_prm,
80
const
GR_RenderInfo
*info,
81
GR_PrimAcceptResult
&processed,
82
GUI_VisFlags
&vis_flags)
const
;
83
84
virtual
85
VISF_Primitive
*createPrimitive(
const
GU_Detail
*gdp,
86
const
GT_PrimitiveHandle
>_prim,
87
const
GEO_Primitive
*geo_prim,
88
const
GR_Primitive
*gr_prim,
89
const
GR_RenderInfo
*info,
90
const
char
*
cache_name
,
91
GR_PrimAcceptResult
&processed)
const
;
92
93
virtual
VISF_Visualizer
*
castToVISR
() {
return
this
; }
94
protected
:
95
/// Copy constructor
96
VISF_Visualizer
(
const
VISF_Visualizer
&
src
);
97
98
virtual
99
void
doUpdateForRender
(
RE_RenderContext
r
) {}
100
101
int
myRenderVersion
;
// cathes up with myCookVersion
102
103
};
104
105
static
inline
106
UT_Vector2F
107
VISgetViewCoord(
const
UT_Vector3F
& p,
108
const
UT_Matrix4D
*xform,
109
const
UT_DimRect
*viewport)
110
{
111
UT_Vector4F
pos(p(0), p(1), p(2), 1.0);
112
fpreal32
scx, scy;
113
// Get the screen space x,y,z after the view and projection transforms.
114
pos *= *xform;
115
pos.
dehomogenize
();
116
scx = (pos.
x
() * 0.5 + 0.5) * viewport->
width
() + viewport->
x1
();
117
scy = (pos.
y
() * 0.5 + 0.5) * viewport->
height
() + viewport->
y1
();
118
return
UT_Vector2F
(scx, scy);
119
}
120
121
#endif
GUI_GeoRender
Definition:
GUI_GeoRender.h:84
RE_RenderContext.h
VISF_API
#define VISF_API
Definition:
VISF_API.h:10
flags
GLbitfield flags
Definition:
glcorearb.h:1596
UT_Matrix4T< fpreal64 >
GR_DecorRenderFlags
GR_DecorRenderFlags
Definition:
GR_Defines.h:230
UT_Vector4T::y
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition:
UT_Vector4.h:493
GT_Handles.h
GR_Defines.h
GUI_VisFlags
GUI_VisFlags
Definition:
GUI_VisInterface.h:26
GT_Names::cache_name
GT_API const UT_StringHolder cache_name
GUI_DisplayOption
Definition:
GUI_DisplayOption.h:65
VISF_Visualizer::renderDecorations
virtual void renderDecorations(RE_RenderContext r, const UT_Array< GUI_GeoRender * > &geos, const GUI_DisplayOption &disp_opts, GR_DecorRenderFlags flags) const
Definition:
VISF_Visualizer.h:53
GUI_VisInterface.h
UT_Array.h
UT_Vector3T< fpreal32 >
UT_Vector4T< fpreal32 >
UT_Vector2T< fpreal32 >
fpreal32
float fpreal32
Definition:
SYS_Types.h:200
UT_Array< GUI_GeoRender * >
GUI_DisplaySetType
GUI_DisplaySetType
Context specific display options for geometry states.
Definition:
GUI_DisplayOption.h:41
RE_RenderContext
Temporary container for either a RV_Render and an RE_Render.
Definition:
RE_RenderContext.h:23
UT_Vector4T::x
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition:
UT_Vector4.h:491
VISF_Visualizer::myRenderVersion
int myRenderVersion
Definition:
VISF_Visualizer.h:101
GR_Primitive
Definition:
GR_Primitive.h:55
VISF_Visualizer::castToVISR
virtual VISF_Visualizer * castToVISR()
Definition:
VISF_Visualizer.h:93
VISF_PrimitiveType.h
GR_DecorVisibility
GR_DecorVisibility
Definition:
GR_Defines.h:192
GR_RenderMode
GR_RenderMode
Definition:
GR_Defines.h:48
RE_Render
Definition:
RE_Render.h:29
GR_DECOR_ALWAYS_VISIBLE
Definition:
GR_Defines.h:194
VISF_Visualizer::acceptsPrimitiveType
virtual bool acceptsPrimitiveType(VISF_PrimitiveType type)
Definition:
VISF_Visualizer.h:44
VISF_Visualizer
Definition:
VISF_Visualizer.h:36
VISF_PrimitiveType
Definition:
VISF_PrimitiveType.h:22
UT_IntrusivePtr< GT_Primitive >
VISF_Visualizer::setupRender
virtual void setupRender(RE_RenderContext r, GUI_DisplaySetType dset, GR_RenderMode render_mode, const GUI_GeoRender *geo, GUI_DisplayOption &disp_opts) const
Definition:
VISF_Visualizer.h:64
GR_PrimAcceptResult
GR_PrimAcceptResult
Definition:
GR_Defines.h:359
UT_Rect::x1
int x1() const
Get lower-left corner.
Definition:
UT_Rect.h:228
GR_RenderInfo
Definition:
GR_RenderInfo.h:29
VIS_Visualizer.h
UT_Rect::width
int width() const
Get width/height dimensions.
Definition:
UT_Rect.h:248
UT_Vector2F
UT_Vector2T< fpreal32 > UT_Vector2F
Definition:
UT_VectorTypes.h:28
VISF_Primitive
Definition:
VISF_Primitive.h:25
UT_Rect< UT_DimRectImpl >
GU_Detail
Definition:
GU_Detail.h:154
VISF_API.h
GUI_DisplayOption.h
UT_Rect::height
int height() const
Get width/height dimensions.
Definition:
UT_Rect.h:249
r
GLboolean r
Definition:
glcorearb.h:1222
UT_Vector4T::dehomogenize
void dehomogenize()
Express the point in homogeneous coordinates or vice-versa.
Definition:
UT_Vector4.h:545
GEO_Primitive
Definition:
GEO_Primitive.h:41
VISF_Visualizer::getDecorVisibility
virtual GR_DecorVisibility getDecorVisibility()
Definition:
VISF_Visualizer.h:50
VISF_Visualizer::cleanupRender
virtual void cleanupRender(RE_RenderContext r, GUI_DisplaySetType dset, GR_RenderMode render_mode, const GUI_GeoRender *geo, GUI_DisplayOption &disp_opts) const
Definition:
VISF_Visualizer.h:70
type
type
Definition:
core.h:1059
UT_Rect::y1
int y1() const
Get lower-left corner.
Definition:
UT_Rect.h:229
VISF_Visualizer::doUpdateForRender
virtual void doUpdateForRender(RE_RenderContext r)
Definition:
VISF_Visualizer.h:99
VIS_Visualizer
Definition:
VIS_Visualizer.h:57
src
GLenum src
Definition:
glcorearb.h:1793
VISF
VISF_Visualizer.h
Generated on Fri Nov 22 2024 02:44:22 for HDK by
1.8.6