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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
ef5e8b10
Commit
ef5e8b10
authored
Jan 11, 2010
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
gui for embedded points
parent
33b8f132
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Fltk/menuWindow.cpp
+26
-12
26 additions, 12 deletions
Fltk/menuWindow.cpp
Geo/GModelIO_Geo.cpp
+11
-12
11 additions, 12 deletions
Geo/GModelIO_Geo.cpp
Geo/GeoStringInterface.cpp
+16
-4
16 additions, 4 deletions
Geo/GeoStringInterface.cpp
Geo/GeoStringInterface.h
+1
-0
1 addition, 0 deletions
Geo/GeoStringInterface.h
with
54 additions
and
28 deletions
Fltk/menuWindow.cpp
+
26
−
12
View file @
ef5e8b10
...
...
@@ -1794,7 +1794,7 @@ static void mesh_define_transfinite_cb(Fl_Widget *w, void *data)
FlGui
::
instance
()
->
menu
->
setContext
(
menu_mesh_define_transfinite
,
0
);
}
static
void
add_transfinite
(
int
dim
)
static
void
add_transfinite
_embedded
(
int
dim
,
bool
embed
)
{
opt_geometry_points
(
0
,
GMSH_SET
|
GMSH_GUI
,
1
);
switch
(
dim
)
{
...
...
@@ -1885,17 +1885,22 @@ static void add_transfinite(int dim)
}
while
(
1
)
{
if
(
p
.
size
()
==
1
)
Msg
::
StatusBar
(
3
,
false
,
"Select (ordered) boundary points
\n
"
"[Press 'e' to end selection or 'q' to abort]"
);
Msg
::
StatusBar
(
3
,
false
,
"Select %s points
\n
"
"[Press 'e' to end selection or 'q' to abort]"
,
embed
?
"embedded"
:
"(ordered) boundary"
);
else
Msg
::
StatusBar
(
3
,
false
,
"Select
(ordered) boundary
points
\n
"
Msg
::
StatusBar
(
3
,
false
,
"Select
%s
points
\n
"
"[Press 'e' to end selection, 'u' to undo last selection "
"or 'q' to abort]"
);
"or 'q' to abort]"
,
embed
?
"embedded"
:
"(ordered) boundary"
);
ib
=
FlGui
::
instance
()
->
selectEntity
(
ENT_POINT
);
if
(
ib
==
'l'
)
{
FlGui
::
instance
()
->
selectedVertices
[
0
]
->
setSelection
(
1
);
for
(
unsigned
int
i
=
0
;
i
<
FlGui
::
instance
()
->
selectedVertices
.
size
();
i
++
){
FlGui
::
instance
()
->
selectedVertices
[
i
]
->
setSelection
(
1
);
p
.
push_back
(
FlGui
::
instance
()
->
selectedVertices
[
i
]
->
tag
());
if
(
!
embed
)
break
;
}
drawContext
::
global
()
->
draw
();
p
.
push_back
(
FlGui
::
instance
()
->
selectedVertices
[
0
]
->
tag
());
}
if
(
ib
==
'u'
)
{
if
(
p
.
size
()
>
1
){
...
...
@@ -1912,11 +1917,14 @@ static void add_transfinite(int dim)
if
(
ib
==
'e'
)
{
switch
(
dim
)
{
case
2
:
if
(
p
.
size
()
==
0
+
1
||
p
.
size
()
==
3
+
1
||
p
.
size
()
==
4
+
1
)
if
(
embed
&&
p
.
size
())
add_embedded
(
"Point"
,
p
,
GModel
::
current
()
->
getFileName
());
else
if
(
!
embed
&&
(
p
.
size
()
==
0
+
1
||
p
.
size
()
==
3
+
1
||
p
.
size
()
==
4
+
1
))
add_trsfsurf
(
p
,
GModel
::
current
()
->
getFileName
(),
FlGui
::
instance
()
->
meshContext
->
choice
[
1
]
->
text
());
else
Msg
::
Error
(
"Wrong number of points for
transfinite surface
"
);
Msg
::
Error
(
"Wrong number of points for
mesh constraint
"
);
break
;
case
3
:
if
(
p
.
size
()
==
6
+
1
||
p
.
size
()
==
8
+
1
)
...
...
@@ -1948,18 +1956,23 @@ static void add_transfinite(int dim)
static
void
mesh_define_transfinite_line_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
FlGui
::
instance
()
->
meshContext
->
show
(
1
);
add_transfinite
(
1
);
add_transfinite
_embedded
(
1
,
false
);
}
static
void
mesh_define_transfinite_surface_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
FlGui
::
instance
()
->
meshContext
->
show
(
2
);
add_transfinite
(
2
);
add_transfinite
_embedded
(
2
,
false
);
}
static
void
mesh_define_transfinite_volume_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
add_transfinite
(
3
);
add_transfinite_embedded
(
3
,
false
);
}
static
void
mesh_define_embedded_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
add_transfinite_embedded
(
2
,
true
);
}
static
void
view_toggle_cb
(
Fl_Widget
*
w
,
void
*
data
)
...
...
@@ -2498,6 +2511,7 @@ contextItem menu_mesh[] = {
{
"1Mesh>Define"
}
,
{
"Fields"
,
(
Fl_Callback
*
)
field_cb
},
{
"Characteristic length"
,
(
Fl_Callback
*
)
mesh_define_length_cb
}
,
{
"Embedded point"
,
(
Fl_Callback
*
)
mesh_define_embedded_cb
,
(
void
*
)
"point"
}
,
{
"Recombine"
,
(
Fl_Callback
*
)
mesh_define_recombine_cb
}
,
{
"Transfinite"
,
(
Fl_Callback
*
)
mesh_define_transfinite_cb
}
,
{
""
}
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO_Geo.cpp
+
11
−
12
View file @
ef5e8b10
...
...
@@ -43,17 +43,18 @@ int GModel::readGEO(const std::string &name)
int
GModel
::
exportDiscreteGEOInternals
()
{
_geo_internals
=
new
GEO_Internals
;
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
it
++
){
Vertex
*
v
=
Create_Vertex
((
*
it
)
->
tag
(),
(
*
it
)
->
x
(),
(
*
it
)
->
y
(),
(
*
it
)
->
z
(),
(
*
it
)
->
prescribedMeshSizeAtVertex
(),
1.0
);
Vertex
*
v
=
Create_Vertex
((
*
it
)
->
tag
(),
(
*
it
)
->
x
(),
(
*
it
)
->
y
(),
(
*
it
)
->
z
(),
(
*
it
)
->
prescribedMeshSizeAtVertex
(),
1.0
);
Tree_Add
(
GModel
::
current
()
->
getGEOInternals
()
->
Points
,
&
v
);
}
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
it
++
){
if
((
*
it
)
->
geomType
()
==
GEntity
::
DiscreteCurve
){
Curve
*
c
=
Create_Curve
((
*
it
)
->
tag
(),
MSH_SEGM_DISCRETE
,
1
,
NULL
,
NULL
,
-
1
,
-
1
,
0.
,
1.
);
Curve
*
c
=
Create_Curve
((
*
it
)
->
tag
(),
MSH_SEGM_DISCRETE
,
1
,
NULL
,
NULL
,
-
1
,
-
1
,
0.
,
1.
);
List_T
*
points
=
Tree2List
(
_geo_internals
->
Points
);
GVertex
*
gvb
=
(
*
it
)
->
getBeginVertex
();
GVertex
*
gve
=
(
*
it
)
->
getEndVertex
();
...
...
@@ -95,8 +96,7 @@ int GModel::exportDiscreteGEOInternals()
}
}
//create Volumes from discreteRegions
//TODO
// TODO: create Volumes from discreteRegions
Msg
::
Debug
(
"Geo internal model has:"
);
List_T
*
points
=
Tree2List
(
_geo_internals
->
Points
);
...
...
@@ -111,7 +111,6 @@ int GModel::exportDiscreteGEOInternals()
int
GModel
::
importGEOInternals
()
{
if
(
Tree_Nbr
(
_geo_internals
->
Points
))
{
List_T
*
points
=
Tree2List
(
_geo_internals
->
Points
);
for
(
int
i
=
0
;
i
<
List_Nbr
(
points
);
i
++
){
...
...
@@ -193,7 +192,9 @@ int GModel::importGEOInternals()
List_Read
(
p
->
Entities
,
j
,
&
num
);
GEntity
*
ge
=
0
;
switch
(
p
->
Typ
){
case
MSH_PHYSICAL_POINT
:
ge
=
getVertexByTag
(
abs
(
num
));
break
;
case
MSH_PHYSICAL_POINT
:
ge
=
getVertexByTag
(
abs
(
num
));
break
;
case
MSH_PHYSICAL_LINE
:
ge
=
getEdgeByTag
(
abs
(
num
));
e_compound
.
push_back
(
getEdgeByTag
(
abs
(
num
)));
...
...
@@ -213,11 +214,9 @@ int GModel::importGEOInternals()
ge
->
physicals
.
push_back
(
pnum
);
}
// the physical is a compound i.e. we allow the meshes
// not to conform internal MEdges of the compound
if
(
p
->
Typ
==
MSH_PHYSICAL_LINE
&&
p
->
Boundaries
[
0
]){
GEdge
*
ge
=
getEdgeByTag
(
abs
(
p
->
Num
));
if
(
!
ge
){
...
...
This diff is collapsed.
Click to expand it.
Geo/GeoStringInterface.cpp
+
16
−
4
View file @
ef5e8b10
...
...
@@ -20,7 +20,7 @@
#include
"Parser.h"
#endif
void
add_infile
(
std
::
string
text
,
std
::
string
fileName
,
bool
deleted_something
)
void
add_infile
(
std
::
string
text
,
std
::
string
fileName
,
bool
forceDestroy
)
{
// make sure we don't add stuff in a non-geo file
if
(
!
CTX
::
instance
()
->
expertMode
)
{
...
...
@@ -80,9 +80,9 @@ void add_infile(std::string text, std::string fileName, bool deleted_something)
fclose
(
gmsh_yyin
);
gmsh_yyin
=
gmsh_yyin_old
;
if
(
deleted_something
){
// we need to start from scratch
since
the command just parsed
// could have deleted some entities
if
(
forceDestroy
){
// we need to start from scratch
(e.g. if
the command just parsed
// could have deleted some entities
)
GModel
::
current
()
->
destroy
();
}
GModel
::
current
()
->
importGEOInternals
();
...
...
@@ -183,6 +183,18 @@ void add_trsfvol(std::vector<int> &l, std::string fileName)
add_infile
(
sstream
.
str
(),
fileName
);
}
void
add_embedded
(
std
::
string
what
,
std
::
vector
<
int
>
&
l
,
std
::
string
fileName
)
{
std
::
ostringstream
sstream
;
sstream
<<
"Point{"
;
for
(
unsigned
int
i
=
1
;
i
<
l
.
size
();
i
++
)
{
if
(
i
>
1
)
sstream
<<
", "
;
sstream
<<
l
[
i
];
}
sstream
<<
"} In Surface{"
<<
l
[
0
]
<<
"};"
;
add_infile
(
sstream
.
str
(),
fileName
,
true
);
}
void
add_param
(
std
::
string
par
,
std
::
string
value
,
std
::
string
fileName
)
{
std
::
ostringstream
sstream
;
...
...
This diff is collapsed.
Click to expand it.
Geo/GeoStringInterface.h
+
1
−
0
View file @
ef5e8b10
...
...
@@ -19,6 +19,7 @@ void add_trsfline(std::vector<int> &l, std::string fileName, std::string type,
std
::
string
typearg
,
std
::
string
pts
);
void
add_trsfsurf
(
std
::
vector
<
int
>
&
l
,
std
::
string
fileName
,
std
::
string
dir
);
void
add_trsfvol
(
std
::
vector
<
int
>
&
l
,
std
::
string
fileName
);
void
add_embedded
(
std
::
string
what
,
std
::
vector
<
int
>
&
l
,
std
::
string
fileName
);
void
add_param
(
std
::
string
par
,
std
::
string
value
,
std
::
string
fileName
);
void
add_point
(
std
::
string
fileName
,
std
::
string
x
,
std
::
string
y
,
std
::
string
z
,
std
::
string
lc
);
...
...
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