In file graphics3D/CameraOGL.h:

class CameraOGL : public Camera3D

OpenGL specific properties for a camera

Inheritance:


Public Fields

static const double lineDisplacementOffset
the offset to draw lines on top of rendered objects

Public Methods

TclString getLightsName () const
return the Tcl names associated with the lights
virtual void drawBoundingBox (Data3D *obj) const
Draw a bounding box around a 3D object
virtual void redraw (void)
Redraw all existing 3D objects in the 3D scene and eventually objects belonging to the camera (clipping planes, spot loghts,
virtual void initViewport (void)
initialize the viewport and basic OpenGL parameters
virtual void resize (void)
sets the viewport to (width,height) and updates camera parameters
virtual void resize (unsigned int w, unsigned int h)
sets the viewport to (width,height) and updates camera parameters
virtual void setViewingParameters (bool reset=true)
updates the internal camera parameters after the camera size has changed
virtual void setProjectionParameters (bool reset=true)
set the OGL projection matrix
void setFog (bool nfog)
set new fog flag value
void printString (unsigned int posx, unsigned int posy, char *str, GLuint font=0)
print a string on the screen
void setStencilBuffer (bool nstb)
set stencilBuffer flag value
void buildStencilBufferDisplayList ()
build stencilBufferDisplayList initialize GL_COLOR_WRITEMASK and GL_DEPHT_WRITEMASK to 0x1
bool getFog (void) const
returns fog flag
void setSpecularity (bool specularity)
set new specularity flag value
bool getSpecularity () const
returns true specularity flag
void setRenderFrontAndBack (bool flag)
set front or front and back rendering
bool getUseTwoSides () const
returns front and back rendering flag
virtual void rotateCameraObject (Rotation3D &rot)
camera callback to catch trackball rotation
virtual void translateCameraObject (Vec3 &t)
camera callback to catch trackball translation
virtual void setSelectedClippingPlane (ClippingPlane *cp)
selects a clipping plane and enable MOVE_CAMERA_OBJECT motion mode
virtual void unsetSelectedClippingPlane (void)
unselects a clipping plane and disable MOVE_CAMERA_OBJECT motion mode
virtual void setSelectedLight (Light *cl)
selects a light and enable MOVE_CAMERA_OBJECT motion mode
virtual void unsetSelectedLight (void)
unselects a light and disable MOVE_CAMERA_OBJECT motion mode
virtual void setSelectedObject (Data3D *data)
selects a scene object
virtual void applyObjectSelection (Data3D *obj)
Eventually install the Tcl menus associated with a 3D objects
virtual void applyObjectUnselection (Data3D *obj)
Eventually Uninstall the Tcl menus associated with a 3D objects
virtual void bindMouseMotion (bool on)
set the action to perform each time the mouse is moved
void toggleCopyright ()
change the display of the copyright
void toggleFrameRate ()
change the display of the frame rate
virtual ClippingPlane* newClippingPlane (void)
creates a new clipping plane in this camera centered on the scene and orthogonal to (0, 0, 1)
virtual ClippingPlane* newClippingPlane (GLdouble *eqn)
creates a new clipping plane in this camera with equation equation[0] x + equation[1] y + equation[2] z + equation[3] = 0
virtual ClippingPlane* newClippingPlane (const Vec3& P, const Vec3& n)
creates a new clipping plane in this camera passing through P and orthogonal to n
virtual Light* newLight (void)
creates a new white directional light in this camera
void addLight (Light *l)
add a light in the list of lights
void addClippingPlane (ClippingPlane *l)
add a clipping plane in the list of lights
std::list <ClippingPlane *> ::iterator getFirstClippingPlane ()
returns iterator on first clipping plane
std::list <ClippingPlane *> ::iterator getLastClippingPlane ()
returns iterator on last clipping plane
std::list <Light *> ::iterator getFirstLight ()
returns iterator on first clipping plane
std::list <Light *> ::iterator getLastLight ()
returns iterator on last clipping plane
bool isCameraBeingDestroyed () const
is the camera being destroyed?
GLenum getFreeClippingPlane (void) const
returns an unused OpenGL clipping plane id
GLenum getFreeLight (void) const
returns an unused OpenGL light id
virtual void grab (const TclString& filename)
dump camera window content in an xwd file

Public

constructor
CameraOGL (Scene3D *scn = 0, bool stereo = false)
creates an OpenGL camera given the 3D scene it visualizes
destructor
virtual ~CameraOGL ()
destroy the camera

Protected Fields

bool beingDestroyed
is the camera being deleted ?
bool useTwoSides
should we compute the shading on both sides?
bool useTrueSpecularity
should we compute the true specularity component in the shading computation
bool fog
whether to use fog for inrimage display
bool stencilBuffer
whether to use stencil Buffer for display
double fogRange
fog range
int StereoFlag
moved from Togl to implement openGl stereo on capable hardware
ClippingPlane* selectedClippingPlane
clipping plane being selected
Light* selectedLight
light being selected
std::list <ClippingPlane *> clipPlanes
allocated clipping planes
std::list <Light *> lights
allocated light
Vec3 eyeOffset
vector defining the displacement between the stereo cameras
Timer globalTimer
Measuring the time between two redraws action
unsigned int count
Counting number of redraws
char stringFrameRate [100]
Frame Ratestring
char stringCopyright [100]
copyright string
bool showCopyright
if copyright should be displayed
bool showFrameRate
if frame rate should be displayed

Protected Methods

void destroyCamera ()
called before the destruction of a camera : removes clipping planes, lights and stencil display list
virtual void applyTransformation ()
updates the Viewing matrix based on refcenter, center and the matTransform matrix

Protected

constructor
CameraOGL (CameraOGL *c)
builds a CameraOGL by calling the Camera3D(this) constructor

Private Methods

void init (void)
constructors common code
void remove (ClippingPlane *clip)
remove one clipping plane from camera clipping planes list
void remove (Light *light)
remove one light from camera lights list
virtual void redrawScene (void)
execute OpenGL calls to redraw complete scene

Inherited from Camera3D:

Public Methods

static LONGINT getRenderDuration()
static LONGINT getClickDuration()
BUTTON_STATE getButtonState(WHICH_BUTTON w)

Protected Fields

Vec3 eye
Vec3 refCenter
double dl
double expansionX
double expansionY
Vec3 mouse

Protected Methods

Vec3 computeEye(void)
Vec3 getRefCenter(void) const
void setRefCenter(Vec3 rc)
Matrix4x4 getMatTransform(void) const
void setMatTransform(Matrix4x4 mat)
void setParameters(void)
Vec3 getMousePosition(const Vec2 &pixel)
void getEyeDirectionVector(const Vec2 &pixel, Vec3&eye, Vec3&dir)
double getFieldOfView() const
void setFieldOfView(const double f)
virtual void pickObject(const Vec2 &pixel)
void rotate(const Vec3& axis, double angle)
virtual void rotateObject(const Rotation3D &r)
virtual void rotateCamera(Rotation3D& rot)
virtual void translateCamera(Vec3 &t)
virtual void scaleCamera(double s)
void doFocus(void)
void focusOnRegion(Vec3 &c, double _radius)
virtual void defineLights(void)
virtual void useLights(void) const
virtual void startComputation()
virtual void stopComputation()
Vec3 mapToScreen(const Vec3& t)
virtual void startAutoMove(AUTO_MOVE_MODE amm)
virtual void stopAutoMove(void)
virtual void activation(void)
virtual Vec3 getTrackballVector(int x, int y) const
virtual Rotation3D getTrackballRotation(const Vec3&a, const Vec3&b)
virtual double getTrackballScale(const Vec3&a, const Vec3&b)
virtual Vec3 getTrackballTranslation(const Vec3& a, const Vec3& b)
virtual Vec3 getTrackballZTranslation(const double a)
void mapworld2(const Vec2 &pixel, double *wx, double *wy)

Private Methods

void initCamera(void)

Documentation

OpenGL specific properties for a camera
static const double lineDisplacementOffset
the offset to draw lines on top of rendered objects

bool beingDestroyed
is the camera being deleted ?

bool useTwoSides
should we compute the shading on both sides?

bool useTrueSpecularity
should we compute the true specularity component in the shading computation

bool fog
whether to use fog for inrimage display

bool stencilBuffer
whether to use stencil Buffer for display

double fogRange
fog range

int StereoFlag
moved from Togl to implement openGl stereo on capable hardware

ClippingPlane* selectedClippingPlane
clipping plane being selected

Light* selectedLight
light being selected

std::list <ClippingPlane *> clipPlanes
allocated clipping planes

std::list <Light *> lights
allocated light

Vec3 eyeOffset
vector defining the displacement between the stereo cameras

Timer globalTimer
Measuring the time between two redraws action

unsigned int count
Counting number of redraws

char stringFrameRate[100]
Frame Ratestring

char stringCopyright[100]
copyright string

bool showCopyright
if copyright should be displayed

bool showFrameRate
if frame rate should be displayed

void destroyCamera()
called before the destruction of a camera : removes clipping planes, lights and stencil display list

virtual void applyTransformation()
updates the Viewing matrix based on refcenter, center and the matTransform matrix

void init(void)
constructors common code

constructor

CameraOGL(CameraOGL *c)
builds a CameraOGL by calling the Camera3D(this) constructor
Parameters:
c - unused parameter

constructor

CameraOGL(Scene3D *scn = 0, bool stereo = false)
creates an OpenGL camera given the 3D scene it visualizes
Parameters:
scn - the 3D scene seen by the camera; if it is null then used the default scene
stereo - whether this is a stereo buffer

destructor

virtual ~CameraOGL()
destroy the camera

TclString getLightsName() const
return the Tcl names associated with the lights

virtual void drawBoundingBox(Data3D *obj) const
Draw a bounding box around a 3D object
Parameters:
obj - the object around which the bounding box is drawn

virtual void redraw(void)
Redraw all existing 3D objects in the 3D scene and eventually objects belonging to the camera (clipping planes, spot loghts,..)

virtual void initViewport(void)
initialize the viewport and basic OpenGL parameters

virtual void resize(void)
sets the viewport to (width,height) and updates camera parameters

virtual void resize(unsigned int w, unsigned int h)
sets the viewport to (width,height) and updates camera parameters

virtual void setViewingParameters(bool reset=true)
updates the internal camera parameters after the camera size has changed
Parameters:
reset - wether tp init the transformation matrix to identity

virtual void setProjectionParameters(bool reset=true)
set the OGL projection matrix
Parameters:
reset - wether tp init the transformation matrix to identity

void setFog(bool nfog)
set new fog flag value
Parameters:
nfog - new fog value

void printString(unsigned int posx, unsigned int posy, char *str, GLuint font=0)
print a string on the screen
Parameters:
posx - the position in the window (column index)
posx - the position in the window (row index)
str - the null terminated string
font - must be either defaultFont, smallFont or largeFont

void setStencilBuffer(bool nstb)
set stencilBuffer flag value
Parameters:
nstb - new stencilBuffer value

void buildStencilBufferDisplayList()
build stencilBufferDisplayList initialize GL_COLOR_WRITEMASK and GL_DEPHT_WRITEMASK to 0x1

bool getFog(void) const
returns fog flag

void setSpecularity(bool specularity)
set new specularity flag value
Parameters:
specularity - new specularity value

bool getSpecularity() const
returns true specularity flag

void setRenderFrontAndBack(bool flag)
set front or front and back rendering
Parameters:
flag - front (if false) or front and back (if true) flag

bool getUseTwoSides() const
returns front and back rendering flag

virtual void rotateCameraObject(Rotation3D &rot)
camera callback to catch trackball rotation
Parameters:
rot - rotation matrix

virtual void translateCameraObject(Vec3 &t)
camera callback to catch trackball translation
Parameters:
t - translation vector

virtual void setSelectedClippingPlane(ClippingPlane *cp)
selects a clipping plane and enable MOVE_CAMERA_OBJECT motion mode
Parameters:
cp - clipping plane to select

virtual void unsetSelectedClippingPlane(void)
unselects a clipping plane and disable MOVE_CAMERA_OBJECT motion mode

virtual void setSelectedLight(Light *cl)
selects a light and enable MOVE_CAMERA_OBJECT motion mode
Parameters:
cl - light to select

virtual void unsetSelectedLight(void)
unselects a light and disable MOVE_CAMERA_OBJECT motion mode

virtual void setSelectedObject(Data3D *data)
selects a scene object
Parameters:
data - object to select

virtual void applyObjectSelection(Data3D *obj)
Eventually install the Tcl menus associated with a 3D objects
Parameters:
obj - the selected object

virtual void applyObjectUnselection(Data3D *obj)
Eventually Uninstall the Tcl menus associated with a 3D objects
Parameters:
obj - the object to be unselected

virtual void bindMouseMotion(bool on)
set the action to perform each time the mouse is moved
Parameters:
on - if true then a specific action is performed each time the mouse is moved. If false then unbind the action

void toggleCopyright()
change the display of the copyright

void toggleFrameRate()
change the display of the frame rate

virtual ClippingPlane* newClippingPlane(void)
creates a new clipping plane in this camera centered on the scene and orthogonal to (0, 0, 1)

virtual ClippingPlane* newClippingPlane(GLdouble *eqn)
creates a new clipping plane in this camera with equation equation[0] x + equation[1] y + equation[2] z + equation[3] = 0

virtual ClippingPlane* newClippingPlane(const Vec3& P, const Vec3& n)
creates a new clipping plane in this camera passing through P and orthogonal to n

virtual Light* newLight(void)
creates a new white directional light in this camera

void addLight(Light *l)
add a light in the list of lights

void addClippingPlane(ClippingPlane *l)
add a clipping plane in the list of lights

std::list <ClippingPlane *> ::iterator getFirstClippingPlane()
returns iterator on first clipping plane

std::list <ClippingPlane *> ::iterator getLastClippingPlane()
returns iterator on last clipping plane

std::list <Light *> ::iterator getFirstLight()
returns iterator on first clipping plane

std::list <Light *> ::iterator getLastLight()
returns iterator on last clipping plane

bool isCameraBeingDestroyed() const
is the camera being destroyed?

GLenum getFreeClippingPlane(void) const
returns an unused OpenGL clipping plane id

GLenum getFreeLight(void) const
returns an unused OpenGL light id

virtual void grab(const TclString& filename)
dump camera window content in an xwd file
Parameters:
filename - dump file name

void remove(ClippingPlane *clip)
remove one clipping plane from camera clipping planes list
Parameters:
clip - clipping plane to remove

void remove(Light *light)
remove one light from camera lights list
Parameters:
light - light to remove

virtual void redrawScene(void)
execute OpenGL calls to redraw complete scene


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de