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

vrvis::LayerComponent Class Reference

Class representing a visible part of a Layer, visualizing at least one RasterData object. More...

#include <LayerComponent.hpp>

Inheritance diagram for vrvis::LayerComponent:

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

Public Member Functions

Constructor & Destructor
 LayerComponent (RasterData *pRasterData0, eColor color0, RasterData *pRasterData1=0, eColor color1=NONE, RasterData *pRasterData2=0, eColor color2=NONE)
 Constructor that takes one or more RasterData objects and their color interpretation.
 ~LayerComponent (void)
 Destructor.
Accessors
float getRelativeOriginX (void) const
 Get the relative origin of this Component, X coordinate.
float getRelativeOriginY (void) const
 Get the relative origin of this Component, Y coordinate.
float getRelativeSizeX (void) const
 Get the relative width of this Component.
float getRelativeSizeY (void) const
 Get the relative height of this Component.
double getLowerTexLimit (void) const
 Get the lower clamping limit of this Component's Textures.
double getUpperTexLimit (void) const
 Get the upper clamping limit of this Component's Textures.
const std::vector< Texture * > & getTextures (void) const
 Get an STL vector of this Component's Textures.
Transformation
void moveTo (const float cRelativeOriginX, const float cRelativeOriginY)
 Move this Component inside its Layer.
void resizeTo (const float cRelativeSizeX, const float cRelativeSizeY)
 Resize this Component inside its Layer.
Forwarded VR Juggler Callbacks
virtual void init (void)
 Prepare RasterData and Textures.
virtual void contextInit (void)
 Build Textures and create own GL display lists.
virtual void contextUpdate (void)
 Rebuild Textures.
virtual void draw (void)
 Do nothing. Real drawing done by drawTextures().

Detailed Description

A LayerComponent could be described as the visible representation of one or more objects implementing the RasterData interface. It is constructed out of pairs of in each case a RasterData object and a desired color interpretation (Red, Green, or Blue). The LayerComponent cannot exist without its containing Layer, in which it is positioned relatively.
See also:
Layer

RasterData, eColor


Constructor & Destructor Documentation

LayerComponent::LayerComponent (  RasterData *  pRasterData0,
vrvis::eColor  color0,
RasterData *  pRasterData1 = 0,
vrvis::eColor  color1 = NONE,
RasterData *  pRasterData2 = 0,
vrvis::eColor  color2 = NONE
) 
 

Constructs a LayerComponent out of up to three objects implementing the RasterData interface and a connected color interpretation for each one. The default arguments make it possible to create LayerComponents out of one, two or all three primary colors.

Parameters:
pRasterData0 First RasterData object.
color0 Color interpretation for the first RasterData object.
pRasterData1 Second RasterData object.
color1 Color interpretation for the second RasterData object.
pRasterData2 Third RasterData object.
color2 Color interpretation for the third RasterData object.
Attention:
The application exits if the same color interpretation is given multiple times!

LayerComponent::~LayerComponent (  void   ) 
 

Destructor.


Member Function Documentation

void LayerComponent::contextInit (  void   )  [virtual]
 

Builds GL textures for all owned Texture objects and creates a GL display list for the Component's border.

Reimplemented from vrvis::Drawable.

void LayerComponent::contextUpdate (  void   )  [virtual]
 

Rebuilds the GL texture for all owned Texture objects.

Reimplemented from vrvis::Drawable.

void LayerComponent::draw (  void   )  [virtual]
 

Inherited method that exceptionally does nothing. The "real" drawing is done in drawTextures(), which is permanently called by Layer::draw(). Through this design a LayerComponent is not drawn - as every other Drawable - through its inherited draw() method, but is dependent on its surrounding Layer object, which draws the Component in the correct relative position.

Implements vrvis::Drawable.

double LayerComponent::getLowerTexLimit (  void   )  const
 

Get the lower clamping limit of this Component's Textures.

Returns:
Lower clamping limit value (0.0 - 1.0).
Attention:
Right now based on the fact that all Textures owned by a LayerComponent have the same lower limit.

float LayerComponent::getRelativeOriginX (  void   )  const
 

Get this Component's relative origin, X coordinate.

Returns:
Relative origin X value (0.0 - 1.0).

float LayerComponent::getRelativeOriginY (  void   )  const
 

Get this Component's relative origin, Y coordinate.

Returns:
Relative origin Y value (0.0 - 1.0).

float LayerComponent::getRelativeSizeX (  void   )  const
 

Get this Component's relative width.

Returns:
Relative width value (0.0 - 1.0).

float LayerComponent::getRelativeSizeY (  void   )  const
 

Get this Component's relative height.

Returns:
Relative height value (0.0 - 1.0).

const std::vector< Texture * > & LayerComponent::getTextures (  void   )  const
 

Get an STL vector of this Component's Textures.

Returns:
Const reference to vector of Textures.

double LayerComponent::getUpperTexLimit (  void   )  const
 

Get the upper clamping limit of this Component's Textures.

Returns:
Upper clamping limit value (0.0 - 1.0).
Attention:
Right now based on the fact that all Textures owned by a LayerComponent have the same upper limit.

void LayerComponent::init (  void   )  [virtual]
 

Prepares suitable Texture objects, loads the RasterData and fills the Textures with data.

Reimplemented from vrvis::Drawable.

void LayerComponent::moveTo (  const float  cRelativeOriginX,
const float  cRelativeOriginY
) 
 

Move the Component to the given relative position.

Parameters:
cRelativeOriginX New relative origin, X coordinate.
cRelativeOriginY New relative origin, Y coordinate.
Attention:
Make sure that Origin[X|Y] + Size[X|Y] is always less than 1.0!

void LayerComponent::resizeTo (  const float  cRelativeSizeX,
const float  cRelativeSizeY
) 
 

Resize the Component to the given relative size.

Parameters:
cRelativeSizeX New relative width.
cRelativeSizeY New relative height.
Attention:
Make sure that Origin[X|Y] + Size[X|Y] is always less than 1.0!


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