Draw

void Draw(
Rgba color ) const

Draws the shape to the drawing surface filled with the specified color.

The actual output of this function depends on what kind of a Shape the object actually is.

Examples

// Create a new circle and store a pointer to it //
Shape *myShape = new Circle200.0100.050.0 );

// Draw the shape to the canvas filled with green //
myShape->Draw( Rgba::GREEN );

// Using a pointer to a shape can be useful if you make a list //
// which contains all the primitives in the screen //
std::list< Shape *> myList;

// Add a circle, line and a rectangle to the list //
myList.push_back( new Circle200.0100.050.0 ));
myList.push_back( new Line200.0100.0250.0150.0 );
myList.push_back( new Rect200.0100.070.050.0 );

// Draw all the primitives filled with black //
for( std::list< Shape *> ::iterator iter = myList.begin(); iter != myList.end(); iter++ ) {
  (*iter)->Draw( Rgba::BLACK );
}


Other functions of the class Shape
Draw
Draws the shape filled with the specified color
DrawOutline
Draws the outline of the shape
RecordDraw
Records the results of Draw-function
MoveBy
Moves the shape
SetLineWidth
Sets the width of the outline of the shape
GetLineWidth
Returns the width of the outline of the shape


Questions about Draw? Click here.