TPostScript


class description - source file - inheritance tree

class TPostScript : public TVirtualPS


    public:
TPostScript TPostScript(const char* filename, Int_t type = -111) TPostScript TPostScript(TPostScript&) TPostScript TPostScript() virtual void ~TPostScript() TClass* Class() virtual void Close(Option_t* opt) Int_t CMtoPS(Float_t u) void DefineMarkers() virtual void DrawBox(Coord_t x1, Coord_t y1, Coord_t x2, Coord_t y2) virtual void DrawFrame(Coord_t xl, Coord_t yl, Coord_t xt, Coord_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light) void DrawHatch(Float_t dy, Float_t angle, Int_t n, Float_t* x, Float_t* y) void DrawPolyLine(Int_t n, TPoints* xy) void DrawPolyLineNDC(Int_t n, TPoints* uv) virtual void DrawPolyMarker(Int_t n, Float_t* x, Float_t* y) virtual void DrawPS(Int_t n, Float_t* xw, Float_t* yw) void FontEncode() void Initialize() virtual TClass* IsA() const void MakeGreek() void MovePS(Int_t x, Int_t y) virtual void NewPage() void Off() void On() virtual void Open(const char* filename, Int_t type = -111) virtual void PrintFast(Int_t nch, const Text_t* string) void PrintStr(const Text_t* string) void Range(Float_t xrange, Float_t yrange) void SaveRestore(Int_t flag) void SetColor(Int_t color = 1) virtual void SetFillColor(Color_t cindex = 1) void SetFillPatterns(Int_t ipat, Int_t color) virtual void SetLineColor(Color_t cindex = 1) virtual void SetLineStyle(Style_t linestyle = 1) virtual void SetLineWidth(Width_t linewidth = 1) virtual void SetMarkerColor(Color_t cindex = 1) virtual void SetTextColor(Color_t cindex = 1) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) virtual void Text(Float_t x, Float_t y, const Text_t* string) void TextNDC(Float_t u, Float_t v, const Text_t* string) Int_t UtoPS(Float_t u) Int_t VtoPS(Float_t v) void WriteInteger(Int_t i) void WriteReal(Float_t r) Int_t XtoPS(Float_t x) Int_t YtoPS(Float_t y) void Zone()

Data Members

protected:
Float_t fX1v X bottom left corner of paper Float_t fY1v Y bottom left corner of paper Float_t fX2v X top right corner of paper Float_t fY2v Y top right corner of paper Float_t fX1w Float_t fY1w Float_t fX2w Float_t fY2w Float_t fDXC Float_t fDYC Float_t fXC Float_t fYC Float_t fFX Float_t fFY Float_t fXVP1 Float_t fXVP2 Float_t fYVP1 Float_t fYVP2 Float_t fXVS1 Float_t fXVS2 Float_t fYVS1 Float_t fYVS2 Float_t fXsize Page size along X Float_t fYsize Page size along Y Float_t fMaxsize Largest dimension of X and Y Float_t fRed Per cent of red Float_t fGreen Per cent of green Float_t fBlue Per cent of blue Int_t fSave Number of gsave for restore Int_t fNXzone Number of zones along X Int_t fNYzone Number of zones along Y Int_t fIXzone Current zone along X Int_t fIYzone Current zone along Y Int_t fLenBuffer buffer length Float_t fMarkerSizeCur current transformed value of marker size Int_t fCurrentColor current Postscript color index Int_t fNpages number of pages Int_t fType PostScript workstation type Int_t fMode PostScript mode Int_t fClip Clipping mode Bool_t fBoundingBox True for Encapsulated PostScript Bool_t fClear True when page must be cleared Bool_t fClipStatus Clipping Indicator Bool_t fPrinted True when a page must be printed Bool_t fRange True when a range has been defined Bool_t fZone Zone indicator ofstream* fStream File stream identifier Text_t fBuffer[512] PostScript file buffer Text_t fPatterns[32] Indicate if pattern n is defined

Class Description

*-*-*-*-*-*-*-*-*-*-*-*-*The  P O S T S C R I P T  class-*-*-*-*-*-*-*-*-*-*
*-*                      ===============================
*-*
*-*   Graphics interface to PostScript.
*-*
*-*  This code was initially developped in the context of HIGZ and PAW
*-*  by Olivier Couet and Pierre Juillot.
*-*  It has been converted to a C++ class by Rene Brun.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TPostScript() : TVirtualPS()
*-*-*-*-*-*-*-*-*-*-*Default PostScript constructor*-*-*-*-*-*-*-*-*-*-*-*-*

