Panda3D
eggSurface.I
1 // Filename: eggSurface.I
2 // Created by: drose (15Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggSurface::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggSurface::
22 EggSurface(const string &name) : EggPrimitive(name) {
23  _u_subdiv = 0;
24  _v_subdiv = 0;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: EggSurface::Copy constructor
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 INLINE EggSurface::
33 EggSurface(const EggSurface &copy) :
34  EggPrimitive(copy),
35  _u_subdiv(copy._u_subdiv),
36  _v_subdiv(copy._v_subdiv)
37 {
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: EggSurface::Copy assignment operator
42 // Access: Public
43 // Description:
44 ////////////////////////////////////////////////////////////////////
45 INLINE EggSurface &EggSurface::
46 operator = (const EggSurface &copy) {
47  EggPrimitive::operator = (copy);
48  _u_subdiv = copy._u_subdiv;
49  _v_subdiv = copy._v_subdiv;
50  return *this;
51 }
52 
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: EggSurface::set_u_subdiv
56 // Access: Public
57 // Description: Sets the number of subdivisions in the U direction
58 // that will be requested across the surface. (This
59 // doesn't necessary guarantee that this number of
60 // subdivisions will be made; it's just a hint to any
61 // surface renderer or quick tesselator.) Set the
62 // number to 0 to disable the hint.
63 ////////////////////////////////////////////////////////////////////
64 INLINE void EggSurface::
65 set_u_subdiv(int subdiv) {
66  _u_subdiv = subdiv;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: EggSurface::get_u_subdiv
71 // Access: Public
72 // Description: Returns the requested number of subdivisions in the U
73 // direction, or 0 if no particular subdivisions have
74 // been requested.
75 ////////////////////////////////////////////////////////////////////
76 INLINE int EggSurface::
77 get_u_subdiv() const {
78  return _u_subdiv;
79 }
80 
81 ////////////////////////////////////////////////////////////////////
82 // Function: EggSurface::set_v_subdiv
83 // Access: Public
84 // Description: Sets the number of subdivisions in the U direction
85 // that will be requested across the surface. (This
86 // doesn't necessary guarantee that this number of
87 // subdivisions will be made; it's just a hint to any
88 // surface renderer or quick tesselator.) Set the
89 // number to 0 to disable the hint.
90 ////////////////////////////////////////////////////////////////////
91 INLINE void EggSurface::
92 set_v_subdiv(int subdiv) {
93  _v_subdiv = subdiv;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: EggSurface::get_v_subdiv
98 // Access: Public
99 // Description: Returns the requested number of subdivisions in the U
100 // direction, or 0 if no particular subdivisions have
101 // been requested.
102 ////////////////////////////////////////////////////////////////////
103 INLINE int EggSurface::
104 get_v_subdiv() const {
105  return _v_subdiv;
106 }
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition: eggPrimitive.h:51
int get_v_subdiv() const
Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions h...
Definition: eggSurface.I:104
void set_u_subdiv(int subdiv)
Sets the number of subdivisions in the U direction that will be requested across the surface...
Definition: eggSurface.I:65
void set_v_subdiv(int subdiv)
Sets the number of subdivisions in the U direction that will be requested across the surface...
Definition: eggSurface.I:92
A parametric surface of some kind.
Definition: eggSurface.h:27
int get_u_subdiv() const
Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions h...
Definition: eggSurface.I:77