#include <Shapes.h>
Public Member Functions | |
Rectangle (double x, double y, double width, double height, Color penColor, Color fillColor, float lineWidth, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
Rectangle (const Rect &rect, Color penColor, Color fillColor, float lineWidth, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
const std::string & | name () const |
double | x () const |
double | y () const |
double | width () |
double | height () |
Point | topLeft () |
Point | topRight () |
Point | bottomLeft () |
Point | bottomRight () |
Rectangle | rotated (double angle, const Point ¢er) const |
Rectangle | rotated (double angle) const |
Rectangle | translated (double dx, double dy) const |
Rectangle | scaled (double sx, double sy) const |
Rectangle | scaled (double s) const |
void | scaleAll (double s) |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
Shape * | clone () const |
Protected Attributes | |
bool | _isRectangle |
The rectangle structure.
examples/arrows.cpp, examples/ellipse.cpp, examples/example4.cpp, and examples/ruler.cpp.
const std::string & LibBoard::Rectangle::name | ( | ) | const [virtual] |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Polyline.
Returns a copy of the arrow, rotated around a given rotation center.
angle | The rotation angle. | |
center | The center of rotation. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::_points.
Rectangle LibBoard::Rectangle::rotated | ( | double | angle | ) | const |
Returns a copy of the arrow, rotated around its center.
angle | The angle of rotation. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::center(), and LibBoard::Polyline::rotate().
Rectangle LibBoard::Rectangle::translated | ( | double | dx, | |
double | dy | |||
) | const |
Returns a translated copy of the arrow.
dx | The shift along the x axis. | |
dy | The shift along the y axis. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::translate().
Rectangle LibBoard::Rectangle::scaled | ( | double | sx, | |
double | sy | |||
) | const |
Returns a scaled copy of the arrow.
sx | Scale factor along the x axis. | |
sy | Scale factor along the y axis. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::scale().
void LibBoard::Rectangle::scaleAll | ( | double | s | ) | [virtual] |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Reimplemented from LibBoard::Polyline.
void LibBoard::Rectangle::flushFIG | ( | std::ostream & | stream, | |
const TransformFIG & | transform, | |||
std::map< Color, int > & | colormap | |||
) | const [virtual] |
Writes the FIG code of the shape in a stream according to a transform.
stream | The output stream. | |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::Polyline::flushFIG(), LibBoard::TransformFIG::mapDepth(), LibBoard::TransformFIG::mapWidth(), LibBoard::Transform::mapX(), LibBoard::TransformFIG::mapY(), and LibBoard::Color::valid().
Referenced by LibBoard::Board::saveFIG().
void LibBoard::Rectangle::flushSVG | ( | std::ostream & | stream, | |
const TransformSVG & | transform | |||
) | const [virtual] |
Writes the SVG code of the shape in a stream according to a transform.
stream | The output stream. | |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::flushSVG(), LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Point::norm(), LibBoard::Transform::scale(), and LibBoard::Shape::svgProperties().
Referenced by LibBoard::Board::saveSVG().
Shape * LibBoard::Rectangle::clone | ( | ) | const [virtual] |