Panda3D
 All Classes Functions Variables Enumerations
showBoundsEffect.h
1 // Filename: showBoundsEffect.h
2 // Created by: drose (25Mar02)
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 SHOWBOUNDSEFFECT_H
16 #define SHOWBOUNDSEFFECT_H
17 
18 #include "pandabase.h"
19 
20 #include "renderEffect.h"
21 
22 class FactoryParams;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : ShowBoundsEffect
26 // Description : Applied to a GeomNode to cause a visible bounding
27 // volume to be drawn for this node. This is generally
28 // used only during development to help identify
29 // bounding volume issues.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_PGRAPH ShowBoundsEffect : public RenderEffect {
32 private:
33  INLINE ShowBoundsEffect();
34 
35 PUBLISHED:
36  static CPT(RenderEffect) make(bool tight = false);
37 
38  INLINE bool get_tight() const;
39 
40 protected:
41  virtual bool safe_to_combine() const;
42  virtual int compare_to_impl(const RenderEffect *other) const;
43 
44 private:
45  bool _tight;
46 
47 public:
48  static void register_with_read_factory();
49  virtual void write_datagram(BamWriter *manager, Datagram &dg);
50 
51 protected:
52  static TypedWritable *make_from_bam(const FactoryParams &params);
53  void fillin(DatagramIterator &scan, BamReader *manager);
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  RenderEffect::init_type();
61  register_type(_type_handle, "ShowBoundsEffect",
62  RenderEffect::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "showBoundsEffect.I"
74 
75 #endif
76 
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
Applied to a GeomNode to cause a visible bounding volume to be drawn for this node.
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