Panda3D
lwoLayer.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 lwoLayer.h
10  * @author drose
11  * @date 2001-04-24
12  */
13 
14 #ifndef LWOLAYER_H
15 #define LWOLAYER_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "lwoChunk.h"
20 
21 #include "luse.h"
22 
23 /**
24  * Signals the start of a new layer. All the data chunks which follow will be
25  * included in this layer until another layer chunk is encountered. If data
26  * is encountered before a layer chunk, it goes into an arbitrary layer.
27  */
28 class LwoLayer : public LwoChunk {
29 public:
30  void make_generic();
31 
32  enum Flags {
33  F_hidden = 0x0001
34  };
35 
36  int _number;
37  int _flags;
38  LPoint3 _pivot;
39  std::string _name;
40  int _parent;
41 
42 public:
43  virtual bool read_iff(IffInputFile *in, size_t stop_at);
44  virtual void write(std::ostream &out, int indent_level = 0) const;
45 
46 public:
47  virtual TypeHandle get_type() const {
48  return get_class_type();
49  }
50  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  LwoChunk::init_type();
56  register_type(_type_handle, "LwoLayer",
57  LwoChunk::get_class_type());
58  }
59 
60 private:
61  static TypeHandle _type_handle;
62 };
63 
64 #endif
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 specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:26
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:30
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
Definition: lwoLayer.cxx:42
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Signals the start of a new layer.
Definition: lwoLayer.h:28
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
void make_generic()
Resets the layer's parameters to initial defaults for a generic layer created implicitly.
Definition: lwoLayer.cxx:27