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
40ec0d66
Commit
40ec0d66
authored
20 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
a8e79b40
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
Plugin/Levelset.cpp
+54
-3
54 additions, 3 deletions
Plugin/Levelset.cpp
with
54 additions
and
3 deletions
Plugin/Levelset.cpp
+
54
−
3
View file @
40ec0d66
// $Id: Levelset.cpp,v 1.2
0
2004-11-26 1
4:42:56
remacle Exp $
// $Id: Levelset.cpp,v 1.2
1
2004-11-26 1
5:13:07
remacle Exp $
//
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -556,7 +556,7 @@ Post_View *GMSH_LevelsetPlugin::execute(Post_View * v)
...
@@ -556,7 +556,7 @@ Post_View *GMSH_LevelsetPlugin::execute(Post_View * v)
static
bool
recur_sign_change
(
_triangle
*
t
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
static
bool
recur_sign_change
(
_triangle
*
t
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
{
{
if
(
!
t
->
t
[
0
])
if
(
!
t
->
t
[
0
]
||
t
->
visible
)
{
{
double
v1
=
plug
->
levelset
(
t
->
p
[
0
]
->
X
,
t
->
p
[
0
]
->
Y
,
t
->
p
[
0
]
->
Z
,
t
->
p
[
0
]
->
val
);
double
v1
=
plug
->
levelset
(
t
->
p
[
0
]
->
X
,
t
->
p
[
0
]
->
Y
,
t
->
p
[
0
]
->
Z
,
t
->
p
[
0
]
->
val
);
double
v2
=
plug
->
levelset
(
t
->
p
[
1
]
->
X
,
t
->
p
[
1
]
->
Y
,
t
->
p
[
1
]
->
Z
,
t
->
p
[
1
]
->
val
);
double
v2
=
plug
->
levelset
(
t
->
p
[
1
]
->
X
,
t
->
p
[
1
]
->
Y
,
t
->
p
[
1
]
->
Z
,
t
->
p
[
1
]
->
val
);
...
@@ -589,7 +589,7 @@ static bool recur_sign_change (_triangle *t, double val, const GMSH_LevelsetPlug
...
@@ -589,7 +589,7 @@ static bool recur_sign_change (_triangle *t, double val, const GMSH_LevelsetPlug
static
bool
recur_sign_change
(
_tet
*
t
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
static
bool
recur_sign_change
(
_tet
*
t
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
{
{
if
(
!
t
->
t
[
0
])
if
(
!
t
->
t
[
0
]
||
t
->
visible
)
{
{
double
v1
=
plug
->
levelset
(
t
->
p
[
0
]
->
X
,
t
->
p
[
0
]
->
Y
,
t
->
p
[
0
]
->
Z
,
t
->
p
[
0
]
->
val
);
double
v1
=
plug
->
levelset
(
t
->
p
[
0
]
->
X
,
t
->
p
[
0
]
->
Y
,
t
->
p
[
0
]
->
Z
,
t
->
p
[
0
]
->
val
);
double
v2
=
plug
->
levelset
(
t
->
p
[
1
]
->
X
,
t
->
p
[
1
]
->
Y
,
t
->
p
[
1
]
->
Z
,
t
->
p
[
1
]
->
val
);
double
v2
=
plug
->
levelset
(
t
->
p
[
1
]
->
X
,
t
->
p
[
1
]
->
Y
,
t
->
p
[
1
]
->
Z
,
t
->
p
[
1
]
->
val
);
...
@@ -628,6 +628,52 @@ static bool recur_sign_change (_tet *t, double val, const GMSH_LevelsetPlugin *p
...
@@ -628,6 +628,52 @@ static bool recur_sign_change (_tet *t, double val, const GMSH_LevelsetPlugin *p
}
}
}
}
static
bool
recur_sign_change
(
_hex
*
t
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
{
if
(
!
t
->
h
[
0
]
||
t
->
visible
)
{
double
v1
=
plug
->
levelset
(
t
->
p
[
0
]
->
X
,
t
->
p
[
0
]
->
Y
,
t
->
p
[
0
]
->
Z
,
t
->
p
[
0
]
->
val
);
double
v2
=
plug
->
levelset
(
t
->
p
[
1
]
->
X
,
t
->
p
[
1
]
->
Y
,
t
->
p
[
1
]
->
Z
,
t
->
p
[
1
]
->
val
);
double
v3
=
plug
->
levelset
(
t
->
p
[
2
]
->
X
,
t
->
p
[
2
]
->
Y
,
t
->
p
[
2
]
->
Z
,
t
->
p
[
2
]
->
val
);
double
v4
=
plug
->
levelset
(
t
->
p
[
3
]
->
X
,
t
->
p
[
3
]
->
Y
,
t
->
p
[
3
]
->
Z
,
t
->
p
[
3
]
->
val
);
double
v5
=
plug
->
levelset
(
t
->
p
[
4
]
->
X
,
t
->
p
[
4
]
->
Y
,
t
->
p
[
4
]
->
Z
,
t
->
p
[
4
]
->
val
);
double
v6
=
plug
->
levelset
(
t
->
p
[
5
]
->
X
,
t
->
p
[
5
]
->
Y
,
t
->
p
[
5
]
->
Z
,
t
->
p
[
5
]
->
val
);
double
v7
=
plug
->
levelset
(
t
->
p
[
6
]
->
X
,
t
->
p
[
6
]
->
Y
,
t
->
p
[
6
]
->
Z
,
t
->
p
[
6
]
->
val
);
double
v8
=
plug
->
levelset
(
t
->
p
[
7
]
->
X
,
t
->
p
[
7
]
->
Y
,
t
->
p
[
7
]
->
Z
,
t
->
p
[
7
]
->
val
);
if
(
v1
*
v2
>
0
&&
v1
*
v3
>
0
&&
v1
*
v4
>
0
&&
v1
*
v5
>
0
&&
v1
*
v6
>
0
&&
v1
*
v7
>
0
&&
v1
*
v8
>
0
)
t
->
visible
=
false
;
else
t
->
visible
=
true
;
return
t
->
visible
;
}
else
{
bool
sc1
=
recur_sign_change
(
t
->
h
[
0
],
val
,
plug
);
bool
sc2
=
recur_sign_change
(
t
->
h
[
1
],
val
,
plug
);
bool
sc3
=
recur_sign_change
(
t
->
h
[
2
],
val
,
plug
);
bool
sc4
=
recur_sign_change
(
t
->
h
[
3
],
val
,
plug
);
bool
sc5
=
recur_sign_change
(
t
->
h
[
4
],
val
,
plug
);
bool
sc6
=
recur_sign_change
(
t
->
h
[
5
],
val
,
plug
);
bool
sc7
=
recur_sign_change
(
t
->
h
[
6
],
val
,
plug
);
bool
sc8
=
recur_sign_change
(
t
->
h
[
7
],
val
,
plug
);
if
(
sc1
||
sc2
||
sc3
||
sc4
||
sc5
||
sc6
||
sc7
||
sc8
)
{
if
(
!
sc1
)
t
->
h
[
0
]
->
visible
=
true
;
if
(
!
sc2
)
t
->
h
[
1
]
->
visible
=
true
;
if
(
!
sc3
)
t
->
h
[
2
]
->
visible
=
true
;
if
(
!
sc4
)
t
->
h
[
3
]
->
visible
=
true
;
if
(
!
sc5
)
t
->
h
[
4
]
->
visible
=
true
;
if
(
!
sc6
)
t
->
h
[
5
]
->
visible
=
true
;
if
(
!
sc7
)
t
->
h
[
6
]
->
visible
=
true
;
if
(
!
sc8
)
t
->
h
[
7
]
->
visible
=
true
;
return
true
;
}
t
->
visible
=
false
;
return
false
;
}
}
static
bool
recur_sign_change
(
_quad
*
q
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
static
bool
recur_sign_change
(
_quad
*
q
,
double
val
,
const
GMSH_LevelsetPlugin
*
plug
)
{
{
...
@@ -679,4 +725,9 @@ void GMSH_LevelsetPlugin::assign_specific_visibility () const
...
@@ -679,4 +725,9 @@ void GMSH_LevelsetPlugin::assign_specific_visibility () const
_quad
*
qe
=
*
_quad
::
all_quads
.
begin
();
_quad
*
qe
=
*
_quad
::
all_quads
.
begin
();
qe
->
visible
=
!
recur_sign_change
(
qe
,
_valueView
,
this
);
qe
->
visible
=
!
recur_sign_change
(
qe
,
_valueView
,
this
);
}
}
if
(
_hex
::
all_hexes
.
size
())
{
_hex
*
he
=
*
_hex
::
all_hexes
.
begin
();
he
->
visible
=
!
recur_sign_change
(
he
,
_valueView
,
this
);
}
}
}
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