Modelib: PSFile class Reference

Page principale | Hiérarchie des classes | Liste des composants | Liste des fichiers | Composants

# Référence de la classe PSFile

`#include <PsFile.h>`

Liste de tous les membres

## Membres publics
| PSFile (const std::string &_nom)
void | close ()
void | begin_figure (double xmin, double xmax, double ymin, double ymax, double hmin, double hmax, double vmin, double vmax, int xn, int yn)
void | end_figure ()
void | begin_document ()
void | begin_page (int page, double xmin, double xmax, double ymin, double ymax, double hmin, double hmax, double vmin, double vmax, int xn, int yn)
void | end_page ()
void | end_document (int npages)
void | begin_section (char *title)
void | end_section ()
void | set_pen (double gray, double width, double dashlength, double dashspace)
void | draw_segment (double xa, double ya, double xb, double yb)
void | draw_curve (double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd)
void | draw_rectangle (double xlo, double xhi, double ylo, double yhi)
void | fill_rectangle (double xlo, double xhi, double ylo, double yhi, double gray)
void | fill_and_draw_rectangle (double xlo, double xhi, double ylo, double yhi, double gray)
void | fill_circle (double xc, double yc, double radius, double gray)
void | draw_circle (double xc, double yc, double radius)
void | fill_and_draw_circle (double xc, double yc, double radius, double gray)
void | fill_and_draw_lune (double xc, double yc, double radius, double tilt, double gray)
void | fill_polygon (double x[], double y[], int n, double gray)
void | draw_polygon (double x[], double y[], int n)
void | fill_and_draw_polygon (double x[], double y[], int n, double gray)
void | fill_triangle (double xa, double ya, double xb, double yb, double xc, double yc, double gray)
void | fill_grid_cell (int xi, int yi, double gray)
void | draw_coord_line (char axis, double coord)
void | draw_grid_lines ()
void | set_label_font (char *font, float size)
void | put_label (char *text, double x, double y, float xalign, float yalign)
void | draw_frame ()
void | add_caption (char *txt)
void | put_text (char *text, char *newline)
PSFile & | operator<< (const std::string &str)
PSFile & | operator<< (const Model &m)
## Membres protégés
void | aux_rectangle (double xlo, double xhi, double ylo, double yhi, double gray, char *op)
void | aux_polygon (double x[], double y[], int npoints, double gray, char *op)
void | aux_circle (double xc, double yc, double radius, double gray, char *op)
void | aux_lune (double xc, double yc, double radius, double tilt, double gray, char *op)
void | define_procs ()
void | define_caption_procs ()
void | save_scales (double xmin, double xmax, double ymin, double ymax, double hmin, double hmax, double vmin, double vmax)
void | setup_page_state (int xn, int yn)
void | setup_caption_data ()
void | aux_end_page ()

## Description détaillée

Classe permettant de gerer/generer des fichier de type PostScript

Les fonctions ont ete repises d'un programme C et converti en C++. Il y a eut quelques ajouts et quelques modifications.

## Documentation des méthodes

void PSFile::add_caption | ( | char * | txt | ) |

| Adds a caption text below the drawing, *outside* the nominal bounding box.

void PSFile::begin_document | ( |  | ) |

| Initializes a (non-encapsulated, multi-page) PS file. A standard PostScript file contains a document with one or more pages, with explicit "show" commands at the end of each page, and no BoundingBox comment. It can be printed by itself. The procedure writes the file's preamble, with auxiliary Postscript ops. The client must call begin_page and end_page around each page. of the document.

void PSFile::begin_figure | ( | double | xmin,
|  | double | xmax,
|  | double | ymin,
|  | double | ymax,
|  | double | hmin,
|  | double | hmax,
|  | double | vmin,
|  | double | vmax,
|  | int | xn,
|  | int | yn
| ) |

| Initializes an Encapsulated PostScript file. An Encapsulated PostScript file contains a single figure, with a BoundingBox comment, without an explicit "showpage" command; It is suitable for inclusion in TeX papers and such. This procedure writes the preamble and bounding box, sets coordinate system, clip path, caption font, Postscript ops and constants, etc. Client coordinates will range over [xmin __ xmax] x [ymin __ ymax]. Plotting area is [hmin __ hmax] x [vmin __ vmax] (in pt). The plotting scales dh/dx and dv/dy must be equal. The plotting area is divided implicitly into a grid of /xn/ by /yn/ rectangular "cells".

void PSFile::begin_page | ( | int | page,
|  | double | xmin,
|  | double | xmax,
|  | double | ymin,
|  | double | ymax,
|  | double | hmin,
|  | double | hmax,
|  | double | vmin,
|  | double | vmax,
|  | int | xn,
|  | int | yn
| ) |

| Starts a new page of a PS document. Sets coordinate system, clip path, dimension constants, etc. Client coordinates will range over [xmin __ xmax] x [ymin __ ymax]. Plotting area is [hmin __ hmax] x [vmin __ vmax] (in pt). The plotting scales dh/dx and dv/dy must be equal. The plotting area is divided implicitly into a grid of /xn/ by /yn/ rectangular "cells".

void PSFile::begin_section | ( | char * | title | ) |

| Starts a new section of a plot. The title is a comment

