#include <View.h>
Inheritance diagram for View:
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.
Public Member Functions | |
Abstract Interface | |
virtual std::auto_ptr< View > | clone (void) const |
virtual const View & | root (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) |
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.
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.
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.
virtual const int size | ( | void | ) | const [virtual] |
virtual const Viewport& viewport | ( | void | ) | const [virtual] |
virtual void reposition | ( | const int | x, | |
const int | y | |||
) | [virtual] |
Changes the position of the viewport.
x | - desired x position (pixels) of lower left corner | |
y | - desired y position (pixels) of lower left corner |
virtual void resize | ( | const unsigned int | width, | |
const unsigned int | height | |||
) | [virtual] |
Changes the size of the viewport.
width | - desired width of the viewport | |
height | - desired height of the viewport |
virtual void flip | ( | const bool | x, | |
const bool | y | |||
) | [virtual] |
Flip the view in the provided direction(s).
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.
angle | - angle in degrees to rotate the view |
virtual void zoom | ( | const float | scale | ) | [virtual] |
Scale the view by the given constant.
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.
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.