.eps files
#include <lemon/eps.h>
Public Types | |
enum | NodeShapes { CIRCLE = 0, SQUARE = 1, DIAMOND = 2, MALE = 3, FEMALE = 4 } |
Public Member Functions | |
EpsDrawer (std::ostream &os, int x, int y) | |
| |
EpsDrawer (std::ostream &os, int x1, int y1, int x2, int y2) | |
| |
EpsDrawer (std::ostream &os, dim2::Point< double > s) | |
| |
EpsDrawer (std::ostream &os, dim2::Point< double > a, dim2::Point< double > b) | |
| |
EpsDrawer (const std::string &name, int x, int y) | |
| |
EpsDrawer (const std::string &name, int x1, int y1, int x2, int y2) | |
| |
EpsDrawer (const std::string &name, dim2::Point< double > s) | |
| |
EpsDrawer (const std::string &name, dim2::Point< double > a, dim2::Point< double > b) | |
| |
EpsDrawer & | save () |
Save the current graphic state. | |
EpsDrawer & | restore () |
Restore the saves graphic state. | |
EpsDrawer & | line (double x1, double y1, double x2, double y2) |
Draw a line. | |
EpsDrawer & | lineTo (double x1, double y1) |
Draw a line from the current point. | |
EpsDrawer & | moveTo (double x1, double y1) |
Move the current point. | |
EpsDrawer & | circle (double x, double y, double r) |
Draw a circle. | |
template<class T > | |
EpsDrawer & | line (dim2::Point< T > p1, dim2::Point< T > p2) |
Draw a line. | |
template<class T > | |
EpsDrawer & | lineTo (dim2::Point< T > p) |
Draw a line from the current point. | |
template<class T > | |
EpsDrawer & | moveTo (dim2::Point< T > p) |
Move the current point. | |
template<class T > | |
EpsDrawer & | circle (dim2::Point< T > p, double r) |
Draw a circle. | |
EpsDrawer & | fontSize (double si) |
Set the font size. | |
EpsDrawer & | font (std::string) |
Set the fint type. | |
EpsDrawer & | centerMode (bool m) |
Sets whether text output is centerized of not. | |
EpsDrawer & | collect () |
Turn to collect mode. | |
EpsDrawer & | closePath () |
Close the current drawing path. | |
EpsDrawer & | stroke () |
Stroke (draw) a path. | |
EpsDrawer & | fill () |
Fill a path. | |
EpsDrawer & | eoFill () |
Even-odd fill a path. | |
EpsDrawer & | clip () |
Set a clipping area. | |
EpsDrawer & | eoClip () |
Set a clipping area using even-odd rule. | |
EpsDrawer & | lineWidth (double w) |
Set the line width. | |
EpsDrawer & | lineCap (int i) |
Set the style of the line ends. | |
EpsDrawer & | lineJoin (int i) |
Set the style of the line joins. | |
EpsDrawer & | miterLimit (double w) |
Set the cut length of near parallel joining lines. | |
EpsDrawer & | color (double r, double g, double b) |
Set the drawing color. | |
EpsDrawer & | color (Color c) |
Set the drawing color. | |
EpsDrawer & | node (NodeShapes t, double x, double y, double r, Color col=WHITE, Color brd=BLACK) |
Draw a node shape. | |
template<class T > | |
EpsDrawer & | node (NodeShapes t, dim2::Point< T > pos, double r, Color col=WHITE, Color brd=BLACK) |
Draw a node shape. | |
EpsDrawer & | translate (double x, double y) |
Translate the coordinate system. | |
template<class T > | |
EpsDrawer & | translate (dim2::Point< T > p) |
Translate the coordinate system. | |
EpsDrawer & | rotate (double r) |
Rotate the coordinate system. | |
EpsDrawer & | scale (double sx, double sy) |
Scale the coordinate system. | |
EpsDrawer & | scale (double s) |
Scale the coordinate system. | |
template<class T > | |
EpsDrawer & | scale (dim2::Point< T > p) |
Scale the coordinate system. | |
EpsDrawer & | flush () |
| |
EpsDrawer & | clear () |
Clear the image. | |
EpsDrawer & | operator<< (const std::string &s) |
Print a text at the current point. | |
EpsDrawer & | operator<< (const char *s) |
Print a text at the current point. | |
EpsDrawer & | operator<< (int i) |
Print a number at the current point. | |
EpsDrawer & | operator<< (double d) |
Print a number at the current point. | |
template<class T > | |
EpsDrawer & | operator<< (dim2::Point< T > p) |
Print a coordinate at the current point. |
enum NodeShapes |
EpsDrawer | ( | std::ostream & | os, | |
int | x, | |||
int | y | |||
) |
The generated file is put to os
.
x
and y
determine the upper right corner of the bounding box. The lower left corner is (0,0).
EpsDrawer | ( | std::ostream & | os, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
The generated file is put to os
.
(x1,y1) and (x2,y2) determine the lower left and the upper right corners of the bounding box, respectively.
EpsDrawer | ( | std::ostream & | os, | |
dim2::Point< double > | s | |||
) |
The generated file is put to os
.
s
determines the upper right corner of the bounding box. The lower left corner is (0,0).
EpsDrawer | ( | std::ostream & | os, | |
dim2::Point< double > | a, | |||
dim2::Point< double > | b | |||
) |
The generated file is put to os
.
a
and b
determine the lower left and the upper right corners of the bounding box, respectively.
EpsDrawer | ( | const std::string & | name, | |
int | x, | |||
int | y | |||
) |
The generated picture is put to the file name
.
x
and y
determine the upper right corner of the bounding box. The lower left corner is (0,0).
EpsDrawer | ( | const std::string & | name, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
The generated picture is put to the file name
.
(x1,y1) and (x2,y2) determine the lower left and the upper right corners of the bounding box, respectively.
EpsDrawer | ( | const std::string & | name, | |
dim2::Point< double > | s | |||
) |
The generated picture is put to the file name
.
s
determines the upper right corner of the bounding box. The lower left corner is (0,0).
EpsDrawer | ( | const std::string & | name, | |
dim2::Point< double > | a, | |||
dim2::Point< double > | b | |||
) |
The generated picture is put to the file name
.
a
and b
determine the lower left and the upper right corners of the bounding box, respectively.
EpsDrawer & save | ( | ) |
This function saves the current coordinate system, and the parameters set by color(), lineWidth() etc. The can be restore()d later.
EpsDrawer & centerMode | ( | bool | m | ) |
EpsDrawer & collect | ( | ) |
If you call this function, then the drawing operations like line(), lineTo(), moveTo() will not take place immediately, but istead they are collected. These operations form a path. Then you can stroke(), fill(), eoFill(), clip() or eoClip() it. When drawing, you can also use closePath() to - surprise - close the current path.
This example draws a red filled diamond.
EpsDraw ed("diamond.eps",-1,-1,1,1);
ed.color(1,0,0,).collect().line(0,-1,1,0).lineTo(0,1)
.lineTo(-1,0).closePath().fill();
EpsDrawer & clip | ( | ) |
This function sets a clipping area. After that, the drawing operations will affect only this area.
EpsDrawer & eoClip | ( | ) |
This function sets a clipping area using even-odd rule. After that, the drawing operations will affect only this area.
EpsDrawer & lineCap | ( | int | i | ) |
i | It can be 0, 1 or 2 |
EpsDrawer & lineJoin | ( | int | i | ) |
i | It can be 0, 1 or 2 |
EpsDrawer& node | ( | NodeShapes | t, | |
dim2::Point< T > | pos, | |||
double | r, | |||
Color | col = WHITE , |
|||
Color | brd = BLACK | |||
) | [inline] |