DGtal 1.4.0
|
A piece of text. More...
#include <Board/Shapes.h>
Public Member Functions | |
Text (double x, double y, const std::string &text, const Fonts::Font font, double size, DGtal::Color color=DGtal::Color::Black, int depthValue=-1) | |
Text (double x, double y, const std::string &text, const Fonts::Font font, const std::string &svgFont, double size, DGtal::Color color=DGtal::Color::Black, int depthValue=-1) | |
const std::string & | name () const |
Point | center () const |
Text & | rotate (double angle, const Point ¢er) |
Text | rotated (double angle, const Point ¢er) const |
Text & | rotate (double angle) |
Text | rotated (double angle) const |
Text & | translate (double dx, double dy) |
Text | translated (double dx, double dy) const |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Text | scaled (double sx, double sy) const |
Text | 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 | flushCairo (cairo_t *cr, const TransformCairo &transform) const |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const |
Rect | boundingBox () const |
Text * | clone () 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 |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
Rect | bbox () |
Shape & | operator-- () |
Shape & | operator++ () |
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 | _position |
std::string | _text |
Fonts::Font | _font |
std::string | _svgFont |
double | _angle |
double | _size |
double | _xScale |
double | _yScale |
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 |
void | setCairoDashStyle (cairo_t *cr, LineStyle type) const |
std::string | tikzProperties (const TransformTikZ &transform) const |
|
inline |
Create a Text sctucture.
x | x |
y | y |
text | text |
font | font |
size | The font size expressed in 1/72 inches. |
color | color |
depthValue | depth |
Definition at line 1588 of file Board/Shapes.h.
Referenced by clone(), rotated(), rotated(), scaled(), scaled(), and translated().
|
inline |
Create a Text sctucture.
x | x |
y | y |
text | text |
font | font |
svgFont | The font family for an SVG file. (E.g. "Verdana, Arial" or "'Time New Roman', Serif" ) |
size | The font size expressed in 1/72 inches. |
color | color |
depthValue | depth |
Definition at line 1613 of file Board/Shapes.h.
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Definition at line 2759 of file Shapes.cpp.
References _position, LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
Definition at line 2535 of file Shapes.cpp.
References _position.
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Definition at line 2623 of file Shapes.cpp.
References Text().
|
virtual |
Writes the cairo code of the shape in a cairo drawing context according to a transform.
cr | The cairo drawing context. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
Definition at line 2694 of file Shapes.cpp.
|
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. |
colormap | A colormap. |
Implements LibBoard::Shape.
Definition at line 2641 of file Shapes.cpp.
References _angle, LibBoard::Shape::_depth, _font, LibBoard::Shape::_penColor, _position, _size, _text, LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Writes the EPS code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
Definition at line 2628 of file Shapes.cpp.
References _angle, _font, LibBoard::Shape::_penColor, _position, _size, _text, DGtal::Color::postscript(), LibBoard::PSFontNames, LibBoard::Point::x, and LibBoard::Point::y.
|
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. |
Implements LibBoard::Shape.
Definition at line 2661 of file Shapes.cpp.
References _angle, LibBoard::Shape::_fillColor, _font, LibBoard::Shape::_penColor, _position, _size, _svgFont, _text, LibBoard::PSFontNames, DGtal::Color::svg(), DGtal::Color::svgAlpha(), LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Writes the TikZ code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
Definition at line 2701 of file Shapes.cpp.
References _font, _position, _text, LibBoard::Shape::tikzProperties(), LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Definition at line 2529 of file Shapes.cpp.
References _name.
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Definition at line 2560 of file Shapes.cpp.
References _angle.
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
Definition at line 2540 of file Shapes.cpp.
References _angle, _position, LibBoard::Point::norm(), and LibBoard::Point::rotate().
Text LibBoard::Text::rotated | ( | double | angle | ) | const |
Definition at line 2571 of file Shapes.cpp.
Definition at line 2554 of file Shapes.cpp.
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Definition at line 2598 of file Shapes.cpp.
|
virtual |
Scale the shape along the x an y axis.
sx | The scale factor along the x axis. |
sy | The scale factor along the y axis. |
Implements LibBoard::Shape.
Definition at line 2590 of file Shapes.cpp.
|
virtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
Definition at line 2617 of file Shapes.cpp.
References _position.
Text LibBoard::Text::scaled | ( | double | s | ) | const |
Definition at line 2611 of file Shapes.cpp.
References Text().
Text LibBoard::Text::scaled | ( | double | sx, |
double | sy ) const |
Definition at line 2605 of file Shapes.cpp.
References Text().
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
Definition at line 2577 of file Shapes.cpp.
References _position.
Text LibBoard::Text::translated | ( | double | dx, |
double | dy ) const |
Definition at line 2584 of file Shapes.cpp.
References Text().
|
protected |
Definition at line 1694 of file Board/Shapes.h.
Referenced by flushFIG(), flushPostscript(), flushSVG(), rotate(), and rotate().
|
protected |
Definition at line 1692 of file Board/Shapes.h.
Referenced by flushFIG(), flushPostscript(), flushSVG(), and flushTikZ().
|
staticprivate |
The generic name of the shape.
Definition at line 1687 of file Board/Shapes.h.
Referenced by name().
|
protected |
Definition at line 1690 of file Board/Shapes.h.
Referenced by boundingBox(), center(), flushFIG(), flushPostscript(), flushSVG(), flushTikZ(), rotate(), scaleAll(), and translate().
|
protected |
Definition at line 1695 of file Board/Shapes.h.
Referenced by flushFIG(), flushPostscript(), and flushSVG().
|
protected |
Definition at line 1693 of file Board/Shapes.h.
Referenced by flushSVG().
|
protected |
Definition at line 1691 of file Board/Shapes.h.
Referenced by flushFIG(), flushPostscript(), flushSVG(), and flushTikZ().
|
protected |
Definition at line 1696 of file Board/Shapes.h.
|
protected |
Definition at line 1697 of file Board/Shapes.h.