Panda3D

eggPoint.I

00001 // Filename: eggPoint.I
00002 // Created by:  drose (15Dec99)
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: EggPoint::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE EggPoint::
00022 EggPoint(const string &name) : 
00023   EggPrimitive(name),
00024   _flags(0),
00025   _thick(1.0)
00026 {
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: EggPoint::Copy constructor
00031 //       Access: Public
00032 //  Description:
00033 ////////////////////////////////////////////////////////////////////
00034 INLINE EggPoint::
00035 EggPoint(const EggPoint &copy) : 
00036   EggPrimitive(copy),
00037   _flags(copy._flags),
00038   _thick(copy._thick)
00039 {
00040 }
00041 
00042 ////////////////////////////////////////////////////////////////////
00043 //     Function: EggPoint::Copy assignment operator
00044 //       Access: Public
00045 //  Description:
00046 ////////////////////////////////////////////////////////////////////
00047 INLINE EggPoint &EggPoint::
00048 operator = (const EggPoint &copy) {
00049   EggPrimitive::operator = (copy);
00050   _flags = copy._flags;
00051   _thick = copy._thick;
00052   return *this;
00053 }
00054 
00055 ////////////////////////////////////////////////////////////////////
00056 //     Function: EggPoint::has_thick
00057 //       Access: Published
00058 //  Description:
00059 ////////////////////////////////////////////////////////////////////
00060 INLINE bool EggPoint::
00061 has_thick() const {
00062   return (_flags & F_has_thick) != 0;
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function: EggPoint::get_thick
00067 //       Access: Published
00068 //  Description: Returns the thickness set on this particular point.
00069 //               If there is no thickness set, returns 1.0.
00070 ////////////////////////////////////////////////////////////////////
00071 INLINE double EggPoint::
00072 get_thick() const {
00073   return _thick;
00074 }
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //     Function: EggPoint::set_thick
00078 //       Access: Published
00079 //  Description:
00080 ////////////////////////////////////////////////////////////////////
00081 INLINE void EggPoint::
00082 set_thick(double thick) {
00083   _thick = thick;
00084   _flags |= F_has_thick;
00085 }
00086 
00087 ////////////////////////////////////////////////////////////////////
00088 //     Function: EggPoint::clear_thick
00089 //       Access: Published
00090 //  Description:
00091 ////////////////////////////////////////////////////////////////////
00092 INLINE void EggPoint::
00093 clear_thick() {
00094   _thick = 1.0;
00095   _flags &= ~F_has_thick;
00096 }
00097 
00098 ////////////////////////////////////////////////////////////////////
00099 //     Function: EggPoint::has_perspective
00100 //       Access: Published
00101 //  Description:
00102 ////////////////////////////////////////////////////////////////////
00103 INLINE bool EggPoint::
00104 has_perspective() const {
00105   return (_flags & F_has_perspective) != 0;
00106 }
00107 
00108 ////////////////////////////////////////////////////////////////////
00109 //     Function: EggPoint::get_perspective
00110 //       Access: Published
00111 //  Description: Returns the perspective flag set on this particular
00112 //               point.  If there is no perspective flag set, returns
00113 //               false.
00114 ////////////////////////////////////////////////////////////////////
00115 INLINE bool EggPoint::
00116 get_perspective() const {
00117   return (_flags & F_perspective) != 0;
00118 }
00119 
00120 ////////////////////////////////////////////////////////////////////
00121 //     Function: EggPoint::set_perspective
00122 //       Access: Published
00123 //  Description:
00124 ////////////////////////////////////////////////////////////////////
00125 INLINE void EggPoint::
00126 set_perspective(bool perspective) {
00127   if (perspective) {
00128     _flags |= F_perspective;
00129   } else {
00130     _flags &= ~F_perspective;
00131   }
00132   _flags |= F_has_perspective;
00133 }
00134 
00135 ////////////////////////////////////////////////////////////////////
00136 //     Function: EggPoint::clear_perspective
00137 //       Access: Published
00138 //  Description:
00139 ////////////////////////////////////////////////////////////////////
00140 INLINE void EggPoint::
00141 clear_perspective() {
00142   _flags &= ~(F_has_perspective | F_perspective);
00143 }
 All Classes Functions Variables Enumerations