Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9c5277ff
Commit
9c5277ff
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
6045c3e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Graphics/gl2ps.cpp
+20
-21
20 additions, 21 deletions
Graphics/gl2ps.cpp
Graphics/gl2ps.h
+2
-2
2 additions, 2 deletions
Graphics/gl2ps.h
with
22 additions
and
23 deletions
Graphics/gl2ps.cpp
+
20
−
21
View file @
9c5277ff
/*
/*
* GL2PS, an OpenGL to Postscript Printing Library, version 0.32
* GL2PS, an OpenGL to Postscript Printing Library, version 0.32
* Copyright (C) 1999-200
0
Christophe Geuzaine
* Copyright (C) 1999-200
1
Christophe Geuzaine
*
*
*
Last Mod by Christophe on Mon Aug 14 23:49:15 2000
*
$Id: gl2ps.cpp,v 1.13 2001-05-23 19:06:41 geuzaine Exp $
*
*
* E-mail: Christophe.Geuzaine@AdValvas.be
* E-mail: Christophe.Geuzaine@AdValvas.be
* URL: http://www.geuz.org/gl2ps/
* URL: http://www.geuz.org/gl2ps/
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
*
*
*/
*/
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
#include
<string.h>
#include
<string.h>
...
@@ -59,14 +58,14 @@ GLvoid *gl2psMalloc(size_t size){
...
@@ -59,14 +58,14 @@ GLvoid *gl2psMalloc(size_t size){
if
(
!
size
)
return
(
NULL
);
if
(
!
size
)
return
(
NULL
);
ptr
=
malloc
(
size
);
ptr
=
malloc
(
size
);
if
(
!
ptr
)
gl2psMsg
(
GL2PS_ERROR
,
"Couldn't
A
llocate
R
equested
M
emory"
);
if
(
!
ptr
)
gl2psMsg
(
GL2PS_ERROR
,
"Couldn't
a
llocate
r
equested
m
emory"
);
return
(
ptr
);
return
(
ptr
);
}
}
GLvoid
*
gl2psRealloc
(
GLvoid
*
ptr
,
size_t
size
){
GLvoid
*
gl2psRealloc
(
GLvoid
*
ptr
,
size_t
size
){
if
(
!
size
)
return
(
NULL
);
if
(
!
size
)
return
(
NULL
);
ptr
=
realloc
(
ptr
,
size
);
ptr
=
realloc
(
ptr
,
size
);
if
(
!
ptr
)
gl2psMsg
(
GL2PS_ERROR
,
"Couldn't
R
eallocate
R
equested
M
emory"
);
if
(
!
ptr
)
gl2psMsg
(
GL2PS_ERROR
,
"Couldn't
r
eallocate
r
equested
m
emory"
);
return
(
ptr
);
return
(
ptr
);
}
}
...
@@ -121,7 +120,7 @@ GLint gl2psListNbr(GL2PSlist *list){
...
@@ -121,7 +120,7 @@ GLint gl2psListNbr(GL2PSlist *list){
GLvoid
*
gl2psListPointer
(
GL2PSlist
*
list
,
GLint
index
){
GLvoid
*
gl2psListPointer
(
GL2PSlist
*
list
,
GLint
index
){
if
((
index
<
0
)
||
(
index
>=
list
->
n
))
if
((
index
<
0
)
||
(
index
>=
list
->
n
))
gl2psMsg
(
GL2PS_ERROR
,
"Wrong
L
ist
I
ndex in gl2psListPointer"
);
gl2psMsg
(
GL2PS_ERROR
,
"Wrong
l
ist
i
ndex in gl2psListPointer"
);
return
(
&
list
->
array
[
index
*
list
->
size
]);
return
(
&
list
->
array
[
index
*
list
->
size
]);
}
}
...
@@ -176,7 +175,7 @@ GLvoid gl2psGetNormal(GLfloat *a, GLfloat *b, GLfloat *c){
...
@@ -176,7 +175,7 @@ GLvoid gl2psGetNormal(GLfloat *a, GLfloat *b, GLfloat *c){
c
[
2
]
=
c
[
2
]
/
norm
;
c
[
2
]
=
c
[
2
]
/
norm
;
}
}
else
else
gl2psMsg
(
GL2PS_WARNING
,
"Bad
P
lane in BSP
T
ree"
);
gl2psMsg
(
GL2PS_WARNING
,
"Bad
p
lane in BSP
t
ree"
);
}
}
GLvoid
gl2psGetPlane
(
GL2PSprimitive
*
prim
,
GL2PSplane
plane
){
GLvoid
gl2psGetPlane
(
GL2PSprimitive
*
prim
,
GL2PSplane
plane
){
...
@@ -231,7 +230,7 @@ GLvoid gl2psGetPlane(GL2PSprimitive *prim, GL2PSplane plane){
...
@@ -231,7 +230,7 @@ GLvoid gl2psGetPlane(GL2PSprimitive *prim, GL2PSplane plane){
plane
[
3
]
=
-
prim
->
verts
[
0
].
xyz
[
2
];
plane
[
3
]
=
-
prim
->
verts
[
0
].
xyz
[
2
];
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
P
rimitive
T
ype in BSP
T
ree"
);
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
p
rimitive
t
ype in BSP
t
ree"
);
}
}
}
}
...
@@ -273,7 +272,7 @@ GLvoid gl2psCreateSplittedPrimitive(GL2PSprimitive *parent, GL2PSplane plane,
...
@@ -273,7 +272,7 @@ GLvoid gl2psCreateSplittedPrimitive(GL2PSprimitive *parent, GL2PSplane plane,
GLshort
i
;
GLshort
i
;
if
(
numverts
>
4
){
if
(
numverts
>
4
){
gl2psMsg
(
GL2PS_WARNING
,
"%d
V
ertices in
P
olygon"
,
numverts
);
gl2psMsg
(
GL2PS_WARNING
,
"%d
v
ertices in
p
olygon"
,
numverts
);
numverts
=
4
;
numverts
=
4
;
}
}
...
@@ -540,7 +539,7 @@ GLvoid gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives){
...
@@ -540,7 +539,7 @@ GLvoid gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives){
tree
->
front
=
(
GL2PSbsptree
*
)
gl2psMalloc
(
sizeof
(
GL2PSbsptree
));
tree
->
front
=
(
GL2PSbsptree
*
)
gl2psMalloc
(
sizeof
(
GL2PSbsptree
));
gl2psBuildBspTree
(
tree
->
front
,
frontlist
);
gl2psBuildBspTree
(
tree
->
front
,
frontlist
);
}
}
else
else
gl2psListDelete
(
frontlist
);
gl2psListDelete
(
frontlist
);
if
(
gl2psListNbr
(
backlist
)){
if
(
gl2psListNbr
(
backlist
)){
...
@@ -855,10 +854,10 @@ GLvoid gl2psPrintPrimitive(GLvoid *a, GLvoid *b){
...
@@ -855,10 +854,10 @@ GLvoid gl2psPrintPrimitive(GLvoid *a, GLvoid *b){
}
}
break
;
break
;
case
GL2PS_QUADRANGLE
:
case
GL2PS_QUADRANGLE
:
gl2psMsg
(
GL2PS_WARNING
,
"There
S
hould not be any
Q
uad left to
P
rint"
);
gl2psMsg
(
GL2PS_WARNING
,
"There
s
hould not be any
q
uad left to
p
rint"
);
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
T
ype of
P
rimitive to
P
rint"
);
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
t
ype of
p
rimitive to
p
rint"
);
break
;
break
;
}
}
}
}
...
@@ -973,12 +972,12 @@ GLint gl2psParseFeedbackBuffer(GLvoid){
...
@@ -973,12 +972,12 @@ GLint gl2psParseFeedbackBuffer(GLvoid){
used
=
glRenderMode
(
GL_RENDER
);
used
=
glRenderMode
(
GL_RENDER
);
if
(
used
<
0
){
if
(
used
<
0
){
gl2psMsg
(
GL2PS_INFO
,
"OpenGL
F
eedback
B
uffer
R
eallocation"
);
gl2psMsg
(
GL2PS_INFO
,
"OpenGL
f
eedback
b
uffer
r
eallocation"
);
return
GL2PS_OVERFLOW
;
return
GL2PS_OVERFLOW
;
}
}
if
(
used
==
0
){
if
(
used
==
0
){
gl2psMsg
(
GL2PS_WARNING
,
"Empty
F
eedback
B
uffer"
);
gl2psMsg
(
GL2PS_WARNING
,
"Empty
f
eedback
b
uffer"
);
return
GL2PS_NO_FEEDBACK
;
return
GL2PS_NO_FEEDBACK
;
}
}
...
@@ -1060,7 +1059,7 @@ GLint gl2psParseFeedbackBuffer(GLvoid){
...
@@ -1060,7 +1059,7 @@ GLint gl2psParseFeedbackBuffer(GLvoid){
used
-=
2
;
used
-=
2
;
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
T
oken in
B
uffer"
);
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
t
oken in
b
uffer"
);
current
++
;
current
++
;
used
--
;
used
--
;
break
;
break
;
...
@@ -1104,7 +1103,7 @@ GLvoid gl2psPrintPostscriptHeader(GLvoid){
...
@@ -1104,7 +1103,7 @@ GLvoid gl2psPrintPostscriptHeader(GLvoid){
"%%%%Orientation: Portrait
\n
"
"%%%%Orientation: Portrait
\n
"
"%%%%DocumentMedia: Default %d %d 0 () ()
\n
"
"%%%%DocumentMedia: Default %d %d 0 () ()
\n
"
"%%%%BoundingBox: %d %d %d %d
\n
"
"%%%%BoundingBox: %d %d %d %d
\n
"
"%%%%Copyright: GNU LGPL (C) 1999-200
0
Christophe.Geuzaine@AdValvas.be
\n
"
"%%%%Copyright: GNU LGPL (C) 1999-200
1
Christophe.Geuzaine@AdValvas.be
\n
"
"%%%%EndComments
\n
"
"%%%%EndComments
\n
"
"%%%%BeginProlog
\n
"
"%%%%BeginProlog
\n
"
"/gl2psdict 64 dict def gl2psdict begin
\n
"
"/gl2psdict 64 dict def gl2psdict begin
\n
"
...
@@ -1225,12 +1224,12 @@ GLvoid gl2psBeginPage(char *title, char *producer, GLint sort, GLint options,
...
@@ -1225,12 +1224,12 @@ GLvoid gl2psBeginPage(char *title, char *producer, GLint sort, GLint options,
memcpy
(
gl2ps
.
colormap
,
colormap
,
gl2ps
.
colorsize
*
sizeof
(
GL2PSrgba
));
memcpy
(
gl2ps
.
colormap
,
colormap
,
gl2ps
.
colorsize
*
sizeof
(
GL2PSrgba
));
}
}
else
else
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
C
olor
M
ode in gl2psBeginPage"
);
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
c
olor
m
ode in gl2psBeginPage"
);
if
(
stream
)
if
(
stream
)
gl2ps
.
stream
=
stream
;
gl2ps
.
stream
=
stream
;
else
else
gl2psMsg
(
GL2PS_ERROR
,
"Bad
F
ile
P
ointer"
);
gl2psMsg
(
GL2PS_ERROR
,
"Bad
f
ile
p
ointer"
);
glFeedbackBuffer
(
gl2ps
.
buffersize
,
GL_3D_COLOR
,
gl2ps
.
feedback
);
glFeedbackBuffer
(
gl2ps
.
buffersize
,
GL_3D_COLOR
,
gl2ps
.
feedback
);
glRenderMode
(
GL_FEEDBACK
);
glRenderMode
(
GL_FEEDBACK
);
...
@@ -1278,7 +1277,7 @@ GLint gl2psEndPage(GLvoid){
...
@@ -1278,7 +1277,7 @@ GLint gl2psEndPage(GLvoid){
res
=
GL2PS_SUCCESS
;
res
=
GL2PS_SUCCESS
;
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
S
orting
A
lgorithm"
);
gl2psMsg
(
GL2PS_ERROR
,
"Unknown
s
orting
a
lgorithm"
);
}
}
fprintf
(
gl2ps
.
stream
,
fprintf
(
gl2ps
.
stream
,
"grestore
\n
"
"grestore
\n
"
...
@@ -1339,7 +1338,7 @@ GLvoid gl2psEnable(GLint mode){
...
@@ -1339,7 +1338,7 @@ GLvoid gl2psEnable(GLint mode){
glPassThrough
(
GL2PS_BEGIN_LINE_STIPPLE
);
glPassThrough
(
GL2PS_BEGIN_LINE_STIPPLE
);
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
M
ode in gl2psEnable"
);
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
m
ode in gl2psEnable"
);
break
;
break
;
}
}
}
}
...
@@ -1356,7 +1355,7 @@ GLvoid gl2psDisable(GLint mode){
...
@@ -1356,7 +1355,7 @@ GLvoid gl2psDisable(GLint mode){
glPassThrough
(
GL2PS_END_LINE_STIPPLE
);
glPassThrough
(
GL2PS_END_LINE_STIPPLE
);
break
;
break
;
default
:
default
:
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
M
ode in gl2psDisable"
);
gl2psMsg
(
GL2PS_WARNING
,
"Unknown
m
ode in gl2psDisable"
);
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Graphics/gl2ps.h
+
2
−
2
View file @
9c5277ff
/*
/*
* GL2PS, an OpenGL to Postscript Printing Library, version 0.32
* GL2PS, an OpenGL to Postscript Printing Library, version 0.32
* Copyright (C) 1999-200
0
Christophe Geuzaine
* Copyright (C) 1999-200
1
Christophe Geuzaine
*
*
*
Last Mod by Christophe on Sun Oct 1 20:31:44 2000
*
$Id: gl2ps.h,v 1.8 2001-05-23 19:06:41 geuzaine Exp $
*
*
* E-mail: Christophe.Geuzaine@AdValvas.be
* E-mail: Christophe.Geuzaine@AdValvas.be
* URL: http://www.geuz.org/gl2ps/
* URL: http://www.geuz.org/gl2ps/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment