00001 // Filename: eggCurve.h 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 #ifndef EGGCURVE_H 00020 #define EGGCURVE_H 00021 00022 #include <pandabase.h> 00023 00024 #include "eggPrimitive.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : EggCurve 00028 // Description : A parametric curve of some kind. See 00029 // EggNurbsCurve. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDAEGG EggCurve : public EggPrimitive { 00032 public: 00033 INLINE EggCurve(const string &name = ""); 00034 INLINE EggCurve(const EggCurve ©); 00035 INLINE EggCurve &operator = (const EggCurve ©); 00036 00037 enum CurveType { 00038 CT_none, 00039 CT_xyz, 00040 CT_hpr, 00041 CT_t 00042 }; 00043 00044 INLINE void set_subdiv(int subdiv); 00045 INLINE int get_subdiv() const; 00046 00047 INLINE void set_curve_type(CurveType type); 00048 INLINE CurveType get_curve_type() const; 00049 00050 static CurveType string_curve_type(const string &string); 00051 00052 private: 00053 int _subdiv; 00054 CurveType _type; 00055 00056 public: 00057 00058 static TypeHandle get_class_type() { 00059 return _type_handle; 00060 } 00061 static void init_type() { 00062 EggPrimitive::init_type(); 00063 register_type(_type_handle, "EggCurve", 00064 EggPrimitive::get_class_type()); 00065 } 00066 virtual TypeHandle get_type() const { 00067 return get_class_type(); 00068 } 00069 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00070 00071 private: 00072 static TypeHandle _type_handle; 00073 }; 00074 00075 ostream &operator << (ostream &out, EggCurve::CurveType t); 00076 00077 #include "eggCurve.I" 00078 00079 #endif