[cig-commits] commit: supporting mods for OutputVECTOR

Mercurial hg at geodynamics.org
Mon Nov 24 11:29:21 PST 2008


changeset:   54:ead4cc90eb97
user:        JohnMansour
date:        Mon Apr 21 03:20:07 2008 +0000
files:       DrawingObjects/src/Axis.c DrawingObjects/src/ColourBar.c DrawingObjects/src/SwarmViewerBase.c DrawingObjects/src/TimeStep.c DrawingObjects/src/Title.c DrawingObjects/src/makefile DrawingObjects/tests/makefile OutputFormats/src/Init.c OutputFormats/src/OutputFormats.h OutputFormats/src/makefile OutputFormats/src/types.h RenderingEngines/src/OpenGlUtil.h RenderingEngines/src/RenderingEngineGL.c RenderingEngines/src/makefile RenderingEngines/tests/makefile libglucifer/src/makefile project-config.sh src/makefile
description:
supporting mods for OutputVECTOR


diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/Axis.c
--- a/DrawingObjects/src/Axis.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/Axis.c	Mon Apr 21 03:20:07 2008 +0000
@@ -50,6 +50,10 @@
 
 #include <glucifer/Base/Base.h>
 #include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
 
 #include "types.h"
 #include "OpenGLDrawingObject.h"
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/ColourBar.c
--- a/DrawingObjects/src/ColourBar.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/ColourBar.c	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: ColourBar.c 740 2007-10-11 08:05:31Z SteveQuenette $
+** $Id: ColourBar.c 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -50,6 +50,10 @@
 
 #include <glucifer/Base/Base.h>
 #include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
 
 #include "types.h"
 #include "ColourBar.h"
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/SwarmViewerBase.c
--- a/DrawingObjects/src/SwarmViewerBase.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/SwarmViewerBase.c	Mon Apr 21 03:20:07 2008 +0000
@@ -55,6 +55,10 @@
 #include <glucifer/Base/Base.h>
 #include <glucifer/RenderingEngines/RenderingEngines.h>
 
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
+
 #include "types.h"
 #include "OpenGLDrawingObject.h"
 #include "SwarmViewerBase.h"
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/TimeStep.c
--- a/DrawingObjects/src/TimeStep.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/TimeStep.c	Mon Apr 21 03:20:07 2008 +0000
@@ -50,6 +50,10 @@
 
 #include <glucifer/Base/Base.h>
 #include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
 
 #include "types.h"
 #include "OpenGLDrawingObject.h"
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/Title.c
--- a/DrawingObjects/src/Title.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/Title.c	Mon Apr 21 03:20:07 2008 +0000
@@ -50,6 +50,11 @@
 
 #include <glucifer/Base/Base.h>
 #include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
+
 
 #include "types.h"
 #include "OpenGLDrawingObject.h"
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/src/makefile
--- a/DrawingObjects/src/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/src/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -9,6 +9,10 @@ HDRS := $(wildcard *.h)
 
 packages = PICELLERATOR STGFEM STGDOMAIN STGERMAIN PETSC MPI XML GL
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 # Work out name to call library
 lib = luc$(shell basename `pwd | sed s/src//g`)
 libdynamic = yes
diff -r d287d3173f35 -r ead4cc90eb97 DrawingObjects/tests/makefile
--- a/DrawingObjects/tests/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/DrawingObjects/tests/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -19,6 +19,10 @@ ifdef HAVE_GL
 	packages += GL
 endif
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 packages += PETSC MPI XML 
 
 tests = lib${PROJECT}_DrawingObjects
