Board  0.6.devel
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Macros
LibBoard::Rectangle Struct Reference

#include <Shapes.h>

Inheritance diagram for LibBoard::Rectangle:
Collaboration diagram for LibBoard::Rectangle:

Public Member Functions

 Rectangle (double x, double y, double width, double height, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 Rectangle (const Rect &rect, DGtal::Color penColor, DGtal::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< DGtal::Color, int > &colormap) const
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const
Rectangleclone () const
- Public Member Functions inherited from LibBoard::Polyline
 Polyline (const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 Polyline (const Path &path, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 Polyline (bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
Point center () const
Polylineoperator<< (const Point &p)
Pointoperator[] (const unsigned int n)
Polylinerotate (double angle, const Point &center)
Polylinerotate (double angle)
Polylinetranslate (double dx, double dy)
Shapescale (double sx, double sy)
Shapescale (double s)
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
Rect boundingBox () const
- Public Member Functions inherited from LibBoard::Shape
 Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth)
virtual ~Shape ()
bool filled () const
ShaperotateDeg (double angle, const Point &center)
ShaperotateDeg (double angle)
Rect bbox ()
Shapeoperator-- ()
Shapeoperator++ ()
int depth () const
virtual void depth (int)
virtual void shiftDepth (int shift)
const DGtal::Color & penColor () const
const DGtal::Color & fillColor () const

Protected Attributes

bool _isRectangle
- Protected Attributes inherited from LibBoard::Polyline
Path _path
- Protected Attributes inherited from LibBoard::Shape
int _depth
DGtal::Color _penColor
DGtal::Color _fillColor
double _lineWidth
LineStyle _lineStyle
LineCap _lineCap
LineJoin _lineJoin

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,
DGtal::Color  penColor,
DGtal::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,
DGtal::Color  penColor,
DGtal::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< DGtal::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:
streamThe output stream.
transformA 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().

void LibBoard::Rectangle::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
virtual

Writes the TikZ code of the shape in a stream according to a transform.

Parameters:
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::Image.

References LibBoard::Shape::tikzProperties().

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

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:
angleThe rotation angle.
centerThe 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:
angleThe 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:
sThe scaling factor.

Reimplemented from LibBoard::Polyline.

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

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

Returns a scaled copy of the arrow.

Parameters:
sxScale factor along the x axis.
syScale factor along the y axis.
Returns:
A scaled copy of the arrow.

Reimplemented from LibBoard::Polyline.

References Rectangle().

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

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:
dxThe shift along the x axis.
dyThe 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

bool LibBoard::Rectangle::_isRectangle
protected
const std::string LibBoard::Rectangle::_name
staticprivate

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: