Panda3D
 All Classes Functions Variables Enumerations
fltTransformPut.h
1 // Filename: fltTransformPut.h
2 // Created by: drose (29Aug00)
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 FLTTRANSFORMPUT_H
16 #define FLTTRANSFORMPUT_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltTransformRecord.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : FltTransformPut
24 // Description : A "put", which is a MultiGen concept of defining a
25 // transformation by mapping three arbitrary points to
26 // three new arbitrary points.
27 ////////////////////////////////////////////////////////////////////
29 public:
30  FltTransformPut(FltHeader *header);
31 
32  void set(const LPoint3d &from_origin,
33  const LPoint3d &from_align,
34  const LPoint3d &from_track,
35  const LPoint3d &to_origin,
36  const LPoint3d &to_align,
37  const LPoint3d &to_track);
38 
39  const LPoint3d &get_from_origin() const;
40  const LPoint3d &get_from_align() const;
41  const LPoint3d &get_from_track() const;
42  const LPoint3d &get_to_origin() const;
43  const LPoint3d &get_to_align() const;
44  const LPoint3d &get_to_track() const;
45 
46 private:
47  void recompute_matrix();
48 
49  LPoint3d _from_origin;
50  LPoint3d _from_align;
51  LPoint3d _from_track;
52  LPoint3d _to_origin;
53  LPoint3d _to_align;
54  LPoint3d _to_track;
55 
56 protected:
57  virtual bool extract_record(FltRecordReader &reader);
58  virtual bool build_record(FltRecordWriter &writer) const;
59 
60 public:
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65  static TypeHandle get_class_type() {
66  return _type_handle;
67  }
68  static void init_type() {
69  FltTransformRecord::init_type();
70  register_type(_type_handle, "FltTransformPut",
71  FltTransformRecord::get_class_type());
72  }
73 
74 private:
75  static TypeHandle _type_handle;
76 };
77 
78 #endif
79 
80 
A "put", which is a MultiGen concept of defining a transformation by mapping three arbitrary points t...
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
void set(const LPoint3d &from_origin, const LPoint3d &from_align, const LPoint3d &from_track, const LPoint3d &to_origin, const LPoint3d &to_align, const LPoint3d &to_track)
Defines the put explicitly.
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
A base class for a number of types of ancillary records that follow beads and indicate some kind of a...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85