Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plugin-MetaMesh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Jan Schnathmeier
Plugin-MetaMesh
Commits
bb772c8f
Commit
bb772c8f
authored
5 years ago
by
Jan Schnathmeier
Browse files
Options
Downloads
Patches
Plain Diff
Output data for Iteration parameters
#41
parent
57b1f640
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
IsotropicRemesher.cc
+89
-17
89 additions, 17 deletions
IsotropicRemesher.cc
IsotropicRemesher.hh
+9
-0
9 additions, 0 deletions
IsotropicRemesher.hh
with
98 additions
and
17 deletions
IsotropicRemesher.cc
+
89
−
17
View file @
bb772c8f
...
...
@@ -42,8 +42,14 @@ void IsotropicRemesher::Remesh(Embedding* embedding,
dir
.
mkpath
(
"."
);
}
}
QFile
param_file
(
QString
(
SCREENSHOT_PATH
)
+
"/target"
+
QString
::
number
(
target_length
)
+
"-iterations"
+
QString
::
number
(
iterations
)
+
"/t"
+
QString
::
number
(
target_length
)
+
"i"
+
QString
::
number
(
iterations
)
+
".param.txt"
);
QFile
output_file
(
QString
(
SCREENSHOT_PATH
)
+
"/target"
+
QString
::
number
(
target_length
)
+
"-iterations"
+
QString
::
number
(
iterations
)
+
"/data.csv"
);
+
"-iterations"
+
QString
::
number
(
iterations
)
+
"/t"
+
QString
::
number
(
target_length
)
+
"i"
+
QString
::
number
(
iterations
)
+
".csv"
);
const
double
inf
=
std
::
numeric_limits
<
double
>::
infinity
();
ACG
::
Vec3d
minCorner
=
{
+
inf
,
+
inf
,
+
inf
};
...
...
@@ -60,6 +66,9 @@ void IsotropicRemesher::Remesh(Embedding* embedding,
if
(
dataoutput
)
{
output_file
.
resize
(
0
);
param_file
.
resize
(
0
);
DataOutputParam
(
embedding
,
&
param_file
,
target_length
,
iterations
,
alpha
,
beta
,
smtype
,
limitflips
,
strtype
,
corder
);
DataOutputHeader
(
embedding
,
&
output_file
);
DataOutput
(
embedding
,
&
output_file
,
0.0
,
0
);
}
...
...
@@ -1016,6 +1025,85 @@ void IsotropicRemesher::Straightening(Embedding *embedding, StraighteningType st
}
}
void
IsotropicRemesher
::
DataOutputParam
(
Embedding
*
embedding
,
QFile
*
file
,
double
target_length
,
uint
iterations
,
double
alpha
,
double
beta
,
SmoothingType
smtype
,
bool
limitflips
,
StraighteningType
strtype
,
CollapsingOrder
corder
)
{
if
(
file
->
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Append
|
QIODevice
::
Text
))
{
QTextStream
tstream
(
file
);
QString
target_length_str
=
QString
::
number
(
target_length
);
QString
iterations_str
=
QString
(
iterations
);
QString
alpha_str
=
QString
::
number
(
alpha
);
QString
beta_str
=
QString
::
number
(
beta
);
QString
smtype_str
;
switch
(
smtype
)
{
case
FORESTFIRE
:
{
smtype_str
=
QString
(
"ForestFire"
);
break
;
}
case
VERTEXWEIGHTS
:
{
smtype_str
=
QString
(
"VertexWeights"
);
break
;
}
case
VERTEXDISTANCES
:
{
smtype_str
=
QString
(
"VertexDistances"
);
break
;
}
}
QString
limitflips_str
=
QString
(
limitflips
);
QString
strtype_str
;
switch
(
strtype
)
{
case
NONE
:
{
strtype_str
=
QString
(
"None"
);
break
;
}
case
IMPLICIT
:
{
strtype_str
=
QString
(
"Implicit"
);
break
;
}
case
SIMPLE
:
{
strtype_str
=
QString
(
"Simple"
);
break
;
}
case
PATCHWISE
:
{
strtype_str
=
QString
(
"Patchwise"
);
break
;
}
}
QString
corder_str
;
switch
(
corder
)
{
case
RANDOM
:
{
corder_str
=
QString
(
"Random"
);
break
;
}
case
VALENCE
:
{
corder_str
=
QString
(
"Valence"
);
break
;
}
case
SPLITWEIGHT
:
{
corder_str
=
QString
(
"Splitweight"
);
break
;
}
}
tstream
<<
"Target edge length: "
<<
target_length_str
<<
endl
<<
"Iterations: "
<<
iterations_str
<<
endl
<<
"Alpha: "
<<
alpha_str
<<
endl
<<
"Beta: "
<<
beta_str
<<
endl
<<
"Smoothing type: "
<<
smtype_str
<<
endl
<<
"Limit Flips: "
<<
limitflips_str
<<
endl
<<
"Straightening Type: "
<<
strtype_str
<<
endl
<<
"Collapsing Order: "
<<
corder_str
<<
endl
;
file
->
close
();
}
}
void
IsotropicRemesher
::
DataOutputHeader
(
Embedding
*
embedding
,
QFile
*
file
)
{
if
(
file
->
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Append
|
QIODevice
::
Text
))
{
QTextStream
tstream
(
file
);
...
...
@@ -1073,22 +1161,6 @@ void IsotropicRemesher::DataOutput(Embedding *embedding,
}
avgvalence
/=
meta_mesh
->
n_vertices
();
valencedeviation
/=
meta_mesh
->
n_vertices
();
/*
qDebug() << "Base Mesh- V: " << base_mesh->n_vertices()
<< "E: " << base_mesh->n_edges()
<< "F: " << base_mesh->n_faces()
<< "Eul: " << baseeuler
<< "Gen: " << basegenus;
qDebug() << "Meta Mesh- V: " << meta_mesh->n_vertices()
<< "E: " << meta_mesh->n_edges()
<< "F: " << meta_mesh->n_faces()
<< "Eul: " << metaeuler
<< "Gen: " << metagenus;
qDebug() << "Embedding- Avg. Edge Length: " << avgmetaedgelength
<< " deviation: " << metaedgelengthdeviation
<< " avg valence: " << avgvalence
<< " deviation from 6: " << valencedeviation;
*/
QTextStream
tstream
(
file
);
tstream
<<
iteration
<<
","
...
...
This diff is collapsed.
Click to expand it.
IsotropicRemesher.hh
+
9
−
0
View file @
bb772c8f
...
...
@@ -63,6 +63,15 @@ private:
std
::
list
<
OpenMesh
::
HalfedgeHandle
>
mih_list
);
void
Straightening
(
Embedding
*
embedding
,
StraighteningType
strtype
=
PATCHWISE
);
void
DataOutputParam
(
Embedding
*
embedding
,
QFile
*
file
,
double
target_length
,
uint
iterations
,
double
alpha
,
double
beta
,
SmoothingType
smtype
,
bool
limitflips
,
StraighteningType
strtype
,
CollapsingOrder
corder
);
void
DataOutputHeader
(
Embedding
*
embedding
,
QFile
*
file
);
void
DataOutput
(
Embedding
*
embedding
,
QFile
*
file
,
double
time_elapsed
,
uint
iteration
);
...
...
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