Panda3D
fltTransformPut.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file fltTransformPut.h
10  * @author drose
11  * @date 2000-08-29
12  */
13 
14 #ifndef FLTTRANSFORMPUT_H
15 #define FLTTRANSFORMPUT_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "fltTransformRecord.h"
20 
21 /**
22  * A "put", which is a MultiGen concept of defining a transformation by
23  * mapping three arbitrary points to three new arbitrary points.
24  */
26 public:
27  FltTransformPut(FltHeader *header);
28 
29  void set(const LPoint3d &from_origin,
30  const LPoint3d &from_align,
31  const LPoint3d &from_track,
32  const LPoint3d &to_origin,
33  const LPoint3d &to_align,
34  const LPoint3d &to_track);
35 
36  const LPoint3d &get_from_origin() const;
37  const LPoint3d &get_from_align() const;
38  const LPoint3d &get_from_track() const;
39  const LPoint3d &get_to_origin() const;
40  const LPoint3d &get_to_align() const;
41  const LPoint3d &get_to_track() const;
42 
43 private:
44  void recompute_matrix();
45 
46  LPoint3d _from_origin;
47  LPoint3d _from_align;
48  LPoint3d _from_track;
49  LPoint3d _to_origin;
50  LPoint3d _to_align;
51  LPoint3d _to_track;
52 
53 protected:
54  virtual bool extract_record(FltRecordReader &reader);
55  virtual bool build_record(FltRecordWriter &writer) const;
56 
57 public:
58  virtual TypeHandle get_type() const {
59  return get_class_type();
60  }
61  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
62  static TypeHandle get_class_type() {
63  return _type_handle;
64  }
65  static void init_type() {
66  FltTransformRecord::init_type();
67  register_type(_type_handle, "FltTransformPut",
68  FltTransformRecord::get_class_type());
69  }
70 
71 private:
72  static TypeHandle _type_handle;
73 };
74 
75 #endif
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:81