Empirical
|
Define an arbitrary shape to draw on a canvas (base clase) More...
#include <CanvasShape.h>
Public Member Functions | |
CanvasShape (double _x, double _y, const std::string &fc="", const std::string &lc="", double lw=1.0) | |
CanvasShape (Point _p, const std::string &fc="", const std::string &lc="", double lw=1.0) | |
virtual | ~CanvasShape () |
void | MoveTo (Point _p) |
Shift the position of this shape to a point. More... | |
void | MoveTo (double _x, double _y) |
Shift the position of this shape to coordinates. More... | |
void | SetLineWidth (double lw=1.0) |
Setup details needed before drawing lines. More... | |
void | SetFillColor (const std::string &color) |
Change the fill color of this shape. More... | |
void | SetLineColor (const std::string &color) |
Change the stroke color of this shape. More... | |
void | ApplyColor () |
Actually change the color on screen. More... | |
virtual void | Apply ()=0 |
Apply current action to emp_i.ctx. More... | |
virtual CanvasAction * | Clone () const =0 |
Make a copy of the current action. More... | |
Protected Member Functions | |
void | Fill (const std::string &style="") |
Helper function to set the fill status. More... | |
void | Stroke (const std::string &style="") |
Helper function to set the stroke status. More... | |
void | LineWidth (double line_width=1.0) |
Helper function to set the stroke status. More... | |
Protected Attributes | |
Point | p |
Anchor point for this shape. More... | |
std::string | fill_color |
Internal color to fill shape with. More... | |
std::string | line_color |
Border color for shape. More... | |
double | line_width |
How wide should lines be? More... | |
Define an arbitrary shape to draw on a canvas (base clase)
|
inline |
|
inline |
|
inlinevirtual |
|
pure virtualinherited |
Apply current action to emp_i.ctx.
Implemented in emp::web::CanvasText, emp::web::CanvasMultiLine, emp::web::CanvasLine, emp::web::CanvasPolygon, emp::web::CanvasImage, emp::web::CanvasClearRect, emp::web::CanvasFont, emp::web::CanvasRect, emp::web::CanvasRotate, emp::web::CanvasCircle, and emp::web::CanvasStrokeColor.
|
inline |
Actually change the color on screen.
|
pure virtualinherited |
Make a copy of the current action.
Implemented in emp::web::CanvasText, emp::web::CanvasMultiLine, emp::web::CanvasLine, emp::web::CanvasPolygon, emp::web::CanvasImage, emp::web::CanvasClearRect, emp::web::CanvasFont, emp::web::CanvasRect, emp::web::CanvasRotate, emp::web::CanvasCircle, and emp::web::CanvasStrokeColor.
|
inlineprotectedinherited |
Helper function to set the fill status.
|
inlineprotectedinherited |
Helper function to set the stroke status.
|
inline |
Shift the position of this shape to a point.
|
inline |
Shift the position of this shape to coordinates.
|
inline |
Change the fill color of this shape.
|
inline |
Change the stroke color of this shape.
|
inline |
Setup details needed before drawing lines.
|
inlineprotectedinherited |
Helper function to set the stroke status.
|
protected |
Internal color to fill shape with.
|
protected |
Border color for shape.
|
protected |
How wide should lines be?
|
protected |
Anchor point for this shape.