Panda3D
Loading...
Searching...
No Matches
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
21class 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 */
28class EXPCL_PANDA_PGRAPH ShowBoundsEffect : public RenderEffect {
29private:
30 INLINE ShowBoundsEffect();
31
32PUBLISHED:
33 static CPT(RenderEffect) make(bool tight = false);
34
35 INLINE bool get_tight() const;
36
37protected:
38 virtual bool safe_to_combine() const;
39 virtual int compare_to_impl(const RenderEffect *other) const;
40
41private:
42 bool _tight;
43
44public:
45 static void register_with_read_factory();
46 virtual void write_datagram(BamWriter *manager, Datagram &dg);
47
48protected:
49 static TypedWritable *make_from_bam(const FactoryParams &params);
50 void fillin(DatagramIterator &scan, BamReader *manager);
51
52public:
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
66private:
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
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition bamWriter.h:63
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Applied to a GeomNode to cause a visible bounding volume to be drawn for this node.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.