14 #include "Board/Rect.h" 15 #include "Board/Shapes.h" 16 #include "Board/Tools.h" 17 #include "Board/PSFonts.h" 26 #define M_PI 3.14159265358979323846 35 const char * xFigDashStylesPS[] = {
39 " [4.5 2.3 1.5 2.3] 0 sd ",
40 " [4.5 2.0 1.5 1.5 1.5 2.0] 0 sd ",
41 " [4.5 1.8 1.5 1.4 1.5 1.4 1.5 1.8 ] 0 sd " 44 const char * xFigDashStylesSVG[] = {
46 "stroke-dasharray:1,1;stroke-dashoffset:0",
47 "stroke-dasharray:1.5,4.5;stroke-dashoffset:45",
48 "stroke-dasharray:4.5,2.3,1.5,2.3;stroke-dashoffset:0",
49 "stroke-dasharray:4.5,2.0,1.5,1.5,1.5,2.0;stroke-dashoffset;0",
50 "stroke-dasharray:4.5,1.8,1.5,1.4,1.5,1.4,1.5,1.8;stroke-dashoffset:0" 53 const char * xFigDashStylesTikZ[] = {
55 "dash pattern=on 1pt off 1pt,",
59 "dash pattern=on 2pt off 3pt on 4pt off 4pt," 64 cairo_line_cap_t cairoLineCap[] = {
70 cairo_line_join_t cairoLineJoin[] = {
71 CAIRO_LINE_JOIN_MITER,
72 CAIRO_LINE_JOIN_ROUND,
76 #define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) 78 const double cairoSolidStyle[] = {1, 0};
const double cairoSolidStyle_offset = 0;
79 const double cairoDashStyle[] = {1, 1};
const double cairoDashStyle_offset = 0;
80 const double cairoDotStyle[] = {1.5, 4.5};
const double cairoDotStyle_offset = 45;
81 const double cairoDashDotStyle[] = {4.5, 2.3, 1.5, 2.3};
const double cairoDashDotStyle_offset = 0;
82 const double cairoDashDotDotStyle[] = {4.5, 2.0, 1.5, 1.5, 1.5, 2.0};
const double cairoDashDotDotStyle_offset = 0;
83 const double cairoDashDotDotDotStyle[] = {4.5, 1.8, 1.5, 1.4, 1.5, 1.4, 1.5, 1.8};
const double cairoDashDotDotDotStyle_offset = 0;
112 static const char * capStrings[3] = {
"butt",
"round",
"square" };
113 static const char * joinStrings[3] = {
"miter",
"round",
"bevel" };
114 std::stringstream str;
119 <<
" style=\"stroke-linecap:" << capStrings[
_lineCap ]
120 <<
";stroke-linejoin:" << joinStrings[
_lineJoin ];
122 str <<
";" << xFigDashStylesSVG[
_lineStyle ];
130 <<
" stroke=\"none\"" 131 <<
" stroke-width=\"0\"" 132 <<
" style=\"stroke-linecap:round;stroke-linejoin:round;" 143 std::stringstream str;
159 cairo_set_dash (cr, cairoSolidStyle, ARRAY_SIZE(cairoSolidStyle), cairoSolidStyle_offset);
break;
161 cairo_set_dash (cr, cairoDashStyle, ARRAY_SIZE(cairoDashStyle), cairoDashStyle_offset);
break;
163 cairo_set_dash (cr, cairoDotStyle, ARRAY_SIZE(cairoDotStyle), cairoDotStyle_offset);
break;
165 cairo_set_dash (cr, cairoDashDotStyle, ARRAY_SIZE(cairoDashDotStyle), cairoDashDotStyle_offset);
break;
167 cairo_set_dash (cr, cairoDashDotDotStyle, ARRAY_SIZE(cairoDashDotDotStyle), cairoDashDotDotStyle_offset);
break;
169 cairo_set_dash (cr, cairoDashDotDotDotStyle, ARRAY_SIZE(cairoDashDotDotDotStyle), cairoDashDotDotDotStyle_offset);
break;
172 cairo_set_dash (cr, cairoSolidStyle, ARRAY_SIZE(cairoSolidStyle), cairoSolidStyle_offset);
180 static const char * capStrings[3] = {
"" ,
"line cap=round,",
"line cap=rect," };
181 static const char * joinStrings[3] = {
"" ,
"line join=round",
"line join=bevel" };
183 std::stringstream str;
220 return Point( _x, _y );
226 Point( _x, _y ).rotate( angle, rotCenter ).get( _x, _y );
233 return Dot(*this).
rotate( angle, rotCenter );
297 stream <<
"\n% Dot\n";
300 << transform.
mapX( _x ) <<
" " 301 << transform.
mapY( _y ) <<
" " 303 << transform.
mapX( _x ) <<
" " 304 << transform.
mapY( _y ) <<
" " 311 std::map<DGtal::Color,int> & colormap )
const 329 stream << static_cast<int>( transform.
mapX( _x ) ) <<
" " 330 << static_cast<int>( transform.
mapY( _y ) ) <<
" " 331 << static_cast<int>( transform.
mapX( _x ) ) <<
" " 332 << static_cast<int>( transform.
mapY( _y ) ) << std::endl;
339 stream <<
"<line x1=\"" << transform.
mapX( _x ) <<
"\"" 340 <<
" y1=\"" << transform.
mapY( _y ) <<
"\"" 341 <<
" x2=\"" << transform.
mapX( _x ) <<
"\"" 342 <<
" y2=\"" << transform.
mapY( _y ) <<
"\"" 344 <<
" />" << std::endl;
356 cairo_move_to (cr, transform.
mapX( _x ), transform.
mapY( _y ));
357 cairo_line_to (cr, transform.
mapX( _x ), transform.
mapY( _y ));
360 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
361 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
376 stream <<
"% FIXME: Dot::flushTikZ unimplemented" << std::endl;
382 return Rect( _x, _y, 0.0, 0.0 );
387 return new Dot(*
this);
404 return 0.5 *
Point( _x1 + _x2, _y1 + _y2 );
410 Point( _x1, _y1 ).rotate( angle, rotCenter ).get( _x1, _y1 );
411 Point( _x2, _y2 ).rotate( angle, rotCenter ).get( _x2, _y2 );
425 Point( _x1, _y1 ).rotate( angle, rotCenter ).get( res.
_x1, res.
_y1 );
426 Point( _x2, _y2 ).rotate( angle, rotCenter ).get( res.
_x2, res.
_y2 );
435 Point( _x1, _y1 ).rotate( angle, c ).get( res.
_x1, res.
_y1 );
436 Point( _x2, _y2 ).rotate( angle, c ).get( res.
_x2, res.
_y2 );
511 return new Line(*
this);
518 stream <<
"\n% Line\n";
521 << transform.
mapX( _x1 ) <<
" " 522 << transform.
mapY( _y1 ) <<
" " 524 << transform.
mapX( _x2 ) <<
" " 525 << transform.
mapY( _y2 ) <<
" " 532 std::map<DGtal::Color,int> & colormap )
const 548 stream <<
"-1 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 0 0 ";
552 stream << static_cast<int>( transform.
mapX( _x1 ) ) <<
" " 553 << static_cast<int>( transform.
mapY( _y1 ) ) <<
" " 554 << static_cast<int>( transform.
mapX( _x2 ) ) <<
" " 555 << static_cast<int>( transform.
mapY( _y2 ) ) << std::endl;
562 stream <<
"<line x1=\"" << transform.
mapX( _x1 ) <<
"\"" 563 <<
" y1=\"" << transform.
mapY( _y1 ) <<
"\"" 564 <<
" x2=\"" << transform.
mapX( _x2 ) <<
"\"" 565 <<
" y2=\"" << transform.
mapY( _y2 ) <<
"\"" 567 <<
" />" << std::endl;
579 cairo_move_to (cr, transform.
mapX( _x1 ), transform.
mapY( _y1 ));
580 cairo_line_to (cr, transform.
mapX( _x2 ), transform.
mapY( _y2 ));
583 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
584 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
598 << transform.
mapX( _x1 ) <<
',' << transform.
mapY( _y1 )
600 << transform.
mapX( _x2 ) <<
',' << transform.
mapY( _y2 )
601 <<
");" << std::endl;
609 rect.
width = _x1 - _x2;
612 rect.
width = _x2 - _x1;
641 return new Image(*
this);
647 std::map<DGtal::Color,int> & colormap )
const 661 <<
"-1 -1 0.000 0 0 -1 0 0 5" << std::endl <<
" 0 " 662 << _filename << std::endl;
663 _path.flushFIG( stream, transform );
674 stream <<
"<image x=\"" << transform.
mapX( _path[0].x ) <<
'"' 675 <<
" y=\"" << transform.
mapY( _path[0].y ) <<
'"' 676 <<
" width=\"" << transform.
scale( (_path[1] - _path[0]).norm() ) <<
'"' 677 <<
" height=\"" << transform.
scale( (_path[0] - _path[3]).norm() ) <<
'"' 678 <<
" xlink:href=\""<< _filename <<
"\" >" << std::endl
679 <<
" <title>My image</title>"<<std::endl
680 <<
" </image>" << std::endl;
691 cairo_surface_t *
image;
693 std::string extension = _filename.substr(_filename.find_last_of(
".") + 1);
694 ASSERT(extension==
"png");
695 image = cairo_image_surface_create_from_png (_filename.c_str());
696 assert(cairo_surface_status (image) == CAIRO_STATUS_SUCCESS);
697 w = cairo_image_surface_get_width (image);
698 h = cairo_image_surface_get_height (image);
701 cairo_translate (cr, transform.
mapX( _path[0].x ), transform.
mapY( _path[0].y ));
703 cairo_scale (cr, transform.
scale( (_path[1] - _path[0]).norm() )/w, transform.
scale( (_path[0] - _path[3]).norm() )/h);
706 cairo_set_source_surface (cr, image, 0, 0);
707 cairo_paint_with_alpha(cr, _alpha);
708 cairo_surface_destroy (image);
719 stream <<
"\\node [below right=0pt] at (" 720 << transform.
mapX( _path[0].x ) <<
"pt," 721 << transform.
mapY( _path[0].y ) <<
"pt) {\\pgfimage[" 722 <<
"width=" << transform.
scale( (_path[1] - _path[0]).norm() ) <<
"pt," 723 <<
"height=" << transform.
scale( (_path[0] - _path[3]).norm() ) <<
"pt," 724 <<
"]{" << _filename <<
"}};" << std::endl;
743 Point( _x1, _y1 ).rotate( angle, rotCenter ).get( res.
_x1, res.
_y1 );
744 Point( _x2, _y2 ).rotate( angle, rotCenter ).get( res.
_x2, res.
_y2 );
753 Point( _x1, _y1 ).rotate( angle, c ).get( res.
_x1, res.
_y1 );
754 Point( _x2, _y2 ).rotate( angle, c ).get( res.
_x2, res.
_y2 );
790 return new Arrow(*
this);
797 double dx = _x1 - _x2;
798 double dy = _y1 - _y2;
799 double norm = sqrt( dx*dx + dy*dy );
808 double ndx1 = dx*cos(0.3)-dy*sin(0.3);
809 double ndy1 = dx*sin(0.3)+dy*cos(0.3);
810 double ndx2 = dx*cos(-0.3)-dy*sin(-0.3);
811 double ndy2 = dx*sin(-0.3)+dy*cos(-0.3);
813 stream <<
"\n% Arrow\n";
817 << transform.
mapX( _x1 ) <<
" " 818 << transform.
mapY( _y1 ) <<
" " 820 << transform.
mapX( _x2 + ( dx * cos(0.3) ) ) <<
" " 821 << transform.
mapY( _y2 + ( dy * cos(0.3) ) ) <<
" " 822 <<
"l stroke" << std::endl;
826 << transform.
mapX( _x2 ) + transform.
scale( ndx1 ) <<
" " 827 << transform.
mapY( _y2 ) + transform.
scale( ndy1 ) <<
" " 829 << transform.
mapX( _x2 ) <<
" " 830 << transform.
mapY( _y2 ) <<
" l " 831 << transform.
mapX( _x2 ) + transform.
scale( ndx2 ) <<
" " 832 << transform.
mapY( _y2 ) + transform.
scale( ndy2 ) <<
" ";
837 << transform.
mapX( _x2 ) + transform.
scale( ndx1 ) <<
" " 838 << transform.
mapY( _y2 ) + transform.
scale( ndy1 ) <<
" " 840 << transform.
mapX( _x2 ) <<
" " 841 << transform.
mapY( _y2 ) <<
" l " 842 << transform.
mapX( _x2 ) + transform.
scale( ndx2 ) <<
" " 843 << transform.
mapY( _y2 ) + transform.
scale( ndy2 ) <<
" l" 850 std::map<DGtal::Color,int> & colormap )
const 866 stream <<
"-1 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 1 0 ";
870 stream <<
" 1 1 1.00 60.00 120.00\n";
872 stream <<
" 1 0 1.00 60.00 120.00\n";
874 stream << static_cast<int>( transform.
mapX( _x1 ) ) <<
" " 875 << static_cast<int>( transform.
mapY( _y1 ) ) <<
" " 876 << static_cast<int>( transform.
mapX( _x2 ) ) <<
" " 877 << static_cast<int>( transform.
mapY( _y2 ) ) << std::endl;
884 double dx = _x1 - _x2;
885 double dy = _y1 - _y2;
886 double norm = sqrt( dx*dx + dy*dy );
895 double ndx1 = dx*cos(0.3)-dy*sin(0.3);
896 double ndy1 = dx*sin(0.3)+dy*cos(0.3);
897 double ndx2 = dx*cos(-0.3)-dy*sin(-0.3);
898 double ndy2 = dx*sin(-0.3)+dy*cos(-0.3);
900 stream <<
"<g>" << std::endl;
903 <<
"d=\"M " << transform.
mapX( _x1 ) <<
" " << transform.
mapY( _y1 )
904 <<
" L " << transform.
mapX( _x2 + ( dx * cos(0.3) ) )
905 <<
" " << transform.
mapY( _y2 + ( dy * cos(0.3) ) ) <<
" z\"" 906 <<
" fill=\"none\" stroke=\"" <<
_penColor.
svg() <<
"\"" 909 stream <<
" style=\"" << xFigDashStylesSVG[
_lineStyle ] <<
'"';
913 stream <<
" <polygon";
917 <<
" style=\"stroke-linecap:butt;stroke-linejoin:miter\"" 921 << transform.
mapX( _x2 ) + transform.
scale( ndx1 ) <<
"," 922 << transform.
mapY( _y2 ) - transform.
scale( ndy1 ) <<
" " 923 << transform.
mapX( _x2 ) <<
"," 924 << transform.
mapY( _y2 ) <<
" " 925 << transform.
mapX( _x2 ) + transform.
scale( ndx2 ) <<
"," 926 << transform.
mapY( _y2 ) - transform.
scale( ndy2 ) <<
" " 927 << transform.
mapX( _x2 ) + transform.
scale( ndx1 ) <<
"," 928 << transform.
mapY( _y2 ) - transform.
scale( ndy1 ) <<
"\" />" << std::endl;
929 stream <<
"</g>" << std::endl;
937 double dx = _x1 - _x2;
938 double dy = _y1 - _y2;
939 double norm = sqrt( dx*dx + dy*dy );
948 double ndx1 = dx*cos(0.3)-dy*sin(0.3);
949 double ndy1 = dx*sin(0.3)+dy*cos(0.3);
950 double ndx2 = dx*cos(-0.3)-dy*sin(-0.3);
951 double ndy2 = dx*sin(-0.3)+dy*cos(-0.3);
958 cairo_move_to (cr, transform.
mapX( _x1 ), transform.
mapY( _y1 ));
959 cairo_line_to (cr, transform.
mapX( _x2 + ( dx * cos(0.3) ) ), transform.
mapY( _y2 + ( dy * cos(0.3) ) ));
962 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
963 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
971 cairo_move_to (cr, transform.
mapX( _x2 ) + transform.
scale( ndx1 ), transform.
mapY( _y2 ) - transform.
scale( ndy1 ));
972 cairo_line_to (cr, transform.
mapX( _x2 ), transform.
mapY( _y2 ));
973 cairo_line_to (cr, transform.
mapX( _x2 ) + transform.
scale( ndx2 ), transform.
mapY( _y2 ) - transform.
scale( ndy2 ));
974 cairo_close_path (cr);
979 cairo_fill_preserve (cr);
991 cairo_set_line_cap (cr, cairoLineCap[
ButtCap]);
992 cairo_set_line_join (cr, cairoLineJoin[
MiterJoin]);
1008 << transform.
mapX( _x1 ) <<
',' << transform.
mapY( _y1 )
1010 << transform.
mapX( _x2 ) <<
',' << transform.
mapY( _y2 )
1011 <<
");" << std::endl;
1038 Point axis = re - rc;
1039 _angle = atan( axis.
y / axis.
x );
1065 _center +=
Point( dx, dy );
1080 if ( _angle != 0 ) {
1081 double co = cos( _angle );
1082 double si = sin( _angle );
1085 double m00 = ( 1 / _xRadius ) * co;
1086 double m01 = ( 1 / _xRadius ) * si;
1087 double m10 = - ( 1 / _yRadius ) * si;
1088 double m11 = ( 1 / _yRadius ) * co;
1092 double a = ( m00 * m00 ) + ( m10 * m10 );
1093 double b = 2 * ( ( m00 * m01 ) + ( m10 * m11 ) );
1094 double c = ( m01 * m01 ) + ( m11 * m11 );
1097 a = a / ( sx * sx );
1098 b = b / ( sx * sy );
1099 c = c / ( sy * sy );
1103 }
else if ( a == c ) {
1108 _angle = 0.5 * atan( b / ( a - c ) );
1109 double k = 1 + ( ( b * b ) / ( ( a - c ) * ( a - c ) ) );
1113 a = 0.5 * ( c + k );
1114 c = 0.5 * ( c - k );
1116 _xRadius = 1 / sqrt( a );
1117 _yRadius = 1 / sqrt( c );
1119 _xRadius = _xRadius * sx;
1120 _yRadius = _yRadius * sy;
1160 double yScale = _yRadius / _xRadius;
1161 stream <<
"\n% Ellipse\n";
1164 << transform.
mapX( _center.x ) <<
" " << transform.
mapY( _center.y ) <<
" tr";
1165 if ( _angle != 0.0 ) stream <<
" " << (_angle*180/M_PI) <<
" rot ";
1166 if ( ! _circle ) stream <<
" " << 1.0 <<
" " << yScale <<
" sc";
1167 stream <<
" n " << transform.
scale( _xRadius ) <<
" 0 m " 1168 <<
" 0 0 " << transform.
scale( _xRadius ) <<
" 0.0 360.0 arc ";
1170 stream <<
" fill gr" << std::endl;
1175 stream <<
"gs " << transform.
mapX( _center.x ) <<
" " << transform.
mapY( _center.y ) <<
" tr";
1176 if ( _angle != 0.0 ) stream <<
" " << (_angle*180/M_PI) <<
" rot ";
1177 if ( ! _circle ) stream <<
" " << 1.0 <<
" " << yScale <<
" sc";
1178 stream <<
" n " << transform.
scale( _xRadius ) <<
" 0 m " 1179 <<
" 0 0 " << transform.
scale( _xRadius ) <<
" 0.0 360.0 arc ";
1181 stream <<
" stroke gr" << std::endl;
1188 std::map<DGtal::Color,int> & colormap )
const 1194 stream <<
"1 1 " << _lineStyle <<
" ";
1200 stream << transform.
mapDepth(
_depth ) <<
" -1 20 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
" 1 " << _angle <<
" ";
1202 stream << transform.
mapDepth(
_depth ) <<
" -1 -1 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
" 1 " << _angle <<
" ";
1203 stream << static_cast<int>( transform.
mapX( _center.x ) ) <<
" " 1204 << static_cast<int>( transform.
mapY( _center.y ) ) <<
" " 1205 << static_cast<int>( transform.
scale( _xRadius ) ) <<
" " 1206 << static_cast<int>( transform.
scale( _yRadius ) ) <<
" " 1207 << static_cast<int>( transform.
mapX( _center.x ) ) <<
" " 1208 << static_cast<int>( transform.
mapY( _center.y ) ) <<
" " 1209 << static_cast<int>( transform.
mapX( _center.x ) + transform.
scale( _xRadius ) ) <<
" " 1210 << static_cast<int>( transform.
mapY( _center.y ) ) <<
"\n";
1217 stream <<
"<ellipse cx=\"" << transform.
mapX( _center.x ) <<
'"' 1218 <<
" cy=\"" << transform.
mapY( _center.y ) <<
'"' 1219 <<
" rx=\"" << transform.
scale( _xRadius ) <<
'"' 1220 <<
" ry=\"" << transform.
scale( _yRadius ) <<
'"' 1222 if ( _angle != 0.0 ) {
1223 stream <<
" transform=\"rotate( " 1224 << -(_angle*180/M_PI) <<
", " 1225 << transform.
mapX( _center.x ) <<
", " 1226 << transform.
mapY( _center.y ) <<
" )\" ";
1228 stream <<
" />" << std::endl;
1241 cairo_translate (cr, transform.
mapX( _center.x ), transform.
mapY( _center.y ));
1242 if ( _angle != 0.0 )
1243 cairo_rotate (cr, _angle);
1244 cairo_scale (cr, transform.
scale( _xRadius ), transform.
scale( _yRadius ));
1247 cairo_arc (cr, 0, 0, 1, 0, 2*M_PI);
1252 cairo_fill_preserve (cr);
1264 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
1265 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
1280 stream <<
"% FIXME: Ellipse::flushTikZ unimplemented" << std::endl;
1282 << transform.
mapX( _center.x ) <<
',' 1283 << transform.
mapY( _center.y ) <<
')' 1284 <<
" circle [x radius=" << transform.
scale( _xRadius ) <<
',' 1285 <<
"y radius=" << transform.
scale( _yRadius ) <<
',' 1286 <<
"rotate=" << -(_angle*180/M_PI)
1294 if ( _angle == 0.0 )
1295 return Rect( _center.x - _xRadius, _center.y + _yRadius,
1296 2 * _xRadius, 2 * _yRadius );
1298 double angleXmax = -atan( (_yRadius/_xRadius)*(tan(_angle) ) );
1299 double angleXmin = -atan( (_yRadius/_xRadius)*(tan(_angle) ) ) + M_PI;
1300 double angleYmax = atan( (_yRadius/_xRadius)*(1/tan(_angle) ) );
1301 double angleYmin = M_PI + atan( (_yRadius/_xRadius)*(1/tan(_angle) ) );
1303 if ( _angle < 0.0 ) {
1308 return Rect( _center.x + _xRadius*cos(angleXmin)*cos(_angle) - _yRadius*sin(angleXmin)*sin(_angle),
1309 _center.y + _xRadius*cos(angleYmax)*sin(_angle) + _yRadius*sin(angleYmax)*cos(_angle),
1310 ( _xRadius*cos(angleXmax)*cos(_angle) - _yRadius*sin(angleXmax)*sin(_angle) ) -
1311 ( _xRadius*cos(angleXmin)*cos(_angle) - _yRadius*sin(angleXmin)*sin(_angle) ),
1312 ( _xRadius*cos(angleYmax)*sin(_angle) + _yRadius*sin(angleYmax)*cos(_angle) ) -
1313 ( _xRadius*cos(angleYmin)*sin(_angle) + _yRadius*sin(angleYmin)*cos(_angle) ) );
1337 if ( rotCenter == _center )
return *
this;
1338 _center.
rotate( angle, rotCenter );
1368 _center +=
Point( dx, dy );
1412 return new Circle(*
this);
1422 stream <<
"<circle cx=\"" << transform.
mapX( _center.x ) <<
'"' 1423 <<
" cy=\"" << transform.
mapY( _center.y ) <<
'"' 1424 <<
" r=\"" << transform.
scale( _xRadius ) <<
'"' 1426 <<
" />" << std::endl;
1443 cairo_arc (cr, transform.
mapX( _center.x ), transform.
mapY( _center.y ), transform.
scale( _xRadius ), 0, 2*M_PI);
1448 cairo_fill_preserve (cr);
1460 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
1461 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
1480 << transform.
mapX( _center.x ) <<
',' 1481 << transform.
mapY( _center.y ) <<
')' 1482 <<
" circle (" << transform.
scale( _xRadius ) <<
");" 1509 cairo_arc (cr, transform.
mapX( _center.x ), transform.
mapY( _center.y ), transform.
scale( _xRadius ), 2.*M_PI-_angle1, 2.*M_PI-_angle2);
1511 cairo_arc_negative (cr, transform.
mapX( _center.x ), transform.
mapY( _center.y ), transform.
scale( _xRadius ), 2.*M_PI-_angle1, 2.*M_PI-_angle2);
1516 cairo_fill_preserve (cr);
1528 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
1529 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
1547 if (_negative ==
true)
1558 stream <<
"\n% Arc\n";
1561 << transform.
mapX( _center.x ) <<
" " << transform.
mapY( _center.y ) <<
" " 1562 << transform.
scale( _xRadius )<<
" " << (a1*180/M_PI) <<
" " 1563 << (a2*180/M_PI) <<
" "<<
"arc ";
1565 stream <<
" fill gr" << std::endl;
1571 << transform.
mapX( _center.x ) <<
" " << transform.
mapY( _center.y ) <<
" " 1572 << transform.
scale( _xRadius )<<
" " << (a1*180/M_PI) <<
" " 1573 << (a2*180/M_PI) <<
" "<<
"arc ";
1575 stream <<
" stroke gr" << std::endl;
1584 double fx = _center.x + _xRadius*std::cos(_angle1);
1585 double fy = _center.y + _xRadius*std::sin(_angle1);
1586 double lx = _center.x + _xRadius*std::cos(_angle2);
1587 double ly = _center.y + _xRadius*std::sin(_angle2);
1592 stream <<
"d='M " << transform.
mapX( fx );
1593 stream <<
"," << transform.
mapY( fy );
1595 stream <<
" A " << transform.
scale( _xRadius ) <<
" " << transform.
scale( _xRadius );
1601 if ( (std::cos(_angle1)*std::sin(_angle2) - std::sin(_angle1)*std::cos(_angle2))<0 )
1610 if ( (std::cos(_angle1)*std::sin(_angle2) - std::sin(_angle1)*std::cos(_angle2))<0 )
1619 stream <<
" " << transform.
mapX( lx );
1620 stream <<
"," << transform.
mapY( ly );
1630 << transform.
mapX( _center.x ) <<
',' << transform.
mapY( _center.y ) <<
')' 1631 <<
" +(" << -_angle1/M_PI*180. <<
':' << transform.
scale( _xRadius) <<
')' 1632 <<
" arc (" << -_angle1/M_PI*180. <<
':' << -_angle2/M_PI*180. + _negative * 360. <<
':' << transform.
scale( _xRadius ) <<
");" 1657 return _path.center();
1663 _path.
rotate( angle, rotCenter );
1702 _path.
scale( sx, sy );
1728 _path.scaleAll( s );
1740 if ( _path.empty() )
return;
1741 stream <<
"\n% Polyline\n";
1744 _path.flushPostscript( stream, transform );
1748 stream <<
" fill" << std::endl;
1753 _path.flushPostscript( stream, transform );
1756 stream <<
" stroke" << std::endl;
1763 std::map<DGtal::Color,int> & colormap )
const 1765 if ( _path.empty() )
1767 if ( _path.closed() )
1783 stream <<
"20 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 0 0 ";
1785 stream <<
"-1 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 0 0 ";
1787 stream << _path.size() + _path.closed() << std::endl;
1788 _path.flushFIG( stream <<
" ", transform );
1789 stream << std::endl;
1796 if ( _path.empty() )
1798 if ( _path.closed() )
1799 stream <<
"<polygon";
1801 stream <<
"<polyline";
1803 stream <<
" points=\"";
1804 _path.flushSVGPoints( stream, transform );
1805 stream <<
"\" />" << std::endl;
1813 if ( _path.empty() )
1820 _path.flushCairoPoints( cr, transform );
1821 if ( _path.closed() )
1822 cairo_close_path (cr);
1827 cairo_fill_preserve (cr);
1839 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
1840 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
1854 if ( _path.empty() )
1860 _path.flushTikZPoints( stream, transform );
1862 if ( _path.closed() )
1863 stream <<
" -- cycle";
1864 stream <<
";" << std::endl;
1870 return _path.boundingBox();
1918 _path.scaleAll( s );
1929 std::map<DGtal::Color,int> & colormap )
const 1931 if ( _path[0].y != _path[1].y ) {
1935 if ( _path[0].x != _path[3].x ) {
1940 double x1 = _path[1].x - _path[0].x;
1941 double y1 = _path[1].y - _path[0].y;
1942 double x2 = _path[3].x - _path[0].x;
1943 double y2 = _path[3].y - _path[0].y;
1944 if ( fabs(x1*x2 + y1*y2) > 0.01 ) {
1963 stream <<
"20 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 0 0 5\n";
1965 stream <<
"-1 " << (_lineStyle?
"4.000 ":
"0.000 ") <<
_lineJoin <<
" " <<
_lineCap <<
" -1 0 0 5\n";
1967 _path.flushFIG( stream, transform );
1968 stream << std::endl;
1976 double x1 = _path[1].x - _path[0].x;
1977 double y1 = _path[1].y - _path[0].y;
1978 double x2 = _path[3].x - _path[0].x;
1979 double y2 = _path[3].y - _path[0].y;
1980 if ( fabs(x1*x2 + y1*y2) > 0.01 ) {
1986 if ( _path[0].y == _path[1].y ) {
1987 stream <<
"<rect x=\"" << transform.
mapX( _path[0].x ) <<
'"' 1988 <<
" y=\"" << transform.
mapY( _path[0].y ) <<
'"' 1989 <<
" width=\"" << transform.
scale( _path[1].x - _path[0].x ) <<
'"' 1990 <<
" height=\"" << transform.
scale( _path[0].y - _path[3].y ) <<
'"' 1992 <<
" />" << std::endl;
1994 Point v = _path[1] - _path[0];
1996 double angle = ( _path[1].y > _path[0].y ) ? acos( v *
Point(1,0) ) : -acos( v *
Point( 1, 0 ) );
1997 angle = ( angle * 180 ) / M_PI;
1998 stream <<
"<rect x=\"" << transform.
mapX( _path[0].x ) <<
'"' 1999 <<
" y=\"" << transform.
mapY( _path[0].y ) <<
'"' 2000 <<
" width=\"" << transform.
scale( (_path[1] - _path[0]).norm() ) <<
'"' 2001 <<
" height=\"" << transform.
scale( (_path[0] - _path[3]).norm() ) <<
'"' 2003 <<
" transform=\"rotate(" << -angle <<
", " 2004 << transform.
mapX( _path[0].x ) <<
", " << transform.
mapY( _path[0].y ) <<
") \" " 2005 <<
" />" << std::endl;
2015 double x1 = _path[1].x - _path[0].x;
2016 double y1 = _path[1].y - _path[0].y;
2017 double x2 = _path[3].x - _path[0].x;
2018 double y2 = _path[3].y - _path[0].y;
2019 if ( fabs(x1*x2 + y1*y2) > 0.01 ) {
2029 if ( _path[0].y == _path[1].y )
2030 cairo_rectangle (cr, transform.
mapX( _path[0].x ), transform.
mapY( _path[0].y ), transform.
scale( _path[1].x - _path[0].x ), transform.
scale( _path[0].y - _path[3].y ));
2033 Point v = _path[1] - _path[0];
2035 double angle = ( _path[1].y > _path[0].y ) ? acos( v *
Point(1,0) ) : -acos( v *
Point( 1, 0 ) );
2038 cairo_translate (cr, transform.
mapX( _path[0].x )+transform.
scale( _path[1].x - _path[0].x )/2., transform.
mapY( _path[0].y )+transform.
scale( _path[0].y - _path[3].y )/2.);
2039 cairo_rotate (cr, angle);
2042 cairo_rectangle (cr, -transform.
scale( _path[1].x - _path[0].x )/2., -transform.
scale( _path[0].y - _path[3].y )/2., transform.
scale( (_path[1] - _path[0]).norm() ), transform.
scale( (_path[0] - _path[3]).norm() ));
2048 cairo_fill_preserve (cr);
2060 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
2061 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
2079 << _path[0].x <<
',' << _path[0].y <<
')' 2081 << _path[1].x <<
',' << _path[3].y <<
");" << std::endl;
2126 _color0( color0 ), _color1( color1 ), _color2( color2 ), _subdivisions( subdivisions ) {
2137 const Point & p1,
float brightness1,
2138 const Point & p2,
float brightness2,
2234 Point p01( 0.5*(p0.
x+p1.
x), 0.5*(p0.
y+p1.
y) );
2238 Point p12( 0.5*(p1.
x+p2.
x), 0.5*(p1.
y+p2.
y) );
2242 Point p20( 0.5*(p2.
x+p0.
x), 0.5*(p2.
y+p0.
y) );
2255 std::map<DGtal::Color,int> & colormap )
const 2300 Point p01( 0.5*(p0.
x+p1.
x), 0.5*(p0.
y+p1.
y) );
2304 Point p12( 0.5*(p1.
x+p2.
x), 0.5*(p1.
y+p2.
y) );
2308 Point p20( 0.5*(p2.
x+p0.
x), 0.5*(p2.
y+p0.
y) );
2335 stream <<
"% FIXME: GouraudTriangle::flushTikZ unimplemented" << std::endl;
2394 double x1, y1, x2, y2, x3, y3, x4, y4;
2395 _path[ 0 ].get(x1, y1);
2396 _path[ 1 ].get(x3, y3);
2397 _path[ 2 ].get(x4, y4);
2400 x2 = x1 + 2/3.0*(x3-x1);
2401 y2 = y1 + 2/3.0*(y3-y1);
2402 x3 = x2 + 1/3.0*(x4-x1);
2403 y3 = y2 + 1/3.0*(y4-y1);
2405 stream << std::endl <<
"% Bezier curve" << std::endl;
2408 << transform.
mapX( x1 ) <<
" " 2409 << transform.
mapY( y1 ) <<
" " 2411 << transform.
mapX( x2 ) <<
" " 2412 << transform.
mapY( y2 ) <<
" " 2413 << transform.
mapX( x3 ) <<
" " 2414 << transform.
mapY( y3 ) <<
" " 2415 << transform.
mapX( x4 ) <<
" " 2416 << transform.
mapY( y4 ) <<
" " 2420 stream <<
" fill" << std::endl;
2425 << transform.
mapX( x1 ) <<
" " 2426 << transform.
mapY( y1 ) <<
" " 2428 << transform.
mapX( x2 ) <<
" " 2429 << transform.
mapY( y2 ) <<
" " 2430 << transform.
mapX( x3 ) <<
" " 2431 << transform.
mapY( y3 ) <<
" " 2432 << transform.
mapX( x4 ) <<
" " 2433 << transform.
mapY( y4 ) <<
" " 2436 stream <<
" stroke" << std::endl;
2443 std::map<DGtal::Color,int> & colormap )
const 2445 stream <<
"#FIXME: quadratic Bezier curve unimplemented" << std::endl;
2453 double x1, y1, x2, y2, x3, y3;
2454 _path[ 0 ].get(x1, y1);
2455 _path[ 1 ].get(x2, y2);
2456 _path[ 2 ].get(x3, y3);
2461 stream <<
"d='M " << transform.
mapX( x1 );
2462 stream <<
"," << transform.
mapY( y1 );
2464 stream <<
" Q " << transform.
mapX( x2 ) <<
"," << transform.
mapY( y2 );
2466 stream <<
" " << transform.
mapX( x3 );
2467 stream <<
"," << transform.
mapY( y3 );
2476 double x1, y1, x2, y2, x3, y3, x4, y4;
2477 _path[ 0 ].get(x1, y1);
2478 _path[ 1 ].get(x3, y3);
2479 _path[ 2 ].get(x4, y4);
2482 x2 = x1 + 2/3.0*(x3-x1);
2483 y2 = y1 + 2/3.0*(y3-y1);
2484 x3 = x2 + 1/3.0*(x4-x1);
2485 y3 = y2 + 1/3.0*(y4-y1);
2491 cairo_move_to( cr, transform.
mapX( x1 ), transform.
mapY( y1 ) );
2492 cairo_curve_to( cr, transform.
mapX( x2 ), transform.
mapY( y2 ),
2493 transform.
mapX( x3 ), transform.
mapY( y3 ),
2494 transform.
mapX( x4 ), transform.
mapY( y4 ) );
2499 cairo_fill_preserve (cr);
2509 cairo_set_line_cap (cr, cairoLineCap[
_lineCap]);
2510 cairo_set_line_join (cr, cairoLineJoin[
_lineJoin]);
2524 double x1, y1, x2, y2, x3, y3, x4, y4;
2525 _path[ 0 ].get(x1, y1);
2526 _path[ 1 ].get(x3, y3);
2527 _path[ 2 ].get(x4, y4);
2530 x2 = x1 + 2/3.0*(x3-x1);
2531 y2 = y1 + 2/3.0*(y3-y1);
2532 x3 = x2 + 1/3.0*(x4-x1);
2533 y3 = y2 + 1/3.0*(y4-y1);
2536 << transform.
mapX( x1 ) <<
',' << transform.
mapY( y1 )
2537 <<
") .. controls (" 2538 << transform.
mapX( x2 ) <<
',' << transform.
mapY( y2 )
2540 << transform.
mapX( x3 ) <<
',' << transform.
mapY( y3 )
2542 << transform.
mapX( x4 ) <<
',' << transform.
mapY( y4 )
2543 <<
");" << std::endl;
2567 Point endPos = _position +
Point( 10000 * cos( _angle ), 10000 * sin( _angle ) );
2568 _position.rotate( angle, rotCenter );
2569 endPos.
rotate( angle, rotCenter );
2570 Point v = endPos - _position;
2572 if ( v.
x >= 0 ) _angle = asin( v.
y );
2573 else if ( v.
y > 0 ) _angle = (M_PI/2.0) + acos( v.
y );
2574 else _angle = (-M_PI/2.0) - acos( -v.
y );
2581 return Text(*this).
rotate( angle, rotCenter );
2589 while ( _angle < M_PI ) _angle += 2 * M_PI;
2591 while ( _angle > M_PI ) _angle -= 2 * M_PI;
2604 _position +=
Point( dx, dy );
2625 _xScale = _yScale = s;
2649 return new Text(*
this);
2656 stream <<
"\n% Text\n";
2657 stream <<
"gs /" <<
PSFontNames[ _font ] <<
" ff " << _size <<
" scf sf";
2658 stream <<
" " << transform.
mapX( _position.x ) <<
" " << transform.
mapY( _position.y ) <<
" m";
2659 if ( _angle != 0.0 ) stream <<
" " << (_angle/M_PI)*180.0 <<
" rot ";
2660 stream <<
" (" << _text <<
")" 2662 <<
" sh gr" << std::endl;
2668 std::map<DGtal::Color,int> & colormap )
const 2674 stream << _size <<
" " << _angle <<
" 4 ";
2676 stream << static_cast<int>( _size * 135 / 12.0 ) <<
" ";
2678 stream << static_cast<int>( _text.size() * _size * 135 / 12.0 ) <<
" ";
2680 stream << static_cast<int>( transform.
mapX( _position.x ) ) <<
" " 2681 << static_cast<int>( transform.
mapY( _position.y ) ) <<
" ";
2682 stream << _text <<
"\\001\n";
2689 if ( _angle != 0.0f ) {
2690 stream <<
"<g transform=\"translate(" 2691 << transform.
mapX( _position.x ) <<
"," 2692 << transform.
mapY( _position.y ) <<
")\" >" 2693 <<
"<g transform=\"rotate(" << (-_angle*180.0/M_PI) <<
")\" >" 2694 <<
"<text x=\"0\" y=\"0\"" 2695 <<
" font-family=\"" << ( _svgFont.length() ? _svgFont :
PSFontNames[ _font ] ) <<
"\"" 2696 <<
" font-size=\"" << _size <<
"\"" 2702 <<
"</text></g></g>" << std::endl;
2704 stream <<
"<text x=\"" << transform.
mapX( _position.x )
2705 <<
"\" y=\"" << transform.
mapY( _position.y ) <<
"\" " 2706 <<
" font-family=\"" << ( _svgFont.length() ? _svgFont :
PSFontNames[ _font ] ) <<
"\"" 2707 <<
" font-size=\"" << _size <<
"\"" 2713 <<
"</text>" << std::endl;
2730 #define BOLD_FONT 0x01 2731 #define ITALIC_FONT 0x02 2732 #define MONOSPACE_FONT 0x04 2733 #define SANSSERIF_FONT 0x08 2734 char fontTraits[] = {
2738 BOLD_FONT | ITALIC_FONT,
2740 SANSSERIF_FONT | ITALIC_FONT,
2742 SANSSERIF_FONT | ITALIC_FONT,
2748 MONOSPACE_FONT | ITALIC_FONT,
2749 MONOSPACE_FONT | BOLD_FONT,
2750 MONOSPACE_FONT | BOLD_FONT | ITALIC_FONT,
2752 SANSSERIF_FONT | ITALIC_FONT,
2753 SANSSERIF_FONT | BOLD_FONT,
2754 SANSSERIF_FONT | BOLD_FONT | ITALIC_FONT,
2756 SANSSERIF_FONT | ITALIC_FONT,
2757 SANSSERIF_FONT | BOLD_FONT,
2758 SANSSERIF_FONT | BOLD_FONT | ITALIC_FONT,
2762 BOLD_FONT | ITALIC_FONT,
2766 BOLD_FONT | ITALIC_FONT,
2773 << transform.
mapX( _position.x ) <<
',' << transform.
mapY( _position.y )
2775 << (fontTraits[ _font ] & ITALIC_FONT ?
"\\itshape " :
"")
2776 << (fontTraits[ _font ] & BOLD_FONT ?
"\\bfseries " :
"")
2777 << (fontTraits[ _font ] & MONOSPACE_FONT ?
"\\ttfamily " :
"")
2778 << (fontTraits[ _font ] & SANSSERIF_FONT ?
"\\sffamily " :
"")
2780 <<
"};" << std::endl;
2786 return Rect( _position.x, _position.y, 0, 0 );
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Ellipse & translate(double dx, double dy)
const std::string & name() const
Arrow scaled(double sx, double sy) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Abstract structure for a 2D shape.
Circle scaled(double sx, double sy) const
A line between two points.
Ellipse scaled(double sx, double sy) const
Polyline rotated(double angle, const Point ¢er) const
virtual Point center() const =0
virtual Shape & rotate(double angle, const Point ¢er)=0
const std::string & name() const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
Circle translated(double dx, double dy) const
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
const std::string & name() const
const std::string & name() const
static const std::string _name
Dot scaled(double sx, double sy) const
const char * PSFontNames[]
static const std::string _name
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
A polygonal line described by a series of 2D points.
Point & rotate(double angle)
virtual Shape & scale(double sx, double sy)=0
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
A line between two points with an arrow at one extremity.
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
A triangle. Basically a Polyline with a convenient constructor.
Text scaled(double sx, double sy) const
Arrow translated(double dx, double dy) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
Shape & scale(double sx, double sy)
GouraudTriangle translated(double dx, double dy) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Text & rotate(double angle, const Point ¢er)
Line scaled(double sx, double sy) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Shape & scale(double sx, double sy)
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
Circle rotated(double angle, const Point ¢er) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Text translated(double dx, double dy) const
void setCairoDashStyle(cairo_t *cr, LineStyle type) const
const std::string & name() const
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)
Triangle translated(double dx, double dy) const
Circle & translate(double dx, double dy)
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Line rotated(double angle, const Point ¢er) const
static const std::string _name
A line between two points.
Struct representing a 2D point.
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Ellipse & rotate(double angle, const Point ¢er)
virtual void shiftDepth(int shift)
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
Polyline & rotate(double angle, const Point ¢er)
std::string svgProperties(const TransformSVG &transform) const
std::string postscript() const
Polyline & operator<<(const Point &p)
static const std::string _name
Dot translated(double dx, double dy) const
Shape & scale(double sx, double sy)
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Polyline translated(double dx, double dy) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
const std::string & name() const
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
Line translated(double dx, double dy) const
Path & rotate(double angle, const Point ¢er)
Line & rotate(double angle, const Point ¢er)
std::string svgAlpha(const char *aPrefix) const
Polyline scaled(double sx, double sy) const
GouraudTriangle & rotate(double angle, const Point ¢er)
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
virtual Shape & translate(double dx, double dy)=0
const std::string & name() const
GouraudTriangle rotated(double angle, const Point ¢er) const
const char * XFigPostscriptFontnames[]
const std::string & name() const
Used to draw image in figure.
const std::string & name() const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
Rectangle scaled(double sx, double sy) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Dot & rotate(double angle, const Point ¢er)
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
static const std::string _name
DGtal is the top-level namespace which contains all DGtal functions and types.
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
static const std::string _name
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
Triangle scaled(double sx, double sy) const
GouraudTriangle scaled(double sx, double sy) const
Ellipse translated(double dx, double dy) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
Arrow rotated(double angle, const Point ¢er) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
static const std::string _name
Dot rotated(double angle, const Point ¢er) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
virtual const std::string & name() const
static const std::string _name
static const std::string _name
ImageContainerBySTLVector< Domain, Value > Image
Text & translate(double dx, double dy)
Dot & translate(double dx, double dy)
bool shapeGreaterDepth(const Shape *s1, const Shape *s2)
Ellipse rotated(double angle, const Point ¢er) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Circle & rotate(double angle, const Point ¢er)
Line & translate(double dx, double dy)
Shape & scale(double sx, double sy)
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
Shape & scale(double sx, double sy)
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
const std::string & name() const
Structure representing an RGB triple with alpha component.
Rectangle rotated(double angle, const Point ¢er) const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
const std::string & name() const
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
static const std::string _name
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
void green(const unsigned char aGreenValue)
Rectangle translated(double dx, double dy) const
void flushPostscript(std::ostream &) const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
static const std::string _name
Triangle rotated(double angle) const
static const std::string _name
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
void red(const unsigned char aRedValue)
Struct representing a rectangle on the plane.
Shape & scale(double sx, double sy)
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
GouraudTriangle * clone() const
Point rotated(double angle) const
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Polyline & translate(double dx, double dy)
std::string tikzProperties(const TransformTikZ &transform) const
std::string postscriptProperties() const
Rectangle * clone() const
Text rotated(double angle, const Point ¢er) const
const std::string & name() const
void flushCairo(cairo_t *cr, const TransformCairo &transform) const
static const std::string _name
A triangle with shaded filling according to colors given for each vertex.
static const std::string _name
void blue(const unsigned char aBlueValue)
const std::string & name() const