Panda3D
showBoundsEffect.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 showBoundsEffect.h
10  * @author drose
11  * @date 2002-03-25
12  */
13 
14 #ifndef SHOWBOUNDSEFFECT_H
15 #define SHOWBOUNDSEFFECT_H
16 
17 #include "pandabase.h"
18 
19 #include "renderEffect.h"
20 
21 class FactoryParams;
22 
23 /**
24  * Applied to a GeomNode to cause a visible bounding volume to be drawn for
25  * this node. This is generally used only during development to help identify
26  * bounding volume issues.
27  */
28 class EXPCL_PANDA_PGRAPH ShowBoundsEffect : public RenderEffect {
29 private:
30  INLINE ShowBoundsEffect();
31 
32 PUBLISHED:
33  static CPT(RenderEffect) make(bool tight = false);
34 
35  INLINE bool get_tight() const;
36 
37 protected:
38  virtual bool safe_to_combine() const;
39  virtual int compare_to_impl(const RenderEffect *other) const;
40 
41 private:
42  bool _tight;
43 
44 public:
45  static void register_with_read_factory();
46  virtual void write_datagram(BamWriter *manager, Datagram &dg);
47 
48 protected:
49  static TypedWritable *make_from_bam(const FactoryParams &params);
50  void fillin(DatagramIterator &scan, BamReader *manager);
51 
52 public:
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  RenderEffect::init_type();
58  register_type(_type_handle, "ShowBoundsEffect",
59  RenderEffect::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65 
66 private:
67  static TypeHandle _type_handle;
68 };
69 
70 #include "showBoundsEffect.I"
71 
72 #endif
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:63
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition: renderEffect.h:48
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
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:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38