Panda3D
Public Member Functions | Static Public Member Functions | List of all members
RocketRegion Class Reference

Represents a region in a window or buffer where the libRocket UI will be rendered to. More...

#include "rocketRegion.h"

Inheritance diagram for RocketRegion:
DisplayRegion DisplayRegionBase DrawableRegion TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Member Functions

virtual TypeHandle force_init_type ()
 
Rocket::Core::Context * get_context () const
 Returns a pointer to the Rocket context associated with this region. More...
 
RocketInputHandlerget_input_handler () const
 Returns the RocketInputHandler object previously passed to set_input_handler. More...
 
virtual TypeHandle get_type () const
 
bool init_debugger ()
 Initializes the libRocket debugger. More...
 
bool is_debugger_visible () const
 Returns true if the debugger is visible. More...
 
void set_debugger_visible (bool visible)
 Sets whether the debugger should be visible. More...
 
void set_input_handler (RocketInputHandler *handler)
 Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the libRocket context before rendering. More...
 
- Public Member Functions inherited from DisplayRegion
void cleanup ()
 Cleans up some pointers associated with the DisplayRegion to help reduce the chance of memory leaks due to circular reference counts. More...
 
void clear_cull_callback ()
 Removes the callback set by an earlier call to set_cull_callback(). More...
 
void clear_draw_callback ()
 Removes the callback set by an earlier call to set_draw_callback(). More...
 
void compute_pixels ()
 Computes the pixel locations of the DisplayRegion within its window. More...
 
void compute_pixels (int x_size, int y_size)
 Computes the pixel locations of the DisplayRegion within its window, given the size of the window in pixels. More...
 
void compute_pixels_all_stages ()
 Computes the pixel locations of the DisplayRegion within its window. More...
 
void compute_pixels_all_stages (int x_size, int y_size)
 Performs a compute_pixels() operation for all stages of the pipeline. More...
 
PN_stdfloat get_bottom (int i=0) const
 Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. More...
 
NodePath get_camera (Thread *current_thread=Thread::get_current_thread()) const
 Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More...
 
CallbackObjectget_cull_callback () const
 Returns the CallbackObject set by set_cull_callback(). More...
 
PStatCollectorget_cull_region_pcollector ()
 Returns a PStatCollector for timing the cull operation for just this DisplayRegion. More...
 
CullResultget_cull_result (Thread *current_thread) const
 Returns the CullResult value that was stored on this DisplayRegion, presumably by the last successful cull operation. More...
 
CullTraverserget_cull_traverser ()
 Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
