48 return CapturePostscript(viewer, format, filePath);
69 if (!filePath || !filePath[0]) {
71 filePath =
"viewer.eps";
73 filePath =
"viewer.pdf";
76 Info(
"TGLOutput::Postscript()",
"Start creating %s.", filePath);
77 std::cout <<
"Please wait.";
79 if (FILE *
output = fopen (filePath,
"w+b"))
109 buffsize += 1024*1024;
113 GL_RGBA, 0,
NULL,0, 0, 0,
119 std::cout << std::endl;
123 Info(
"TGLOutput::Postscript",
"Finished creating %s.", filePath);
127 Error(
"TGLOutput::Postscript",
"Failed to create %s. ", filePath);
138 Info(
"TGLOutput::StartEmbeddedPS",
"PS output started ...");
143 Double_t xx[2] = {0.}, yy[2] = {0.};
144 xx[0] =
gPad->GetUxmin();
145 yy[0] =
gPad->GetUymin();
146 xx[1] =
gPad->GetUxmax();
147 yy[1] =
gPad->GetUymax();
151 glGetIntegerv(GL_VIEWPORT,vp);
190 Info(
"TGLOutput::CloseEmbeddedPS",
"PS output finished");
204 Error(
"TGLOutput::Capture",
"can not open file for embedding ps");
216 buffsize += 1024*1024;
220 GL_RGBA, 0,
NULL,0, 0, 0,
221 buffsize, output,
NULL);
227 std::cout << std::endl;
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void SetStream(std::ofstream *os)
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, GLint viewport[4], GLint format, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint nr, GLint ng, GLint nb, GLint buffersize, FILE *stream, const char *filename)
void DoDraw(Bool_t swap_buffers=kTRUE)
Draw out the viewer.
virtual void WriteInteger(Int_t i, Bool_t space=kTRUE)
Write one Integer to the file.
static std::string format(double x, double y, int digits, int width)
#define GL2PS_OCCLUSION_CULL
static Bool_t CapturePostscript(TGLViewer &viewer, EFormat format, const char *filePath)
Capture viewer to postscript file.
Wrapper class for GL capture & output routines.
virtual void PrintStr(const char *string="")
Output the string str in the output buffer.
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
GL2PSDLL_API GLint gl2psEndPage(void)
#define GL2PS_USE_CURRENT_VIEWPORT
static void StartEmbeddedPS()
this function used by gl-in-pad
R__EXTERN TSystem * gSystem
Bool_t fIsPrinting
debug mode (forced rebuild + draw scene/frustum/interest boxes)
virtual const char * GetName() const
Returns name of object.
#define GL2PS_SIMPLE_SORT
Base GL viewer object - used by both standalone and embedded (in pad) GL.
ClassImp(TGLOutput) Bool_t TGLOutput
Capture viewer to file.
static Bool_t Capture(TGLViewer &viewer, EFormat format, const char *filePath=0)
static void CloseEmbeddedPS()
this function used by gl-in-pad Restore the gVirtualPS output stream
virtual void DrawPS(Int_t n, Float_t *xw, Float_t *yw)=0
virtual void * GetStream() const
R__EXTERN TVirtualPS * gVirtualPS
static void output(int code)