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
abfc71e4
Commit
abfc71e4
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix old-style physical group labels in list browser
parent
6c8d9efd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/visibilityWindow.cpp
+14
-12
14 additions, 12 deletions
Fltk/visibilityWindow.cpp
with
14 additions
and
12 deletions
Fltk/visibilityWindow.cpp
+
14
−
12
View file @
abfc71e4
...
@@ -190,12 +190,12 @@ class VisibilityList { // singleton
...
@@ -190,12 +190,12 @@ class VisibilityList { // singleton
_entities
.
push_back
(
new
VisModel
(
GModel
::
list
[
i
],
i
));
_entities
.
push_back
(
new
VisModel
(
GModel
::
list
[
i
],
i
));
std
::
string
name
=
GModel
::
list
[
i
]
->
getName
();
std
::
string
name
=
GModel
::
list
[
i
]
->
getName
();
if
(
GModel
::
list
[
i
]
==
GModel
::
current
())
name
+=
" (Active)"
;
if
(
GModel
::
list
[
i
]
==
GModel
::
current
())
name
+=
" (Active)"
;
setLabel
(
i
,
name
);
setLabel
(
i
,
name
,
1
);
}
}
}
}
if
(
type
==
ElementaryEntities
){
else
if
(
type
==
ElementaryEntities
){
for
(
GModel
::
piter
it
=
m
->
firstElementaryName
();
it
!=
m
->
lastElementaryName
();
++
it
)
for
(
GModel
::
piter
it
=
m
->
firstElementaryName
();
it
!=
m
->
lastElementaryName
();
++
it
)
setLabel
(
it
->
first
,
it
->
second
);
setLabel
(
it
->
first
,
it
->
second
,
1
);
for
(
GModel
::
viter
it
=
m
->
firstVertex
();
it
!=
m
->
lastVertex
();
it
++
)
for
(
GModel
::
viter
it
=
m
->
firstVertex
();
it
!=
m
->
lastVertex
();
it
++
)
_entities
.
push_back
(
new
VisElementary
(
*
it
));
_entities
.
push_back
(
new
VisElementary
(
*
it
));
for
(
GModel
::
eiter
it
=
m
->
firstEdge
();
it
!=
m
->
lastEdge
();
it
++
)
for
(
GModel
::
eiter
it
=
m
->
firstEdge
();
it
!=
m
->
lastEdge
();
it
++
)
...
@@ -207,7 +207,7 @@ class VisibilityList { // singleton
...
@@ -207,7 +207,7 @@ class VisibilityList { // singleton
}
}
else
if
(
type
==
PhysicalEntities
){
else
if
(
type
==
PhysicalEntities
){
for
(
GModel
::
piter
it
=
m
->
firstPhysicalName
();
it
!=
m
->
lastPhysicalName
();
++
it
)
for
(
GModel
::
piter
it
=
m
->
firstPhysicalName
();
it
!=
m
->
lastPhysicalName
();
++
it
)
setLabel
(
it
->
first
,
it
->
second
);
setLabel
(
it
->
first
,
it
->
second
,
1
);
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
m
->
getPhysicalGroups
(
groups
);
m
->
getPhysicalGroups
(
groups
);
for
(
int
i
=
0
;
i
<
4
;
i
++
){
for
(
int
i
=
0
;
i
<
4
;
i
++
){
...
@@ -262,21 +262,23 @@ class VisibilityList { // singleton
...
@@ -262,21 +262,23 @@ class VisibilityList { // singleton
std
::
string
getBrowserLine
(
int
n
)
std
::
string
getBrowserLine
(
int
n
)
{
{
int
tag
=
_entities
[
n
]
->
getTag
();
int
tag
=
_entities
[
n
]
->
getTag
();
char
str
[
256
];
std
::
ostringstream
sstream
;
bool
label_exists
=
_labels
.
count
(
tag
);
sstream
<<
"
\t
"
<<
_entities
[
n
]
->
getName
()
<<
"
\t
"
<<
tag
<<
"
\t
"
;
const
char
*
label_color
=
(
label_exists
&&
_labels
[
tag
].
second
)
?
"@b"
:
""
;
if
(
_labels
.
count
(
tag
)){
sprintf
(
str
,
"
\t
%s
\t
%d
\t
%s%s"
,
_entities
[
n
]
->
getName
().
c_str
(),
tag
,
if
(
_labels
[
tag
].
second
)
label_color
,
label_exists
?
_labels
[
tag
].
first
.
c_str
()
:
""
);
sstream
<<
"@b"
;
return
std
::
string
(
str
);
sstream
<<
_labels
[
tag
].
first
;
}
return
sstream
.
str
();
}
}
// set the sort mode
// set the sort mode
void
setSortMode
(
int
mode
){
_sortMode
=
(
_sortMode
!=
mode
)
?
mode
:
-
mode
;
}
void
setSortMode
(
int
mode
){
_sortMode
=
(
_sortMode
!=
mode
)
?
mode
:
-
mode
;
}
// get the sort mode
// get the sort mode
int
getSortMode
(){
return
_sortMode
;
}
int
getSortMode
(){
return
_sortMode
;
}
// associate a label with a tag (quality=0 for "old-style" unreliable labels)
// associate a label with a tag (quality=0 for "old-style" unreliable labels)
void
setLabel
(
int
tag
,
std
::
string
label
,
int
quality
=
1
)
void
setLabel
(
int
tag
,
std
::
string
label
,
int
quality
)
{
{
_labels
[
tag
]
=
std
::
make_pair
(
label
,
quality
);
if
(
label
.
size
())
_labels
[
tag
]
=
std
::
pair
<
std
::
string
,
int
>
(
label
,
quality
);
}
}
// get the label associated with a tag
// get the label associated with a tag
std
::
string
getLabel
(
int
tag
){
return
_labels
[
tag
].
first
;
}
std
::
string
getLabel
(
int
tag
){
return
_labels
[
tag
].
first
;
}
...
...
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