void PSFile::draw_circle | ( | double | xc,
|  | double | yc,
|  | double | radius
| ) |

| Draws the circle with given center and radius, using the current pen and gray.

void PSFile::draw_coord_line | ( | char | axis,
|  | double | coord
| ) |

| Draws a reference line perpendicular to the given axis at the given coordinate value.

void PSFile::draw_curve | ( | double | xa,
|  | double | ya,
|  | double | xb,
|  | double | yb,
|  | double | xc,
|  | double | yc,
|  | double | xd,
|  | double | yd
| ) |

| Draws a Bezier arc with given control points, using the current pen and gray.

void PSFile::draw_frame | ( |  | ) |

| Draws a frame around the plotting area. (The frame will extend half a line width outside the nominal bounding box.)

void PSFile::draw_grid_lines | ( |  | ) |

| Draws the cell boundaries with the current pen and gray level.

void PSFile::draw_polygon | ( | double | x[],
|  | double | y[],
|  | int | n
| ) |

| Draws the contour of the polygon (x[1],y[1]),.. (x[n],y[n]) using the current pen and gray.

void PSFile::draw_rectangle | ( | double | xlo,
|  | double | xhi,
|  | double | ylo,
|  | double | yhi
| ) |

| Draws the outline of the given rectangle using the current pen.

void PSFile::draw_segment | ( | double | xa,
|  | double | ya,
|  | double | xb,
|  | double | yb
| ) |

| Draws segment from (xa,ya) to (xb,yb) with current pen and gray

void PSFile::end_document | ( | int | npages | ) |

| Finalizes a multipage document. The client must keep track of the number of pages that were written to the file.

void PSFile::end_figure | ( |  | ) |

| Finalizes an Encapsulated PostScript file.

void PSFile::end_page | ( |  | ) |

| Finalizes a page: Writes page trailer line, etc.

void PSFile::end_section | ( |  | ) |

| Ends a section of a plot.

void PSFile::fill_and_draw_circle | ( | double | xc,
|  | double | yc,
|  | double | radius,
|  | double | gray
| ) |

| Fills the circle with given center and radius, using the given gray, then draws its outline, using the current pen and gray.

void PSFile::fill_and_draw_lune | ( | double | xc,
|  | double | yc,
|  | double | radius,
|  | double | tilt,
|  | double | gray
| ) |

| Fills the lune with given center, radius, and tilt, using the given gray, then draws its outline, using the current pen and gray.

void PSFile::fill_and_draw_polygon | ( | double | x[],
|  | double | y[],
|  | int | n,
|  | double | gray
| ) |

| Fills the polygon (x[1],y[1]),.. (x[n],y[n]) with the given gray level, then draws its contour using the current pen and gray.

void PSFile::fill_and_draw_rectangle | ( | double | xlo,
|  | double | xhi,
|  | double | ylo,
|  | double | yhi,
|  | double | gray
| ) |

| Fills rectangle with given gray, then draws its outline with current pen.

void PSFile::fill_circle | ( | double | xc,
|  | double | yc,
|  | double | radius,
|  | double | gray
| ) |

| Fills the circle with given center and radius, using the given gray.

void PSFile::fill_grid_cell | ( | int | xi,
|  | int | yi,
|  | double | gray
| ) |

| Fills the given cell of the current cell grid with the given gray level.

void PSFile::fill_polygon | ( | double | x[],
|  | double | y[],
|  | int | n,
|  | double | gray
| ) |

| Fills the polygon (x[1],y[1]),.. (x[n],y[n]) with the given gray level.

void PSFile::fill_rectangle | ( | double | xlo,
|  | double | xhi,
|  | double | ylo,
|  | double | yhi,
|  | double | gray
| ) |

| Fills given rectangle with given gray color

void PSFile::fill_triangle | ( | double | xa,
|  | double | ya,
|  | double | xb,
|  | double | yb,
|  | double | xc,
|  | double | yc,
|  | double | gray
| ) |

| Fills triangle /abc/ with given gray level.

PSFile& PSFile::operator<< | ( | const std::string & | str | ) | `[inline]`

| Operator overloading

void PSFile::put_label | ( | char * | text,
|  | double | x,
|  | double | y,
|  | float | xalign,
|  | float | yalign
| ) |

| Prints "label" at point (x,y), using the current label font size. The parameter "xalign" (resp. "yalign)" specifies which point of the string's bounding box will end up at (x,y): 0.0 means the left (resp. bottom) side, 1.0 means the right (resp. top) side. Default is (0.5, 0.5), meaning the box will be centered at (x,y).

void PSFile::put_text | ( | char * | text,
|  | char * | newline
| ) |

| Writes a text string to /psfile/, in Postscript form, handling special chars and parentheses. Replaces any embedded ' ' by the given /newline/ string.

void PSFile::set_label_font | ( | char * | font,
|  | float | size
| ) |

| Sets the name and point size of the font to be used by put_label.

void PSFile::set_pen | ( | double | gray,
|  | double | width,
|  | double | dashlength,
|  | double | dashspace
| ) |

| Sets pen parameters and ink color for line drawing. Dimensions are in *millimeters*

La documentation associée à cette classe a été générée à partir des fichiers suivants :

- PsFile.h
- PsFile.cpp