Commit 13ddc51b authored by David C. Lonie's avatar David C. Lonie

Sync with svn version of gl2ps.

Recent modifications to our bundled gl2ps library have been merged
upstream.

The modification that disabled writing a timestamp has been removed,
as the timestamp will no longer break tests. The associated API in
vtkGL2PSExporter (which was new) has been removed.

Change-Id: Ic26eeabf84ad8a46bada6d9eb192455fe7c672a6
parent 29f3b90f
......@@ -71,7 +71,6 @@ int TestContextGL2PS( int, char *[] )
std::string("/TestContextGL2PS");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
return EXIT_SUCCESS;
......
......@@ -76,7 +76,6 @@ int TestGL2PSExporterMultipleRenderers( int, char *[] )
std::string("/TestGL2PSExporterMultipleRenderers");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
renWin->SetMultiSamples(0);
......
......@@ -116,7 +116,6 @@ int TestGL2PSExporterRaster( int, char *[] )
std::string("/TestGL2PSExporterRaster");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
return EXIT_SUCCESS;
......
......@@ -120,7 +120,6 @@ int TestGL2PSExporterRasterExclusion( int, char *[] )
std::string("/TestGL2PSExporterRasterExclusion");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
renWin->GetInteractor()->Initialize();
......
......@@ -116,7 +116,6 @@ int TestGL2PSExporterVector( int, char *[] )
std::string("/TestGL2PSExporterVector");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
return EXIT_SUCCESS;
......
......@@ -135,7 +135,6 @@ int TestGL2PSExporterVolumeRaster( int, char *[] )
std::string("/TestGL2PSExporterVolumeRaster");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
return EXIT_SUCCESS;
......
......@@ -96,7 +96,6 @@ int TestGL2PSTextActor3D(int, char *[])
std::string("/TestGL2PSTextActor3D");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
// Finally render the scene and compare the image to a reference image
......
......@@ -134,7 +134,6 @@ int TestStackedPlotGL2PS(int , char * [])
std::string("/TestStackedPlotGL2PS");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
//Finally render the scene and compare the image to a reference image
......
......@@ -74,7 +74,6 @@ vtkGL2PSExporter::vtkGL2PSExporter()
this->PS3Shading = 1;
this->OcclusionCull = 1;
this->Write3DPropsAsRasterImage = 0;
this->WriteTimeStamp = 1;
this->PixelData = NULL;
}
......@@ -210,9 +209,6 @@ void vtkGL2PSExporter::WriteData()
viewport, format, sort, options, GL_RGBA, 0,
NULL, 0, 0, 0, buffsize, fpObj, fName);
if (!this->WriteTimeStamp)
gl2psDisable(GL2PS_TIMESTAMP);
// Render non-specialized geometry by either passing in the raster image or
// rendering into the feedback buffer.
if (this->Write3DPropsAsRasterImage)
......
......@@ -266,12 +266,6 @@ public:
void SetRasterExclusions(vtkProp3DCollection*);
vtkGetObjectMacro(RasterExclusions, vtkProp3DCollection);
// Description:
// Turn on/off the timestamp in the produced output. Defaults to on.
vtkSetMacro(WriteTimeStamp, int);
vtkGetMacro(WriteTimeStamp, int);
vtkBooleanMacro(WriteTimeStamp, int);
protected:
vtkGL2PSExporter();
~vtkGL2PSExporter();
......@@ -340,7 +334,6 @@ protected:
int PS3Shading;
int OcclusionCull;
int Write3DPropsAsRasterImage;
int WriteTimeStamp;
float *PixelData;
int PixelDataSize[2];
......
......@@ -53,7 +53,7 @@ void vtkGL2PSUtilities::DrawString(const char *str,
rgba[3] = tprop->GetOpacity();
glRasterPos3dv(pos);
gl2psTextOpt(str, fontname, fontSize, align, angle, rgba);
gl2psTextOptColor(str, fontname, fontSize, align, angle, rgba);
}
const char *vtkGL2PSUtilities::TextPropertyToPSFontName(vtkTextProperty *tprop)
......
......@@ -93,7 +93,6 @@ int TestGL2PSMathTextActor(int, char *[])
std::string("/TestGL2PSMathTextActor");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
// Finally render the scene and compare the image to a reference image
......
......@@ -96,7 +96,6 @@ int TestGL2PSMathTextActor3D(int, char *[])
std::string("/TestGL2PSMathTextActor3D");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
// Finally render the scene and compare the image to a reference image
......
......@@ -66,7 +66,6 @@ int TestGL2PSMathTextOutput(int, char *[])
std::string("/TestGL2PSMathTextOutput");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
return EXIT_SUCCESS;
......
......@@ -65,7 +65,6 @@ int TestGL2PSMathTextScaling(int, char *[])
std::string("/TestGL2PSMathTextScaling");
exp->SetFilePrefix(fileprefix.c_str());
exp->WriteTimeStampOff(); // Otherwise hashes won't match
exp->Write();
view->GetInteractor()->Initialize();
......
......@@ -12,21 +12,5 @@ modifications to this copy of the GL2PS sources.
Modifications to the GL2PS library
----------------------------------
The gl2psTextOpt function has been modified to accept a color argument. The
default mechanism for coloring text in GL2PS querys the GL current raster color,
which is not required to be valid during feedback rendering. By passing the
color directly to GL2PS, this ambiguity is avoided.
The glSpecial mechanism for inserting PDF drawing instructions has been
fixed/implemented.
In order to avoid linking errors we have modified gl2ps to include vtk_zlib.h
and vtk_png.h instead of the {zlib,png}.h headers.
To aid with regression testing, which is currently performed using MD5 hashes,
an additional option for gl2psEnable/Disable is added, GL2PS_TIMESTAMP, which,
if enabled, replaces the output file's timestamp with a static string.
An additional function, gl2psGetFileFormat(), has been added to the GL2PS API
to allow VTK utilities to query the type of file being produced during GL2PS
export.
This diff is collapsed.
/*
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2011 C. Geuzaine
* Copyright (C) 1999-2012 C. Geuzaine
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of either:
......@@ -20,8 +20,8 @@
*
* You should have received a copy of the GNU Library General Public
* License along with this library in the file named "COPYING.LGPL";
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge, MA 02139, USA.
* if not, write to the Free Software Foundation, Inc., 51 Franklin
* Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* You should have received a copy of the GL2PS License with this
* library in the file named "COPYING.GL2PS"; if not, I will be glad
......@@ -80,14 +80,14 @@
#define GL2PS_MAJOR_VERSION 1
#define GL2PS_MINOR_VERSION 3
#define GL2PS_PATCH_VERSION 6
#define GL2PS_PATCH_VERSION 8
#define GL2PS_EXTRA_VERSION ""
#define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \
0.01 * GL2PS_MINOR_VERSION + \
0.0001 * GL2PS_PATCH_VERSION)
#define GL2PS_COPYRIGHT "(C) 1999-2011 C. Geuzaine"
#define GL2PS_COPYRIGHT "(C) 1999-2012 C. Geuzaine"
/* Output file formats (the values and the ordering are important!) */
......@@ -137,8 +137,6 @@
#define GL2PS_POLYGON_BOUNDARY 2
#define GL2PS_LINE_STIPPLE 3
#define GL2PS_BLEND 4
// Custom VTK options:
#define GL2PS_TIMESTAMP 10
/* Text alignment (o=raster position; default mode is BL):
+---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o
......@@ -176,8 +174,10 @@ GL2PSDLL_API GLint gl2psEndViewport(void);
GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname,
GLshort fontsize);
GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname,
GLshort fontsize, GLint align, GLfloat angle,
GL2PSrgba color_rgba);
GLshort fontsize, GLint align, GLfloat angle);
GL2PSDLL_API GLint gl2psTextOptColor(const char *str, const char *fontname,
GLshort fontsize, GLint align, GLfloat angle,
GL2PSrgba color);
GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str);
GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height,
GLint xorig, GLint yorig,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment