forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsheetNode.I
More file actions
118 lines (108 loc) · 2.78 KB
/
sheetNode.I
File metadata and controls
118 lines (108 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file sheetNode.I
* @author drose
* @date 2003-10-11
*/
/**
*
*/
INLINE SheetNode::CData::
CData() {
_surface = new NurbsSurfaceEvaluator;
_use_vertex_color = false;
_num_u_subdiv = 2;
_num_v_subdiv = 2;
}
/**
*
*/
INLINE SheetNode::CData::
CData(const SheetNode::CData ©) :
_surface(copy._surface),
_use_vertex_color(copy._use_vertex_color),
_num_u_subdiv(copy._num_u_subdiv),
_num_v_subdiv(copy._num_v_subdiv)
{
}
/**
* Sets the particular surface represented by the SheetNode.
*/
INLINE void SheetNode::
set_surface(NurbsSurfaceEvaluator *surface) {
CDWriter cdata(_cycler);
cdata->_surface = surface;
}
/**
* Returns the surface represented by the SheetNode.
*/
INLINE NurbsSurfaceEvaluator *SheetNode::
get_surface() const {
CDReader cdata(_cycler);
return cdata->_surface;
}
/**
* Sets the "use vertex color" flag. When this is true, the R, G, B, A vertex
* color is assumed to be stored as the dimensions 0, 1, 2, 3, respectively,
* of the extended vertex values. Use
* NurbsCurveEvaluator::set_extended_vertex() to set these values.
*/
INLINE void SheetNode::
set_use_vertex_color(bool flag) {
CDWriter cdata(_cycler);
cdata->_use_vertex_color = flag;
}
/**
* Returns the "use vertex color" flag. See set_use_vertex_color().
*/
INLINE bool SheetNode::
get_use_vertex_color() const {
CDReader cdata(_cycler);
return cdata->_use_vertex_color;
}
/**
* Specifies the number of subdivisions per cubic segment (that is, per unique
* knot value) to draw in a fixed uniform tesselation of the surface in the U
* direction.
*/
INLINE void SheetNode::
set_num_u_subdiv(int num_u_subdiv) {
nassertv(num_u_subdiv >= 0);
CDWriter cdata(_cycler);
cdata->_num_u_subdiv = num_u_subdiv;
}
/**
* Returns the number of subdivisions per cubic segment to draw in the U
* direction. See set_num_u_subdiv().
*/
INLINE int SheetNode::
get_num_u_subdiv() const {
CDReader cdata(_cycler);
return cdata->_num_u_subdiv;
}
/**
* Specifies the number of subdivisions per cubic segment (that is, per unique
* knot value) to draw in a fixed uniform tesselation of the surface in the V
* direction.
*/
INLINE void SheetNode::
set_num_v_subdiv(int num_v_subdiv) {
nassertv(num_v_subdiv >= 0);
CDWriter cdata(_cycler);
cdata->_num_v_subdiv = num_v_subdiv;
}
/**
* Returns the number of subdivisions per cubic segment to draw in the V
* direction. See set_num_v_subdiv().
*/
INLINE int SheetNode::
get_num_v_subdiv() const {
CDReader cdata(_cycler);
return cdata->_num_v_subdiv;
}