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
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
32PUBLISHED:
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
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition datagramIterator.h:30
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition factoryParams.h:36
RenderEffect::safe_to_combine
virtual bool safe_to_combine() const
Returns true if this kind of effect can safely be combined with sibling nodes that share the exact sa...
Definition renderEffect.cxx:88
RenderEffect::write_datagram
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition renderEffect.cxx:283
ShowBoundsEffect::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type ShowBoundsEffect.
Definition showBoundsEffect.cxx:66
ShowBoundsEffect::get_tight
bool get_tight() const
Returns true if the "tight" flag was set, meaning the effect should compute and draw the tight boundi...
Definition showBoundsEffect.I:28
ShowBoundsEffect::make
static ConstPointerTo< RenderEffect > make(bool tight=false)
Constructs a new ShowBoundsEffect object.
Definition showBoundsEffect.cxx:26
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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
renderEffect.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
showBoundsEffect.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.