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
5907890e
Commit
5907890e
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
better fix for skipping empty steps
parent
ad4df402
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Common/OpenFile.cpp
+23
-14
23 additions, 14 deletions
Common/OpenFile.cpp
Fltk/graphicWindow.cpp
+15
-15
15 additions, 15 deletions
Fltk/graphicWindow.cpp
Fltk/graphicWindow.h
+1
-1
1 addition, 1 deletion
Fltk/graphicWindow.h
Post/PViewData.h
+1
-1
1 addition, 1 deletion
Post/PViewData.h
with
40 additions
and
31 deletions
Common/OpenFile.cpp
+
23
−
14
View file @
5907890e
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include
<string.h>
#include
<string.h>
#include
"GmshConfig.h"
#include
"GmshConfig.h"
#include
"GmshMessage.h"
#include
"GmshMessage.h"
#include
"Options.h"
#include
"Geo.h"
#include
"Geo.h"
#include
"GModel.h"
#include
"GModel.h"
#include
"Numeric.h"
#include
"Numeric.h"
...
@@ -341,20 +342,14 @@ int MergeFile(std::string fileName, bool warnIfMissing)
...
@@ -341,20 +342,14 @@ int MergeFile(std::string fileName, bool warnIfMissing)
if
(
!
strncmp
(
header
,
"$PTS"
,
4
)
||
!
strncmp
(
header
,
"$NO"
,
3
)
||
if
(
!
strncmp
(
header
,
"$PTS"
,
4
)
||
!
strncmp
(
header
,
"$NO"
,
3
)
||
!
strncmp
(
header
,
"$PARA"
,
5
)
||
!
strncmp
(
header
,
"$ELM"
,
4
)
||
!
strncmp
(
header
,
"$PARA"
,
5
)
||
!
strncmp
(
header
,
"$ELM"
,
4
)
||
!
strncmp
(
header
,
"$MeshFormat"
,
11
)
||
!
strncmp
(
header
,
"$Comments"
,
9
))
{
!
strncmp
(
header
,
"$MeshFormat"
,
11
)
||
!
strncmp
(
header
,
"$Comments"
,
9
))
{
// mesh matcher
// MATCHER
if
(
CTX
::
instance
()
->
geom
.
matchGeomAndMesh
&&
!
GModel
::
current
()
->
empty
()){
if
(
CTX
::
instance
()
->
geom
.
matchGeomAndMesh
&&
!
GModel
::
current
()
->
empty
()
)
{
GModel
*
tmp
=
new
GModel
();
GModel
*
current_mod
=
GModel
::
current
();
tmp
->
readMSH
(
fileName
);
GModel
*
tmp_model
=
new
GModel
();
if
(
GeomMeshMatcher
::
instance
()
->
match
(
GModel
::
current
(),
tmp
))
tmp_model
->
readMSH
(
fileName
);
int
match_status
=
GeomMeshMatcher
::
instance
()
->
match
(
current_mod
,
tmp_model
);
if
(
match_status
)
fileName
=
"out.msh"
;
fileName
=
"out.msh"
;
delete
tmp
_model
;
delete
tmp
;
}
}
// MATCHER END
status
=
GModel
::
current
()
->
readMSH
(
fileName
);
status
=
GModel
::
current
()
->
readMSH
(
fileName
);
#if defined(HAVE_POST)
#if defined(HAVE_POST)
if
(
status
>
1
)
status
=
PView
::
readMSH
(
fileName
);
if
(
status
>
1
)
status
=
PView
::
readMSH
(
fileName
);
...
@@ -383,8 +378,22 @@ int MergeFile(std::string fileName, bool warnIfMissing)
...
@@ -383,8 +378,22 @@ int MergeFile(std::string fileName, bool warnIfMissing)
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
#if defined(HAVE_FLTK) && defined(HAVE_POST)
#if defined(HAVE_FLTK) && defined(HAVE_POST)
if
(
FlGui
::
available
())
if
(
FlGui
::
available
()){
FlGui
::
instance
()
->
updateViews
(
numViewsBefore
!=
(
int
)
PView
::
list
.
size
());
bool
newViews
=
numViewsBefore
!=
(
int
)
PView
::
list
.
size
();
if
(
newViews
){
// go directly to the first non-empty step
for
(
unsigned
int
i
=
0
;
i
<
PView
::
list
.
size
();
i
++
){
for
(
int
j
=
0
;
j
<
(
int
)
opt_view_nb_timestep
(
i
,
GMSH_GET
,
0
);
j
++
){
int
step
=
(
int
)
opt_view_timestep
(
i
,
GMSH_GET
,
0
);
if
(
PView
::
list
[
i
]
->
getData
()
->
hasTimeStep
(
step
))
break
;
else
opt_view_timestep
(
i
,
GMSH_SET
|
GMSH_GUI
,
step
+
1
);
}
}
}
FlGui
::
instance
()
->
updateViews
(
newViews
);
}
#endif
#endif
if
(
!
status
)
Msg
::
Error
(
"Error loading '%s'"
,
fileName
.
c_str
());
if
(
!
status
)
Msg
::
Error
(
"Error loading '%s'"
,
fileName
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
Fltk/graphicWindow.cpp
+
15
−
15
View file @
5907890e
...
@@ -220,7 +220,7 @@ void status_options_cb(Fl_Widget *w, void *data)
...
@@ -220,7 +220,7 @@ void status_options_cb(Fl_Widget *w, void *data)
static
int
stop_anim
=
0
,
view_in_cycle
=
-
1
;
static
int
stop_anim
=
0
,
view_in_cycle
=
-
1
;
void
status_play_manual
(
int
time
,
int
step
)
void
status_play_manual
(
int
time
,
int
incr
)
{
{
// avoid firing this routine recursively (can happen e.g when
// avoid firing this routine recursively (can happen e.g when
// keeping the finger down on the arrow key: if the system generates
// keeping the finger down on the arrow key: if the system generates
...
@@ -232,32 +232,32 @@ void status_play_manual(int time, int step)
...
@@ -232,32 +232,32 @@ void status_play_manual(int time, int step)
if
(
time
)
{
if
(
time
)
{
for
(
unsigned
int
i
=
0
;
i
<
PView
::
list
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
PView
::
list
.
size
();
i
++
){
if
(
opt_view_visible
(
i
,
GMSH_GET
,
0
)){
if
(
opt_view_visible
(
i
,
GMSH_GET
,
0
)){
// skip
any
empty steps
(useful when merging only some steps)
// skip empty steps
int
newS
tep
=
(
int
)
opt_view_timestep
(
i
,
GMSH_GET
,
0
)
+
step
;
int
s
tep
=
(
int
)
opt_view_timestep
(
i
,
GMSH_GET
,
0
)
+
incr
;
int
total
Steps
=
(
int
)
opt_view_nb_timestep
(
i
,
GMSH_GET
,
0
);
int
num
Steps
=
(
int
)
opt_view_nb_timestep
(
i
,
GMSH_GET
,
0
);
for
(
int
j
=
0
;
j
<
total
Steps
;
j
++
){
for
(
int
j
=
0
;
j
<
num
Steps
;
j
++
){
if
(
PView
::
list
[
i
]
->
getData
()
->
hasTimeStep
(
newS
tep
))
if
(
PView
::
list
[
i
]
->
getData
()
->
hasTimeStep
(
s
tep
))
break
;
break
;
else
else
newS
tep
+=
step
;
s
tep
+=
incr
;
if
(
newS
tep
<
0
)
newS
tep
=
total
Steps
-
1
;
if
(
s
tep
<
0
)
s
tep
=
num
Steps
-
1
;
if
(
newS
tep
>
total
Steps
-
1
)
newS
tep
=
0
;
if
(
s
tep
>
num
Steps
-
1
)
s
tep
=
0
;
}
}
opt_view_timestep
(
i
,
GMSH_SET
|
GMSH_GUI
,
newS
tep
);
opt_view_timestep
(
i
,
GMSH_SET
|
GMSH_GUI
,
s
tep
);
}
}
}
}
}
}
else
{
// hide all views except view_in_cycle
else
{
// hide all views except view_in_cycle
if
(
step
>
0
)
{
if
(
incr
>
0
)
{
if
((
view_in_cycle
+=
step
)
>=
(
int
)
PView
::
list
.
size
())
if
((
view_in_cycle
+=
incr
)
>=
(
int
)
PView
::
list
.
size
())
view_in_cycle
=
0
;
view_in_cycle
=
0
;
for
(
int
i
=
0
;
i
<
(
int
)
PView
::
list
.
size
();
i
+=
step
)
for
(
int
i
=
0
;
i
<
(
int
)
PView
::
list
.
size
();
i
+=
incr
)
opt_view_visible
(
i
,
GMSH_SET
|
GMSH_GUI
,
(
i
==
view_in_cycle
));
opt_view_visible
(
i
,
GMSH_SET
|
GMSH_GUI
,
(
i
==
view_in_cycle
));
}
}
else
{
else
{
if
((
view_in_cycle
+=
step
)
<
0
)
if
((
view_in_cycle
+=
incr
)
<
0
)
view_in_cycle
=
PView
::
list
.
size
()
-
1
;
view_in_cycle
=
PView
::
list
.
size
()
-
1
;
for
(
int
i
=
PView
::
list
.
size
()
-
1
;
i
>=
0
;
i
+=
step
)
for
(
int
i
=
PView
::
list
.
size
()
-
1
;
i
>=
0
;
i
+=
incr
)
opt_view_visible
(
i
,
GMSH_SET
|
GMSH_GUI
,
(
i
==
view_in_cycle
));
opt_view_visible
(
i
,
GMSH_SET
|
GMSH_GUI
,
(
i
==
view_in_cycle
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/graphicWindow.h
+
1
−
1
View file @
5907890e
...
@@ -36,6 +36,6 @@ class graphicWindow{
...
@@ -36,6 +36,6 @@ class graphicWindow{
void
status_xyz1p_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
status_xyz1p_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
status_options_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
status_options_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
status_play_manual
(
int
time
,
int
step
);
void
status_play_manual
(
int
time
,
int
incr
);
#endif
#endif
This diff is collapsed.
Click to expand it.
Post/PViewData.h
+
1
−
1
View file @
5907890e
...
@@ -163,7 +163,7 @@ class PViewData {
...
@@ -163,7 +163,7 @@ class PViewData {
bool
checkVisibility
=
false
){
return
false
;
}
bool
checkVisibility
=
false
){
return
false
;
}
// check if the data has the given step/partition/etc.
// check if the data has the given step/partition/etc.
virtual
bool
hasTimeStep
(
int
step
){
return
step
<
getNumTimeSteps
();
}
virtual
bool
hasTimeStep
(
int
step
){
return
step
>=
0
&&
step
<
getNumTimeSteps
();
}
virtual
bool
hasPartition
(
int
part
){
return
false
;
}
virtual
bool
hasPartition
(
int
part
){
return
false
;
}
virtual
bool
hasMultipleMeshes
(){
return
false
;
}
virtual
bool
hasMultipleMeshes
(){
return
false
;
}
virtual
bool
hasModel
(
GModel
*
model
,
int
step
=-
1
){
return
false
;
}
virtual
bool
hasModel
(
GModel
*
model
,
int
step
=-
1
){
return
false
;
}
...
...
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