TPostScript(const char *fname, Int_t wtype) :TVirtualPS(fname, wtype)
*-*-*-*-*-*-*-*-*-*-*Initialize the PostScript interface*-*-*-*-*-*-*-*-*-*
*-*                  ====================================
*-*
*-*_Input parameters:
*-*
*-*  fname : PostScript file name
*-*  wtype : PostScript workstation type
*-*
*-*
*-*  The possible workstation types are:
*-*     111 ps  Portrait
*-*     112 ps  Landscape
*-*     113 eps
*-*
*-*  The picture below shows fancy text with national accents or
*-*  subscripts and superscripts. This picture has been generated by
*-*  the macro  psexam. 

  

     The two following tables list the correspondance between the typed
     character and its interpretation using the special characters given
     in TPostScript::Text. These tables are screen copies. True and better
     resolution PostScript files can be seen at  psexam, pstable1 and pstable2. 
 The macro  pstable  has been used to generate the two PostScript tables.

  


  

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void Open(const char *fname, Int_t wtype)
*-*-*-*-*-*-*-*-*-*-*Open a PostScript file*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =======================
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

~TPostScript()
*-*-*-*-*-*-*-*-*-*-*Default PostScript destructor*-*-*-*-*-*-*-*-*-*-*-*-*

void Close(Option_t *)
*-*-*-*-*-*-*-*-*-*-*Close a PostScript file*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =======================

void On()
*-*-*-*-*-*-*-*-*-*-*Activate an already open PostScript file*-*-*-*-*-*
*-*                  ========================================
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void Off()
*-*-*-*-*-*-*-*-*-*-*DeActivate an already open PostScript file*-*-*-*-*-*
*-*                  ==========================================
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DefineMarkers()
*-*-*-*-*-*-*-*-*-*-*Define the markers*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ===================
*-*==========> (O.Couet)

void DrawBox(Coord_t x1, Coord_t y1, Coord_t x2, Coord_t y2)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Draw a Box*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                          ==========
*-*

void DrawFrame(Coord_t xl, Coord_t yl, Coord_t xt, Coord_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light)
*-*-*-*-*-*-*-*-*-*-*Draw a Frame around a box*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =========================
*-*  mode = -1  box looks as it is behind the screen
*-*  mode =  1  box looks as it is in front of the screen
*-*  border is the bordersize in already precomputed PostScript units
*-*  dark  is the color for the dark part of the frame
*-*  light is the color for the light part of the frame
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DrawPolyLine(Int_t nn, TPoints *xy)
*-*-*-*-*-*-*-*-*-*-*Draw a PolyLine*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ================
*-*
*-*  Draw a polyline through  the points  xy.
*-*  If NN=1 moves only to point x,y.
*-*  If NN=0 the x,y are  written  in the PostScript file
*-*     according to the current tranformation.
*-*  If NN>0 the line is clipped as a line.
*-*  If NN<0 the line is clipped as a fill area.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DrawPolyLineNDC(Int_t nn, TPoints *xy)
*-*-*-*-*-*-*-*-*-*-*Draw a PolyLine in NDC space*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ============================
*-*
*-*  Draw a polyline through  the points  xy.
*-*  If NN=1 moves only to point x,y.
*-*  If NN=0 the x,y are  written  in the PostScript file
*-*     according to the current tranformation.
*-*  If NN>0 the line is clipped as a line.
*-*  If NN<0 the line is clipped as a fill area.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)
*-*-*-*-*-*-*-*-*-*-*Draw markers at the n WC points x, y*-*-*-*-*-*-*-*-*
*-*                  ====================================
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DrawPS(Int_t nn, Float_t *xw, Float_t *yw)
*-*-*-*-*-*-*-*-*-*-*Draw a PolyLine*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ================
*-*
*-*  Draw a polyline through  the points  XW,YW.
*-*  If NN=1 moves only to point XW,YW.
*-*  If NN=0 the XW(1) and YW(1) are  written  in the PostScript file
*-*     according to the current NT.
*-*  If NN>0 the line is clipped as a line.
*-*  If NN<0 the line is clipped as a fill area.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void DrawHatch(Float_t, Float_t, Int_t, Float_t *, Float_t *)
*-*-*-*-*-*-*-*-*-*-*-*Draw Fill area with hacth styles*-*-*-*-*-*-*-*-*-*-*
*-*                    ================================

void FontEncode()
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Font Reencoding*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                          ================
*-- Author :    P.Juillot   13/08/92

