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
e26469e8
Commit
e26469e8
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
polish and document new image drawing functions
parent
f54d3243
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Graphics/drawContext.cpp
+6
-0
6 additions, 0 deletions
Graphics/drawContext.cpp
Graphics/drawGlyph.cpp
+3
-3
3 additions, 3 deletions
Graphics/drawGlyph.cpp
doc/texinfo/gmsh.texi
+13
-4
13 additions, 4 deletions
doc/texinfo/gmsh.texi
with
22 additions
and
7 deletions
Graphics/drawContext.cpp
+
6
−
0
View file @
e26469e8
...
...
@@ -18,6 +18,7 @@
#include
"PViewOptions.h"
#include
"VertexArray.h"
#include
"StringUtils.h"
#include
"OS.h"
#include
"gl2ps.h"
#if defined(HAVE_FLTK)
...
...
@@ -381,6 +382,11 @@ bool drawContext::generateTextureForImage(const std::string &name, int page,
GLuint
&
imageTexture
,
GLuint
&
imageW
,
GLuint
&
imageH
)
{
if
(
StatFile
(
name
)){
Msg
::
Warning
(
"Could not open file `%s'"
,
name
.
c_str
());
return
false
;
}
std
::
string
ext
=
SplitFileName
(
name
)[
2
];
if
(
ext
==
".pdf"
||
ext
==
".PDF"
){
#if defined(HAVE_POPPLER)
...
...
This diff is collapsed.
Click to expand it.
Graphics/drawGlyph.cpp
+
3
−
3
View file @
e26469e8
...
...
@@ -137,15 +137,15 @@ void drawContext::drawImage(const std::string &name, double x, double y, double
{
// format can be "@wxh" or "@wxh,wx,wy,wz,hx,hy,hz", where w and h are the
// width and height (in model coordinates for T3 or in pixels for T2) of the
// image, wx,wy,wz is direction of the bottom edge of the image and
hx,hy,hz
// is the direction of the left edge of the image.
// image, wx,wy,wz is
the
direction of the bottom edge of the image and
//
hx,hy,hz
is the direction of the left edge of the image.
size_t
p
=
name
.
find_last_of
(
"@"
);
std
::
string
file
=
name
,
format
;
if
(
p
!=
std
::
string
::
npos
){
format
=
name
.
substr
(
p
+
1
);
file
=
name
.
substr
(
0
,
p
);
}
double
w
=
0.
,
h
=
0.
,
wx
=
1.
,
wy
=
0.
,
wz
=
0.
,
hx
=
0.
,
hy
=
0
.
,
hz
=
0.
;
double
w
=
0.
,
h
=
0.
,
wx
=
1.
,
wy
=
0.
,
wz
=
0.
,
hx
=
0.
,
hy
=
1
.
,
hz
=
0.
;
if
(
format
.
size
()){
bool
ok
;
if
(
format
.
find
(
","
)
!=
std
::
string
::
npos
)
...
...
This diff is collapsed.
Click to expand it.
doc/texinfo/gmsh.texi
+
13
−
4
View file @
e26469e8
...
...
@@ -1141,9 +1141,10 @@ Character expressions are defined as:
@end example
@code
{
Today
}
returns the current date. @code
{
OnelabAction
}
returns the
current ONELAB action. @code
{
GmshExecutableName
}
returns the full path
of the Gmsh executable. @code
{
CurrentDirectory
}
and @code
{
CurrentDir
}
return the directory of the @code
{
.geo
}
file. @code
{
StrPrefix
}
and
current ONELAB action (e.g. @code
{
check
}
or
@code
{
compute
}
). @code
{
GmshExecutableName
}
returns the full path of the
Gmsh executable. @code
{
CurrentDirectory
}
and @code
{
CurrentDir
}
return
the directory of the @code
{
.geo
}
file. @code
{
StrPrefix
}
and
@code
{
StrRelative
}
permit to take the prefix (e.g. to remove the
extension) or the relative path of a file name. @code
{
StrCat
}
and
@code
{
Str
}
permit to concatenate character expressions (@code
{
Str
}
adds
...
...
@@ -3318,7 +3319,15 @@ world) coordinates. The fourth @var{expression} has the same meaning as the
third @var
{
expression
}
in 2D text objects.
For both 2D and 3D text objects, the @var
{
list-of-values
}
can contain an
arbitrary number of @w
{
@var
{
char-expression
}
s
}
.
arbitrary number of @w
{
@var
{
char-expression
}
s
}
. If the
@var
{
char-expression
}
starts with @code
{
file://
}
, the remainder of the
string is interpreted as the name of an image file, and the image is
displayed instead of the string. A format string in the form
@code
{
@@wxh
}
or @code
{
@@wxh,wx,wy,wz,hx,hy,hz
}
, where @code
{
w
}
and
@code
{
h
}
are the width and height (in model coordinates for @code
{
T3
}
or
in pixels for @code
{
T2
}
) of the image, @code
{
wx,wy,wz
}
is the direction
of the bottom edge of the image and @code
{
hx,hy,hz
}
is the direction of
the left edge of the image.
The optional @code
{
TIME
}
list can contain a list of expressions giving the
value of the time (or any other variable) for which an evolution was saved.
...
...
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