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_PolySurface.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: GR_PrimPolySurface.h ( GR Library, C++)
7
*
8
* COMMENTS:
9
* Generic base class for polygon meshes and soups for all GL renderers
10
*/
11
#ifndef GR_PrimPolySurface_h
12
#define GR_PrimPolySurface_h
13
14
#include "
GR_Defines.h
"
15
#include "
GR_GeoRenderGL.h
"
16
17
#include <
GT/GT_Primitive.h
>
18
19
#include <
UT/UT_NonCopyable.h
>
20
#include <
UT/UT_Vector3.h
>
21
22
#include <utility>
23
24
class
GT_DataArray
;
25
class
GT_PrimPolygonMesh
;
26
27
class
GR_API
GR_PolySurface
:
public
GR_GeoRenderGL
,
private
UT_NonCopyable
28
{
29
public
:
30
static
GR_PolySurface
*create(
GR_Primitive
*parent,
bool
convex);
31
32
GR_PolySurface
(
GR_Primitive
*prim,
33
bool
needs_convexing);
34
~
GR_PolySurface
()
override
;
35
36
const
char
*
className
()
const override
{
return
"GR_PolySurface"
; }
37
38
void
update
(
RE_RenderContext
r
,
39
const
GT_PrimitiveHandle
&primh,
40
const
GR_UpdateParms
&p,
41
const
char
*
cache_name
)
override
;
42
43
bool
hasTransparency
()
const override
44
{
return
(myHasAlpha || myHasTransparentMaterial); }
45
46
GT_PrimitiveHandle
getConvexGeometry
() {
return
myConvexGeo; }
47
48
exint
getNumGLPrimitives
()
const override
;
49
50
protected
:
51
void
retireGeometry
()
override
;
52
53
virtual
int
buildVertexAttributes(
RE_Render
*
r
,
54
const
GT_PrimPolygonMesh
*pmesh,
55
const
GR_UpdateParms
&p,
56
bool
needs_normal,
57
bool
needs_uv,
58
bool
needs_tangent,
59
bool
new_geo,
60
bool
&vertex_promote) = 0;
61
62
// build based on a Material Atlas
63
virtual
void
buildConnectivity(
RE_Render
*
r
,
64
const
GT_PrimPolygonMesh
*pmesh,
65
const
char
*
cache_name
,
66
RE_CacheVersion
geo_version,
67
const
RE_MaterialAtlas
&mats,
68
int
npoints,
69
bool
wireframe,
70
bool
vertex_promote,
71
bool
convexed) = 0;
72
73
virtual
GT_PrimitiveHandle
convexSurface(
const
GT_PrimPolygonMesh
*pmesh)=0;
74
75
GT_PrimitiveHandle
convexWithEdgeInfo(
const
GT_PrimPolygonMesh
*pmesh,
76
GT_DataArrayHandle
&ph,
77
GT_DataArrayHandle
&vh,
78
GT_DataArrayHandle
&vch);
79
80
GT_DataArrayHandle
getPointNormals
() {
return
myAutoGenPointN; }
81
void
freePointNormals();
82
83
virtual
bool
updateBoneTransforms(
RE_Render
*
r
,
84
const
GT_DataArrayHandle
&
a
) = 0;
85
86
virtual
bool
updateBlendShapeWeights(
RE_Render
*
r
,
87
const
GT_DataArrayHandle
&weights_attr) = 0;
88
89
virtual
int
numMaterials()
const
= 0;
90
91
bool
myHasAlpha
;
92
bool
myHasVertexUV
;
93
bool
myHasTransparentMaterial
;
94
95
private
:
96
GT_PrimitiveHandle
convexMesh(
const
GT_PrimPolygonMesh
*pmesh,
97
const
GR_UpdateParms
&p,
98
bool
&convexed,
99
bool
prev_convex_state);
100
101
void
cacheConvexMesh(
const
GT_PrimitiveHandle
&convexed,
102
const
GT_PrimPolygonMesh
*original);
103
void
clearCachedConvexMesh();
104
105
bool
myNeedsConvex;
106
GT_PrimitiveHandle
myOriginalGeo;
107
GT_PrimitiveHandle
myConvexGeo;
108
GT_DataArrayHandle
myAutoGenPointN;
109
int64
myTopVersion;
110
int64
myMatIDVersion;
111
112
GT_DataArrayHandle
myConvexUniformIndirect;
113
GT_DataArrayHandle
myConvexVertexIndirect;
114
GT_DataArrayHandle
myConvexVertexList;
115
GT_DataArrayHandle
myConvexPrimInfo;
116
GT_DataArrayHandle
myConvexVertInfo;
117
std::pair<int64, int64> myConvexVersion;
118
};
119
#endif
120
GR_GeoRenderGL.h
GT_PrimPolygonMesh
A mesh of polygons.
Definition:
GT_PrimPolygonMesh.h:35
GT_Primitive.h
GR_PolySurface::myHasAlpha
bool myHasAlpha
Definition:
GR_PolySurface.h:91
UT_Vector3.h
GR_Defines.h
exint
int64 exint
Definition:
SYS_Types.h:125
GT_Names::cache_name
GT_API const UT_StringHolder cache_name
GR_PolySurface::getConvexGeometry
GT_PrimitiveHandle getConvexGeometry()
Definition:
GR_PolySurface.h:46
a
GLboolean GLboolean GLboolean GLboolean a
Definition:
glcorearb.h:1222
GR_GeoRenderGL::retireGeometry
void retireGeometry() override
RE_RenderContext
Temporary container for either a RV_Render and an RE_Render.
Definition:
RE_RenderContext.h:23
GR_GeoRender::getNumGLPrimitives
virtual exint getNumGLPrimitives() const =0
GR_GeoRenderGL
Definition:
GR_GeoRenderGL.h:26
GR_UpdateParms
set of parameters sent to GR_Primitive::update()
Definition:
GR_UpdateParms.h:37
GR_Primitive
Definition:
GR_Primitive.h:55
GT_DataArray
Abstract data class for an array of float, int or string data.
Definition:
GT_DataArray.h:40
GR_PolySurface::myHasVertexUV
bool myHasVertexUV
Definition:
GR_PolySurface.h:92
RE_Render
Definition:
RE_Render.h:29
GR_API
#define GR_API
Definition:
GR_API.h:10
GR_PolySurface::myHasTransparentMaterial
bool myHasTransparentMaterial
Definition:
GR_PolySurface.h:93
UT_IntrusivePtr< GT_Primitive >
int64
long long int64
Definition:
SYS_Types.h:116
GR_PolySurface::getPointNormals
GT_DataArrayHandle getPointNormals()
Definition:
GR_PolySurface.h:80
UT_NonCopyable.h
GR_PolySurface::className
const char * className() const override
Definition:
GR_PolySurface.h:36
RE_MaterialAtlas
Definition:
RE_Material.h:1050
UT_NonCopyableNS::UT_NonCopyable
Definition:
UT_NonCopyable.h:17
RE_CacheVersion
Simple class for a mutli-integer cache tag.
Definition:
RE_CachedObject.h:31
GR_GeoRender::update
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, const char *cache_name)=0
r
GLboolean r
Definition:
glcorearb.h:1222
GR_PolySurface
Definition:
GR_PolySurface.h:27
GR_PolySurface::hasTransparency
bool hasTransparency() const override
returns true if this drawable renders some transparent elements
Definition:
GR_PolySurface.h:43
GR
GR_PolySurface.h
Generated on Tue Dec 17 2024 03:39:44 for HDK by
1.8.6