VizKit  3.3.7
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
VizKit::VisualStageBox Class Reference

Position and dimensions of a box on stage. More...

#include <VisualStageBox.h>

List of all members.

Public Member Functions

 VisualStageBox (VisualAsset *anAssetRef)
 The constructor.
 ~VisualStageBox ()
 The destructor.
 VisualStageBox (const VisualStageBox &other)
 Copy constructor.
VisualStageBoxoperator= (const VisualStageBox &other)
 Assignment operator.
void setContentPixelWidth (size_t pixelWidth)
 Sets the pixel width of the image data.
void setContentPixelHeight (size_t pixelHeight)
 Sets the pixel height of the image data.
void setCoordDepth (double aCoordDepth)
 Sets the depth of the stage box (in coord values).
void setFrontPosition (double aFrontPosition)
 Sets value of the front position.
double getFrontPosition (void)
 Returns the value of the front position.
void setBackPosition (double aBackPosition)
 Sets value of the back position.
double getBackPosition (void)
 Returns the value of the back position.
void setVisualStagePosition (const VisualStagePosition &aPosition)
 Sets the stage position of the box.
void setScalingBehaviour (ScalingBehaviour aScalingBehaviour)
 Specifies the scaling behaviour.
void setScaleFactor (double aScaleFactor)
 Specifies the magnification/minification of the stage box when drawn.