void Initialize()
*-*-*-*-*-*-*-*-*-*-*PostScript Initialisation*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ==========================
*-*
*-* This routine initialize the following PostScript procedures:
*-*
*-*+------------+------------------+-----------------------------------+
*-*| Macro Name | Input parameters |            Explanation            |
*-*+------------+------------------+-----------------------------------+
*-*|     l      | x y              | Draw a line to the x y position   |
*-*+------------+------------------+-----------------------------------+
*-*|     m      | x y              | Move to the position x y          |
*-*+------------+------------------+-----------------------------------+
*-*|     box    | dx dy x y        | Define a box                      |
*-*+------------+------------------+-----------------------------------+
*-*|     bl     | dx dy x y        | Draw a line box                   |
*-*+------------+------------------+-----------------------------------+
*-*|     bf     | dx dy x y        | Draw a filled box                 |
*-*+------------+------------------+-----------------------------------+
*-*|     sw     | text             | Return string width of text       |
*-*+------------+------------------+-----------------------------------+
*-*|     t      | x y              | Translate                         |
*-*+------------+------------------+-----------------------------------+
*-*|     r      | angle            | Rotate                            |
*-*+------------+------------------+-----------------------------------+
*-*|     rl     | i j              | Roll the stack                    |
*-*+------------+------------------+-----------------------------------+
*-*|     d      | x y              | Draw a relative line to x y       |
*-*+------------+------------------+-----------------------------------+
*-*|     X      | x                | Draw a relative line to x (y=0)   |
*-*+------------+------------------+-----------------------------------+
*-*|     Y      | y                | Draw a relative line to y (x=0)   |
*-*+------------+------------------+-----------------------------------+
*-*|     rm     | x y              | Move relatively to x y            |
*-*+------------+------------------+-----------------------------------+
*-*|     gr     |                  | Restore the graphic context       |
*-*+------------+------------------+-----------------------------------+
*-*|     lw     | lwidth           | Set line width to lwidth          |
*-*+------------+------------------+-----------------------------------+
*-*|     sd     | [] 0             | Set dash line define by []        |
*-*+------------+------------------+-----------------------------------+
*-*|     s      |                  | Stroke mode                       |
*-*+------------+------------------+-----------------------------------+
*-*|     c      | r g b            | Set rgb color to r g b            |
*-*+------------+------------------+-----------------------------------+
*-*|     cl     |                  | Close path                        |
*-*+------------+------------------+-----------------------------------+
*-*|     f      |                  | Fill the last describe path       |
*-*+------------+------------------+-----------------------------------+
*-*|     mXX    | x y              | Draw the marker type XX at (x,y)  |
*-*+------------+------------------+-----------------------------------+
*-*|     Zone   | ix iy            | Define the current zone           |
*-*+------------+------------------+-----------------------------------+
*-*|     black  |                  | The color is black                |
*-*+------------+------------------+-----------------------------------+
*-*|     C      | dx dy x y        | Clipping on                       |
*-*+------------+------------------+-----------------------------------+
*-*|     NC     |                  | Clipping off                      |
*-*+------------+------------------+-----------------------------------+
*-*|     R      |                  | repeat                            |
*-*+------------+------------------+-----------------------------------+
*-*
*-*.==========> (O.Couet)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void MakeGreek()
*-*-*Reencode the Greek (/Symbol) font into the special font (/Special)*-*-*
*-*  ===================================================================
*-*
*-*.==========> (O.Couet)

void MovePS(Int_t ix, Int_t iy)
*-*-*-*-*-*-*-*-*-*-*Move to a new position*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =======================
printf("ix=%d, iy=%dn",ix,iy);

void NewPage()
*-*-*-*-*-*-*-*-*-*Move to a new PostScript page*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                =============================

void PrintStr(const Text_t *str)
*-*-*-*-*-*-*-*Output the string STR in the output buffer*-*-*-*-*-*-*-*-*-*
*-*            ===========================================
*-*

void PrintFast(Int_t len, const Text_t *str)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Fast version of Print*-*-*-*-*-*-*-*-*-*-*-*
*-*                          =====================

void Range(Float_t xsize, Float_t ysize)
*-*-*-*-*-*-*-*-*-*-*Set the range for the paper in centimeters*-*-*-*-*-*-*
*-*                  ===========================================