void get_dimensions (PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More...
 
void get_dimensions (int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More...
 
LVecBase4 get_dimensions (int i=0) const
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More...
 
CallbackObjectget_draw_callback () const
 Returns the CallbackObject set by set_draw_callback(). More...
 
PStatCollectorget_draw_region_pcollector ()
 Returns a PStatCollector for timing the draw operation for just this DisplayRegion. More...
 
bool get_incomplete_render () const
 Returns the incomplete_render flag. More...
 
PN_stdfloat get_left (int i=0) const
 Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. More...
 
int get_lens_index () const
 Returns the specific lens of the associated Camera that will be used for rendering this scene. More...
 
int get_num_regions () const
 Returns the number of regions, see set_num_regions. More...
 
GraphicsPipeget_pipe () const
 Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More...
 
int get_pixel_height (int i=0) const
 Returns the height of the DisplayRegion in pixels. More...
 
int get_pixel_width (int i=0) const
 Returns the width of the DisplayRegion in pixels. More...
 
void get_pixels (int &pl, int &pr, int &pb, int &pt) const
 Retrieves the coordinates of the DisplayRegion within its window, in pixels. More...
 
void get_pixels (int i, int &pl, int &pr, int &pb, int &pt) const
 Retrieves the coordinates of the DisplayRegion within its window, in pixels. More...
 
void get_region_pixels (int &xo, int &yo, int &w, int &h) const
 Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More...
 
void get_region_pixels (int i, int &xo, int &yo, int &w, int &h) const
 Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More...
 
void get_region_pixels_i (int &xo, int &yo, int &w, int &h) const
 Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More...
 
void get_region_pixels_i (int i, int &xo, int &yo, int &w, int &h) const
 Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More...
 
PN_stdfloat get_right (int i=0) const
 Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. More...
 
SceneSetupget_scene_setup (Thread *current_thread) const
 Returns the SceneSetup value that was stored on this DisplayRegion, presumably by the last successful cull operation. More...
 
bool get_scissor_enabled () const
 Returns whether or not scissor testing is enabled for this region. More...
 
bool get_screenshot (PNMImage &image)
 Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More...
 
int get_sort () const
 Returns the sort value associated with the DisplayRegion. More...
 
Lens::StereoChannel get_stereo_channel () const
 Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image. More...
 
int get_target_tex_page () const
 Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More...
 
int get_tex_view_offset () const
 Returns the current texture view offset for this DisplayRegion. More...
 
int get_texture_reload_priority () const
 Returns the priority which is assigned to asynchronous texture reload requests. More...
 
PN_stdfloat get_top (int i=0) const
 Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. More...
 
GraphicsOutputget_window () const
 Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More...
 
bool is_active () const
 Returns the active flag associated with the DisplayRegion. More...
 
virtual bool is_stereo () const
 Returns true if this is a StereoDisplayRegion, false otherwise. More...
 
bool operator< (const DisplayRegion &other) const
 Returns true if this DisplayRegion should be sorted before the other one, false otherwise. More...
 
virtual void output (ostream &out) const
 
 PT (Texture) get_screenshot()
 
virtual PT (PandaNode) make_cull_result_graph()
 
bool save_screenshot (const Filename &filename, const string &image_comment="")
 Saves a screenshot of the region to the indicated filename. More...
 
Filename save_screenshot_default (const string &prefix="screenshot")
 Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More...
 
virtual void set_active (bool active)
 Sets the active flag associated with the DisplayRegion. More...
 
virtual void set_camera (const NodePath &camera)
 Sets the camera that is associated with this DisplayRegion. More...
 
void set_cube_map_index (int cube_map_index)
 Deprecated; replaced by set_target_tex_page(). More...
 
void set_cull_callback (CallbackObject *object)
 Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. More...
 
void set_cull_result (CullResult *cull_result, SceneSetup *scene_setup, Thread *current_thread)
 Stores the result of performing a cull operation on this DisplayRegion. More...
 
virtual void set_cull_traverser (CullTraverser *trav)
 Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
void set_dimensions (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
void set_dimensions (int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
void set_dimensions (const LVecBase4 &dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
virtual void set_dimensions (int i, const LVecBase4 &dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
void set_draw_callback (CallbackObject *object)
 Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. More...
 
virtual void set_incomplete_render (bool incomplete_render)
 Sets the incomplete_render flag. More...
 
void set_lens_index (int index)
 Sets the lens index, allows for multiple lenses to be attached to a camera. More...
 
void set_num_regions (int i)
 Sets the number of regions that this DisplayRegion indicates. More...
 
void set_scissor_enabled (bool scissor_enabled)
 Sets whether or not scissor testing is enabled for this region. More...
 
virtual void set_sort (int sort)
 Sets the sort value associated with the DisplayRegion. More...
 
virtual void set_stereo_channel (Lens::StereoChannel stereo_channel)
 Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. More...
 
virtual void set_target_tex_page (int page)
 This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture. More...
 
virtual void set_tex_view_offset (int tex_view_offset)
 Sets the current texture view offset for this DisplayRegion. More...
 
virtual void set_texture_reload_priority (int texture_reload_priority)
 Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. More...
 
virtual bool supports_pixel_zoom () const
 Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. More...
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 
- Public Member Functions inherited from DrawableRegion
 DrawableRegion (const DrawableRegion &copy)
 
void copy_clear_settings (const DrawableRegion &copy)
 Copies only the clear settings from the other drawable region. More...
 
virtual void disable_clears ()
 Disables both the color and depth clear. More...
 
virtual bool get_clear_active (int n) const
 Gets the clear-active flag for any bitplane. More...
 
const LColorget_clear_color () const
 Returns the current clear color value. More...
 
bool get_clear_color_active () const
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
PN_stdfloat get_clear_depth () const
 Returns the current clear depth value. More...
 
bool get_clear_depth_active () const
 Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More...
 
unsigned int get_clear_stencil () const
 Returns the current clear stencil value. More...
 
bool get_clear_stencil_active () const
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
virtual const LColorget_clear_value (int n) const
 Returns the clear value for any bitplane. More...
 
int get_draw_buffer_type () const
 Returns the RenderBuffer into which the GSG should issue draw commands. More...
 
PN_stdfloat get_pixel_factor () const
 Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More...
 
PN_stdfloat get_pixel_zoom () const
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More...
 
int get_screenshot_buffer_type () const
 Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion. More...
 
virtual bool is_any_clear_active () const
 Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear. More...
 
void operator= (const DrawableRegion &copy)
 
virtual void set_clear_active (int n, bool clear_aux_active)
 Sets the clear-active flag for any bitplane. More...
 
void set_clear_color (const LColor &color)
 Sets the clear color to the indicated value. More...
 
void set_clear_color_active (bool clear_color_active)
 Toggles the flag that indicates whether the color buffer should be cleared every frame. More...
 
void set_clear_depth (PN_stdfloat depth)
 Sets the clear depth to the indicated value. More...
 
void set_clear_depth_active (bool clear_depth_active)
 Toggles the flag that indicates whether the depth buffer should be cleared every frame. More...
 
void set_clear_stencil (unsigned int stencil)
 Sets the clear stencil to the indicated value. More...
 
void set_clear_stencil_active (bool clear_stencil_active)
 Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More...
 
virtual void set_clear_value (int n, const LColor &clear_value)
 Sets the clear value for any bitplane. More...
 
virtual void set_pixel_zoom (PN_stdfloat pixel_zoom)
 Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static RocketRegionmake (const string &context_name, GraphicsOutput *window)
 Creates a libRocket context with the given name (must be unique) for the given window. More...
 
static RocketRegionmake (const string &context_name, GraphicsOutput *window, const LVecBase4 &dimensions)
 Creates a libRocket context with the given name (must be unique) for the given window. More...
 
- Static Public Member Functions inherited from DisplayRegion
static TypeHandle get_class_type ()
 
static void init_type ()
 
static Filename make_screenshot_filename (const string &prefix="screenshot")
 Synthesizes a suitable default filename for passing to save_screenshot(). More...
 
- Static Public Member Functions inherited from DisplayRegionBase
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from DrawableRegion
static int get_renderbuffer_type (int plane)
 Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More...
 

Additional Inherited Members

- Public Types inherited from DisplayRegion
typedef epvector< RegionRegions
 
- Public Types inherited from DrawableRegion
enum  RenderTexturePlane {
  RTP_stencil =0, RTP_depth_stencil =1, RTP_color, RTP_aux_rgba_0,
  RTP_aux_rgba_1, RTP_aux_rgba_2, RTP_aux_rgba_3, RTP_aux_hrgba_0,
  RTP_aux_hrgba_1, RTP_aux_hrgba_2, RTP_aux_hrgba_3, RTP_aux_float_0,
  RTP_aux_float_1, RTP_aux_float_2, RTP_aux_float_3, RTP_depth,
  RTP_COUNT
}
 

Detailed Description

Represents a region in a window or buffer where the libRocket UI will be rendered to.

Definition at line 30 of file rocketRegion.h.

Member Function Documentation

◆ get_context()

Rocket::Core::Context * RocketRegion::get_context ( ) const
inline

Returns a pointer to the Rocket context associated with this region.

Does not increase the reference count, so if you want to preserve it for longer than this region exists, be sure to call AddReference() and RemoveReference() yourself.

Definition at line 57 of file rocketRegion.I.

References set_input_handler().

Referenced by make().

◆ get_input_handler()

RocketInputHandler * RocketRegion::get_input_handler ( ) const
inline

Returns the RocketInputHandler object previously passed to set_input_handler.

Definition at line 83 of file rocketRegion.I.

Referenced by set_input_handler().

◆ init_debugger()

bool RocketRegion::init_debugger ( )

Initializes the libRocket debugger.

This will return false if the debugger failed to initialize, or if support for the debugger has not been built in (for example in an optimize=4 build).

Definition at line 156 of file rocketRegion.cxx.

References set_debugger_visible().

◆ is_debugger_visible()

bool RocketRegion::is_debugger_visible ( ) const

Returns true if the debugger is visible.

Definition at line 182 of file rocketRegion.cxx.

Referenced by set_debugger_visible().

◆ make() [1/2]

RocketRegion * RocketRegion::make ( const string &  context_name,
GraphicsOutput window 
)
inlinestatic

Creates a libRocket context with the given name (must be unique) for the given window.

Returns a new DisplayRegion where the libRocket context will render to. This variant of make() creates a region that fills the entire window.

Definition at line 27 of file rocketRegion.I.

◆ make() [2/2]

RocketRegion * RocketRegion::make ( const string &  context_name,
GraphicsOutput window,
const LVecBase4 dimensions 
)
inlinestatic

Creates a libRocket context with the given name (must be unique) for the given window.

Returns a new DisplayRegion where the libRocket context will render to.

Definition at line 40 of file rocketRegion.I.

References get_context().

◆ set_debugger_visible()

void RocketRegion::set_debugger_visible ( bool  visible)

Sets whether the debugger should be visible.

Definition at line 170 of file rocketRegion.cxx.

References is_debugger_visible().

Referenced by init_debugger().

◆ set_input_handler()

void RocketRegion::set_input_handler ( RocketInputHandler handler)
inline

Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the libRocket context before rendering.

You may use one input handler to provide inputs to any number of RocketRegion objects.

Definition at line 72 of file rocketRegion.I.

References get_input_handler().

Referenced by get_context().


The documentation for this class was generated from the following files: