Panda3D
 All Classes Functions Variables Enumerations
eggCurve.I
1 // Filename: eggCurve.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: EggCurve::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggCurve::
22 EggCurve(const string &name) : EggPrimitive(name) {
23  _subdiv = 0;
24  _type = CT_none;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: EggCurve::Copy constructor
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 INLINE EggCurve::
33 EggCurve(const EggCurve &copy) :
34  EggPrimitive(copy),
35  _subdiv(copy._subdiv),
36  _type(copy._type)
37 {
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: EggCurve::Copy assignment operator
42 // Access: Public
43 // Description:
44 ////////////////////////////////////////////////////////////////////
45 INLINE EggCurve &EggCurve::
46 operator = (const EggCurve &copy) {
47  EggPrimitive::operator = (copy);
48  _subdiv = copy._subdiv;
49  _type = copy._type;
50  return *this;
51 }
52 
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: EggCurve::set_subdiv
56 // Access: Public
57 // Description: Sets the number of subdivisions that will be
58 // requested across the curve. (This doesn't necessary
59 // guarantee that this number of subdivisions will be
60 // made; it's just a hint to any curve renderer or quick
61 // tesselator.) Set the number to 0 to disable the
62 // hint.
63 ////////////////////////////////////////////////////////////////////
64 INLINE void EggCurve::
65 set_subdiv(int subdiv) {
66  _subdiv = subdiv;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: EggCurve::get_subdiv
71 // Access: Public
72 // Description: Returns the requested number of subdivisions, or 0 if
73 // no particular subdivisions have been requested.
74 ////////////////////////////////////////////////////////////////////
75 INLINE int EggCurve::
76 get_subdiv() const {
77  return _subdiv;
78 }
79 
80 
81 ////////////////////////////////////////////////////////////////////
82 // Function: EggCurve::set_curve_type
83 // Access: Public
84 // Description: Sets the type of the curve. This is primarily used
85 // as a hint to any code that may need to deal with this
86 // curve.
87 ////////////////////////////////////////////////////////////////////
88 INLINE void EggCurve::
89 set_curve_type(EggCurve::CurveType type) {
90  _type = type;
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: EggCurve::get_curve_type
95 // Access: Public
96 // Description: Returns the indicated type of the curve.
97 ////////////////////////////////////////////////////////////////////
98 INLINE EggCurve::CurveType EggCurve::
99 get_curve_type() const {
100  return _type;
101 }
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition: eggPrimitive.h:51
CurveType get_curve_type() const
Returns the indicated type of the curve.
Definition: eggCurve.I:99
void set_curve_type(CurveType type)
Sets the type of the curve.
Definition: eggCurve.I:89
void set_subdiv(int subdiv)
Sets the number of subdivisions that will be requested across the curve.
Definition: eggCurve.I:65
int get_subdiv() const
Returns the requested number of subdivisions, or 0 if no particular subdivisions have been requested...
Definition: eggCurve.I:76
A parametric curve of some kind.
Definition: eggCurve.h:27