Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

vrvis::Layer Class Reference

Class representing a 2D plane in 3D space holding multiple LayerComponents. More...

#include <Layer.hpp>

Inheritance diagram for vrvis::Layer:

vrvis::Drawable vrvis::Selectable List of all members.

Public Member Functions

Constructor & Destructor
 Layer (const float cSizeX, const float cSizeY)
 Constructs a Layer of the given size.
 ~Layer (void)
void addComponent (LayerComponent *pComponent, const float cRelativeOriginX=0.0f, const float cRelativeOriginY=0.0f, const float cRelativeSizeX=1.0f, const float cRelativeSizeY=1.0f)
 Adds a LayerComponent at a certain position to this Layer.
void removeComponent (LayerComponent *pComponent)
 Removes a certain LayerComponent from this Layer.
float getSizeX (void)
 Get Layer width (horizontal/X size).
float getSizeY (void)
 Get Layer height (vertical/Y size).
const std::list< LayerComponent * > & getComponentList (void)
 Get STL list of LayerComponents included in this Layer.
void moveTo (const float cX, const float cY, const float cZ)
 Transformation Move the Layer to a certain position in 3D space.
void rotateDegrees (const float cDegX, const float cDegY, const float cDegZ)
 Rotate the Layer around the coordinate axes (Euler angles).
Forwarded VR Juggler Callbacks
virtual void contextInit (void)
 Initialize GL display lists.
virtual void draw (void)
 Draw all embedded LayerComponents.

Detailed Description

This class represents a 2D plane in the 3D space of the visualization application. It is positioned absolute in space and it can hold multiple LayerComponents which in contrast are positioned relative in their parent Layer. The Layer class takes care of drawing its embedded components at the correct global position.
See also:

Constructor & Destructor Documentation

Layer::Layer const float  cSizeX,
const float  cSizeY

Constructs a Layer object out of given horizontal and vertical sizes.

cSizeX Width in meters.
cSizeY Height in meters.
The Layer is by default positioned at the global origin (0, 0, 0) standing in the x-y plane. To position it somewhere else, use the moveTo() method.

Layer::~Layer void   ) 


Member Function Documentation

void Layer::addComponent LayerComponent pComponent,
const float  cRelativeOriginX = 0.0f,
const float  cRelativeOriginY = 0.0f,
const float  cRelativeSizeX = 1.0f,
const float  cRelativeSizeY = 1.0f

Adds a given LayerComponent object to this Layer. The Component is positioned at the given relative origin and scaled to the given relative size. If origin and size are omitted, the Component fills the whole Layer.

pComponent The LayerComponent to be added.
cRelativeOriginX Relative Component origin - X coordinate.
cRelativeOriginY Relative Component origin - Y coordinate.
cRelativeSizeX Relative Component width.
cRelativeSizeY Relative Component height.
Origin[X/Y] + Size[X/Y] <= 1.0!

void Layer::contextInit void   )  [virtual]

Compiles a GL display list for this Layer's border.

Reimplemented from vrvis::Drawable.

void Layer::draw void   )  [virtual]

Draws all embedded visible LayerComponents at their relative position and - if the Layer is selected - the Layer's border.

See also:

Implements vrvis::Drawable.

const std::list< LayerComponent * > & Layer::getComponentList void   ) 

Get an STL list of all LayerComponents embedded in this Layer.

Const reference to the list of LayerComponents.

float Layer::getSizeX void   ) 

Get Layer width.

Horizontal Layer size in meters.

float Layer::getSizeY void   ) 

Get Layer height.

Vertical Layer size in meters.

void Layer::moveTo const float  cX,
const float  cY,
const float  cZ

Move the Layer to a certain position in 3D space.

cX Position to move to - X coordinate.
cY Position to move to - Y coordinate.
cZ Position to move to - Z coordinate.
A Layer's position is defined as the position of its lower left corner!

void Layer::removeComponent LayerComponent pComponent  ) 

Removes the given LayerComponent from this Layer.

pComponent Component to be removed.

void Layer::rotateDegrees const float  cDegX,
const float  cDegY,
const float  cDegZ

Rotate the Layer by certain degrees around each local coordinate axis (Euler angles).

cDegX Angle in degrees to be rotated around X axis.
cDegY Angle in degrees to be rotated around Y axis.
cDegZ Angle in degrees to be rotated around Z axis.
Due to the fact that Euler angles are used for the rotation and the rotations are carried out in an X -> Y -> Z order around this Layer's local coordinate axes, the problem of Gimbal Lock may occur.

All calls to this method are carried out in rotations starting at the current Layer rotation, i.e. all previous rotations add up with this one to produce the overall rotation of the Layer.

The documentation for this class was generated from the following files:
Generated on Tue Sep 21 07:31:11 2004 for VRVis by doxygen 1.3.8