/* $Id: gl2ps.c 173 2007-05-20 15:51:51Z krischnamurti $ */
/*
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2006 Christophe Geuzaine <geuz@geuz.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of either:
*
* a) the GNU Library General Public License as published by the Free
* Software Foundation, either version 2 of the License, or (at your
* option) any later version; or
*
* b) the GL2PS License as published by Christophe Geuzaine, either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
* the GNU Library General Public License or the GL2PS License for
* more details.
*
* 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.
*
* 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
* to provide one.
*
* Contributors:
* Michael Sweet <mike@easysw.com>
* Marc Ume <marc.ume@digitalgraphics.be>
* Jean-Francois Remacle <remacle@gce.ucl.ac.be>
* Bart Kaptein <B.L.Kaptein@lumc.nl>
* Quy Nguyen-Dai <quy@nguyendai.org>
* Sam Buss <sbuss@ucsd.edu>
* Shane Hill <Shane.Hill@dsto.defence.gov.au>
* Romain Boman <r_boman@yahoo.fr>
* Rouben Rostamian <rostamian@umbc.edu>
* Diego Santa Cruz <Diego.SantaCruz@epfl.ch>
* Shahzad Muzaffar <Shahzad.Muzaffar@cern.ch>
* Lassi Tuura <lassi.tuura@cern.ch>
* Guy Barrand <barrand@lal.in2p3.fr>
* Prabhu Ramachandran <prabhu@aero.iitm.ernet.in>
* Micha Bieber <bieber@traits.de>
* Olivier Couet <couet@mail.cern.ch>
* Shai Ayal <shaiay@gmail.com>
* Fabian Wenzel <wenzel@tu-harburg.de>
* Ian D. Gay <gay@sfu.ca>
* Cosmin Truta <cosmin@cs.toronto.edu>
* Baiju Devani <b.devani@gmail.com>
* Alexander Danilov <danilov@lanl.gov>
*
* For the latest info about gl2ps, see http://www.geuz.org/gl2ps/.
* Please report all bugs and problems to <gl2ps@geuz.org>.
*/
#include "gl2ps.h"
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <stdarg.h>
#include <time.h>
#include <float.h>
#if defined(GL2PS_HAVE_ZLIB)
#include <zlib.h>
#endif
#if defined(GL2PS_HAVE_LIBPNG)
#include <png.h>
#endif
/*********************************************************************
*
* Private definitions, data structures and prototypes
*
*********************************************************************/
/* Magic numbers (assuming that the order of magnitude of window
coordinates is 10^3) */
#define GL2PS_EPSILON 5.0e-3F
#define GL2PS_ZSCALE 1000.0F
#define GL2PS_ZOFFSET 5.0e-2F
#define GL2PS_ZOFFSET_LARGE 20.0F
#define GL2PS_ZERO(arg) (fabs(arg) < 1.e-20)
/* Primitive types */
#define GL2PS_NO_TYPE -1
#define GL2PS_TEXT 1
#define GL2PS_POINT 2
#define GL2PS_LINE 3
#define GL2PS_QUADRANGLE 4
#define GL2PS_TRIANGLE 5
#define GL2PS_PIXMAP 6
#define GL2PS_IMAGEMAP 7
#define GL2PS_IMAGEMAP_WRITTEN 8
#define GL2PS_IMAGEMAP_VISIBLE 9
#define GL2PS_SPECIAL 10
/* BSP tree primitive comparison */
#define GL2PS_COINCIDENT 1
#define GL2PS_IN_FRONT_OF 2
#define GL2PS_IN_BACK_OF 3
#define GL2PS_SPANNING 4
/* 2D BSP tree primitive comparison */
#define GL2PS_POINT_COINCIDENT 0
#define GL2PS_POINT_INFRONT 1
#define GL2PS_POINT_BACK 2
/* Internal feedback buffer pass-through tokens */
#define GL2PS_BEGIN_OFFSET_TOKEN 1
#define GL2PS_END_OFFSET_TOKEN 2
#define GL2PS_BEGIN_BOUNDARY_TOKEN 3
#define GL2PS_END_BOUNDARY_TOKEN 4
#define GL2PS_BEGIN_STIPPLE_TOKEN 5
#define GL2PS_END_STIPPLE_TOKEN 6
#define GL2PS_POINT_SIZE_TOKEN 7
#define GL2PS_LINE_WIDTH_TOKEN 8
#define GL2PS_BEGIN_BLEND_TOKEN 9
#define GL2PS_END_BLEND_TOKEN 10
#define GL2PS_SRC_BLEND_TOKEN 11
#define GL2PS_DST_BLEND_TOKEN 12
#define GL2PS_IMAGEMAP_TOKEN 13
#define GL2PS_DRAW_PIXELS_TOKEN 14
#define GL2PS_TEXT_TOKEN 15
typedef enum {
T_UNDEFINED = -1,
T_CONST_COLOR = 1,
T_VAR_COLOR = 1<<1,
T_ALPHA_1 = 1<<2,
T_ALPHA_LESS_1 = 1<<3,
T_VAR_ALPHA = 1<<4
} GL2PS_TRIANGLE_PROPERTY;
typedef GLfloat GL2PSxyz[3];
typedef GLfloat GL2PSplane[4];
typedef struct _GL2PSbsptree2d GL2PSbsptree2d;
struct _GL2PSbsptree2d {
GL2PSplane plane;
GL2PSbsptree2d *front, *back;
};
typedef struct {
GLint nmax, size, incr, n;
char *array;
} GL2PSlist;
typedef struct _GL2PSbsptree GL2PSbsptree;
struct _GL2PSbsptree {
GL2PSplane plane;
GL2PSlist *primitives;
GL2PSbsptree *front, *back;
};
typedef struct {
GL2PSxyz xyz;
GL2PSrgba rgba;
} GL2PSvertex;
typedef struct {
GL2PSvertex vertex[3];
int prop;
} GL2PStriangle;
typedef struct {
GLshort fontsize;
char *str, *fontname;
/* Note: for a 'special' string, 'alignment' holds the format
(PostScript, PDF, etc.) of the special string */
GLint alignment;
GLfloat angle;
} GL2PSstring;
typedef struct {
GLsizei width, height;
/* Note: for an imagemap, 'type' indicates if it has already been
written to the file or not, and 'format' indicates if it is
visible or not */
GLenum format, type;
GLfloat *pixels;
} GL2PSimage;
typedef struct _GL2PSimagemap GL2PSimagemap;
struct _GL2PSimagemap {
GL2PSimage *image;
GL2PSimagemap *next;
};
typedef struct {
GLshort type, numverts;
GLushort pattern;
char boundary, offset, culled;
GLint factor;
GLfloat width;
GL2PSvertex *verts;
union {
GL2PSstring *text;
GL2PSimage *image;
} data;
} GL2PSprimitive;
typedef struct {
#if defined(GL2PS_HAVE_ZLIB)
Bytef *dest, *src, *start;
uLongf destLen, srcLen;
#else
int dummy;
#endif
} GL2PScompress;
typedef struct{
GL2PSlist* ptrlist;
int gsno, fontno, imno, shno, maskshno, trgroupno;
int gsobjno, fontobjno, imobjno, shobjno, maskshobjno, trgroupobjno;
} GL2PSpdfgroup;
typedef struct {
/* General */
GLint format, sort, options, colorsize, colormode, buffersize;
char *title, *producer, *filename;
GLboolean boundary, blending;
GLfloat *feedback, offset[2], lastlinewidth;
GLint viewport[4], blendfunc[2], lastfactor;
GL2PSrgba *colormap, lastrgba, threshold, bgcolor;
GLushort lastpattern;
GL2PSvertex lastvertex;
GL2PSlist *primitives, *auxprimitives;
FILE *stream;
GL2PScompress *compress;
GLboolean header;
/* BSP-specific */
GLint maxbestroot;
/* Occlusion culling-specific */
GLboolean zerosurfacearea;
GL2PSbsptree2d *imagetree;
GL2PSprimitive *primitivetoadd;
/* PDF-specific */
int streamlength;
GL2PSlist *pdfprimlist, *pdfgrouplist;
int *xreflist;
int objects_stack; /* available objects */
int extgs_stack; /* graphics state object number */
int font_stack; /* font object number */
int im_stack; /* image object number */
int trgroupobjects_stack; /* xobject numbers */
int shader_stack; /* shader object numbers */
int mshader_stack; /* mask shader object numbers */
/* for image map list */
GL2PSimagemap *imagemap_head;
GL2PSimagemap *imagemap_tail;
} GL2PScontext;
typedef struct {
void (*printHeader)(void);
void (*printFooter)(void);
void (*beginViewport)(GLint viewport[4]);
GLint (*endViewport)(void);
void (*printPrimitive)(void *data);
void (*printFinalPrimitive)(void);
const char *file_extensio
没有合适的资源?快使用搜索试试~ 我知道了~
qwtplot3d-0.2.7.rar
共280个文件
h:50个
cpp:50个
obj:49个
需积分: 50 33 下载量 117 浏览量
2019-05-03
19:08:42
上传
评论
收藏 14.06MB RAR 举报
温馨提示
QWT3D 和QWT 都是QT的同门师弟,QWT3D主要信赖于QT中的QGLWidget类,可以直接使用opengl 命令,QWT3D的编译比较简单,这里是我已经编译完成的QWT3DPLOT.
资源推荐
资源详情
资源评论
收起资源包目录
qwtplot3d-0.2.7.rar (280个子文件)
dsp.bat 216B
dsp.bat 54B
gl2ps.c 183KB
moc_predefs.h.cbt 57B
COPYING 962B
qrc_images.cpp 109KB
qrc_images.cpp 109KB
qrc_images.cpp 109KB
qrc_images.cpp 109KB
qrc_images.cpp 109KB
mesh2mainwindow.cpp 26KB
moc_qwt3d_plot.cpp 16KB
qwt3d_gridplot.cpp 16KB
qwt3d_coordsys.cpp 16KB
moc_mesh2mainwindow.cpp 16KB
qwt3d_plot.cpp 12KB
qwt3d_mousekeyboard.cpp 11KB
qwt3d_io_gl2ps.cpp 9KB
qwt3d_axis.cpp 8KB
qwt3d_enrichment_std.cpp 8KB
qwt3d_io.cpp 8KB
qwt3d_meshplot.cpp 8KB
axesmainwindow.cpp 7KB
qwt3d_scale.cpp 7KB
qwt3d_autoscaler.cpp 6KB
moc_axesmainwindow.cpp 5KB
qwt3d_label.cpp 5KB
designerworkaround.cpp 5KB
qwt3d_colorlegend.cpp 5KB
moc_lightingdlg.cpp 5KB
enrichments.cpp 5KB
qwt3d_io_reader.cpp 4KB
moc_qwt3d_surfaceplot.cpp 4KB
qwt3d_types.cpp 4KB
lightingdlg.cpp 4KB
qwt3d_lighting.cpp 4KB
qwt3d_surfaceplot.cpp 4KB
moc_enrichmentmainwindow.cpp 4KB
moc_autoswitch.cpp 3KB
qwt3d_drawable.cpp 3KB
enrichmentmainwindow.cpp 3KB
autoswitch.cpp 3KB
qwt3d_movements.cpp 3KB
qwt3d_parametricsurface.cpp 2KB
qwt3d_function.cpp 2KB
simpleplot.cpp 2KB
colormapreader.cpp 2KB
qwt3d_color.cpp 1KB
mesh.cpp 1KB
main.cpp 736B
main.cpp 653B
qwt3d_gridmapping.cpp 647B
main.cpp 643B
lightingdlgbaseimpl.cpp 615B
qwt3d_dataviews.cpp 200B
doxygen.css 5KB
menu.css 428B
Makefile.Debug 233KB
Makefile.Debug 84KB
Makefile.Debug 62KB
Makefile.Debug 54KB
Makefile.Debug 36KB
Makefile.Debug 26KB
Makefile.Debug 19KB
qwtplot3d.dll 879KB
qwtplot3d.dll 879KB
Doxyfile.doxygen 9KB
mesh2.exe 487KB
axes.exe 195KB
enrichments.exe 164KB
simpleplot.exe 98KB
qwtplot3d.exp 116KB
common.vcxproj.filters 2KB
icon.gif 1KB
COPYING.GL2PS 985B
qwt3d_plot.h 13KB
ui_mesh2mainwindowbase4.h 12KB
ui_axesmainwindowbase4.h 11KB
ui_lightingdlgbase4.h 10KB
qwt3d_types.h 9KB
gl2ps.h 7KB
ui_enrichmentmainwindowbase4.h 7KB
qwt3d_axis.h 6KB
qwt3d_surfaceplot.h 4KB
qwt3d_io.h 4KB
functions.h 4KB
qwt3d_coordsys.h 4KB
mesh2mainwindow.h 3KB
qwt3d_scale.h 3KB
qwt3d_openglhelper.h 3KB
qwt3d_io_gl2ps.h 3KB
qwt3d_enrichment_std.h 3KB
qwt3d_colorlegend.h 2KB
qwt3d_label.h 2KB
qwt3d_color.h 2KB
qwt3d_enrichment.h 2KB
lightingdlg.h 2KB
qwt3d_portability.h 2KB
designerworkaround.h 2KB
qwt3d_function.h 2KB
共 280 条
- 1
- 2
- 3
资源评论
weixin_44132138
- 粉丝: 1
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功