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

#include <Shapes.h>

Inheritance diagram for LibBoard::Ellipse:
Collaboration diagram for LibBoard::Ellipse:

Public Member Functions

 Ellipse (double x, double y, double xRadius, double yRadius, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle lineStyle=SolidStyle, int depthValue=-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
Shapescale (double sx, double sy)
Shapescale (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< DGtal::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 (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

Point _center
double _xRadius
double _yRadius
double _angle
bool _circle
- 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

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.


Constructor & Destructor Documentation

LibBoard::Ellipse::Ellipse ( double  x,
double  y,
double  xRadius,
double  yRadius,
DGtal::Color  pen,
DGtal::Color  fill,
double  lineWidth,
const LineStyle  lineStyle = SolidStyle,
int  depthValue = -1 
)
inline

References _angle, M_PI, and M_PI_2.

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


Member Function Documentation

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

Returns the bounding box of the figure.

Returns:
The rectangle of the bounding box.

Implements LibBoard::Shape.

References _angle, _center, _xRadius, _yRadius, M_PI, LibBoard::Point::x, and LibBoard::Point::y.

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

Returns the gravity center of the shape.

Returns:
The center of the shape.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References _center.

Referenced by rotate(), and rotated().

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

Return a copy of the shape.

Returns:

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References Ellipse().

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

Writes 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.

Reimplemented in LibBoard::Arc.

References _angle, _center, _circle, LibBoard::Shape::_fillColor, LibBoard::Shape::_penColor, _xRadius, _yRadius, LibBoard::Shape::filled(), M_PI, LibBoard::Transform::mapX(), LibBoard::TransformEPS::mapY(), LibBoard::Shape::postscriptProperties(), LibBoard::Transform::scale(), LibBoard::Point::x, and LibBoard::Point::y.

void LibBoard::Ellipse::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.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Arc, and LibBoard::Circle.

References _angle, _center, _xRadius, _yRadius, M_PI, LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Transform::scale(), LibBoard::Shape::svgProperties(), LibBoard::Point::x, and LibBoard::Point::y.

void LibBoard::Ellipse::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.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Arc, and LibBoard::Circle.

References _angle, _center, _xRadius, _yRadius, M_PI, LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Transform::scale(), LibBoard::Shape::tikzProperties(), LibBoard::Point::x, and LibBoard::Point::y.

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::Arc, and LibBoard::Circle.

References _name.

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 _angle, _center, _xRadius, LibBoard::Point::rotated(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by rotate().

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:

Reimplemented in LibBoard::Circle.

References Ellipse().

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

Reimplemented in LibBoard::Circle.

References center(), and Ellipse().

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

Scale the shape along the x an y axis.

Parameters:
sxThe scale factor along the x axis.
syThe scale factor along the y axis.
Returns:
The shape itself.

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References _angle, _xRadius, _yRadius, and M_PI.

Referenced by scale().

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

Scale the shape along both axis.

Parameters:
sThe scale factor along both axis.
Returns:
The shape itself.

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.

References _center, _xRadius, and _yRadius.

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

Reimplemented in LibBoard::Circle.

References Ellipse().

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

Reimplemented in LibBoard::Circle.

References Ellipse().

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

Translate the shape by a given offset.

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

Implements LibBoard::Shape.

Reimplemented in LibBoard::Circle.

References _center.

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

Reimplemented in LibBoard::Circle.

References Ellipse().


Field Documentation

double LibBoard::Ellipse::_angle
protected
const std::string LibBoard::Ellipse::_name
staticprivate

The generic name of the shape.

Reimplemented from LibBoard::Shape.

Reimplemented in LibBoard::Arc, and LibBoard::Circle.

Referenced by name().

double LibBoard::Ellipse::_yRadius
protected

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