Public Member Functions | Protected Attributes | Static Private Attributes

LibBoard::Rectangle Struct Reference

A rectangle. More...

#include <Shapes.h>

Inheritance diagram for LibBoard::Rectangle:
Inheritance graph
[legend]
Collaboration diagram for LibBoard::Rectangle:
Collaboration graph
[legend]

Public Member Functions

 Rectangle (double x, double y, double width, double height, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 Rectangle (const Rect &rect, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, 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 &center) 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
Rectangleclone () const

Protected Attributes

bool _isRectangle

Static Private Attributes

static const std::string _name

Detailed Description

A rectangle.

The rectangle structure.


Constructor & Destructor Documentation

LibBoard::Rectangle::Rectangle ( double  x,
double  y,
double  width,
double  height,
Color  penColor,
Color  fillColor,
double  lineWidth,
const LineStyle  style = SolidStyle,
const LineCap  cap = ButtCap,
const LineJoin  join = MiterJoin,
int  depth = -1 
) [inline]

Referenced by clone(), rotated(), scaled(), and translated().

LibBoard::Rectangle::Rectangle ( const Rect rect,
Color  penColor,
Color  fillColor,
double  lineWidth,
const LineStyle  style = SolidStyle,
const LineCap  cap = ButtCap,
const LineJoin  join = MiterJoin,
int  depth = -1 
) [inline]

Member Function Documentation

Point LibBoard::Rectangle::bottomLeft (  )  [inline]
Point LibBoard::Rectangle::bottomRight (  )  [inline]
Rectangle * LibBoard::Rectangle::clone (  )  const [virtual]

Return a copy of the shape.

Returns:

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::Image.

References Rectangle().

void LibBoard::Rectangle::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const [virtual]
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.

Parameters:
stream The output stream.
transform A 2D transform to be applied.

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::Image.

References LibBoard::Polyline::_path, M_PI, LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Point::norm(), LibBoard::Transform::scale(), LibBoard::Shape::svgProperties(), x(), and y().

Referenced by LibBoard::Board::saveSVG().

double LibBoard::Rectangle::height (  )  [inline]
const std::string & LibBoard::Rectangle::name (  )  const [virtual]

Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)

Returns:

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::Image.

References _name.

Rectangle LibBoard::Rectangle::rotated ( double  angle,
const Point center 
) const

Returns a copy of the arrow, rotated around a given rotation center.

Parameters:
angle The rotation angle.
center The center of rotation.
Returns:
The rotated copy of the line.

Reimplemented from LibBoard::Polyline.

References Rectangle().

Rectangle LibBoard::Rectangle::rotated ( double  angle  )  const

Returns a copy of the arrow, rotated around its center.

Parameters:
angle The angle of rotation.
Returns:
A copy of the lines, rotated around its center by the given angle.

Reimplemented from LibBoard::Polyline.

References LibBoard::Polyline::center(), and Rectangle().

void LibBoard::Rectangle::scaleAll ( double  s  )  [virtual]

Scales all the values (positions, dimensions, etc.) associated with the shape.

Parameters:
s The scaling factor.

Reimplemented from LibBoard::Polyline.

References LibBoard::Polyline::_path, and LibBoard::Path::scaleAll().

Rectangle LibBoard::Rectangle::scaled ( double  s  )  const

Reimplemented from LibBoard::Polyline.

References Rectangle().

Rectangle LibBoard::Rectangle::scaled ( double  sx,
double  sy 
) const

Returns a scaled copy of the arrow.

Parameters:
sx Scale factor along the x axis.
sy Scale factor along the y axis.
Returns:
A scaled copy of the arrow.

Reimplemented from LibBoard::Polyline.

References Rectangle().

Point LibBoard::Rectangle::topLeft (  )  [inline]
Point LibBoard::Rectangle::topRight (  )  [inline]
Rectangle LibBoard::Rectangle::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the arrow.

Parameters:
dx The shift along the x axis.
dy The shift along the y axis.
Returns:
A translated copy of the line.

Reimplemented from LibBoard::Polyline.

References Rectangle().

double LibBoard::Rectangle::width (  )  [inline]
double LibBoard::Rectangle::x (  )  const [inline]
double LibBoard::Rectangle::y (  )  const [inline]

Field Documentation

const std::string LibBoard::Rectangle::_name [static, private]

The generic name of the shape.

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::Image.

Referenced by name().


The documentation for this struct was generated from the following files: