Panda3D

eggLine.I

00001 // Filename: eggLine.I
00002 // Created by:  drose (14Oct03)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: EggLine::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE EggLine::
00022 EggLine(const string &name) : 
00023   EggCompositePrimitive(name),
00024   _has_thick(false)
00025 {
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: EggLine::Copy constructor
00030 //       Access: Public
00031 //  Description:
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE EggLine::
00034 EggLine(const EggLine &copy) : 
00035   EggCompositePrimitive(copy),
00036   _thick(copy._thick),
00037   _has_thick(copy._has_thick)
00038 {
00039 }
00040 
00041 ////////////////////////////////////////////////////////////////////
00042 //     Function: EggLine::Copy assignment operator
00043 //       Access: Public
00044 //  Description:
00045 ////////////////////////////////////////////////////////////////////
00046 INLINE EggLine &EggLine::
00047 operator = (const EggLine &copy) {
00048   EggCompositePrimitive::operator = (copy);
00049   _thick = copy._thick;
00050   _has_thick = copy._has_thick;
00051   return *this;
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: EggLine::has_thick
00056 //       Access: Published
00057 //  Description:
00058 ////////////////////////////////////////////////////////////////////
00059 INLINE bool EggLine::
00060 has_thick() const {
00061   return _has_thick;
00062 }
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 //     Function: EggLine::get_thick
00066 //       Access: Published
00067 //  Description: Returns the thickness set on this particular line.
00068 //               If there is no thickness set, returns 1.0.
00069 ////////////////////////////////////////////////////////////////////
00070 INLINE double EggLine::
00071 get_thick() const {
00072   if (has_thick()) {
00073     return _thick;
00074   } else {
00075     return 1.0;
00076   }
00077 }
00078 
00079 ////////////////////////////////////////////////////////////////////
00080 //     Function: EggLine::set_thick
00081 //       Access: Published
00082 //  Description:
00083 ////////////////////////////////////////////////////////////////////
00084 INLINE void EggLine::
00085 set_thick(double thick) {
00086   _thick = thick;
00087   _has_thick = true;
00088 }
00089 
00090 ////////////////////////////////////////////////////////////////////
00091 //     Function: EggLine::clear_thick
00092 //       Access: Published
00093 //  Description:
00094 ////////////////////////////////////////////////////////////////////
00095 INLINE void EggLine::
00096 clear_thick() {
00097   _has_thick = false;
00098 }
 All Classes Functions Variables Enumerations