void SaveRestore(Int_t flag)
*-*-*-*-*-*-*-*Compute number of gsaves for restore*-*-*-*-*-*-*-*-*-*-*-*-*
*-*            ====================================
*-* This allows to write the correct number of grestore at the
*-* end of the PS file.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void SetFillColor( Color_t cindex )
*-*-*-*-*-*-*-*-*-*-*Set color index for fill areas*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ==============================
*-*  cindex : color index
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void SetFillPatterns(Int_t ipat, Int_t color)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Patterns definition*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                          ===================
*-- Author :    O.Couet   16/07/99
*-*
*-* Define the pattern ipat in the current PS file. ipat can vary from
*-* 1 to 25. Together with the pattern, the color (color) in which the
*-* pattern has to be drawn is also required. A pattern is defined in the
*-* current PS file only the first time it is used. Some level 2
*-* Postscript functions are used, so on level 1 printers, patterns will
*-* not work. This is not a big problem because patterns are
*-* defined only if they are used, so if they are not used a PS level 1
*-* file will not be poluted by level 2 features, and in any case the old
*-* patterns used a lot of memory which made them almost unusable on old
*-* level 1 printers. Finally we should say that level 1 devices are
*-* becoming very rare. The official PostScript is now level 3 !
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*

void SetLineColor( Color_t cindex )
*-*-*-*-*-*-*-*-*-*-*Set color index for lines*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =========================
*-*  cindex    : color index
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void SetLineStyle(Style_t linestyle)
*-*-*-*-*-*-*-*-*-*-*Change the line style*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================
*-*
*-*   linestyle = 2 dashed
*-*             = 3  dotted
*-*             = 4  dash-dotted
*-*              else = solid
*-*
*-*.==========> See TStyle::SetLineStyleString for style definition
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void SetLineWidth(Width_t linewidth)
*-*-*-*-*-*-*-*-*-*-*Change the line width*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================

void SetMarkerColor( Color_t cindex )
*-*-*-*-*-*-*-*-*-*-*Set color index for markers*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ===========================
*-*  cindex : color index
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void SetColor(Int_t color)
*-*-*-*-*-*-*-*-*-*-*Set the current color*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ======================
*-*

void SetTextColor( Color_t cindex )
*-*-*-*-*-*-*-*-*-*-*Set color index for text*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ========================
*-*  cindex    : color index
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void Text(Float_t xx, Float_t yy, const Text_t *chars)
*-*-*-*-*-*-*-*-*-*-*Write a string of characters*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =============================
*-*
*-*   This routine writes the string chars into a PostScript file
*-*    at position xx,yy in world coordinates.
*-*
*-*  Note the special action of the following special characters:
*-*
*-*       ` : go to greek
*-*       ' : go to special
*-*       ~ : go to ZapfDingbats
*-*       ? : go to subscript
*-*       ^ : go to superscript
*-*       ! : go to normal level of script
*-*       & : backspace one character
*-*       # : end of greek or of ZapfDingbats
*-*
*-*  Note1: This special characters have no effect on the screen.
*-*  Note2: To print one of the characters above in the Postscript file
*-*         use the escape character "@" in front of the character.
*-*
*-*.==========> (P.Juillot)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void TextNDC(Float_t u, Float_t v, const Text_t *chars)
*-*-*-*-*-*-*-*-*-*-*Write a string of characters in NDC*-*-*-*-*-*-*-*-*-*-*
*-*                  ===================================

Int_t UtoPS(Float_t u)
*-*-*-*-*-*-*-*Convert U from NDC coordinate to PostScript*-*-*-*-*-*-*-*-*
*-*            ===========================================

Int_t VtoPS(Float_t v)
*-*-*-*-*-*-*-*Convert V from NDC coordinate to PostScript*-*-*-*-*-*-*-*-*
*-*            ===========================================

void WriteInteger(Int_t n)
*-*-*-*-*-*-*-*-*-*-*Write one Integer to the PostScript file*-*-*-*-*-*-*-*
*-*                  =========================================

void WriteReal(Float_t z)
*-*-*-*-*-*-*-*Write a Real number to the PostScript file*-*-*-*-*-*-*-*-*-*
*-*            ===========================================

Int_t XtoPS(Float_t x)
*-*-*-*-*-*-*-*Convert X from world coordinate to PostScript*-*-*-*-*-*-*-*-*
*-*            =============================================

Int_t YtoPS(Float_t y)
*-*-*-*-*-*-*-*Convert Y from world coordinate to PostScript*-*-*-*-*-*-*-*-*
*-*            =============================================

void Zone()
*-*-*-*-*-*-*-*-*-*-*Initialize the PostScript page in zones*-*-*-*-*-*-*-*-*
*-*                  ========================================



Inline Functions


              Int_t CMtoPS(Float_t u)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
        TPostScript TPostScript(TPostScript&)


Author: Rene Brun, Olivier Couet, Pierre Juillot 29/11/94
Last update: 2.23/08 01/11/99 16.57.02 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.