Panda3D

rocketRegion.h

00001 // Filename: rocketRegion.h
00002 // Created by:  rdb (30Nov11)
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 ROCKETREGION_H
00016 #define ROCKETREGION_H
00017 
00018 #include "config_rocket.h"
00019 #include "displayRegion.h"
00020 #include "rocketRenderInterface.h"
00021 #include "rocketInputHandler.h"
00022 
00023 class OrthographicLens;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : RocketRegion
00027 // Description : Represents a region in a window or buffer where
00028 //               the libRocket UI will be rendered to.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_ROCKET RocketRegion : public DisplayRegion {
00031 protected:
00032   RocketRegion(GraphicsOutput *window, const LVecBase4 &dimensions,
00033                const string &context_name);
00034 
00035   virtual void do_cull(CullHandler *cull_handler, SceneSetup *scene_setup,
00036                        GraphicsStateGuardian *gsg, Thread *current_thread);
00037 
00038 PUBLISHED:
00039   virtual ~RocketRegion();
00040 
00041   INLINE static RocketRegion* make(const string &context_name,
00042                                    GraphicsOutput *window);
00043   INLINE static RocketRegion* make(const string &context_name,
00044                                    GraphicsOutput *window,
00045                                    const LVecBase4 &dimensions);
00046 #ifndef CPPPARSER
00047   INLINE Rocket::Core::Context* get_context() const;
00048 #endif
00049 #ifdef HAVE_ROCKET_PYTHON
00050   EXTENSION(PyObject *get_context() const);
00051 #endif
00052 
00053   INLINE void set_input_handler(RocketInputHandler *handler);
00054   INLINE RocketInputHandler *get_input_handler() const;
00055 
00056 private:
00057   RocketRenderInterface _interface;
00058   Rocket::Core::Context* _context;
00059   PT(OrthographicLens) _lens;
00060   PT(RocketInputHandler) _input_handler;
00061 
00062 public:
00063   static TypeHandle get_class_type() {
00064     return _type_handle;
00065   }
00066   static void init_type() {
00067     DisplayRegion::init_type();
00068     register_type(_type_handle, "RocketRegion",
00069                   DisplayRegion::get_class_type());
00070   }
00071   virtual TypeHandle get_type() const {
00072     return get_class_type();
00073   }
00074   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00075 
00076 private:
00077   static TypeHandle _type_handle;
00078 };
00079 
00080 #include "rocketRegion.I"
00081 
00082 #endif /* ROCKETREGION_H */
 All Classes Functions Variables Enumerations