Panda3D
 All Classes Functions Variables Enumerations
fltCurve.h
1 // Filename: fltCurve.h
2 // Created by: drose (28Feb01)
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 FLTCURVE_H
16 #define FLTCURVE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltBeadID.h"
21 #include "fltHeader.h"
22 
23 #include "luse.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : FltCurve
27 // Description : A single curve, like a Bezier or B-Spline.
28 ////////////////////////////////////////////////////////////////////
29 class FltCurve : public FltBeadID {
30 public:
31  FltCurve(FltHeader *header);
32 
33  enum CurveType {
34  CT_b_spline = 4,
35  CT_cardinal = 5,
36  CT_bezier = 6
37  };
38 
40 
41  CurveType _curve_type;
42  ControlPoints _control_points;
43 
44 public:
45  INLINE int get_num_control_points() const;
46  INLINE const LPoint3d &get_control_point(int n) const;
47 
48 
49 protected:
50  virtual bool extract_record(FltRecordReader &reader);
51  virtual bool build_record(FltRecordWriter &writer) const;
52 
53 public:
54  virtual TypeHandle get_type() const {
55  return get_class_type();
56  }
57  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
58  static TypeHandle get_class_type() {
59  return _type_handle;
60  }
61  static void init_type() {
62  FltBeadID::init_type();
63  register_type(_type_handle, "FltCurve",
64  FltBeadID::get_class_type());
65  }
66 
67 private:
68  static TypeHandle _type_handle;
69 };
70 
71 #include "fltCurve.I"
72 
73 #endif
74 
75 
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
A base class for any of a broad family of flt beads that include an ID.
Definition: fltBeadID.h:27
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
int get_num_control_points() const
Returns the number of control points assigned to the curve.
Definition: fltCurve.I:23
const LPoint3d & get_control_point(int n) const
Returns the nth control point assigned to the curve.
Definition: fltCurve.I:33
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:531
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A single curve, like a Bezier or B-Spline.
Definition: fltCurve.h:29