class Viewer

Basic OpenGL viewing window.

Inheritance:

Viewer


Public Fields

[more]SpaceEntity camera
This is the object which specifies position, lookat and up orientation of the GL camera (via a gluLookat call within updategl).
[more]Vector3 gl_light_pos
Specifies the light position.
[more]Gtk::HBox upper_hbox
One of two containers in which additional widgets can be inserted afterwards.
[more]Gtk::HBox lower_hbox
One of two containers in which additional widgets can be inserted afterwards.
[more]SigC::Signal0<void> gl_changed_event
This signal will be emmitted whenever the gl stats have changed.

Public Methods

[more] Viewer(const char* name)
Constructor.
[more]void initgl()
This method initializes the Viewer specific GL environment.
[more]void updategl()
Updates all the gl stats like gluLookat.
[more]gint drawgl()
Draws the GL content.
[more]virtual gint init_gl_context_imp()
Virtual method which is called within initgl.
[more]virtual gint draw_gl_context_imp()
Within this virtual method all drawing calls are processed.
[more]gint gl_expose_handler(GdkEventExpose* expose)
This handling method is called when ever an expose event occurs, eg when the mouse enters the window (?)
[more]gint gl_configure_handler(GdkEventConfigure* configure)
Another handling method.
[more]void gl_realize_handler()
Is called once when the window is realized (eg.
[more]virtual gint gl_motion_notify_handler_imp(GdkEventMotion* event)
Virtual method which handels mouse motion.
[more]virtual gint gl_button_press_handler_imp(GdkEventButton* event)
Virtual method which handels mouse clicks.
[more]virtual gint gl_button_release_handler_imp(GdkEventButton* event)
Virtual method which handels mouse clicks.
[more]int set_light(Vector3 pos)
Change the light position.


Documentation

Basic OpenGL viewing window. The Viewer consists of an ViewerDisplay object nested within a single window. Mouse events like clicking and moving are handled within appropiate methods, which enables the user to rotate the scene and zoom in and out. No content is drawn yet. The Viewer is meant to inherit to another Class where then GL content can be specified by overriding the virtual method draw_gl_context_imp. The mouse handling methods can also be overriden. Finally there are public Gtk container members to insert additional widgets afterwards.
o Viewer(const char* name)
Constructor. Argument is a string which labels the Viewer window.

ovoid initgl()
This method initializes the Viewer specific GL environment. It is called within the constructor. Right now there is no need to call this method otherwise.

ovoid updategl()
Updates all the gl stats like gluLookat. It is called whenever the camera stats have changed, for example.

ogint drawgl()
Draws the GL content. Calls draw_gl_context_imp. Whenever the content or the camera stats have changed, drawgl is called.

ovirtual gint init_gl_context_imp()
Virtual method which is called within initgl. It can be overriden to initialize some gl content like display lists.

ovirtual gint draw_gl_context_imp()
Within this virtual method all drawing calls are processed. The GL content is specified here. drawgl must be called to do the actual drawing!

ogint gl_expose_handler(GdkEventExpose* expose)
This handling method is called when ever an expose event occurs, eg when the mouse enters the window (?)

ogint gl_configure_handler(GdkEventConfigure* configure)
Another handling method. It is called when the window is resized.

ovoid gl_realize_handler()
Is called once when the window is realized (eg. by a show() call).

ovirtual gint gl_motion_notify_handler_imp(GdkEventMotion* event)
Virtual method which handels mouse motion. Contains the standard Viewer mouse control. Override to realize alternative mouse control.

ovirtual gint gl_button_press_handler_imp(GdkEventButton* event)
Virtual method which handels mouse clicks. Contains the standard Viewer mouse control. Override to realize alternative mouse control.

ovirtual gint gl_button_release_handler_imp(GdkEventButton* event)
Virtual method which handels mouse clicks. Contains the standard Viewer mouse control. Override to realize alternative mouse control.

oSpaceEntity camera
This is the object which specifies position, lookat and up orientation of the GL camera (via a gluLookat call within updategl).

oVector3 gl_light_pos
Specifies the light position.

oint set_light(Vector3 pos)
Change the light position.

oGtk::HBox upper_hbox
One of two containers in which additional widgets can be inserted afterwards. This one is located above the GL widget.

oGtk::HBox lower_hbox
One of two containers in which additional widgets can be inserted afterwards. This one is located beneath the GL widget.

oSigC::Signal0<void> gl_changed_event
This signal will be emmitted whenever the gl stats have changed. It can be used to monitor the camera stats in other objects.


Direct child classes:
GenericViewer

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.