#include <CNCL/EZD.h>
CN_EZD
CNNamed
EZDDrawing, EZDObject, EZDPushButton, ...
None
EZD
is the base class for EZD graphic objects. It manages the
access to EZD's I/O streams and provides the EZD drawing primitives.
For additional information about EZD, refer to the manual pages of EZD.
Constructors:
EZD();
EZD(CNParam *param);
EZD(const CNStringR name);
In addition to the member functions required by CNCL, EZD
provides:
static ostream & out();
static istream & in();
static void draw_point(int x, int y, const CNStringR col)
col
.
static void draw_line(int x1, int y1, int x2, int y2, const CNStringR col, int width = -1);
static void draw_dash_line(int x1, int y1, int x2, int y2, const CNStringR col, int width = -1);
(x1,y1)
to point (x2,y2)
in color col
and width
pixels wide. If width
is <=
0, the minimum of one pixel is used for it.
static void draw_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col,
int width = -1);
(x,y)
are the minimum coordinates of the
rectangle defining the arc. The arc's rectangle size is width w
by
height h
. The arc starts at a1
degrees and spans a2
degrees - all angles are measured in the positive mathematical sense,
the positive x-axis is the reference axis. The drawing color is
col
and the line width is width
. If width <= 0 EZD's
default value (1 pixel) is used.
static void draw_fill_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);
(x,y)
are
the minimum coordinates of the rectangle defining the arc. The arcs
rectangle size is width w by heigth h. The arc starts at a1 degrees and
spans a2 degrees - all angles measured in positive mathematical sense,
the positive x-axis is the reference axis. The drawing color is
col
.
static void draw_pie_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);
(x,y)
are the minimum coordinates of the rectangle defining the
arc. The arcs rectangle size is width w by heigth h. The arc starts at
a1 degrees and spans a2 degrees - all angles measured in positive
mathematical sense, the positive x-axis is the reference axis. The
drawing color is col
.
static void draw_rectangle(int x, int y, int w, int h, const CNStringR col, int width = -1);
(x,y)
are the minimum coordinates.
The size is defined by its width w and its heigth h. The drawing color
is col
and the line width is width
. If width is <= 0 EZD's
default value (1 pixel) is used.
static void draw_fill_rectangle(int x, int y, int w, int h, const
static void draw_fill_rectangle(int x, int y, int w, int h, const CNStringR col,
CNStringR stipple);
(x,y)
are the minimum
coordinates. The size is defined by its width w and its heigth h. The
drawing color is col
.
static void draw_text(int x, int y, const CNStringR text, const CNStringR col,
const CNStringR font);
static void draw_text(int x, int y, int w, int h, const CNStringR align, const CNStringR text,
const CNStringR col, const CNStringR font);
text
in the current drawing. (x,y)
are the minimum
coordinates of the rectangle containing the text. col
and
font
describe color and font of the text. The optional width w,
heigth h and alignment information describe the size of this rectangle
and how the text has to be positioned in it. If the text does not fit
in, no text is displayed at all.
static void draw_bitmap(int x, int y, CNStringR filename, CNStringR color1 = "black",
CNStringR color2= "");
static void draw_bitmap(int x, int y, int w, int h, CNStringR filename,
CNStringR color1 = "black", CNStringR color2= "");
filename
at position x,y
in
width w
and height h
. The bits that are on are drawn in
color1
, those which are off in color2
.
draw_text()
.
static void draw_now();
static void draw_clear();
static void pause(int msec);
msec
milliseconds pass or some event action issues a quit
command.
static CNString event();
static bool test_event();
static void set_scale(const float xscale_x, const float xscale_y, const int xorigin_x,
const int xorigin_y);
static int x2pix(const float x);
static int y2pix(const float y);
set_scale
specifies the scale factor (default: scale (x,y) = (1.0,1.0), origin
(x,y) = (0,0)). x2pix
and y2pix
evaluate the coordinate
transformation for the given values (x,y)
by the formula
(value * scale + origin)
, rounded to an integer.
static void print_window(CNStringR winname, CNStringR dateiname);
winname
to disk. The file
dateiname
is in postscript format.
static void save_drawing();
static void restore_drawing();
Go to the first, previous, next, last section, table of contents.