Panda3D
lwoSurfaceBlockOpacity.h
1 // Filename: lwoSurfaceBlockOpacity.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 LWOSURFACEBLOCKOPACITY_H
16 #define LWOSURFACEBLOCKOPACITY_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoChunk.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : LwoSurfaceBlockOpacity
24 // Description : Indicates how transparent or opaque this particular
25 // layer is in relation to the layers beneath it. This
26 // is a subchunk of LwoSurfaceBlockHeader.
27 ////////////////////////////////////////////////////////////////////
29 public:
30  enum Type {
31  T_additive = 0,
32  T_subtractive = 1,
33  T_difference = 2,
34  T_multiply = 3,
35  T_divide = 4,
36  T_alpha = 5,
37  T_texture_displacement = 6
38  };
39 
40  Type _type;
41  PN_stdfloat _opacity;
42  int _envelope;
43 
44 public:
45  virtual bool read_iff(IffInputFile *in, size_t stop_at);
46  virtual void write(ostream &out, int indent_level = 0) const;
47 
48 public:
49  virtual TypeHandle get_type() const {
50  return get_class_type();
51  }
52  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  LwoChunk::init_type();
58  register_type(_type_handle, "LwoSurfaceBlockOpacity",
59  LwoChunk::get_class_type());
60  }
61 
62 private:
63  static TypeHandle _type_handle;
64 };
65 
66 #endif
67 
68 
Indicates how transparent or opaque this particular layer is in relation to the layers beneath it...
A specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:29
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85