Panda3D
 All Classes Functions Variables Enumerations
fltInstanceDefinition.h
1 // Filename: fltInstanceDefinition.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 FLTINSTANCEDEFINITION_H
16 #define FLTINSTANCEDEFINITION_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltBead.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : FltInstanceDefinition
24 // Description : This special kind of record marks the top node of an
25 // instance subtree. This subtree lives outside of the
26 // normal hierarchy, and is MultiGen's way of supporting
27 // instancing--each instance subtree has a unique index,
28 // which may be referenced in a FltInstanceRef object to
29 // make the instance appear in various places in the
30 // hierarchy.
31 ////////////////////////////////////////////////////////////////////
33 public:
35 
36  int _instance_index;
37 
38 protected:
39  virtual bool extract_record(FltRecordReader &reader);
40  virtual bool build_record(FltRecordWriter &writer) const;
41 
42 public:
43  virtual TypeHandle get_type() const {
44  return get_class_type();
45  }
46  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
51  FltBead::init_type();
52  register_type(_type_handle, "FltInstanceDefinition",
53  FltBead::get_class_type());
54  }
55 
56 private:
57  static TypeHandle _type_handle;
58 
59  friend class FltInstanceRef;
60  friend class FltRecordWriter;
61 };
62 
63 #endif
64 
65 
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...
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h: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 bead appears in the hierarchy to refer to a FltInstanceDefinition node defined elsewhere...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This special kind of record marks the top node of an instance subtree.