Go to the documentation of this file.
23 #define CM2POINTS 450.0
30 #define POINTS2CM (1.0/CM2POINTS)
41 #define USER2XFIG(x,y,p) (signed int)(((p)->offset_x+(x))*CM2POINTS),\
42 (signed int)(((p)->offset_y-(y))*CM2POINTS)
52 #define PRINTXFIGPREAMBLE(p) fprintf((p)->f," %d %d %d %d %d -1 %d %f ",\
53 (p)->line_style,(p)->line_width,(p)->pen_color,\
54 (p)->fill_color,(p)->depth,(p)->fill_intensity,\
55 (((p)->line_style==SOLID_LINE)?0.0:4.0))
66 fprintf(stderr, "File %s can not be created in function InitPlot\n",name);
82 fprintf(p-> f, "#FIG 3.2\n");
83 fprintf(p-> f, "Landscape\n");
84 fprintf(p-> f, "Center\n");
85 fprintf(p-> f, "Metric\n");
87 fprintf(p-> f, "100.00\n");
88 fprintf(p-> f, "Single\n");
90 fprintf(p-> f, "1200 2\n");
124 if ((color>-2)&&(color<32))
130 if ((color>-2)&&(color<32))
155 fprintf(p-> f, "1 0.0000 %d %d %d %d %d %d %d %d\n",
157 ( signed int)(r* CM2POINTS),( signed int)(r*CM2POINTS),
171 fprintf(p-> f, "0 0 -1 0 0 5\n");
201 fprintf(p-> f, "0 0 -1 0 0 4\n");
233 fprintf(p-> f, " 0 0 -1 1 0 2 \n 1 1 5.00 60.00 120.00 \n %d %d %d %d\n", USER2XFIG(x0,y0,p), USER2XFIG(x1,y1,p));
241 fprintf(p-> f, "4 0 0 50 0 0 14 0.0000 4 150 150 %d %d %s\\001\n", USER2XFIG(x,y,p),text);
247 void PlotAxis( const char *nx, double min_x, double max_x,
248 const char *ny, double min_y, double max_y,
260 for(i=( signed int)(min_x/step);i<( signed int)(max_x/step);i++)
261 PlotLine(1.0*i*step,-0.1*step,1.0*i*step,0.1*step,p);
266 for(i=( signed int)(min_y/step);i<( signed int)(max_y/step);i++)
267 PlotLine(-0.1*step,1.0*i*step,0.1*step,1.0*i*step,p);
void ClosePlot(Tplot *p) Destructor.
void PlotRectangle(double x_left, double y_sup, double x_right, double y_inf, Tplot *p) Plots a rectangle.
void SetFillColor(int color, Tplot *p) Changes the current fill color.
void SetPenColor(int color, Tplot *p) Changes the current pen color.
void SetOrigin(double offset_x, double offset_y, Tplot *p) Changes the current origin of the plot.
void SetFillIntensity(unsigned int intensity, Tplot *p) Changes the current fill intensity.
void PlotArrow(double x0, double y0, double x1, double y1, Tplot *p) Plots a segment with an arrow.
Definitions of constants and macros used in several parts of the cuik library.
void SetLineWidth(unsigned int width, Tplot *p) Changes the current line width.
void PlotCircle(double cx, double cy, double r, Tplot *p) Plots a circle.
#define USER2XFIG(x, y, p) Converts a x-y point in R^2 into a xfig point.
Module to generate 2d plots.
#define POINTS2CM Scale factor between xfig units and centimiters.
#define SOLID_LINE Solid line in 2d.
void PlotTriangle(double x1, double y1, double x2, double y2, double x3, double y3, Tplot *p) Plots a triangle.
void InitPlot(const char *name, Tplot *p) Constructor.
#define CM2POINTS Scale factor between centimiters and xfig units.
void PlotText(double x, double y, const char *text, Tplot *p) Plots a text.
void PlotLine(double x0, double y0, double x1, double y1, Tplot *p) Plots a segment.
void SetDepth(unsigned int depth, Tplot *p) Changes the current plot depth.
void SetLineStyle(unsigned int style, Tplot *p) Changes the current line stype.
#define PRINTXFIGPREAMBLE(p) Writes a preamble common to all xfig elements.
void PlotAxis(const char *nx, double min_x, double max_x, const char *ny, double min_y, double max_y, double step, Tplot *p) Plots a X-Y axis.
|
Follow us!