Logo ROOT   6.08/07
Reference Guide
TVirtualPS.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 05/09/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TVirtualPS
12 #define ROOT_TVirtualPS
13 
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVirtualPS //
18 // //
19 // Abstract interface to a PostScript driver. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 #ifndef ROOT_TAttLine
28 #include "TAttLine.h"
29 #endif
30 #ifndef ROOT_TAttFill
31 #include "TAttFill.h"
32 #endif
33 #ifndef ROOT_TAttText
34 #include "TAttText.h"
35 #endif
36 #ifndef ROOT_TAttMarker
37 #include "TAttMarker.h"
38 #endif
39 
40 class TVirtualPS : public TNamed, public TAttLine, public TAttFill, public TAttMarker, public TAttText {
41 
42 private:
43  TVirtualPS(const TVirtualPS&); // Not implemented
44  TVirtualPS& operator=(const TVirtualPS&); // Not implemented
45 
46 protected:
47  Int_t fNByte; //Number of bytes written in the file (PDF)
48  Int_t fLenBuffer; //Buffer length
49  Int_t fSizBuffer; //Buffer size
50  Bool_t fPrinted; //True when a page must be printed
51  std::ofstream *fStream; //File stream identifier
52  char *fBuffer; //File buffer
53  const char *fImplicitCREsc; //Escape symbol before enforced new line
54 
55 public:
56  TVirtualPS();
57  TVirtualPS(const char *filename, Int_t type=-111);
58  virtual ~TVirtualPS();
59  virtual void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) = 0;
60  virtual void CellArrayFill(Int_t r, Int_t g, Int_t b) = 0;
61  virtual void CellArrayEnd() = 0;
62  virtual void Close(Option_t *opt="") = 0;
63  virtual void DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t y2) = 0;
64  virtual void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt,
65  Int_t mode, Int_t border, Int_t dark, Int_t light) = 0;
66  virtual void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) = 0;
67  virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) = 0;
68  virtual void DrawPS(Int_t n, Float_t *xw, Float_t *yw) = 0;
69  virtual void DrawPS(Int_t n, Double_t *xw, Double_t *yw) = 0;
70  virtual void NewPage() = 0;
71  virtual void Open(const char *filename, Int_t type=-111) = 0;
72  virtual void Text(Double_t x, Double_t y, const char *string) = 0;
73  virtual void Text(Double_t x, Double_t y, const wchar_t *string) = 0;
74  virtual void SetColor(Float_t r, Float_t g, Float_t b) = 0;
75 
76  virtual void PrintFast(Int_t nch, const char *string="");
77  virtual void PrintStr(const char *string="");
78  virtual void WriteInteger(Int_t i, Bool_t space=kTRUE);
79  virtual void WriteReal(Float_t r, Bool_t space=kTRUE);
80  virtual void PrintRaw(Int_t len, const char *str);
81  virtual void *GetStream() const { return (void*)fStream; }
82  virtual void SetStream(std::ofstream *os) { fStream = os; }
83 
84  virtual void SetType(Int_t /*type*/ = -111) { }
85  virtual Int_t GetType() const { return 111; }
86 
87  ClassDef(TVirtualPS,0) //Abstract interface to a PostScript driver
88 };
89 
90 
92 
93 #endif
char * fBuffer
Definition: TVirtualPS.h:52
virtual void DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)=0
virtual void SetColor(Float_t r, Float_t g, Float_t b)=0
virtual void CellArrayFill(Int_t r, Int_t g, Int_t b)=0
virtual void SetStream(std::ofstream *os)
Definition: TVirtualPS.h:82
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual Int_t GetType() const
Definition: TVirtualPS.h:85
virtual void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)=0
const char * fImplicitCREsc
Definition: TVirtualPS.h:53
#define H(x, y, z)
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
Definition: TVirtualPS.cxx:170
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void CellArrayEnd()=0
virtual void WriteReal(Float_t r, Bool_t space=kTRUE)
Write a Real number to the file.
Definition: TVirtualPS.cxx:185
Marker Attributes class.
Definition: TAttMarker.h:24
static const double x2[5]
Fill Area Attributes class.
Definition: TAttFill.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
Definition: TVirtualPS.cxx:72
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void NewPage()=0
virtual void * GetStream() const
Definition: TVirtualPS.h:81
virtual void Text(Double_t x, Double_t y, const char *string)=0
virtual ~TVirtualPS()
VirtualPS destructor.
Definition: TVirtualPS.cxx:63
TRandom2 r(17)
virtual void Close(Option_t *opt="")=0
Int_t fSizBuffer
Definition: TVirtualPS.h:49
Text Attributes class.
Definition: TAttText.h:24
virtual void CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2)=0
Bool_t fPrinted
Definition: TVirtualPS.h:50
std::ofstream * fStream
Definition: TVirtualPS.h:51
virtual void DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t mode, Int_t border, Int_t dark, Int_t light)=0
virtual void PrintRaw(Int_t len, const char *str)
Print a raw.
Definition: TVirtualPS.cxx:200
static const double x1[5]
double Double_t
Definition: RtypesCore.h:55
virtual void PrintFast(Int_t nch, const char *string="")
Fast version of Print.
Definition: TVirtualPS.cxx:103
int type
Definition: TGX11.cxx:120
Double_t y[n]
Definition: legend1.C:17
virtual void SetType(Int_t=-111)
Definition: TVirtualPS.h:84
#define R__EXTERN
Definition: DllImport.h:27
Int_t fLenBuffer
Definition: TVirtualPS.h:48
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
virtual void DrawPS(Int_t n, Float_t *xw, Float_t *yw)=0
R__EXTERN TVirtualPS * gVirtualPS
Definition: TVirtualPS.h:91
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
Definition: TVirtualPS.h:40
const Bool_t kTRUE
Definition: Rtypes.h:91
TVirtualPS & operator=(const TVirtualPS &)
const Int_t n
Definition: legend1.C:16
Line Attributes class.
Definition: TAttLine.h:24
virtual void Open(const char *filename, Int_t type=-111)=0
Int_t fNByte
Definition: TVirtualPS.h:47
TVirtualPS()
VirtualPS default constructor.
Definition: TVirtualPS.cxx:32