3#include <cgv/base/base.h>
4#include <cgv/base/traverser.h>
5#include <cgv/render/context.h>
6#include <cgv/math/fray.h>
7#include <cgv/render/view.h>
52 virtual void resize(
unsigned int w,
unsigned int h);
74 int current_render_pass;
76 unsigned render_pass_recursion_depth;
95#include <cgv/config/lib_end.h>
nodes should inherit from this policy class to allow selective tree traversals
base class for all drawables, which is independent of the used rendering API.
bool get_world_location(int x, int y, const view &V, dvec3 &world_location, double *window_z_ptr=0) const
use given view together with depth buffer of context in order to compute the world location of the po...
context * get_context() const
access the current context. The context will be available latestly in the init method but not in the ...
virtual void init_frame(context &)
this method is called in one pass over all drawables before the draw method
cgv::ray3 get_world_ray(int x, int y, view *view_ptr, const cgv::dmat4 &modelview_projection_window_matrix) const
compute ray from eye of given view_ptr through pixel at given mouse location (x,y) according to given...
void set_context(context *_ctx)
set the current focus context, this should only be called by the context itself
virtual void finish_draw(context &)
this method is called when the current drawable is left in a tree traversal that calls the draw metho...
virtual void destruct(context &) final
do not use destruct for a drawable but clear!!
virtual void draw(context &)
overload to draw the content of this drawable
void force_redraw()
forces a redraw right now. This cannot be called from init, init_frame, draw, finish_draw,...
virtual void resize(unsigned int w, unsigned int h)
callback to announce resizing of the output window
void hide()
hide the drawable
virtual void after_finish(context &)
this method is called in one pass over all drawables after finish frame
virtual void finish_frame(context &)
this method is called in one pass over all drawables after drawing
drawable()
default construction
virtual bool init(context &)
this method is called after creation or recreation of the context, return whether all necessary funct...
virtual void clear(context &)
clear all objects living in the context like textures or display lists
view * find_view_as_node(size_t view_idx=0) const
convenience function to find the view control in the current hierarchy
void show()
show the drawable
void post_redraw()
posts a redraw event to the current context if one is available
bool is_visible() const
check whether the drawable is visible
bool multi_pass_terminate(const context &ctx)
check in after_finish method, whether this was the terminating render pass
void perform_render_pass(context &ctx, int rp_idx, RenderPass rp=RP_USER_DEFINED, int excluded_flags=RPF_HANDLE_SCREEN_SHOT, int included_flags=0)
call to initiate a render pass in the init_frame method after initiate_render_pass_recursion() has su...
bool initiate_render_pass_recursion(context &ctx)
call in init_frame method to check whether the recursive render passes need to be initiated
bool multi_pass_ignore_finish(const context &ctx)
check in after_finish method, whether this should be directly exited with a return statement
void initiate_terminal_render_pass(int rp_idx)
call after last recursive render pass to use current render pass for last render pass
multi_pass_drawable()
construct to be not inside of a render pass
defines a symmetric view with the following quantities:
namespace for api independent GPU programming
RenderPass
Enumeration of different render passes, which can be queried from the context and used to specify a n...
@ RP_USER_DEFINED
user defined renderpass
@ RPF_HANDLE_SCREEN_SHOT
whether to perform a screen shot if this was scheduled
this header is dependency free
cgv::math::fray< float, 3 > ray3
3d ray using 32 bit single precision floating point type
cgv::math::fvec< double, 3 > dvec3
declare type of 3d double precision floating point vectors
cgv::math::fmat< double, 4, 4 > dmat4
declare type of 4x4 matrices