diff -r d287d3173f35 -r ead4cc90eb97 OutputFormats/src/Init.c
--- a/OutputFormats/src/Init.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/OutputFormats/src/Init.c	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: Init.c 740 2007-10-11 08:05:31Z SteveQuenette $
+** $Id: Init.c 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -57,10 +57,15 @@ Bool lucOutputFormats_Init() {
 	Stg_ComponentRegister* componentRegister = Stg_ComponentRegister_Get_ComponentRegister();
 
 	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
-	
+
 	Stg_ComponentRegister_Add( componentRegister, lucOutputPPM_Type,      "0", _lucOutputPPM_DefaultNew );
 	RegisterParent( lucOutputPPM_Type,         lucOutputFormat_Type );
-		
+
+	#ifdef HAVE_GL2PS
+	  Stg_ComponentRegister_Add( componentRegister, lucOutputVECTOR_Type,      "0", _lucOutputVECTOR_DefaultNew );
+	  RegisterParent( lucOutputVECTOR_Type,         lucOutputFormat_Type );
+	#endif
+
 	#ifdef HAVE_PNG
 	   Stg_ComponentRegister_Add( componentRegister, lucOutputPNG_Type,      "0", _lucOutputPNG_DefaultNew );
 	   RegisterParent( lucOutputPNG_Type,         lucOutputFormat_Type );
diff -r d287d3173f35 -r ead4cc90eb97 OutputFormats/src/OutputFormats.h
--- a/OutputFormats/src/OutputFormats.h	Mon Apr 21 03:17:44 2008 +0000
+++ b/OutputFormats/src/OutputFormats.h	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: OutputFormats.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** $Id: OutputFormats.h 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -49,6 +49,7 @@
 
 
 #include "types.h"
+#include "OutputVECTOR.h"
 #include "OutputPPM.h"
 #include "OutputPNG.h"
 #include "OutputJPEG.h"
diff -r d287d3173f35 -r ead4cc90eb97 OutputFormats/src/makefile
--- a/OutputFormats/src/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/OutputFormats/src/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -9,6 +9,10 @@ HDRS := $(wildcard *.h)
 
 packages = STGDOMAIN STGERMAIN MPI XML TIFF JPEG PNG LIBFAME LIBAVCODEC
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 # Work out name to call library
 lib = luc$(shell basename `pwd | sed s/src//g`)
 libdynamic = yes
diff -r d287d3173f35 -r ead4cc90eb97 OutputFormats/src/types.h
--- a/OutputFormats/src/types.h	Mon Apr 21 03:17:44 2008 +0000
+++ b/OutputFormats/src/types.h	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: types.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** $Id: types.h 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -47,6 +47,7 @@
 #ifndef __lucOutputFormats_types_h__
 #define __lucOutputFormats_types_h__
 
+	typedef struct lucOutputVECTOR        lucOutputVECTOR;
 	typedef struct lucOutputPPM           lucOutputPPM;
 	typedef struct lucOutputPNG           lucOutputPNG;
 	typedef struct lucOutputJPEG          lucOutputJPEG;
diff -r d287d3173f35 -r ead4cc90eb97 RenderingEngines/src/OpenGlUtil.h
--- a/RenderingEngines/src/OpenGlUtil.h	Mon Apr 21 03:17:44 2008 +0000
+++ b/RenderingEngines/src/OpenGlUtil.h	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: OpenGlUtil.h 520 2006-03-15 05:36:31Z LouisMoresi $
+** $Id: OpenGlUtil.h 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -47,7 +47,14 @@
 #ifndef __lucRenderingEngines_OpenGlUtil_h__
 #define __lucRenderingEngines_OpenGlUtil_h__
 
-#define lucPrintString( A )        glCallLists( strlen( A ), GL_UNSIGNED_BYTE, A )
+#ifdef HAVE_GL2PS
+/* call to gl2pText is required for text output using vector formats, 
+ * as no text is stored in the GL feedback buffer */  
+	#define lucPrintString( A )       gl2psText( A, "Times-Roman", 16); glCallLists( strlen( A ), GL_UNSIGNED_BYTE, A )
+#else
+	#define lucPrintString( A )       glCallLists( strlen( A ), GL_UNSIGNED_BYTE, A )
+#endif
+
 /* Big hack !! - Assumes that font width is 10 pixels - this is hardly ever true */
 #define lucStringWidth( A )     (strlen( A ) * 10) 
 
diff -r d287d3173f35 -r ead4cc90eb97 RenderingEngines/src/RenderingEngineGL.c
--- a/RenderingEngines/src/RenderingEngineGL.c	Mon Apr 21 03:17:44 2008 +0000
+++ b/RenderingEngines/src/RenderingEngineGL.c	Mon Apr 21 03:20:07 2008 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: RenderingEngineGL.c 740 2007-10-11 08:05:31Z SteveQuenette $
+** $Id: RenderingEngineGL.c 768 2008-04-21 03:20:07Z JohnMansour $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -58,6 +58,10 @@
 #include <gl.h>
 #include <glu.h>
 #include <string.h>
+
+#ifdef HAVE_GL2PS
+	#include <gl2ps.h>
+#endif
 
 #ifndef MASTER
 	#define MASTER 0
@@ -178,7 +182,8 @@ void _lucRenderingEngineGL_Render( void*
 	Viewport_Index        viewport_I;
 	Viewport_Index        viewportCount     = window->viewportCount;
 	lucViewportInfo*      viewportInfo;
-
+	GLint                 viewport_gl2ps[4], state;
+	
 	Journal_DPrintfL( lucDebug, 2, "In func: %s for %s '%s'\n", __func__, self->type, self->name );
 	Stream_Indent( lucDebug );
 
@@ -217,7 +222,17 @@ void _lucRenderingEngineGL_Render( void*
 			Stream_UnIndent( lucDebug );
 			continue;
 		}
-
+		
+		#ifdef HAVE_GL2PS
+			/* calls to gl2ps so that different viewports are created for vector image outputs */
+			glGetIntegerv(GL_VIEWPORT, viewport_gl2ps);
+			state = gl2psBeginViewport(viewport_gl2ps);
+			if(state == 5)
+				Journal_Printf( Journal_MyStream( Error_Type, self ), "\nError. Insufficient GL feedback buffer size. \ 
+										       \nConsider increasing the OutputVECTOR buffersize. \
+										      \nVector image will not be created correctly.\n\n" );
+		#endif
+		
 		lucRenderingEngineGL_Clear( self, window );
 
 		if (context->rank == MASTER)
@@ -247,6 +262,14 @@ void _lucRenderingEngineGL_Render( void*
 
 		Stream_UnIndent( lucDebug );
 		Journal_DPrintfL( lucDebug, 2, "Finised loop.\n" );
+
+		#ifdef HAVE_GL2PS		
+			state = gl2psEndViewport();
+			if(state == 5)
+				Journal_Printf( Journal_MyStream( Error_Type, self ), "\nError. Insufficient GL feedback buffer size. \ 
+										       \nConsider increasing the OutputVECTOR buffersize. \
+										      \nVector image will not be created correctly.\n\n" );
+		#endif		
 	}
 	
 	Stream_UnIndent( lucDebug );
diff -r d287d3173f35 -r ead4cc90eb97 RenderingEngines/src/makefile
--- a/RenderingEngines/src/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/RenderingEngines/src/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -13,6 +13,10 @@ ifdef HAVE_VTK
 	packages += VTK
 endif
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 # Work out name to call library
 lib = luc$(shell basename `pwd | sed s/src//g`)
 libdynamic = yes
diff -r d287d3173f35 -r ead4cc90eb97 RenderingEngines/tests/makefile
--- a/RenderingEngines/tests/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/RenderingEngines/tests/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -12,6 +12,10 @@ subdirs = DummyOpenGL
 
 packages = STGDOMAIN STGERMAIN GL PETSC MPI XML 
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 tests = lib${PROJECT}_RenderingEngines
 SRCS = $(wildcard *.c)
 checks = $(wildcard *.sh)
diff -r d287d3173f35 -r ead4cc90eb97 libglucifer/src/makefile
--- a/libglucifer/src/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/libglucifer/src/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -73,6 +73,10 @@ ifdef HAVE_LIBAVCODEC
 	packages += LIBAVCODEC
 endif
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 ifdef HAVE_VTK
 	packages += VTK
 endif
diff -r d287d3173f35 -r ead4cc90eb97 project-config.sh
--- a/project-config.sh	Mon Apr 21 03:17:44 2008 +0000
+++ b/project-config.sh	Mon Apr 21 03:20:07 2008 +0000
@@ -16,7 +16,7 @@
 ## Role:
 ##	Obtain the project configuration.
 ##
-## $Id: project-config.sh 740 2007-10-11 08:05:31Z SteveQuenette $
+## $Id: project-config.sh 768 2008-04-21 03:20:07Z JohnMansour $
 ##
 ##
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -54,4 +54,5 @@ setValue  PROJECT 'glucifer'
 . ./VMake/Config/OpenGl-config.sh
 . ./VMake/Config/X11-config.sh
 . ./VMake/Config/ImageFormats-config.sh
+. ./VMake/Config/gl2ps-config.sh
 
diff -r d287d3173f35 -r ead4cc90eb97 src/makefile
--- a/src/makefile	Mon Apr 21 03:17:44 2008 +0000
+++ b/src/makefile	Mon Apr 21 03:20:07 2008 +0000
@@ -39,6 +39,10 @@ ifdef HAVE_LIBAVCODEC
 	packages += LIBAVCODEC
 endif
 
+ifdef HAVE_GL2PS
+	packages += GL2PS
+endif
+
 packages += PETSC MPI XML
 
 include ${PROJ_ROOT}/Makefile.vmake



More information about the CIG-COMMITS mailing list