Panda3D
 All Classes Functions Variables Enumerations
eggCurve.h
1 // Filename: eggCurve.h
2 // Created by: drose (15Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGCURVE_H
16 #define EGGCURVE_H
17 
18 #include "pandabase.h"
19 
20 #include "eggPrimitive.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : EggCurve
24 // Description : A parametric curve of some kind. See
25 // EggNurbsCurve.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDAEGG EggCurve : public EggPrimitive {
28 PUBLISHED:
29  INLINE EggCurve(const string &name = "");
30  INLINE EggCurve(const EggCurve &copy);
31  INLINE EggCurve &operator = (const EggCurve &copy);
32 
33  enum CurveType {
34  CT_none,
35  CT_xyz,
36  CT_hpr,
37  CT_t
38  };
39 
40  INLINE void set_subdiv(int subdiv);
41  INLINE int get_subdiv() const;
42 
43  INLINE void set_curve_type(CurveType type);
44  INLINE CurveType get_curve_type() const;
45 
46  static CurveType string_curve_type(const string &string);
47 
48 private:
49  int _subdiv;
50  CurveType _type;
51 
52 public:
53 
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  EggPrimitive::init_type();
59  register_type(_type_handle, "EggCurve",
60  EggPrimitive::get_class_type());
61  }
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 ostream &operator << (ostream &out, EggCurve::CurveType t);
72 
73 #include "eggCurve.I"
74 
75 #endif
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition: eggPrimitive.h:51
A parametric curve of some kind.
Definition: eggCurve.h:27
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85