Panda3D
 All Classes Functions Variables Enumerations
decalEffect.h
1 // Filename: decalEffect.h
2 // Created by: drose (14Mar02)
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 DECALEFFECT_H
16 #define DECALEFFECT_H
17 
18 #include "pandabase.h"
19 
20 #include "renderEffect.h"
21 
22 class FactoryParams;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : DecalEffect
26 // Description : Applied to a GeomNode to indicate that the children
27 // of this GeomNode are coplanar and should be drawn as
28 // decals (eliminating Z-fighting).
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDA_PGRAPH DecalEffect : public RenderEffect {
31 private:
32  INLINE DecalEffect();
33 
34 PUBLISHED:
35  static CPT(RenderEffect) make();
36 
37 protected:
38  virtual bool safe_to_combine() const;
39  virtual int compare_to_impl(const RenderEffect *other) const;
40 
41 public:
42  static void register_with_read_factory();
43  virtual void write_datagram(BamWriter *manager, Datagram &dg);
44 
45 protected:
46  static TypedWritable *make_from_bam(const FactoryParams &params);
47  void fillin(DatagramIterator &scan, BamReader *manager);
48 
49 public:
50  static TypeHandle get_class_type() {
51  return _type_handle;
52  }
53  static void init_type() {
54  RenderEffect::init_type();
55  register_type(_type_handle, "DecalEffect",
56  RenderEffect::get_class_type());
57  }
58  virtual TypeHandle get_type() const {
59  return get_class_type();
60  }
61  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
62 
63 private:
64  static TypeHandle _type_handle;
65 };
66 
67 #include "decalEffect.I"
68 
69 #endif
70 
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition: renderEffect.h:56
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
Applied to a GeomNode to indicate that the children of this GeomNode are coplanar and should be drawn...
Definition: decalEffect.h:30