Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karsten Rink
ogs
Commits
b136a974
Commit
b136a974
authored
6 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[A/U/ME] Clang fmt. ResetPropertiesInPolygonalRegion.
parent
8f08e7ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
+43
-29
43 additions, 29 deletions
...tions/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
with
43 additions
and
29 deletions
Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp
+
43
−
29
View file @
b136a974
...
...
@@ -25,7 +25,7 @@
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"MeshLib/Mesh.h"
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
ApplicationsLib
::
LogogSetup
logog_setup
;
...
...
@@ -41,37 +41,47 @@ int main (int argc, char* argv[])
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)"
,
' '
,
BaseLib
::
BuildInfo
::
ogs_version
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_out
(
"o"
,
"mesh-output-file"
,
TCLAP
::
ValueArg
<
std
::
string
>
mesh_out
(
"o"
,
"mesh-output-file"
,
"the name of the file the mesh will be written to, format depends on "
"the given file name extension"
,
true
,
""
,
"file name"
);
"the given file name extension"
,
true
,
""
,
"file name"
);
cmd
.
add
(
mesh_out
);
TCLAP
::
ValueArg
<
std
::
string
>
polygon_name_arg
(
"p"
,
"polygon-name"
,
"name of polygon in the geometry"
,
true
,
""
,
"string"
);
TCLAP
::
ValueArg
<
std
::
string
>
polygon_name_arg
(
"p"
,
"polygon-name"
,
"name of polygon in the geometry"
,
true
,
""
,
"string"
);
cmd
.
add
(
polygon_name_arg
);
TCLAP
::
ValueArg
<
std
::
string
>
geometry_fname
(
"g"
,
"geometry"
,
"the name of "
"the file containing the input geometry (gli or gml format)"
,
true
,
""
,
"file name"
);
TCLAP
::
ValueArg
<
std
::
string
>
geometry_fname
(
"g"
,
"geometry"
,
"the name of "
"the file containing the input geometry (gli or gml format)"
,
true
,
""
,
"file name"
);
cmd
.
add
(
geometry_fname
);
TCLAP
::
ValueArg
<
char
>
char_property_arg
(
"c"
,
"char-property-value"
,
"new property value (data type char)"
,
false
,
'A'
,
"character"
);
TCLAP
::
ValueArg
<
char
>
char_property_arg
(
"c"
,
"char-property-value"
,
"new property value (data type char)"
,
false
,
'A'
,
"character"
);
cmd
.
add
(
char_property_arg
);
TCLAP
::
ValueArg
<
int
>
int_property_arg
(
"i"
,
"int-property-value"
,
"new property value (data type int)"
,
false
,
0
,
"number"
);
"new property value (data type int)"
,
false
,
0
,
"number"
);
cmd
.
add
(
int_property_arg
);
TCLAP
::
ValueArg
<
bool
>
bool_property_arg
(
"b"
,
"bool-property-value"
,
"new property value (data type bool)"
,
false
,
false
,
"boolean value"
);
TCLAP
::
ValueArg
<
bool
>
bool_property_arg
(
"b"
,
"bool-property-value"
,
"new property value (data type bool)"
,
false
,
false
,
"boolean value"
);
cmd
.
add
(
bool_property_arg
);
TCLAP
::
ValueArg
<
std
::
string
>
property_name_arg
(
"n"
,
"property-name"
,
"name of property in the mesh"
,
false
,
"MaterialIDs"
,
"string"
);
TCLAP
::
ValueArg
<
std
::
string
>
property_name_arg
(
"n"
,
"property-name"
,
"name of property in the mesh"
,
false
,
"MaterialIDs"
,
"string"
);
cmd
.
add
(
property_name_arg
);
TCLAP
::
ValueArg
<
int
>
restrict_arg
(
"r"
,
"restrict-to-MaterialID"
,
"Restrict reseting the property to the material id"
,
false
,
-
1
,
"MaterialID"
);
cmd
.
add
(
restrict_arg
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_in
(
"m"
,
"mesh-input-file"
,
"the name of the file containing the input mesh"
,
true
,
""
,
"file name"
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_in
(
"m"
,
"mesh-input-file"
,
"the name of the file containing the input mesh"
,
true
,
""
,
"file name"
);
cmd
.
add
(
mesh_in
);
TCLAP
::
ValueArg
<
std
::
string
>
gmsh_path_arg
(
""
,
"gmsh-path"
,
"the path to the gmsh binary"
,
...
...
@@ -94,7 +104,8 @@ int main (int argc, char* argv[])
// *** check if the data is usable
// *** get vector of polylines
GeoLib
::
PolylineVec
const
*
plys
(
geometries
.
getPolylineVecObj
(
geo_name
));
if
(
!
plys
)
{
if
(
!
plys
)
{
ERR
(
"Could not get vector of polylines out of geometry '%s'."
,
geo_name
.
c_str
());
return
EXIT_FAILURE
;
...
...
@@ -102,19 +113,18 @@ int main (int argc, char* argv[])
// *** get polygon
GeoLib
::
Polyline
const
*
ply
(
plys
->
getElementByName
(
polygon_name_arg
.
getValue
())
)
;
if
(
!
ply
)
{
plys
->
getElementByName
(
polygon_name_arg
.
getValue
())
);
if
(
!
ply
)
{
ERR
(
"Polyline '%s' not found."
,
polygon_name_arg
.
getValue
().
c_str
());
return
EXIT_FAILURE
;
}
// *** check if the polyline is closed (i.e. is a polygon)
bool
closed
(
ply
->
isClosed
());
bool
closed
(
ply
->
isClosed
());
if
(
!
closed
)
{
ERR
(
"Polyline '%s' is not closed, i.e. does not describe a\
region."
,
ERR
(
"Polyline '%s' is not closed, i.e. does not describe a region."
,
polygon_name_arg
.
getValue
().
c_str
());
return
EXIT_FAILURE
;
}
...
...
@@ -131,19 +141,22 @@ int main (int argc, char* argv[])
}
std
::
string
const
&
property_name
(
property_name_arg
.
getValue
());
if
(
char_property_arg
.
isSet
())
{
if
(
char_property_arg
.
isSet
())
{
MeshGeoToolsLib
::
resetMeshElementProperty
(
*
mesh
,
polygon
,
property_name
,
char_property_arg
.
getValue
(),
restrict_arg
.
getValue
());
}
if
(
int_property_arg
.
isSet
())
{
if
(
int_property_arg
.
isSet
())
{
MeshGeoToolsLib
::
resetMeshElementProperty
(
*
mesh
,
polygon
,
property_name
,
int_property_arg
.
getValue
(),
restrict_arg
.
getValue
());
}
if
(
bool_property_arg
.
isSet
())
{
if
(
bool_property_arg
.
isSet
())
{
MeshGeoToolsLib
::
resetMeshElementProperty
(
*
mesh
,
polygon
,
property_name
,
bool_property_arg
.
getValue
(),
restrict_arg
.
getValue
());
...
...
@@ -152,7 +165,8 @@ int main (int argc, char* argv[])
std
::
vector
<
std
::
string
>
property_names
(
mesh
->
getProperties
().
getPropertyVectorNames
());
INFO
(
"Mesh contains %d property vectors:"
,
property_names
.
size
());
for
(
const
auto
&
name
:
property_names
)
{
for
(
const
auto
&
name
:
property_names
)
{
INFO
(
"- %s"
,
name
.
c_str
());
}
...
...
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