Panda3D

showBoundsEffect.h

00001 // Filename: showBoundsEffect.h
00002 // Created by:  drose (25Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef SHOWBOUNDSEFFECT_H
00016 #define SHOWBOUNDSEFFECT_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "renderEffect.h"
00021 
00022 class FactoryParams;
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : ShowBoundsEffect
00026 // Description : Applied to a GeomNode to cause a visible bounding
00027 //               volume to be drawn for this node.  This is generally
00028 //               used only during development to help identify
00029 //               bounding volume issues.
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDA_PGRAPH ShowBoundsEffect : public RenderEffect {
00032 private:
00033   INLINE ShowBoundsEffect();
00034 
00035 PUBLISHED:
00036   static CPT(RenderEffect) make(bool tight = false);
00037 
00038   INLINE bool get_tight() const;
00039 
00040 protected:
00041   virtual bool safe_to_combine() const;
00042   virtual int compare_to_impl(const RenderEffect *other) const;
00043 
00044 private:
00045   bool _tight;
00046 
00047 public:
00048   static void register_with_read_factory();
00049   virtual void write_datagram(BamWriter *manager, Datagram &dg);
00050 
00051 protected:
00052   static TypedWritable *make_from_bam(const FactoryParams &params);
00053   void fillin(DatagramIterator &scan, BamReader *manager);
00054   
00055 public:
00056   static TypeHandle get_class_type() {
00057     return _type_handle;
00058   }
00059   static void init_type() {
00060     RenderEffect::init_type();
00061     register_type(_type_handle, "ShowBoundsEffect",
00062                   RenderEffect::get_class_type());
00063   }
00064   virtual TypeHandle get_type() const {
00065     return get_class_type();
00066   }
00067   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00068 
00069 private:
00070   static TypeHandle _type_handle;
00071 };
00072 
00073 #include "showBoundsEffect.I"
00074 
00075 #endif
00076 
 All Classes Functions Variables Enumerations