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
Özgür Ozan Sen
ogs
Commits
7dfef54a
Commit
7dfef54a
authored
8 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
added vtu support
parent
8cedc66b
No related branches found
Branches containing commit
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/moveMeshNodes.cpp
+21
-14
21 additions, 14 deletions
Applications/Utils/MeshEdit/moveMeshNodes.cpp
with
21 additions
and
14 deletions
Applications/Utils/MeshEdit/moveMeshNodes.cpp
+
21
−
14
View file @
7dfef54a
...
@@ -14,8 +14,11 @@
...
@@ -14,8 +14,11 @@
#include
"Applications/ApplicationsLib/LogogSetup.h"
#include
"Applications/ApplicationsLib/LogogSetup.h"
#include
"BaseLib/FileTools.h"
#include
"GeoLib/AABB.h"
#include
"GeoLib/AABB.h"
#include
"MeshLib/IO/VtkIO/VtuInterface.h"
#include
"MeshLib/IO/readMeshFromFile.h"
#include
"MeshLib/IO/readMeshFromFile.h"
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"MeshLib/IO/writeMeshToFile.h"
#include
"MeshLib/Mesh.h"
#include
"MeshLib/Mesh.h"
...
@@ -87,12 +90,10 @@ int main (int argc, char* argv[])
...
@@ -87,12 +90,10 @@ int main (int argc, char* argv[])
const
std
::
string
msh_name
(
argv
[
1
]);
const
std
::
string
msh_name
(
argv
[
1
]);
const
std
::
string
current_key
(
argv
[
2
]);
const
std
::
string
current_key
(
argv
[
2
]);
//const std::string msh_name("D:\\rappbode-2013-03-03--30m_lowpass_new_new.msh");
std
::
string
const
ext
(
BaseLib
::
getFileExtension
(
msh_name
));
//const std::string current_key("-MESH");
if
(
!
(
ext
==
"msh"
||
ext
==
"vtu"
))
if
(
msh_name
.
substr
(
msh_name
.
length
()
-
4
,
4
).
compare
(
".msh"
)
!=
0
)
{
{
ERR
(
"Error: Parameter 1
should
be a msh-file."
);
ERR
(
"Error: Parameter 1
must
be a m
e
sh-file
(*.msh / *.vtu)
."
);
INFO
(
"Usage: %s <msh-file.gml> <keyword> <value>"
,
argv
[
0
]);
INFO
(
"Usage: %s <msh-file.gml> <keyword> <value>"
,
argv
[
0
]);
return
-
1
;
return
-
1
;
}
}
...
@@ -113,9 +114,12 @@ int main (int argc, char* argv[])
...
@@ -113,9 +114,12 @@ int main (int argc, char* argv[])
return
-
1
;
return
-
1
;
}
}
std
::
unique_ptr
<
MeshLib
::
Mesh
>
mesh
(
std
::
unique_ptr
<
MeshLib
::
Mesh
>
mesh
(
MeshLib
::
IO
::
readMeshFromFile
(
msh_name
));
MeshLib
::
IO
::
readMeshFromFile
(
msh_name
));
if
(
mesh
==
nullptr
)
//std::vector<std::size_t> del_nodes;
{
ERR
(
"Error reading mesh file."
);
return
1
;
}
// Start keyword-specific selection of nodes
// Start keyword-specific selection of nodes
...
@@ -151,10 +155,14 @@ int main (int argc, char* argv[])
...
@@ -151,10 +155,14 @@ int main (int argc, char* argv[])
}
}
const
std
::
string
value
(
argv
[
3
]);
const
std
::
string
value
(
argv
[
3
]);
double
max_dist
(
pow
(
strtod
(
argv
[
4
],
0
),
2
));
double
max_dist
(
pow
(
strtod
(
argv
[
4
],
0
),
2
));
//const std::string value("D:\\Rappbodevorsperre_elevation440m.msh");
//double max_dist (25.0); // squared maximum distance at which reference points are used
double
offset
(
0.0
);
// additional offset for elevation (should be 0)
double
offset
(
0.0
);
// additional offset for elevation (should be 0)
MeshLib
::
Mesh
*
ground_truth
(
MeshLib
::
IO
::
readMeshFromFile
(
value
));
std
::
unique_ptr
<
MeshLib
::
Mesh
>
ground_truth
(
MeshLib
::
IO
::
readMeshFromFile
(
value
));
if
(
mesh
==
nullptr
)
{
ERR
(
"Error reading mesh file."
);
return
1
;
}
const
std
::
vector
<
MeshLib
::
Node
*>&
ground_truth_nodes
(
ground_truth
->
getNodes
());
const
std
::
vector
<
MeshLib
::
Node
*>&
ground_truth_nodes
(
ground_truth
->
getNodes
());
GeoLib
::
AABB
bounding_box
(
ground_truth_nodes
.
begin
(),
ground_truth_nodes
.
end
());
GeoLib
::
AABB
bounding_box
(
ground_truth_nodes
.
begin
(),
ground_truth_nodes
.
end
());
MathLib
::
Point3d
const
&
min
(
bounding_box
.
getMinPoint
());
MathLib
::
Point3d
const
&
min
(
bounding_box
.
getMinPoint
());
...
@@ -201,8 +209,7 @@ int main (int argc, char* argv[])
...
@@ -201,8 +209,7 @@ int main (int argc, char* argv[])
}
}
/**** add other keywords here ****/
/**** add other keywords here ****/
MeshLib
::
IO
::
writeMeshToFile
(
MeshLib
::
IO
::
VtuInterface
vtu
(
mesh
.
get
(),
0
,
false
);
*
mesh
,
msh_name
.
substr
(
0
,
msh_name
.
length
()
-
4
)
+
"_new.
msh
"
);
vtu
.
writeToFile
(
msh_name
.
substr
(
0
,
msh_name
.
length
()
-
4
)
+
"_new.
vtu
"
);
return
1
;
return
1
;
}
}
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