OpenLayer Offline Manual

OpenLayer | Shape | Draw 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 Circle( 200.0, 100.0, 50.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 Circle( 200.0, 100.0, 50.0 )); myList.push_back( new Line( 200.0, 100.0, 250.0, 150.0 ); myList.push_back( new Rect( 200.0, 100.0, 70.0, 50.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
DrawRecord | Draws the latest record created by RecordDraw
RotateBy | Rotates the shape by the specified angle
TransformBy | Transforms the shape by a Placement
Back to the main page of the manual Questions about Draw? Click here.