Panda3D
 All Classes Functions Variables Enumerations
eggLine.I
1 // Filename: eggLine.I
2 // Created by: drose (14Oct03)
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: EggLine::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggLine::
22 EggLine(const string &name) :
24  _has_thick(false)
25 {
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: EggLine::Copy constructor
30 // Access: Public
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 INLINE EggLine::
34 EggLine(const EggLine &copy) :
36  _thick(copy._thick),
37  _has_thick(copy._has_thick)
38 {
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: EggLine::Copy assignment operator
43 // Access: Public
44 // Description:
45 ////////////////////////////////////////////////////////////////////
46 INLINE EggLine &EggLine::
47 operator = (const EggLine &copy) {
48  EggCompositePrimitive::operator = (copy);
49  _thick = copy._thick;
50  _has_thick = copy._has_thick;
51  return *this;
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: EggLine::has_thick
56 // Access: Published
57 // Description:
58 ////////////////////////////////////////////////////////////////////
59 INLINE bool EggLine::
60 has_thick() const {
61  return _has_thick;
62 }
63 
64 ////////////////////////////////////////////////////////////////////
65 // Function: EggLine::get_thick
66 // Access: Published
67 // Description: Returns the thickness set on this particular line.
68 // If there is no thickness set, returns 1.0.
69 ////////////////////////////////////////////////////////////////////
70 INLINE double EggLine::
71 get_thick() const {
72  if (has_thick()) {
73  return _thick;
74  } else {
75  return 1.0;
76  }
77 }
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: EggLine::set_thick
81 // Access: Published
82 // Description:
83 ////////////////////////////////////////////////////////////////////
84 INLINE void EggLine::
85 set_thick(double thick) {
86  _thick = thick;
87  _has_thick = true;
88 }
89 
90 ////////////////////////////////////////////////////////////////////
91 // Function: EggLine::clear_thick
92 // Access: Published
93 // Description:
94 ////////////////////////////////////////////////////////////////////
95 INLINE void EggLine::
96 clear_thick() {
97  _has_thick = false;
98 }
The base class for primitives such as triangle strips and triangle fans, which include several compon...
A line segment, or a series of connected line segments, defined by a <Line> entry.
Definition: eggLine.h:27
double get_thick() const
Returns the thickness set on this particular line.
Definition: eggLine.I:71