DGtal  0.9.3beta
Public Member Functions | Static Private Attributes
LibBoard::Triangle Struct Reference

#include <Board/Shapes.h>

Inheritance diagram for LibBoard::Triangle:
[legend]
Collaboration diagram for LibBoard::Triangle:
[legend]

Public Member Functions

 Triangle (const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
 
 Triangle (const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
 
const std::string & name () const
 
Triangle rotated (double angle) const
 
Triangle translated (double dx, double dy) const
 
Triangle scaled (double sx, double sy) const
 
Triangle scaled (double s) const
 
Triangleclone () 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)
 
Polyline rotated (double angle, const Point &center) const
 
Polylinerotate (double angle)
 
Polyline rotated (double angle) const
 
Polylinetranslate (double dx, double dy)
 
Polyline translated (double dx, double dy) const
 
Shapescale (double sx, double sy)
 
Shapescale (double s)
 
Polyline scaled (double sx, double sy) const
 
Polyline 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
 
- 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::ColorpenColor () const
 
const DGtal::ColorfillColor () const
 

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

Detailed Description

A triangle. Basically a Polyline with a convenient constructor.

The Triangle structure.

Definition at line 1085 of file Board/Shapes.h.

Constructor & Destructor Documentation

LibBoard::Triangle::Triangle ( const Point p1,
const Point p2,
const Point p3,
DGtal::Color  pen,
DGtal::Color  fill,
double  lineWidth,
const LineStyle  style = SolidStyle,
const LineCap  cap = ButtCap,
const LineJoin  join = MiterJoin,
int  depthValue = -1 
)
inline

Definition at line 1087 of file Board/Shapes.h.

References LibBoard::Polyline::_path.

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

1095  : Polyline( std::vector<Point>(), true, pen, fill, lineWidth, style, cap, join, depthValue ) {
1096  _path << p1;
1097  _path << p2;
1098  _path << p3;
1099  }
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)
LibBoard::Triangle::Triangle ( const double  x1,
const double  y1,
const double  x2,
const double  y2,
const double  x3,
const double  y3,
DGtal::Color  pen,
DGtal::Color  fill,
double  lineWidth,
const LineStyle  style = SolidStyle,
const LineCap  cap = ButtCap,
const LineJoin  join = MiterJoin,
int  depthValue = -1 
)
inline

Definition at line 1101 of file Board/Shapes.h.

References LibBoard::Polyline::_path.

1111  : Polyline( std::vector<Point>(), true, pen, fill, lineWidth, style, cap, join, depthValue ) {
1112  _path << Point( x1, y1 );
1113  _path << Point( x2, y2 );
1114  _path << Point( x3, y3 );
1115  }
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)

Member Function Documentation

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

Return a copy of the shape.

Returns
copye of the shape.

Reimplemented from LibBoard::Polyline.

Definition at line 2375 of file Shapes.cpp.

References Triangle().

2375  {
2376  return new Triangle(*this);
2377 }
Triangle(const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
const std::string & LibBoard::Triangle::name ( ) const
virtual

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

Returns
object name

Reimplemented from LibBoard::Polyline.

Reimplemented in LibBoard::QuadraticBezierCurve.

Definition at line 2345 of file Shapes.cpp.

References _name.

2346 {
2347  return _name;
2348 }
static const std::string _name
Triangle LibBoard::Triangle::rotated ( double  angle) const

Definition at line 2351 of file Shapes.cpp.

References Triangle().

2352 {
2353  return static_cast<Triangle &>( Triangle( *this ).rotate( angle ) );
2354 }
Triangle(const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
Triangle LibBoard::Triangle::scaled ( double  sx,
double  sy 
) const

Returns a scaled copy of the triangle.

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

Definition at line 2363 of file Shapes.cpp.

References Triangle().

2364 {
2365  return static_cast<Triangle &>( Triangle( *this ).scale( sx, sy ) );
2366 }
Triangle(const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
Triangle LibBoard::Triangle::scaled ( double  s) const

Definition at line 2369 of file Shapes.cpp.

References Triangle().

2370 {
2371  return static_cast<Triangle &>( Triangle( *this ).scale( s ) );
2372 }
Triangle(const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)
Triangle LibBoard::Triangle::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the triangle.

Parameters
dxThe shift along the x axis.
dyThe shift along the y axis.
Returns
A translated copy of the line.

Definition at line 2357 of file Shapes.cpp.

References Triangle().

2358 {
2359  return static_cast<Triangle &>( Triangle( *this ).translate( dx, dy ) );
2360 }
Triangle(const Point &p1, const Point &p2, const Point &p3, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depthValue=-1)

Field Documentation

const std::string LibBoard::Triangle::_name
staticprivate

The generic name of the shape.

Definition at line 1151 of file Board/Shapes.h.

Referenced by name().


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