void setDirty (void)
 Marks the stage box for update of the coord values (e.g.
void update (void)
 Updates the coord values (e.g.
void updateIfNeeded (void)
 Performs the updates of the coord values in case it is needed (because the values have been marked as dirty before).
ScalingBehaviour getScalingBehaviour (void) const
 Returns the scaling attributes.
double getScaleFactor (void) const
 Returns the magnification/minification of the stage box when drawn.
double getCoordWidth (void)
 Returns the width of the box.
double getUnscaledCoordWidth (void)
 Returns the width of the box (without current scaleFactor, only layout constraints taken into account).
double getCoordHeight (void)
 Returns the height of the box.
double getUnscaledCoordHeight (void)
 Returns the height of the box (without current scaleFactor, only layout constraints taken into account).
double getCoordDepth (void)
 Returns the depth of the box.
double getUnscaledCoordDepth (void)
 Returns the depth of the box (without current scaleFactor, only layout constraints taken into account).
double getTopCoord (const VisualItemIdentifier *const vertexChainName=NULL)
 Returns the top coord of the box.
double getLeftCoord (const VisualItemIdentifier *const vertexChainName=NULL)
 Returns the left coord of the box.
double getBottomCoord (const VisualItemIdentifier *const vertexChainName=NULL)
 Returns the bottom coord of the box.
double getRightCoord (const VisualItemIdentifier *const vertexChainName=NULL)
 Returns the right coord of the box.
size_t getContentPixelWidth (void) const
 Returns the pixel width of the image data.
size_t getContentPixelHeight (void) const
 Returns the pixel height of the image data.
VisualStagePosition getVisualStagePosition (void) const
 Returns a copy of the stage position of the box.
void initializeVertexChain (const VisualItemIdentifier &vertexChainName)
 Initializes a vertex chain.
void addVertexToChain (const VisualItemIdentifier &vertexChainName, VisualVertex *aVertex)
 Adds a vertex to a chain.
VertexChaingetVertexChain (const VisualItemIdentifier &vertexChainName)
 Returns the vertex chain of the asset identified by that name.
VertexChaingetVertexChain (size_t vertexIdx)
 Returns the indexed vertex chain.
const VisualItemIdentifiergetVertexChainIdentifier (size_t vertexIdx)
 Returns the identifier of an indexed vertex chain.
size_t getNumberOfVertexChains (void) const
 Returns the number of vertex chains of the VisualStageBox.
bool hasVertexChain (const VisualItemIdentifier &vertexChainName) const
 Answers the question whether a vertex chain with the identifier exists.
void removeAllVertexChains (void)
 Clears all vertex chains of the VisualStageBox.
void removeVertexChain (const VisualItemIdentifier &vertexChainName)
 Clears the vertex chain.
double getMinSRelTexCoord (void)
 Returns the minimum relative s-tex coord of all vertex chains of the stage box.
double getMinTRelTexCoord (void)
 Returns the minimum relative t-tex coord of all vertex chains of the stage box.
double getMaxSRelTexCoord (void)
 Returns the maximum relative s-tex coord of all vertex chains of the stage box.
double getMaxTRelTexCoord (void)
 Returns the maximum relative t-tex coord of all vertex chains of the stage box.
void setOpacityValue (double anOpacityValue)
 Sets the opacity value (alpha value).
VisualVertexcreateVertex (double xPos, double yPos, double zPos, double aTexCoordSPos, double aTexCoordTPos, VertexColor anRGBAColor=white)
 Creates and returns a vertex at the specified position.
VisualVertexcreateVertex (double xPos, double yPos, double zPos, VertexColor anRGBAColor=white)
 Creates and returns a vertex at the specified position.
void setDebugMode (bool requestedDebugMode)
 Sets the debug mode.
bool getDebugMode (void)
 Returns the current debug mode.

Static Public Member Functions

static VisualStagePosition tweenVisualStagePosition (const VisualStagePosition &startPosition, const VisualStagePosition &stopPosition, double currPosition, const VisualStageBox &currentAssetBox)
 Calculates the VisualStagePosition according to start position, stop position and current value (between 0.0 and 1.0).

Private Types

typedef std::map
< VisualItemIdentifier,
VertexChain * > 
VertexChainMap
 A VertexChainMap is a map of vertex chains.
typedef VertexChainMap::iterator VertexChainMapIterator
 A VertexChainMapIterator is the iterator of a VertexChainMap.
typedef
VertexChainMap::const_iterator 
ConstVertexChainMapIterator
 A VertexChainMapIterator is the const iterator of a VertexChainMap.

Private Member Functions

void copy (const VisualStageBox &other)
 Copy method for assignment operator and copy constructor.
void calcCoords (const VisualCamera &aCamera)
 Calculates the coord dimension of the box according to alignment and margin settings.
void applyScaleFactor (void)
 Applies the scale factor to the coord values.
void updateVertices (void)
 Updates the position of the existing vertices according to current top, left, bottom, right, front, back coordinates.

Private Attributes

bool hasLayout
 True if calcCoords() was executed at least once, initial state is false.
double topCoord
 The top coord value of the positioned box.
double leftCoord
 The left coord value of the positioned box.
double bottomCoord
 The bottom coord value of the positioned box.
double rightCoord
 The right coord value of the positioned box.
double frontPosition
 The value of the front position.
double backPosition
 The value of the back position.
double coordWidth
 The width of the box measured in coord values.
double unscaledCoordWidth
 The width of the box measured in coord values (without scaleFactor).
double coordHeight
 The height of the box measured in coord values.
double unscaledCoordHeight
 The width of the box measured in coord values (without scaleFactor).
double coordDepth
 The depth of the box measured in coord values.
double unscaledCoordDepth
 The depth of the box measured in coord values (without scaleFactor).
size_t contentPixelWidth
 The width of the box measured in pixels.
size_t contentPixelHeight
 The height of the box measured in pixels.
VisualStagePosition stagePosition
 The dimensionless position of the box.
ScalingBehaviour scalingBehaviour
 Specifies the scaling behaviour.
double scaleFactor
 The factor by which the stage box should be multiplied when rendered (1.0 means no magnification/minification).
VertexChainMap vertexChainMap
 The map of the vertex chains.
VisualItemIdentifier notFoundIdentifier
 A dummy identifier returned in case a search result was empty.
VisualAssetassetRef
 Pointer to the asset the stage box belongs to.
bool debugMode
 True if stage box is in debug mode, false otherwise.

Detailed Description

Position and dimensions of a box on stage.

Used by VisualAsset as a positioning container. It is the bounding box of the visual asset.


Member Typedef Documentation

typedef VertexChainMap::const_iterator VizKit::VisualStageBox::ConstVertexChainMapIterator [private]

A VertexChainMapIterator is the const iterator of a VertexChainMap.

A VertexChainMap is a map of vertex chains.

typedef VertexChainMap::iterator VizKit::VisualStageBox::VertexChainMapIterator [private]

A VertexChainMapIterator is the iterator of a VertexChainMap.


Constructor & Destructor Documentation

The constructor.

Parameters:
anAssetRefPointer to the asset the stage box belongs to.

The destructor.

Copy constructor.

Parameters:
otherReference to another VisualStageBox.

Member Function Documentation

void VisualStageBox::addVertexToChain ( const VisualItemIdentifier vertexChainName,
VisualVertex aVertex 
)

Adds a vertex to a chain.

Parameters:
vertexChainNameThe identifier of the vertex chain.
aVertexThe vertex to be added to the vertex chain.
void VisualStageBox::applyScaleFactor ( void  ) [private]

Applies the scale factor to the coord values.

void VisualStageBox::calcCoords ( const VisualCamera aCamera) [private]

Calculates the coord dimension of the box according to alignment and margin settings.

Parameters:
aCameraThe camera with the dimensions of the stage.
void VisualStageBox::copy ( const VisualStageBox other) [private]

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualStageBox.
VisualVertex * VisualStageBox::createVertex ( double  xPos,
double  yPos,
double  zPos,
double  aTexCoordSPos,
double  aTexCoordTPos,
VertexColor  anRGBAColor = white 
)

Creates and returns a vertex at the specified position.

Parameters:
xPosPosition on x-axis (0.0 means: left, 1.0 means: right).
yPosPosition on y-Axis (0.0 means: bottom, 1.0 means: top).
zPosPosition on z-Axis (0.0 means: front, 1.0 means: back).
aTexCoordSPosAn s position of a texture.
aTexCoordTPosA t position of a texture.
anRGBAColorRGBA color associated with the vertex.
Returns:
A vertex at the specified position.
VisualVertex * VisualStageBox::createVertex ( double  xPos,
double  yPos,
double  zPos,
VertexColor  anRGBAColor = white 
)

Creates and returns a vertex at the specified position.

Parameters:
xPosPosition on x-axis (0.0 means: left, 1.0 means: right).
yPosPosition on y-Axis (0.0 means: bottom, 1.0 means: top).
zPosPosition on z-Axis (0.0 means: front, 1.0 means: back).
anRGBAColorRGBA color associated with the vertex.
Returns:
A vertex at the specified position.

Returns the value of the back position.

Returns:
The value of the back position.
double VisualStageBox::getBottomCoord ( const VisualItemIdentifier *const  vertexChainName = NULL)

Returns the bottom coord of the box.

Parameters:
vertexChainNameThe identifier of the vertex chain. If none is specified (default) then the coord position of the bounding box is returned.
Returns:
The bottom coord of the box.
size_t VisualStageBox::getContentPixelHeight ( void  ) const

Returns the pixel height of the image data.

Returns:
the pixel height of the image data.
size_t VisualStageBox::getContentPixelWidth ( void  ) const

Returns the pixel width of the image data.

Returns:
the pixel width of the image data.
double VisualStageBox::getCoordDepth ( void  )

Returns the depth of the box.

Returns:
The depth of the box.
double VisualStageBox::getCoordHeight ( void  )

Returns the height of the box.

Returns:
The height of the box.
double VisualStageBox::getCoordWidth ( void  )

Returns the width of the box.

Returns:
The width of the box.

Returns the current debug mode.

Returns:
The current debug mode. True means debug mode is on, false means it is turned off.

Returns the value of the front position.

Returns:
The value of the front position.
double VisualStageBox::getLeftCoord ( const VisualItemIdentifier *const  vertexChainName = NULL)

Returns the left coord of the box.

Parameters:
vertexChainNameThe identifier of the vertex chain. If none is specified (default) then the coord position of the bounding box is returned.
Returns:
The left coord of the box.

Returns the maximum relative s-tex coord of all vertex chains of the stage box.

Returns:
The maximum relative s-tex coord of all vertex chains of the stage box.

Returns the maximum relative t-tex coord of all vertex chains of the stage box.

Returns:
The maximum relative t-tex coord of all vertex chains of the stage box.

Returns the minimum relative s-tex coord of all vertex chains of the stage box.

Returns:
The minimum relative s-tex coord of all vertex chains of the stage box.

Returns the minimum relative t-tex coord of all vertex chains of the stage box.

Returns:
The minimum relative t-tex coord of all vertex chains of the stage box.
size_t VisualStageBox::getNumberOfVertexChains ( void  ) const

Returns the number of vertex chains of the VisualStageBox.

Returns:
The number of vertex chains of the VisualStageBox.
double VisualStageBox::getRightCoord ( const VisualItemIdentifier *const  vertexChainName = NULL)

Returns the right coord of the box.

Parameters:
vertexChainNameThe identifier of the vertex chain. If none is specified (default) then the coord position of the bounding box is returned.
Returns:
The right coord of the box.
double VisualStageBox::getScaleFactor ( void  ) const

Returns the magnification/minification of the stage box when drawn.

Returns:
The factor by which the stage box is multiplied when rendered (1.0 means no magnification/minification).

Returns the scaling attributes.

Returns:
The scaling attributes.
double VisualStageBox::getTopCoord ( const VisualItemIdentifier *const  vertexChainName = NULL)

Returns the top coord of the box.

Parameters:
vertexChainNameThe identifier of the vertex chain. If none is specified (default) then the coord position of the bounding box is returned.
Returns:
The top coord of the box.

Returns the depth of the box (without current scaleFactor, only layout constraints taken into account).

Returns:
The depth of the box (without current scaleFactor, only layout constraints taken into account).

Returns the height of the box (without current scaleFactor, only layout constraints taken into account).

Returns:
The height of the box (without current scaleFactor, only layout constraints taken into account).

Returns the width of the box (without current scaleFactor, only layout constraints taken into account).

Returns:
The width of the box (without current scaleFactor, only layout constraints taken into account).

Returns the vertex chain of the asset identified by that name.

Parameters:
vertexChainNameThe identifier/name (enum) of the vertex chain.
Returns:
The vertex chain identified by that name.

Returns the indexed vertex chain.

Parameters:
vertexIdxThe index of the requested vertex chain.
Returns:
The indexed vertex chain.

Returns the identifier of an indexed vertex chain.

Parameters:
vertexIdxThe index of the requested vertex chain.
Returns:
The identifier of the indexed vertex chain.

Returns a copy of the stage position of the box.

Returns:
A copy of the stage position of the box.
bool VisualStageBox::hasVertexChain ( const VisualItemIdentifier vertexChainName) const

Answers the question whether a vertex chain with the identifier exists.

Parameters:
vertexChainNameThe identifier/name (enum) of the vertex chain.
Returns:
True if vertex chain with the identifier exists.

Initializes a vertex chain.

Parameters:
vertexChainNameThe identifier of the vertex chain.
VisualStageBox & VisualStageBox::operator= ( const VisualStageBox other)

Assignment operator.

Parameters:
otherReference to another VisualStageBox.

Clears all vertex chains of the VisualStageBox.

void VisualStageBox::removeVertexChain ( const VisualItemIdentifier vertexChainName)

Clears the vertex chain.

Parameters:
vertexChainNameThe identifier of the VertexChain to remove.
void VisualStageBox::setBackPosition ( double  aBackPosition)

Sets value of the back position.

Parameters:
aBackPositionThe value of the back position.
void VisualStageBox::setContentPixelHeight ( size_t  pixelHeight)

Sets the pixel height of the image data.

Parameters:
pixelHeightThe pixel height of the image data.
void VisualStageBox::setContentPixelWidth ( size_t  pixelWidth)

Sets the pixel width of the image data.

Parameters:
pixelWidthThe pixel width of the image data.
void VisualStageBox::setCoordDepth ( double  aCoordDepth)

Sets the depth of the stage box (in coord values).

Parameters:
aCoordDepthThe depth of the stage box.
void VisualStageBox::setDebugMode ( bool  requestedDebugMode)

Sets the debug mode.

Parameters:
requestedDebugModeThe debug mode. True turns debug mode on, false turns it off.
void VisualStageBox::setDirty ( void  )

Marks the stage box for update of the coord values (e.g.

after setting new relative values of vertex chains).

Remarks:
To enforce immediate update of the coord values, call update().
void VisualStageBox::setFrontPosition ( double  aFrontPosition)

Sets value of the front position.

Parameters:
aFrontPositionThe value of the front position.
void VisualStageBox::setOpacityValue ( double  anOpacityValue)

Sets the opacity value (alpha value).

Parameters:
anOpacityValueThe opacity value (alpha value).
void VisualStageBox::setScaleFactor ( double  aScaleFactor)

Specifies the magnification/minification of the stage box when drawn.

Parameters:
aScaleFactorThe factor by which the stage box should be multiplied when rendered (1.0 means no magnification/minification).

Specifies the scaling behaviour.

Parameters:
aScalingBehaviourThe requested scaling behaviour.

Sets the stage position of the box.

Parameters:
aPositionThe position that is supposed to become the current position.
VisualStagePosition VisualStageBox::tweenVisualStagePosition ( const VisualStagePosition startPosition,
const VisualStagePosition stopPosition,
double  currPosition,
const VisualStageBox currentAssetBox 
) [static]

Calculates the VisualStagePosition according to start position, stop position and current value (between 0.0 and 1.0).

Parameters:
startPositionThe start position.
stopPositionThe stop position.
currPositionThe current value of the animation.
currentAssetBoxThe visual stage box of the current asset which can be queried for additional info.
Returns:
The tweened position.
void VisualStageBox::update ( void  )

Updates the coord values (e.g.

after canvas reshape).

Remarks:
It is preferred to just set the dirty flag by calling setDirty(). By calling setDirty() the update is deferred, the coord values are evaluated lazily.

Performs the updates of the coord values in case it is needed (because the values have been marked as dirty before).

void VisualStageBox::updateVertices ( void  ) [private]

Updates the position of the existing vertices according to current top, left, bottom, right, front, back coordinates.


Member Data Documentation

Pointer to the asset the stage box belongs to.

The value of the back position.

The bottom coord value of the positioned box.

The height of the box measured in pixels.

The width of the box measured in pixels.

The depth of the box measured in coord values.

The height of the box measured in coord values.

The width of the box measured in coord values.

True if stage box is in debug mode, false otherwise.

The value of the front position.

True if calcCoords() was executed at least once, initial state is false.

The left coord value of the positioned box.

A dummy identifier returned in case a search result was empty.

The right coord value of the positioned box.

The factor by which the stage box should be multiplied when rendered (1.0 means no magnification/minification).

Specifies the scaling behaviour.

The dimensionless position of the box.

The top coord value of the positioned box.

The depth of the box measured in coord values (without scaleFactor).

The width of the box measured in coord values (without scaleFactor).

The width of the box measured in coord values (without scaleFactor).

The map of the vertex chains.


The documentation for this class was generated from the following files:

Generated on Sun May 3 2015 20:26:32 for VizKit by doxygen 1.8.0