tests
cpp
types
Strip_test.cpp
Go to the documentation of this file.
1
//=============================================================================
2
// Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3
// Author: Gonzalo Mier
4
// BSD-3 License
5
//=============================================================================
6
7
#include <gtest/gtest.h>
8
#include "
fields2cover/types.h
"
9
10
TEST
(fields2cover_types_strip, clone) {
11
F2CSwath
swath(
F2CLineString
({
F2CPoint
(0, 0),
F2CPoint
(0, 10)}), 2.0, 1);
12
F2CCells
cells
= swath.
areaCovered
();
13
F2CStrip
strip1;
14
strip1.
setCell
(
cells
.getGeometry(0));
15
strip1.
setName
(
"TEST"
);
16
auto
strip2 = strip1.
clone
();
17
EXPECT_EQ(strip1.
getName
(),
"TEST"
);
18
EXPECT_EQ(strip2.getName(),
"TEST"
);
19
EXPECT_NEAR(strip1.
getCell
().
area
(), 20.0, 1e-2);
20
EXPECT_NEAR(strip2.getCell().area(), 20.0, 1e-2);
21
}
22
f2c::types::Geometries::area
double area() const
Compute area of the geometry.
Definition:
Geometries_impl.hpp:14
1_basic_types.cells
cells
Definition:
1_basic_types.py:93
types.h
f2c::types::Strip::clone
Strip clone() const
Definition:
Strip.cpp:31
f2c::types::Strip::setCell
void setCell(const Cell &cell)
Definition:
Strip.cpp:19
f2c::types::Swath
Definition:
Swath.h:23
f2c::types::Swath::areaCovered
Cells areaCovered() const
Definition:
Swath.cpp:106
f2c::types::Strip::getName
std::string getName() const
Definition:
Strip.cpp:23
f2c::types::Strip
Definition:
Strip.h:16
f2c::types::Strip::setName
void setName(const std::string &str)
Definition:
Strip.cpp:27
f2c::types::Cells
Definition:
Cells.h:21
F2CLineString
f2c::types::LineString F2CLineString
Definition:
types.h:40
TEST
TEST(fields2cover_types_strip, clone)
Definition:
Strip_test.cpp:10
f2c::types::Strip::getCell
Cell & getCell()
Definition:
Strip.cpp:11
F2CPoint
f2c::types::Point F2CPoint
Definition:
types.h:38
fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31