Board  0.9.2
Public Member Functions | Protected Attributes | List of all members
LibBoard::Ellipse Struct Reference

An ellipse. More...

#include <Shapes.h>

Inheritance diagram for LibBoard::Ellipse:
LibBoard::Shape LibBoard::Circle

Public Member Functions

 Ellipse (double x, double y, double xRadius, double yRadius, Color penColor, Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, int depth=-1)
 
const std::string & name () const
 
Point center () const
 
Ellipserotate (double angle, const Point &center)
 
Ellipse rotated (double angle, const Point &center) const
 
Ellipserotate (double angle)
 
Ellipse rotated (double angle) const
 
Ellipsetranslate (double dx, double dy)
 
Ellipse translated (double dx, double dy) const
 
Ellipsescale (double sx, double sy)
 
Ellipsescale (double s)
 
Ellipse scaled (double sx, double sy) const
 
Ellipse scaled (double s) const
 
void scaleAll (double s)
 
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
 
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
 
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
 
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const
 
Rect boundingBox () const
 
Ellipseclone () const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape (Color penColor, 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)
 
ShapemoveCenter (double x, double y)
 
ShapemoveCenter (Point p)
 
Rect bbox () const
 
Shapeoperator-- ()
 
Shapeoperator++ ()
 
int depth () const
 
virtual void depth (int)
 
virtual void shiftDepth (int shift)
 
const ColorpenColor () const
 
const ColorfillColor () const
 

Protected Attributes

Point _center
 
double _xRadius
 
double _yRadius
 
double _angle
 
bool _circle
 
- Protected Attributes inherited from LibBoard::Shape
int _depth
 
Color _penColor
 
Color _fillColor
 
double _lineWidth
 
LineStyle _lineStyle
 
LineCap _lineCap
 
LineJoin _lineJoin
 

Additional Inherited Members

- Public Types inherited from LibBoard::Shape
enum  LineCap { ButtCap = 0, RoundCap, SquareCap }
 
enum  LineJoin { MiterJoin = 0, RoundJoin, BevelJoin }
 
enum  LineStyle {
  SolidStyle = 0, DashStyle, DotStyle, DashDotStyle,
  DashDotDotStyle, DashDotDotDotStyle
}
 
- Protected Member Functions inherited from LibBoard::Shape
std::string svgProperties (const TransformSVG &transform) const
 
std::string postscriptProperties () const
 
std::string tikzProperties (const TransformTikZ &transform) const
 

Detailed Description

An ellipse.

The ellipse structure.

Examples:
examples/ellipse.cpp, examples/example4.cpp, and examples/scale_ellipse.cpp.

Member Function Documentation

Rect LibBoard::Ellipse::boundingBox ( ) const
virtual

Compute the bounding box of the figure.

Returns
The rectangle of the bounding box.

Implements LibBoard::Shape.

References LibBoard::Point::x, and LibBoard::Point::y.

Point LibBoard::Ellipse::center ( ) const
virtual

Returns the center of the shape.

Returns
The center of the shape, i.e. the center of its bounding box.

Reimplemented from LibBoard::Shape.

Reimplemented in LibBoard::Circle.

Referenced by rotate(), and rotated().

Ellipse * LibBoard::Ellipse::clone ( ) const
virtual

Return a copy of the shape.

Returns
A copy of the shape.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

void LibBoard::Ellipse::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const
virtual

Write the FIG code of the shape in a stream according to a transform.

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

Implements LibBoard::Shape.

References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::Point::x, and LibBoard::Point::y.

void LibBoard::Ellipse::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
virtual

Write the EPS code of the shape in a stream according to a transform.

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

Implements LibBoard::Shape.

References LibBoard::Shape::_fillColor, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::Shape::postscriptProperties(), LibBoard::Point::x, and LibBoard::Point::y.

void LibBoard::Ellipse::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
virtual

Write the SVG code of the shape in a stream according to a transform.

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

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References LibBoard::Shape::svgProperties(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by LibBoard::Circle::flushSVG().

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

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

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

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References LibBoard::Shape::tikzProperties(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by LibBoard::Circle::flushTikZ().

const std::string & LibBoard::Ellipse::name ( ) const
virtual

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

Returns

Reimplemented from LibBoard::Shape.

Reimplemented in LibBoard::Circle.

Ellipse & LibBoard::Ellipse::rotate ( double  angle,
const Point center 
)
virtual

Rotate the shape around a given center of rotation.

Parameters
angleThe rotation angle in radian.
centerThe center of rotation.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References LibBoard::Point::rotated(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by rotate(), LibBoard::Circle::rotate(), and rotated().

Ellipse & LibBoard::Ellipse::rotate ( double  angle)
virtual

Rotate the shape around its center.

Parameters
angleThe rotation angle in radian.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References center(), and rotate().

Ellipse LibBoard::Ellipse::rotated ( double  angle,
const Point center 
) const
Parameters
angle
center
Returns

References rotate().

Ellipse LibBoard::Ellipse::rotated ( double  angle) const
Parameters
angle
Returns

References center(), and rotate().

Ellipse & LibBoard::Ellipse::scale ( double  sx,
double  sy 
)
virtual

Scale the polyline, given two scaling factors.

Parameters
sxScaling factor along the x axis.
syScaling factor along the y axis.
Returns
A reference to the polyline itself, once scaled.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

Referenced by scale(), LibBoard::Circle::scale(), and scaled().

Ellipse & LibBoard::Ellipse::scale ( double  s)
virtual

Scale the ellipse, given a scaling factor.

Parameters
sScaling factor.
Returns
A reference to the ellipse itself, once scaled.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References scale().

void LibBoard::Ellipse::scaleAll ( double  s)
virtual

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

Parameters
sThe scaling factor.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

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

Returns a scaled copy of the ellipse.

Parameters
sxThe scaling factor along the x axis.
syThe scaling factor along the y axis.
Returns
A scaled copy of the ellipse.

References scale().

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

Returns a scaled copy of the ellipse.

Parameters
sThe scaling factor.
Returns
A scaled copy of the ellipse.

References scale().

Ellipse & LibBoard::Ellipse::translate ( double  dx,
double  dy 
)
virtual

Translate the ellipse by a given offset.

Parameters
dxThe x offset.
dyThe y offset.
Returns
A reference to the ellipse itself.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

Referenced by translated().

Ellipse LibBoard::Ellipse::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the ellipse.

Parameters
dxShift of the first coordinate.
dyShift of the second coordinate.
Returns
A copy of the ellipse, translated.

References translate().


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