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
9655bf78
Commit
9655bf78
authored
10 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
fixed epsilon calculation and default raster value assignment
parent
f87eb16d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Gui/VtkVis/VtkCompositeColorByHeightFilter.cpp
+8
-6
8 additions, 6 deletions
Gui/VtkVis/VtkCompositeColorByHeightFilter.cpp
Gui/mainwindow.cpp
+3
-4
3 additions, 4 deletions
Gui/mainwindow.cpp
MeshLib/MeshGenerators/LayeredVolume.cpp
+5
-3
5 additions, 3 deletions
MeshLib/MeshGenerators/LayeredVolume.cpp
with
16 additions
and
13 deletions
Gui/VtkVis/VtkCompositeColorByHeightFilter.cpp
+
8
−
6
View file @
9655bf78
...
@@ -47,14 +47,16 @@ void VtkCompositeColorByHeightFilter::init()
...
@@ -47,14 +47,16 @@ void VtkCompositeColorByHeightFilter::init()
unsigned
char
a
[
4
]
=
{
0
,
0
,
255
,
255
};
// blue
unsigned
char
a
[
4
]
=
{
0
,
0
,
255
,
255
};
// blue
unsigned
char
b
[
4
]
=
{
0
,
255
,
0
,
255
};
// green
unsigned
char
b
[
4
]
=
{
0
,
255
,
0
,
255
};
// green
unsigned
char
c
[
4
]
=
{
255
,
255
,
0
,
255
};
// yellow
unsigned
char
c
[
4
]
=
{
255
,
255
,
0
,
255
};
// yellow
unsigned
char
d
[
4
]
=
{
255
,
0
,
0
,
255
};
// red
unsigned
char
d
[
4
]
=
{
155
,
100
,
50
,
255
};
// brown
unsigned
char
e
[
4
]
=
{
255
,
0
,
0
,
255
};
// red
VtkColorLookupTable
*
ColorLookupTable
=
heightFilter
->
GetColorLookupTable
();
VtkColorLookupTable
*
ColorLookupTable
=
heightFilter
->
GetColorLookupTable
();
ColorLookupTable
->
setInterpolationType
(
VtkColorLookupTable
::
LUTType
::
LINEAR
);
ColorLookupTable
->
setInterpolationType
(
VtkColorLookupTable
::
LUTType
::
LINEAR
);
ColorLookupTable
->
setColor
(
-
35
,
a
);
ColorLookupTable
->
setColor
(
-
50
,
a
);
ColorLookupTable
->
setColor
(
150
,
b
);
// green at about 150m
ColorLookupTable
->
setColor
(
200
,
b
);
// green at about 20m
ColorLookupTable
->
setColor
(
450
,
c
);
// yellow at about 450m and changing to red from then on
ColorLookupTable
->
setColor
(
500
,
c
);
// yellow at about 500m and changing to red from then on
ColorLookupTable
->
setColor
(
800
,
d
);
ColorLookupTable
->
setColor
(
1000
,
d
);
ColorLookupTable
->
SetTableRange
(
-
35
,
800
);
ColorLookupTable
->
setColor
(
2000
,
e
);
ColorLookupTable
->
SetTableRange
(
-
35
,
2000
);
ColorLookupTable
->
Build
();
ColorLookupTable
->
Build
();
// This passes ownership of the ColorLookupTable to VtkVisPointSetItem
// This passes ownership of the ColorLookupTable to VtkVisPointSetItem
...
...
This diff is collapsed.
Click to expand it.
Gui/mainwindow.cpp
+
3
−
4
View file @
9655bf78
...
@@ -694,11 +694,10 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
...
@@ -694,11 +694,10 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
}
}
else
{
else
{
settings
.
setValue
(
"lastOpenedTetgenFileDirectory"
,
QFileInfo
(
fileName
).
absolutePath
());
settings
.
setValue
(
"lastOpenedTetgenFileDirectory"
,
QFileInfo
(
fileName
).
absolutePath
());
QString
element_fname
=
QFileDialog
::
getOpenFileName
(
this
,
"Select TetGen element file"
,
QString
element_fname
(
fi
.
path
()
+
"
\\
"
+
fi
.
completeBaseName
()
+
".ele"
);
settings
.
value
(
"lastOpenedTetgenFileDirectory"
).
toString
(),
"TetGen element files (*.ele);;"
);
if
(
!
fileName
.
isEmpty
()
&&
!
element_fname
.
isEmpty
())
{
if
(
!
fileName
.
isEmpty
())
{
FileIO
::
TetGenInterface
tetgen
;
FileIO
::
TetGenInterface
tetgen
;
MeshLib
::
Mesh
*
mesh
(
tetgen
.
readTetGenMesh
(
fileName
.
toStdString
(),
element_fname
.
toStdString
()));
MeshLib
::
Mesh
*
mesh
(
tetgen
.
readTetGenMesh
(
fileName
.
toStdString
(),
element_fname
.
toStdString
()));
if
(
mesh
)
if
(
mesh
)
...
...
This diff is collapsed.
Click to expand it.
MeshLib/MeshGenerators/LayeredVolume.cpp
+
5
−
3
View file @
9655bf78
...
@@ -59,7 +59,9 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
...
@@ -59,7 +59,9 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
if
(
mesh
.
getDimension
()
!=
2
)
if
(
mesh
.
getDimension
()
!=
2
)
return
false
;
return
false
;
_elevation_epsilon
=
calcEpsilon
(
*
rasters
.
back
(),
*
rasters
[
0
]);
_elevation_epsilon
=
calcEpsilon
(
*
rasters
[
0
],
*
rasters
.
back
());
if
(
_elevation_epsilon
<=
0
)
return
false
;
// remove line elements, only tri + quad remain
// remove line elements, only tri + quad remain
MeshLib
::
ElementExtraction
ex
(
mesh
);
MeshLib
::
ElementExtraction
ex
(
mesh
);
...
@@ -74,7 +76,7 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
...
@@ -74,7 +76,7 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto
for
(
size_t
i
=
0
;
i
<
nRasters
;
++
i
)
for
(
size_t
i
=
0
;
i
<
nRasters
;
++
i
)
{
{
const
double
replacement_value
=
(
i
==
0
)
?
noDataReplacementValue
:
_invalid_value
;
const
double
replacement_value
=
(
i
==
0
)
?
noDataReplacementValue
:
_invalid_value
;
if
(
!
MeshLayerMapper
::
LayerMapping
(
*
mesh_layer
,
*
rasters
[
i
],
0
,
0
,
_invalid
_value
))
if
(
!
MeshLayerMapper
::
LayerMapping
(
*
mesh_layer
,
*
rasters
[
i
],
0
,
0
,
replacement
_value
))
{
{
this
->
cleanUpOnError
();
this
->
cleanUpOnError
();
return
false
;
return
false
;
...
@@ -207,7 +209,7 @@ bool LayeredVolume::exportToGeometry(GeoLib::GEOObjects &geo_objects) const
...
@@ -207,7 +209,7 @@ bool LayeredVolume::exportToGeometry(GeoLib::GEOObjects &geo_objects) const
double
LayeredVolume
::
calcEpsilon
(
const
GeoLib
::
Raster
&
high
,
const
GeoLib
::
Raster
&
low
)
double
LayeredVolume
::
calcEpsilon
(
const
GeoLib
::
Raster
&
high
,
const
GeoLib
::
Raster
&
low
)
{
{
const
double
max
(
*
std
::
max_element
(
high
.
begin
(),
high
.
end
()));
const
double
max
(
*
std
::
max_element
(
high
.
begin
(),
high
.
end
()));
const
double
min
(
*
std
::
min_element
(
high
.
begin
(),
high
.
end
()));
const
double
min
(
*
std
::
min_element
(
low
.
begin
(),
low
.
end
()));
return
((
max
-
min
)
*
1e-07
);
return
((
max
-
min
)
*
1e-07
);
}
}
...
...
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