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
wenqing
ogs
Commits
c71908ea
Commit
c71908ea
authored
6 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[GL] Raster: Rm unused fct. getRasterFromSurface.
parent
a57b4268
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoLib/Raster.cpp
+0
-35
0 additions, 35 deletions
GeoLib/Raster.cpp
GeoLib/Raster.h
+0
-3
0 additions, 3 deletions
GeoLib/Raster.h
with
0 additions
and
38 deletions
GeoLib/Raster.cpp
+
0
−
35
View file @
c71908ea
...
...
@@ -55,41 +55,6 @@ Raster::~Raster()
delete
[]
_raster_data
;
}
Raster
*
Raster
::
getRasterFromSurface
(
Surface
const
&
sfc
,
double
cell_size
,
double
no_data_val
)
{
MathLib
::
Point3d
const
&
ll
(
sfc
.
getAABB
().
getMinPoint
());
MathLib
::
Point3d
const
&
ur
(
sfc
.
getAABB
().
getMaxPoint
());
const
std
::
size_t
n_cols
=
static_cast
<
std
::
size_t
>
(
std
::
abs
(
ur
[
0
]
-
ll
[
0
])
/
cell_size
)
+
1
;
const
std
::
size_t
n_rows
=
static_cast
<
std
::
size_t
>
(
std
::
abs
(
ur
[
1
]
-
ll
[
1
])
/
cell_size
)
+
1
;
const
std
::
size_t
n_triangles
(
sfc
.
getNumberOfTriangles
());
auto
*
z_vals
(
new
double
[
n_cols
*
n_rows
]);
std
::
size_t
k
(
0
);
for
(
std
::
size_t
r
(
0
);
r
<
n_cols
;
r
++
)
{
for
(
std
::
size_t
c
(
0
);
c
<
n_rows
;
c
++
)
{
GeoLib
::
Point
const
test_pnt
=
{
ll
[
0
]
+
r
*
cell_size
,
ll
[
1
]
+
c
*
cell_size
,
0
};
for
(
k
=
0
;
k
<
n_triangles
;
k
++
)
{
if
(
sfc
[
k
]
->
containsPoint2D
(
test_pnt
))
{
GeoLib
::
Triangle
const
*
const
tri
(
sfc
[
k
]);
// compute coefficients c0, c1, c2 for the plane f(x,y) = c0 x + c1 y + c2
double
coeff
[
3
]
=
{
0.0
,
0.0
,
0.0
};
GeoLib
::
getPlaneCoefficients
(
*
tri
,
coeff
);
z_vals
[
r
*
n_rows
+
c
]
=
coeff
[
0
]
*
test_pnt
[
0
]
+
coeff
[
1
]
*
test_pnt
[
1
]
+
coeff
[
2
];
break
;
}
}
if
(
k
==
n_triangles
)
{
z_vals
[
r
*
n_rows
+
c
]
=
no_data_val
;
}
}
}
RasterHeader
header
=
{
std
::
size_t
(
n_cols
),
std
::
size_t
(
n_rows
),
1
,
MathLib
::
Point3d
(
ll
),
cell_size
,
static_cast
<
double
>
(
-
9999
)
};
return
new
Raster
(
header
,
z_vals
,
z_vals
+
n_cols
*
n_rows
);
}
double
Raster
::
getValueAtPoint
(
const
MathLib
::
Point3d
&
pnt
)
const
{
if
(
pnt
[
0
]
>=
_header
.
origin
[
0
]
&&
pnt
[
0
]
<
(
_header
.
origin
[
0
]
+
(
_header
.
cell_size
*
_header
.
n_cols
))
&&
...
...
This diff is collapsed.
Click to expand it.
GeoLib/Raster.h
+
0
−
3
View file @
c71908ea
...
...
@@ -97,9 +97,6 @@ public:
~
Raster
();
/// Creates a Raster based on a GeoLib::Surface
static
Raster
*
getRasterFromSurface
(
Surface
const
&
sfc
,
double
cell_size
,
double
no_data_val
=
-
9999
);
private
:
void
setCellSize
(
double
cell_size
);
void
setNoDataVal
(
double
no_data_val
);
...
...
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