14 #ifndef _BOARD_SHAPES_H_
15 #define _BOARD_SHAPES_H_
29 #include "DGtal/io/Color.h"
37 #define M_PI 3.14159265358979323846
41 #define M_PI_2 1.57079632679489661923
87 virtual const std::string &
name()
const;
167 virtual Shape &
scale(
double sx,
double sy ) = 0;
214 virtual void scaleAll(
double s ) = 0;
234 virtual void flushFIG( std::ostream & stream,
236 std::map<DGtal::Color,int> & colormap )
const = 0;
245 virtual void flushSVG( std::ostream & stream,
256 virtual void flushCairo( cairo_t *cr,
257 const TransformCairo & transform )
const = 0;
267 virtual void flushTikZ( std::ostream & stream,
270 inline int depth()
const;
272 virtual void depth(
int );
276 inline const DGtal::Color &
penColor()
const;
278 inline const DGtal::Color &
fillColor()
const;
316 void setCairoDashStyle(cairo_t *cr,
LineStyle type)
const;
356 inline const DGtal::Color &
371 return rotate( angle * (
M_PI / 180.0 ), aCenter );
390 inline Dot(
double x,
double y,
400 const std::string &
name()
const;
476 Dot scaled(
double sx,
double sy )
const;
491 void flushFIG( std::ostream & stream,
493 std::map<DGtal::Color,int> & colormap )
const;
495 void flushSVG( std::ostream & stream,
499 void flushCairo( cairo_t *cr,
500 const TransformCairo & transform )
const;
535 inline Line(
double x1,
double y1,
double x2,
double y2,
548 const std::string &
name()
const;
614 void flushFIG( std::ostream & stream,
616 std::map<DGtal::Color,int> & colormap )
const;
618 void flushSVG( std::ostream & stream,
622 void flushCairo( cairo_t *cr,
623 const TransformCairo & transform )
const;
664 inline Arrow(
double x1,
double y1,
double x2,
double y2,
677 const std::string &
name()
const;
723 void flushFIG( std::ostream & stream,
725 std::map<DGtal::Color,int> & colormap )
const;
726 void flushSVG( std::ostream & stream,
730 void flushCairo( cairo_t *cr,
731 const TransformCairo & transform )
const;
748 inline Polyline(
const std::vector<Point> & points,
758 DGtal::Color penColor, DGtal::Color fillColor,
765 inline Polyline(
bool closed, DGtal::Color penColor, DGtal::Color fillColor,
777 const std::string &
name()
const;
864 void flushFIG( std::ostream & stream,
866 std::map<DGtal::Color,int> & colormap )
const;
868 void flushSVG( std::ostream & stream,
872 void flushCairo( cairo_t *cr,
873 const TransformCairo & transform )
const;
905 DGtal::Color penColor, DGtal::Color fillColor,
917 const std::string &
name()
const;
978 void flushFIG( std::ostream & stream,
980 std::map<DGtal::Color,int> & colormap )
const;
982 void flushSVG( std::ostream & stream,
986 void flushCairo( cairo_t *cr,
987 const TransformCairo & transform )
const;
1023 std::string fileName,
int depthValue,
double alpha=1.0 );
1029 const std::string &
name()
const;
1033 void flushFIG( std::ostream & stream,
1035 std::map<DGtal::Color,int> & colormap )
const;
1037 void flushSVG( std::ostream & stream,
1041 void flushCairo( cairo_t *cr,
1042 const TransformCairo & transform )
const;
1076 int depthValue = -1 )
1077 :
Polyline( std::vector<
Point>(), true, pen, fill, lineWidth, style, cap, join, depthValue ) {
1084 const double x2,
const double y2,
1085 const double x3,
const double y3,
1092 int depthValue = -1 )
1093 :
Polyline( std::vector<
Point>(), true, pen, fill, lineWidth, style, cap, join, depthValue ) {
1095 _path << Point( x2, y2 );
1096 _path << Point( x3, y3 );
1104 const std::string &
name()
const;
1147 const Point & p1,
const DGtal::Color & color1,
1148 const Point & p2,
const DGtal::Color & color2,
1153 const Point & p1,
float brightness1,
1154 const Point & p2,
float brightness2,
1164 const std::string &
name()
const;
1228 void flushFIG( std::ostream & stream,
1230 std::map<DGtal::Color,int> & colormap )
const;
1232 void flushSVG( std::ostream & stream,
1236 void flushCairo( cairo_t *cr,
1237 const TransformCairo & transform )
const;
1262 double xRadius,
double yRadius,
1263 DGtal::Color pen, DGtal::Color fill,
1266 int depthValue = -1 )
1281 const std::string &
name()
const;
1347 void flushFIG( std::ostream & stream,
1349 std::map<DGtal::Color,int> & colormap )
const;
1351 void flushSVG( std::ostream & stream,
1355 void flushCairo( cairo_t *cr,
1356 const TransformCairo & transform )
const;
1384 DGtal::Color pen, DGtal::Color fill,
1387 int depthValue = -1 )
1388 :
Ellipse( x, y, radius, radius, pen, fill, lineWidth, style, depthValue )
1396 const std::string &
name()
const;
1428 void flushSVG( std::ostream & stream,
1432 void flushCairo( cairo_t *cr,
1433 const TransformCairo & transform )
const;
1451 Arc(
double x,
double y,
double radius,
double angle1,
double angle2,
bool negative,
1452 DGtal::Color pen, DGtal::Color fill,
1455 int depthValue = -1 )
1456 :
Circle( x, y, radius, pen, fill, lineWidth, style, depthValue )
1464 const std::string &
name()
const;
1473 void flushCairo( cairo_t *cr,
1474 const TransformCairo & transform )
const;
1511 const std::string & text,
1514 DGtal::Color color = DGtal::Color::Black,
1515 int depthValue = -1 )
1537 const std::string & text,
1539 const std::string & svgFont,
1541 DGtal::Color color = DGtal::Color::Black,
1542 int depthValue = -1 )
1555 const std::string &
name()
const;
1590 void flushFIG( std::ostream & stream,
1592 std::map<DGtal::Color,int> & colormap )
const;
1594 void flushSVG( std::ostream & stream,
1598 void flushCairo( cairo_t *cr,
1599 const TransformCairo & transform )
const;
1639 #include "Shapes.ih"