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
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
Yuhao Liu
ogs
Commits
d60c64f8
Commit
d60c64f8
authored
9 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[U/ME] Initial. impl. of MapGeometryToMeshSurface.
parent
d094bec3
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
Applications/Utils/MeshEdit/CMakeLists.txt
+14
-0
14 additions, 0 deletions
Applications/Utils/MeshEdit/CMakeLists.txt
Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
+104
-0
104 additions, 0 deletions
Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
with
118 additions
and
0 deletions
Applications/Utils/MeshEdit/CMakeLists.txt
+
14
−
0
View file @
d60c64f8
...
...
@@ -26,6 +26,20 @@ if(QT4_FOUND)
set_target_properties
(
moveMeshNodes PROPERTIES FOLDER Utilities
)
add_executable
(
MapGeometryToMeshSurface
MapGeometryToMeshSurface.cpp
)
target_link_libraries
(
MapGeometryToMeshSurface
MeshLib
MeshGeoToolsLib
FileIO
InSituLib
${
CATALYST_LIBRARIES
}
${
QT_LIBRARIES
}
)
ADD_CATALYST_DEPENDENCY
(
MapGeometryToMeshSurface
)
set_target_properties
(
MapGeometryToMeshSurface
PROPERTIES FOLDER Utilities
)
endif
()
# QT4_FOUND
add_executable
(
removeMeshElements removeMeshElements.cpp
)
...
...
This diff is collapsed.
Click to expand it.
Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp
0 → 100644
+
104
−
0
View file @
d60c64f8
/*
* \date 2015-04-20
* \brief Map geometric objects to the surface of the given mesh.
*
* \copyright
* Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
*/
#include
<algorithm>
#include
<cstdlib>
#include
<vector>
// TCLAP
#include
"tclap/CmdLine.h"
// ThirdParty/logog
#include
"logog/include/logog.hpp"
// BaseLib
#include
"BaseLib/LogogSimpleFormatter.h"
// FileIO
#include
"FileIO/readMeshFromFile.h"
#include
"FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
#include
"FileIO/XmlIO/Qt/XmlGmlInterface.h"
// GeoLib
#include
"GeoLib/GEOObjects.h"
// MeshLib
#include
"MeshLib/Mesh.h"
// MeshGeoToolsLib
#include
"MeshGeoToolsLib/GeoMapper.h"
int
main
(
int
argc
,
char
*
argv
[])
{
LOGOG_INITIALIZE
();
logog
::
Cout
*
logog_cout
(
new
logog
::
Cout
);
BaseLib
::
LogogSimpleFormatter
*
custom_format
(
new
BaseLib
::
LogogSimpleFormatter
);
logog_cout
->
SetFormatter
(
*
custom_format
);
TCLAP
::
CmdLine
cmd
(
"Maps geometric objects to the surface of a given mesh."
,
' '
,
"0.1"
);
TCLAP
::
ValueArg
<
std
::
string
>
mesh_in
(
"m"
,
"mesh-file"
,
"the name of the file containing the mesh"
,
true
,
""
,
"file name"
);
cmd
.
add
(
mesh_in
);
TCLAP
::
ValueArg
<
std
::
string
>
input_geometry_fname
(
"i"
,
"input-geometry"
,
"the name of the file containing the input geometry"
,
true
,
""
,
"file name"
);
cmd
.
add
(
input_geometry_fname
);
TCLAP
::
ValueArg
<
bool
>
advanced_mapping
(
""
,
"advanced-mapping"
,
"if true advanced mapping algorithm will be applied"
,
false
,
true
,
"boolean value"
);
cmd
.
add
(
advanced_mapping
);
TCLAP
::
ValueArg
<
std
::
string
>
output_geometry_fname
(
"o"
,
"output-geometry"
,
"the name of the file containing the input geometry"
,
true
,
""
,
"file name"
);
cmd
.
add
(
output_geometry_fname
);
cmd
.
parse
(
argc
,
argv
);
// *** read mesh
MeshLib
::
Mesh
*
mesh
(
FileIO
::
readMeshFromFile
(
mesh_in
.
getValue
()));
// *** read geometry
GeoLib
::
GEOObjects
geometries
;
{
FileIO
::
BoostXmlGmlInterface
xml_io
(
geometries
);
if
(
xml_io
.
readFile
(
input_geometry_fname
.
getValue
()))
{
INFO
(
"Read geometry from file
\"
%s
\"
."
,
input_geometry_fname
.
getValue
().
c_str
());
}
else
{
delete
mesh
;
return
EXIT_FAILURE
;
}
}
std
::
string
geo_name
;
{
std
::
vector
<
std
::
string
>
geo_names
;
geometries
.
getGeometryNames
(
geo_names
);
geo_name
=
geo_names
[
0
];
}
std
::
string
new_geo_name
(
geo_name
);
MeshGeoToolsLib
::
GeoMapper
geo_mapper
(
geometries
,
geo_name
);
if
(
advanced_mapping
.
getValue
())
{
new_geo_name
+=
"-Mapped"
;
geo_mapper
.
advancedMapOnMesh
(
mesh
,
new_geo_name
);
}
else
{
geo_mapper
.
mapOnMesh
(
mesh
);
}
{
FileIO
::
XmlGmlInterface
xml_io
(
geometries
);
xml_io
.
setNameForExport
(
new_geo_name
);
xml_io
.
writeToFile
(
output_geometry_fname
.
getValue
());
}
return
EXIT_SUCCESS
;
}
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