00001 // Filename: eggSurface.I 00002 // Created by: drose (15Feb00) 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: EggSurface::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE EggSurface:: 00022 EggSurface(const string &name) : EggPrimitive(name) { 00023 _u_subdiv = 0; 00024 _v_subdiv = 0; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: EggSurface::Copy constructor 00029 // Access: Public 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 INLINE EggSurface:: 00033 EggSurface(const EggSurface ©) : 00034 EggPrimitive(copy), 00035 _u_subdiv(copy._u_subdiv), 00036 _v_subdiv(copy._v_subdiv) 00037 { 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: EggSurface::Copy assignment operator 00042 // Access: Public 00043 // Description: 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE EggSurface &EggSurface:: 00046 operator = (const EggSurface ©) { 00047 EggPrimitive::operator = (copy); 00048 _u_subdiv = copy._u_subdiv; 00049 _v_subdiv = copy._v_subdiv; 00050 return *this; 00051 } 00052 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: EggSurface::set_u_subdiv 00056 // Access: Public 00057 // Description: Sets the number of subdivisions in the U direction 00058 // that will be requested across the surface. (This 00059 // doesn't necessary guarantee that this number of 00060 // subdivisions will be made; it's just a hint to any 00061 // surface renderer or quick tesselator.) Set the 00062 // number to 0 to disable the hint. 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE void EggSurface:: 00065 set_u_subdiv(int subdiv) { 00066 _u_subdiv = subdiv; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function: EggSurface::get_u_subdiv 00071 // Access: Public 00072 // Description: Returns the requested number of subdivisions in the U 00073 // direction, or 0 if no particular subdivisions have 00074 // been requested. 00075 //////////////////////////////////////////////////////////////////// 00076 INLINE int EggSurface:: 00077 get_u_subdiv() const { 00078 return _u_subdiv; 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function: EggSurface::set_v_subdiv 00083 // Access: Public 00084 // Description: Sets the number of subdivisions in the U direction 00085 // that will be requested across the surface. (This 00086 // doesn't necessary guarantee that this number of 00087 // subdivisions will be made; it's just a hint to any 00088 // surface renderer or quick tesselator.) Set the 00089 // number to 0 to disable the hint. 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE void EggSurface:: 00092 set_v_subdiv(int subdiv) { 00093 _v_subdiv = subdiv; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: EggSurface::get_v_subdiv 00098 // Access: Public 00099 // Description: Returns the requested number of subdivisions in the U 00100 // direction, or 0 if no particular subdivisions have 00101 // been requested. 00102 //////////////////////////////////////////////////////////////////// 00103 INLINE int EggSurface:: 00104 get_v_subdiv() const { 00105 return _v_subdiv; 00106 }