Panda3D
fltVectorRecord.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 fltVectorRecord.h
10  * @author drose
11  * @date 2002-08-30
12  */
13 
14 #ifndef FLTVECTORRECORD_H
15 #define FLTVECTORRECORD_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "fltRecord.h"
20 
21 #include "luse.h"
22 
23 /**
24  * This is an ancillary record of the old (pre-15.4) face node. Its only use
25  * is to provide the direction vector for unidirectional and bidirectional
26  * light point faces.
27  */
28 class FltVectorRecord : public FltRecord {
29 public:
30  FltVectorRecord(FltHeader *header);
31 
32  const LVector3 &get_vector() const;
33 
34 protected:
35  LVector3 _vector;
36 
37 protected:
38  virtual bool extract_record(FltRecordReader &reader);
39  virtual bool build_record(FltRecordWriter &writer) const;
40 
41 public:
42  virtual TypeHandle get_type() const {
43  return get_class_type();
44  }
45  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
46  static TypeHandle get_class_type() {
47  return _type_handle;
48  }
49  static void init_type() {
50  FltRecord::init_type();
51  register_type(_type_handle, "FltVectorRecord",
52  FltRecord::get_class_type());
53  }
54 
55 private:
56  static TypeHandle _type_handle;
57 
58  friend class FltBead;
59 };
60 
61 #endif
const LVector3 & get_vector() const
Returns the vector value.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h:29
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:36
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This is an ancillary record of the old (pre-15.4) face node.