Panda3D

eggCurve.I

00001 // Filename: eggCurve.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: EggCurve::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE EggCurve::
00022 EggCurve(const string &name) : EggPrimitive(name) {
00023   _subdiv = 0;
00024   _type = CT_none;
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: EggCurve::Copy constructor
00029 //       Access: Public
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 INLINE EggCurve::
00033 EggCurve(const EggCurve &copy) :
00034   EggPrimitive(copy),
00035   _subdiv(copy._subdiv),
00036   _type(copy._type)
00037 {
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: EggCurve::Copy assignment operator
00042 //       Access: Public
00043 //  Description:
00044 ////////////////////////////////////////////////////////////////////
00045 INLINE EggCurve &EggCurve::
00046 operator = (const EggCurve &copy) {
00047   EggPrimitive::operator = (copy);
00048   _subdiv = copy._subdiv;
00049   _type = copy._type;
00050   return *this;
00051 }
00052 
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: EggCurve::set_subdiv
00056 //       Access: Public
00057 //  Description: Sets the number of subdivisions that will be
00058 //               requested across the curve.  (This doesn't necessary
00059 //               guarantee that this number of subdivisions will be
00060 //               made; it's just a hint to any curve renderer or quick
00061 //               tesselator.)  Set the number to 0 to disable the
00062 //               hint.
00063 ////////////////////////////////////////////////////////////////////
00064 INLINE void EggCurve::
00065 set_subdiv(int subdiv) {
00066   _subdiv = subdiv;
00067 }
00068 
00069 ////////////////////////////////////////////////////////////////////
00070 //     Function: EggCurve::get_subdiv
00071 //       Access: Public
00072 //  Description: Returns the requested number of subdivisions, or 0 if
00073 //               no particular subdivisions have been requested.
00074 ////////////////////////////////////////////////////////////////////
00075 INLINE int EggCurve::
00076 get_subdiv() const {
00077   return _subdiv;
00078 }
00079 
00080 
00081 ////////////////////////////////////////////////////////////////////
00082 //     Function: EggCurve::set_curve_type
00083 //       Access: Public
00084 //  Description: Sets the type of the curve.  This is primarily used
00085 //               as a hint to any code that may need to deal with this
00086 //               curve.
00087 ////////////////////////////////////////////////////////////////////
00088 INLINE void EggCurve::
00089 set_curve_type(EggCurve::CurveType type) {
00090   _type = type;
00091 }
00092 
00093 ////////////////////////////////////////////////////////////////////
00094 //     Function: EggCurve::get_curve_type
00095 //       Access: Public
00096 //  Description: Returns the indicated type of the curve.
00097 ////////////////////////////////////////////////////////////////////
00098 INLINE EggCurve::CurveType EggCurve::
00099 get_curve_type() const {
00100   return _type;
00101 }
 All Classes Functions Variables Enumerations