View Class Reference

#include <View.h>

Inheritance diagram for View:

Inheritance graph
[legend]
List of all members.

Detailed Description

View is the abstract interface that all views must adhere to.

The interface for this class should be kept lightweight so as not to penalize children classes with pointless implementation or unusued memory. This class plays the role of the "Component" in the decorator pattern. This class also plays the role of the prototype in the prototype pattern and has cloning functionality.

See also:
GoF-Decorator, GoF-Prototype


Public Member Functions

Abstract Interface
virtual std::auto_ptr< Viewclone (void) const
virtual const Viewroot (void) const
virtual const int size (void) const
virtual const Viewport & viewport (void) const
virtual void reposition (const int x, const int y)
virtual void resize (const unsigned int width, const unsigned int height)
virtual void flip (const bool x, const bool y)
virtual void rotate (const float angle)
virtual void zoom (const float scale)
virtual void shift (const float x, const float y)
virtual void home (void)


Constructor & Destructor Documentation

View ( void   ) 

Default constructor initializing members.

virtual ~View ( void   )  [virtual]

Virtual destructor to aid in polymorphism Any event locks performed by the view will be removed prior to deletion.

View ( void   ) 

Default constructor initializing members.

virtual ~View ( void   )  [virtual]

Virtual destructor to aid in polymorphism Any event locks performed by the view will be removed prior to deletion.


Member Function Documentation

virtual std::auto_ptr<View> clone ( void   )  const [virtual]

Construct a clone of this object and return it.

Clones will share their rendered data pointer, but not their children or other data.

Returns:
An auto_ptr to the newly allocated View. This object is owned by the caller, and will not be managed by the cloning class.

virtual const View& root ( void   )  const [virtual]

Access the bottom node of a view chain.

This is the node that provides the overall context for the view.

Returns:
A reference to the bottommost node of the current view.

virtual const int size ( void   )  const [virtual]

Returns:
number of layers in the view

virtual const Viewport& viewport ( void   )  const [virtual]

Returns:
viewport for this view

virtual void reposition ( const int  x,
const int  y 
) [virtual]

Changes the position of the viewport.

Parameters:
x - desired x position (pixels) of lower left corner
y - desired y position (pixels) of lower left corner
See also:
Viewport::reposition()

virtual void resize ( const unsigned int  width,
const unsigned int  height 
) [virtual]

Changes the size of the viewport.

Parameters:
width - desired width of the viewport
height - desired height of the viewport
See also:
Viewport::resize()

virtual void flip ( const bool  x,
const bool  y 
) [virtual]

Flip the view in the provided direction(s).

Parameters:
x - if true, flip the view in the x direction
y - if true, flip the view in the y direction

virtual void rotate ( const float  angle  )  [virtual]

Rotate the view CCW by the given angle.

Parameters:
angle - angle in degrees to rotate the view

virtual void zoom ( const float  scale  )  [virtual]

Scale the view by the given constant.

Parameters:
scale - constant by which the view should be multiplied

virtual void shift ( const float  x,
const float  y 
) [virtual]

Shift the view in the x and y directions.

Parameters:
x - desired shift in the x direction (pixels)
y - desired shift in the y direction (pixels)

virtual void home ( void   )  [virtual]

Reset the view manipulation xform to the identity.


The documentation for this class was generated from the following file:
Generated on Fri Jan 19 11:14:24 2007 for Visualization by  doxygen 1.5.1-p1