Panda3D
 All Classes Functions Variables Enumerations
lwoSurface.h
1 // Filename: lwoSurface.h
2 // Created by: drose (24Apr01)
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 LWOSURFACE_H
16 #define LWOSURFACE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoGroupChunk.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : LwoSurface
24 // Description : Describes the shading attributes of a surface. This
25 // is similar to the concept usually called a "material"
26 // or "shader" in other file formats.
27 ////////////////////////////////////////////////////////////////////
28 class LwoSurface : public LwoGroupChunk {
29 public:
30  string _name;
31  string _source;
32 
33 public:
34  virtual bool read_iff(IffInputFile *in, size_t stop_at);
35  virtual void write(ostream &out, int indent_level = 0) const;
36 
37  virtual IffChunk *make_new_chunk(IffInputFile *in, IffId id);
38 
39 public:
40  virtual TypeHandle get_type() const {
41  return get_class_type();
42  }
43  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
44  static TypeHandle get_class_type() {
45  return _type_handle;
46  }
47  static void init_type() {
48  LwoGroupChunk::init_type();
49  register_type(_type_handle, "LwoSurface",
50  LwoGroupChunk::get_class_type());
51  }
52 
53 private:
54  static TypeHandle _type_handle;
55 };
56 
57 #endif
58 
59 
60 
61 
Describes the shading attributes of a surface.
Definition: lwoSurface.h:28
virtual IffChunk * make_new_chunk(IffInputFile *in, IffId id)
Allocates and returns a new chunk of the appropriate type based on the given ID, according to the con...
Definition: lwoSurface.cxx:69
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: lwoSurface.cxx:38
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
Definition: iffChunk.h:32
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
A particular kind of LwoChunk that is expected to contain an arbitrary number of child chunks...
Definition: lwoGroupChunk.h:32
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A four-byte chunk ID appearing in an "IFF" file.
Definition: iffId.h:29