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
b60cc3bb
Commit
b60cc3bb
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
added selection filtering
parent
d023b75a
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
+49
-12
49 additions, 12 deletions
Fltk/GUI_Projection.cpp
Fltk/GUI_Projection.h
+3
-0
3 additions, 0 deletions
Fltk/GUI_Projection.h
with
52 additions
and
12 deletions
Fltk/GUI_Projection.cpp
+
49
−
12
View file @
b60cc3bb
...
...
@@ -206,21 +206,29 @@ projectionEditor::projectionEditor(std::vector<FProjectionFace*> &faces)
}
int
hard
=
8
;
int
uvw
=
width
-
2
*
WB
-
2
*
hard
-
3
*
WB
;
int
uvh
=
height
-
8
*
WB
-
14
*
BH
-
2
*
hard
;
hardEdges
[
0
]
=
new
Fl_Toggle_Button
(
WB
,
3
*
WB
+
9
*
BH
+
hard
,
hard
,
height
-
8
*
WB
-
14
*
BH
-
2
*
hard
);
hardEdges
[
1
]
=
new
Fl_Toggle_Button
(
width
-
WB
-
hard
,
3
*
WB
+
9
*
BH
+
hard
,
hard
,
height
-
8
*
WB
-
14
*
BH
-
2
*
hard
);
hard
,
uvh
);
hardEdges
[
1
]
=
new
Fl_Toggle_Button
(
width
-
4
*
WB
-
hard
,
3
*
WB
+
9
*
BH
+
hard
,
hard
,
uvh
);
hardEdges
[
2
]
=
new
Fl_Toggle_Button
(
WB
+
hard
,
3
*
WB
+
9
*
BH
,
width
-
2
*
WB
-
2
*
hard
,
hard
);
hardEdges
[
3
]
=
new
Fl_Toggle_Button
(
WB
+
hard
,
height
-
5
*
WB
-
5
*
BH
-
hard
,
width
-
2
*
WB
-
2
*
hard
,
hard
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
uvw
,
hard
);
hardEdges
[
3
]
=
new
Fl_Toggle_Button
(
WB
+
hard
,
height
-
5
*
WB
-
5
*
BH
-
hard
,
uvw
,
hard
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
hardEdges
[
i
]
->
tooltip
(
"Push to mark edge as `hard'"
);
}
_uvPlot
=
new
uvPlot
(
WB
+
hard
,
3
*
WB
+
9
*
BH
+
hard
,
width
-
2
*
WB
-
2
*
hard
,
height
-
8
*
WB
-
14
*
BH
-
2
*
hard
);
_uvPlot
=
new
uvPlot
(
WB
+
hard
,
3
*
WB
+
9
*
BH
+
hard
,
uvw
,
uvh
);
_uvPlot
->
end
();
Fl_Slider
*
s
=
new
Fl_Slider
(
width
-
3
*
WB
,
3
*
WB
+
9
*
BH
+
hard
,
2
*
WB
,
uvh
);
s
->
minimum
(
1.
);
s
->
maximum
(
0.
);
s
->
value
(
1.
);
s
->
callback
(
filter_cb
,
this
);
s
->
tooltip
(
"Filter selection by distance to projection surface"
);
modes
[
0
]
=
new
Fl_Value_Input
(
WB
,
height
-
4
*
WB
-
5
*
BH
,
BB
/
2
,
BH
);
modes
[
0
]
->
tooltip
(
"Number of Fourier modes along u"
);
...
...
@@ -315,7 +323,7 @@ void browse_cb(Fl_Widget *w, void *data)
p
->
group
->
show
();
}
update_cb
(
w
,
data
);
update_cb
(
0
,
data
);
}
void
update_cb
(
Fl_Widget
*
w
,
void
*
data
)
...
...
@@ -466,7 +474,7 @@ void select_cb(Fl_Widget *w, void *data)
ent
.
clear
();
break
;
}
update_cb
(
w
,
data
);
update_cb
(
0
,
data
);
}
CTX
.
mesh
.
changed
=
ENT_ALL
;
...
...
@@ -475,6 +483,35 @@ void select_cb(Fl_Widget *w, void *data)
Msg
(
ONSCREEN
,
""
);
}
void
filter_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
Fl_Slider
*
slider
=
(
Fl_Slider
*
)
w
;
projectionEditor
*
e
=
(
projectionEditor
*
)
data
;
projection
*
p
=
e
->
getCurrentProjection
();
if
(
p
){
SBoundingBox3d
bbox
=
GMODEL
->
bounds
();
double
lc
=
norm
(
SVector3
(
bbox
.
max
(),
bbox
.
min
()));
double
threshold
=
slider
->
value
()
*
lc
;
ProjectionSurface
*
ps
=
p
->
face
->
GetProjectionSurface
();
std
::
vector
<
GEntity
*>
&
ent
(
e
->
getEntities
());
for
(
unsigned
int
i
=
0
;
i
<
ent
.
size
();
i
++
){
GVertex
*
ve
=
dynamic_cast
<
GVertex
*>
(
ent
[
i
]);
if
(
ve
){
double
uu
,
vv
,
p
[
3
],
n
[
3
];
ps
->
OrthoProjectionOnSurface
(
ve
->
x
(),
ve
->
y
(),
ve
->
z
(),
uu
,
vv
);
ps
->
F
(
uu
,
vv
,
p
[
0
],
p
[
1
],
p
[
2
]);
double
dx
=
ve
->
x
()
-
p
[
0
],
dy
=
ve
->
y
()
-
p
[
1
],
dz
=
ve
->
z
()
-
p
[
2
];
if
(
uu
>=
0.
&&
uu
<=
1.
&&
vv
>=
0.
&&
vv
<
1.
&&
sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
)
<
threshold
)
ve
->
setSelection
(
true
);
else
ve
->
setSelection
(
false
);
}
}
}
update_cb
(
0
,
data
);
}
void
close_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
if
(
data
)
((
Fl_Window
*
)
data
)
->
hide
();
...
...
This diff is collapsed.
Click to expand it.
Fltk/GUI_Projection.h
+
3
−
0
View file @
b60cc3bb
...
...
@@ -27,6 +27,7 @@
#include
"FM_Reader.h"
void
select_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
filter_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
browse_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
update_cb
(
Fl_Widget
*
w
,
void
*
data
);
void
close_cb
(
Fl_Widget
*
w
,
void
*
data
);
...
...
@@ -50,6 +51,8 @@ class uvPlot : public Fl_Window {
void
get
(
std
::
vector
<
double
>
&
u
,
std
::
vector
<
double
>
&
v
,
std
::
vector
<
double
>
&
dist
,
std
::
vector
<
std
::
complex
<
double
>
>
&
f
)
{
u
=
_u
;
v
=
_v
;
dist
=
_dist
;
f
=
_f
;
}
double
dmin
()
{
return
_dmin
;
}
double
dmax
()
{
return
_dmax
;
}
};
class
projectionEditor
;
...
...
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