00001 // Filename: eggCurve.I 00002 // Created by: drose (15Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: EggCurve::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE EggCurve:: 00026 EggCurve(const string &name) : EggPrimitive(name) { 00027 _subdiv = 0; 00028 _type = CT_none; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: EggCurve::Copy constructor 00033 // Access: Public 00034 // Description: 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE EggCurve:: 00037 EggCurve(const EggCurve ©) : 00038 EggPrimitive(copy), 00039 _subdiv(copy._subdiv), 00040 _type(copy._type) 00041 { 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: EggCurve::Copy assignment operator 00046 // Access: Public 00047 // Description: 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE EggCurve &EggCurve:: 00050 operator = (const EggCurve ©) { 00051 EggPrimitive::operator = (copy); 00052 _subdiv = copy._subdiv; 00053 _type = copy._type; 00054 return *this; 00055 } 00056 00057 00058 //////////////////////////////////////////////////////////////////// 00059 // Function: EggCurve::set_subdiv 00060 // Access: Public 00061 // Description: Sets the number of subdivisions that will be 00062 // requested across the curve. (This doesn't necessary 00063 // guarantee that this number of subdivisions will be 00064 // made; it's just a hint to any curve renderer or quick 00065 // tesselator.) Set the number to 0 to disable the 00066 // hint. 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE void EggCurve:: 00069 set_subdiv(int subdiv) { 00070 _subdiv = subdiv; 00071 } 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: EggCurve::get_subdiv 00075 // Access: Public 00076 // Description: Returns the requested number of subdivisions, or 0 if 00077 // no particular subdivisions have been requested. 00078 //////////////////////////////////////////////////////////////////// 00079 INLINE int EggCurve:: 00080 get_subdiv() const { 00081 return _subdiv; 00082 } 00083 00084 00085 //////////////////////////////////////////////////////////////////// 00086 // Function: EggCurve::set_curve_type 00087 // Access: Public 00088 // Description: Sets the type of the curve. This is primarily used 00089 // as a hint to any code that may need to deal with this 00090 // curve. 00091 //////////////////////////////////////////////////////////////////// 00092 INLINE void EggCurve:: 00093 set_curve_type(EggCurve::CurveType type) { 00094 _type = type; 00095 } 00096 00097 //////////////////////////////////////////////////////////////////// 00098 // Function: EggCurve::get_curve_type 00099 // Access: Public 00100 // Description: Returns the indicated type of the curve. 00101 //////////////////////////////////////////////////////////////////// 00102 INLINE EggCurve::CurveType EggCurve:: 00103 get_curve_type() const { 00104 return _type; 00105 }