BeltContainerStrategy Class Reference

#include <BeltContainerStrategy.h>

Inherits BoundedContainerStrategy.

Inherited by CurrentBeltContainerStrategy.

Inheritance diagram for BeltContainerStrategy:

Inheritance graph
[legend]
Collaboration diagram for BeltContainerStrategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BeltContainerStrategy (float bWidth=100, unsigned int nControlPoints=4, unsigned int subdivLevels=4)
 ~BeltContainerStrategy (void)
Spline getInnerSpline ()
void setInnerSpline (Spline s)
Spline getInnerBorderSpline ()
void setInnerBorderSpline (Spline s)
float getBeltWidth ()
void setBeltWidth (float w)

Protected Member Functions

virtual void createDisplayLists ()
virtual void setDefaultBounds (bool rounded)
virtual void evaluateSplines ()
void calculateInnerBorder ()
virtual void adjustSizeAndPosition ()
virtual void drawInnerRegion ()
virtual void drawBorder (bool noColor=false)
virtual void drawControlPoints ()
virtual void moveControlPointBy (unsigned int index, double dx, double dy)
void fillButtonBuffer (IBuffer< unsigned char > *buffer)
virtual void initializeCPButtonValues ()
void onEvent (LargeDisplayEvent *evt)

Protected Attributes

Spline innerSpline
Spline innerBorderSpline
float beltWidth
unsigned int dlInnerBorder
unsigned int dlInnerBorderSelected
unsigned int dlInnerBorderPicking
std::vector< unsigned char > cpInnerButtonValues

Detailed Description

This strategy extends the BoundedContainerStrategy by adding an inner curve defining a "hole" in the container. The inner curve and its border are also splines with the same number of control points and subdivision levels as their outer counterparts.

This is based on the BoundedContainerGL class in the original implementation of the Tabletop Framework done by T. Isenberg and A. Miede in the Interactions Lab at the University of Calgary, Canada.

Author:
Fabricio Anastacio - fabriciocfa@yahoo.com
Since:
August 23, 2007


Constructor & Destructor Documentation

BeltContainerStrategy::BeltContainerStrategy ( float  bWidth = 100,
unsigned int  nControlPoints = 4,
unsigned int  subdivLevels = 4 
)

Constructs a belt container strategy.

Parameters:
bWidth the width of the inside region (belt) of the container.
nControlPoints the number of control points.
subdivLevels the number of times subdivision should be applied to the curve.

BeltContainerStrategy::~BeltContainerStrategy ( void   ) 

Destroys this strategy.


Member Function Documentation

Spline BeltContainerStrategy::getInnerSpline (  )  [inline]

Returns the inner spline that defines this container bounds.

Returns:
the inner spline that defines this container bounds.

void BeltContainerStrategy::setInnerSpline ( Spline  s  )  [inline]

Sets the inner spline that defines this container bounds.

Parameters:
s the inner spline that defines this container bounds.

Spline BeltContainerStrategy::getInnerBorderSpline (  )  [inline]

Returns the inner border spline that defines this container bounds.

Returns:
the inner border spline that defines this container bounds.

void BeltContainerStrategy::setInnerBorderSpline ( Spline  s  )  [inline]

Sets the inner border spline that defines this container bounds.

Parameters:
s the inner border spline that defines this container bounds.

float BeltContainerStrategy::getBeltWidth (  )  [inline]

Returns the width of the belt (i.e., the inner region).

Returns:
the width of the belt (i.e., the inner region).

void BeltContainerStrategy::setBeltWidth ( float  w  )  [inline]

Sets the width of the belt (i.e., the inner region).

Parameters:
w the width of the belt (i.e., the inner region).

void BeltContainerStrategy::createDisplayLists (  )  [protected, virtual]

Creates the display lists for drawing the container.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::setDefaultBounds ( bool  rounded  )  [protected, virtual]

Sets the control points of the bounding spline as an ellipse/rectangular shape.

Parameters:
rounded if true the container has a rounded shape, otherwise its shape is rectangular.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::evaluateSplines (  )  [protected, virtual]

Evaluates the splines for the outer bounds and its border using the current control points for the outer bounds spline.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::calculateInnerBorder (  )  [protected]

Calculates the inner border spline from the evaluated inner spline.

void BeltContainerStrategy::adjustSizeAndPosition (  )  [protected, virtual]

Adjusts the size of the associated component by obtaining the minimum and maximum coordinates of the region given by the bounded container splines (i.e., the axis-aligned bounding rectangle around the component) and the position of the associated component's center based on the calculated dimensions.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::drawInnerRegion (  )  [protected, virtual]

Draws the inner region of the container.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::drawBorder ( bool  noColor = false  )  [protected, virtual]

Draws the border of the container.

Parameters:
noColor if true the color of the vertices is not set.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::drawControlPoints (  )  [protected, virtual]

Draws the control points of the bounds spline of the container.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::moveControlPointBy ( unsigned int  index,
double  dx,
double  dy 
) [protected, virtual]

Moves the control point given the specified index by the given values along the x- and y-axes.

Parameters:
index the index of the control point.
dx the displacement along the x-axis.
dy the displacement along the y-axis.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::fillButtonBuffer ( IBuffer< unsigned char > *  buffer  )  [protected, virtual]

Fills the given buffer with the inside area, the border (movable), and the control points (incremental indices after last available).

Parameters:
buffer the buffer to be filled.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::initializeCPButtonValues (  )  [protected, virtual]

Initializes the list with the button values of the control points.

Reimplemented from BoundedContainerStrategy.

void BeltContainerStrategy::onEvent ( LargeDisplayEvent *  evt  )  [protected]

Handles the given event.

Parameters:
evt the event to be handled.

Reimplemented from BoundedContainerStrategy.

Reimplemented in CurrentBeltContainerStrategy.


Member Data Documentation

Spline BeltContainerStrategy::innerSpline [protected]

The spline defining the outer bounds of the container.

Spline BeltContainerStrategy::innerBorderSpline [protected]

The spline defining the border of the outer bounds of the container.

float BeltContainerStrategy::beltWidth [protected]

The width of the belt (i.e., the width of the inner region.

unsigned int BeltContainerStrategy::dlInnerBorder [protected]

The display list identifier for the border.

unsigned int BeltContainerStrategy::dlInnerBorderSelected [protected]

The display list identifier for the border when selected.

unsigned int BeltContainerStrategy::dlInnerBorderPicking [protected]

The display list identifier for the border when picking.

std::vector<unsigned char> BeltContainerStrategy::cpInnerButtonValues [protected]

List of button values of each control point.


The documentation for this class was generated from the following files:
Generated on Fri Dec 21 17:46:06 2007 for LargeDisplayFrameworkToolkit by  doxygen 1.5.2