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
1512c9c9
Commit
1512c9c9
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
more IO work
parent
4f4783f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Fltk/GUI_Projection.cpp
+29
-21
29 additions, 21 deletions
Fltk/GUI_Projection.cpp
Fltk/GUI_Projection.h
+1
-1
1 addition, 1 deletion
Fltk/GUI_Projection.h
with
30 additions
and
22 deletions
Fltk/GUI_Projection.cpp
+
29
−
21
View file @
1512c9c9
...
@@ -319,10 +319,10 @@ projectionEditor::projectionEditor()
...
@@ -319,10 +319,10 @@ projectionEditor::projectionEditor()
_window
->
size_range
(
width
,
(
int
)(
0.85
*
height
));
_window
->
size_range
(
width
,
(
int
)(
0.85
*
height
));
}
}
void
projectionEditor
::
load
(
FProjectionFace
*
face
)
void
projectionEditor
::
load
(
FProjectionFace
*
face
,
std
::
string
tag
)
{
{
ProjectionSurface
*
ps
=
face
->
GetProjectionSurface
();
ProjectionSurface
*
ps
=
face
->
GetProjectionSurface
();
_browser
->
add
(
ps
->
GetName
().
c_str
());
_browser
->
add
(
tag
.
size
()
?
tag
.
c_str
()
:
ps
->
GetName
().
c_str
());
projection
*
p
=
new
projection
(
face
,
_paramWin
[
0
],
_paramWin
[
1
],
_paramWin
[
2
],
projection
*
p
=
new
projection
(
face
,
_paramWin
[
0
],
_paramWin
[
1
],
_paramWin
[
2
],
_paramWin
[
3
],
_paramWin
[
4
],
_paramWin
[
5
],
this
);
_paramWin
[
3
],
_paramWin
[
4
],
_paramWin
[
5
],
this
);
_projections
.
push_back
(
p
);
_projections
.
push_back
(
p
);
...
@@ -417,7 +417,7 @@ void update_cb(Fl_Widget *w, void *data)
...
@@ -417,7 +417,7 @@ void update_cb(Fl_Widget *w, void *data)
}
}
}
}
}
}
//
loop over
elements
and do the same thing
//
deal with
elements
here
e
->
uv
()
->
set
(
u
,
v
,
dist
,
f
);
e
->
uv
()
->
set
(
u
,
v
,
dist
,
f
);
}
}
...
@@ -551,6 +551,7 @@ void filter_cb(Fl_Widget *w, void *data)
...
@@ -551,6 +551,7 @@ void filter_cb(Fl_Widget *w, void *data)
ve
->
setSelection
(
false
);
ve
->
setSelection
(
false
);
}
}
}
}
// deal with elements here
}
}
update_cb
(
0
,
data
);
update_cb
(
0
,
data
);
}
}
...
@@ -577,14 +578,14 @@ void save_selection_cb(Fl_Widget *w, void *data)
...
@@ -577,14 +578,14 @@ void save_selection_cb(Fl_Widget *w, void *data)
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
return
;
return
;
}
}
//
FIXME:
maybe we should save as mesh file
// maybe we should save as mesh file
for
(
unsigned
int
i
=
0
;
i
<
ent
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
ent
.
size
();
i
++
){
GVertex
*
v
=
dynamic_cast
<
GVertex
*>
(
ent
[
i
]);
GVertex
*
v
=
dynamic_cast
<
GVertex
*>
(
ent
[
i
]);
if
(
v
&&
v
->
getSelection
())
if
(
v
&&
v
->
getSelection
())
fprintf
(
fp
,
"Point(%d) = {%.16g,%.16g,%.16g,1};
\n
"
,
v
->
tag
(),
fprintf
(
fp
,
"Point(%d) = {%.16g,%.16g,%.16g,1};
\n
"
,
v
->
tag
(),
v
->
x
(),
v
->
y
(),
v
->
z
());
v
->
x
(),
v
->
y
(),
v
->
z
());
}
}
//
FIXME:
deal with
std::vector<MElement*> &ele(e->getElements());
// deal with
elements here
fclose
(
fp
);
fclose
(
fp
);
}
}
}
}
...
@@ -598,28 +599,35 @@ void load_projection_cb(Fl_Widget *w, void *data)
...
@@ -598,28 +599,35 @@ void load_projection_cb(Fl_Widget *w, void *data)
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
return
;
return
;
}
}
char
name
[
256
]
;
int
num
;
if
(
!
fscanf
(
fp
,
"%
s
"
,
name
)){
if
(
!
fscanf
(
fp
,
"%
d
"
,
&
num
)){
Msg
(
GERROR
,
"Bad projection file format"
);
Msg
(
GERROR
,
"Bad projection file format"
);
return
;
return
;
}
}
FProjectionFace
*
face
=
createProjectionFaceFromName
(
name
);
for
(
int
proj
=
0
;
proj
<
num
;
proj
++
){
if
(
face
){
char
name
[
256
],
tag
[
256
];
e
->
load
(
face
);
if
(
!
fscanf
(
fp
,
"%s"
,
tag
)
||
!
fscanf
(
fp
,
"%s"
,
name
)){
projection
*
p
=
e
->
getLastProjection
();
Msg
(
GERROR
,
"Bad projection file format"
);
if
(
p
){
return
;
for
(
unsigned
int
i
=
0
;
i
<
p
->
parameters
.
size
();
i
++
){
}
double
val
;
FProjectionFace
*
face
=
createProjectionFaceFromName
(
name
);
if
(
!
fscanf
(
fp
,
"%lf"
,
&
val
)){
if
(
face
){
Msg
(
GERROR
,
"Missing paramater for projection `%s'"
,
name
);
e
->
load
(
face
,
tag
);
break
;
projection
*
p
=
e
->
getLastProjection
();
if
(
p
){
for
(
unsigned
int
i
=
0
;
i
<
p
->
parameters
.
size
();
i
++
){
double
val
;
if
(
!
fscanf
(
fp
,
"%lf"
,
&
val
)){
Msg
(
GERROR
,
"Missing paramater for projection `%s'"
,
name
);
break
;
}
p
->
parameters
[
i
]
->
value
(
val
);
}
}
p
->
parameters
[
i
]
->
value
(
val
);
}
}
fclose
(
fp
);
update_cb
(
0
,
data
);
}
}
}
}
fclose
(
fp
);
update_cb
(
0
,
data
);
}
}
}
}
...
@@ -635,7 +643,7 @@ void save_projection_cb(Fl_Widget *w, void *data)
...
@@ -635,7 +643,7 @@ void save_projection_cb(Fl_Widget *w, void *data)
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
Msg
(
GERROR
,
"Unable to open file `%s'"
,
file_chooser_get_name
(
1
));
return
;
return
;
}
}
fprintf
(
fp
,
"
%s
\n
"
,
ps
->
GetName
().
c_str
());
fprintf
(
fp
,
"
1
\n
%s
\n
%s
\n
"
,
ps
->
GetName
().
c_str
()
,
ps
->
GetName
().
c_str
());
for
(
unsigned
int
i
=
0
;
i
<
p
->
parameters
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
p
->
parameters
.
size
();
i
++
)
fprintf
(
fp
,
"%.16g
\n
"
,
p
->
parameters
[
i
]
->
value
());
fprintf
(
fp
,
"%.16g
\n
"
,
p
->
parameters
[
i
]
->
value
());
fclose
(
fp
);
fclose
(
fp
);
...
...
This diff is collapsed.
Click to expand it.
Fltk/GUI_Projection.h
+
1
−
1
View file @
1512c9c9
...
@@ -67,7 +67,7 @@ class projectionEditor {
...
@@ -67,7 +67,7 @@ class projectionEditor {
uvPlot
*
_uvPlot
;
uvPlot
*
_uvPlot
;
public:
public:
projectionEditor
();
projectionEditor
();
void
load
(
FProjectionFace
*
face
);
void
load
(
FProjectionFace
*
face
,
std
::
string
tag
=
""
);
void
show
(){
_window
->
show
();
select_cb
(
0
,
this
);
}
void
show
(){
_window
->
show
();
select_cb
(
0
,
this
);
}
uvPlot
*
uv
()
{
return
_uvPlot
;
}
uvPlot
*
uv
()
{
return
_uvPlot
;
}
Fl_Value_Input
*
modes
[
4
];
Fl_Value_Input
*
modes
[
4
];
...
...
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