Panda3D
fltTransformScale.h
1 // Filename: fltTransformScale.h
2 // Created by: drose (30Aug00)
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 FLTTRANSFORMSCALE_H
16 #define FLTTRANSFORMSCALE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltTransformRecord.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : FltTransformScale
24 // Description : A transformation that applies a (possibly nonuniform)
25 // scale.
26 ////////////////////////////////////////////////////////////////////
28 public:
30 
31  void set(const LPoint3d &center, const LVecBase3 &scale);
32 
33  bool has_center() const;
34  const LPoint3d &get_center() const;
35  const LVecBase3 &get_scale() const;
36 
37 private:
38  void recompute_matrix();
39 
40  LPoint3d _center;
41  LVecBase3 _scale;
42 
43 protected:
44  virtual bool extract_record(FltRecordReader &reader);
45  virtual bool build_record(FltRecordWriter &writer) const;
46 
47 public:
48  virtual TypeHandle get_type() const {
49  return get_class_type();
50  }
51  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  FltTransformRecord::init_type();
57  register_type(_type_handle, "FltTransformScale",
58  FltTransformRecord::get_class_type());
59  }
60 
61 private:
62  static TypeHandle _type_handle;
63 };
64 
65 #endif
A transformation that applies a (possibly nonuniform) scale.
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
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...
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:544
bool has_center() const
Returns true if the center is specified, false if it is not.
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