Swaths.h
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 #pragma once
8 #ifndef FIELDS2COVER_TYPES_SWATHS_H_
9 #define FIELDS2COVER_TYPES_SWATHS_H_
10 
11 #include <vector>
17 
18 namespace f2c::types {
19 
20 struct Swaths {
21  Swaths();
22  explicit Swaths(int i);
23  Swaths(const std::initializer_list<Swath>& s);
24  explicit Swaths(const std::vector<Swath>& s);
25  ~Swaths();
26 
27  void emplace_back(const Swath& s);
28 
29  void emplace_back(const LineString& l, double w, int id = 0,
31 
32  void push_back(const Swath& s);
33 
34  std::vector<Swath>::iterator begin();
35  std::vector<Swath>::iterator end();
36  std::vector<Swath>::const_iterator begin() const;
37  std::vector<Swath>::const_iterator end() const;
38  void reverse();
39 
40  Swath& back();
41  const Swath& back() const;
42 
43  Swath& at(size_t i);
44  const Swath& at(size_t i) const;
45 
46  size_t size() const;
47 
48  Swath& operator[] (int i);
49 
50  const Swath& operator[] (int i) const;
51 
52  void append(const LineString& line, double width = 0,
54  void append(const MultiLineString& line, double width = 0,
56  void append(const LineString& line, const Cell& poly, double width = 0,
58  void append(const MultiLineString& lines, const Cell& poly,
59  double width = 0, SwathType type = SwathType::MAINLAND);
60  void append(const LineString& line, const Cells& polys,
61  double width = 0, SwathType type = SwathType::MAINLAND);
62  void append(const MultiLineString& lines, const Cells& poly,
63  double width = 0, SwathType type = SwathType::MAINLAND);
64  void append(const Swaths& swaths);
65 
66  void sort();
67  void reverseDirOddSwaths();
68  void moveTo(const Point& ref_pt);
69 
70  Swaths clone() const;
71 
72  private:
73  std::vector<Swath> data_;
74 };
75 
76 
77 } // namespace f2c::types
78 
79 #endif // FIELDS2COVER_TYPES_SWATHS_H_
f2c::types::Swaths::size
size_t size() const
Definition: Swaths.cpp:78
f2c::types::Swaths::emplace_back
void emplace_back(const Swath &s)
Definition: Swaths.cpp:29
f2c::types::Swaths::end
std::vector< Swath >::iterator end()
Definition: Swaths.cpp:46
5_route_planning.swaths
swaths
Definition: 5_route_planning.py:58
Cell.h
f2c::types::Swaths::reverse
void reverse()
Definition: Swaths.cpp:58
f2c::types
Types used by fields2cover library.
Definition: Cell.h:20
f2c::types::Swaths::~Swaths
~Swaths()
f2c::types::Swaths::reverseDirOddSwaths
void reverseDirOddSwaths()
Definition: Swaths.cpp:136
f2c::types::Swaths::at
Swath & at(size_t i)
Definition: Swaths.cpp:70
f2c::types::Swath
Definition: Swath.h:23
f2c::types::Swaths::operator[]
Swath & operator[](int i)
Definition: Swaths.cpp:82
f2c::types::MultiLineString
Definition: MultiLineString.h:18
Swath.h
f2c::types::Cell
Definition: Cell.h:32
f2c::types::SwathType::MAINLAND
@ MAINLAND
LineString.h
f2c::types::Swaths::moveTo
void moveTo(const Point &ref_pt)
Definition: Swaths.cpp:150
f2c::types::Swaths::Swaths
Swaths()
2_objective_functions.width
float width
Definition: 2_objective_functions.py:29
f2c::types::LineString
Definition: LineString.h:19
f2c::types::Swaths::append
void append(const LineString &line, double width=0, SwathType type=SwathType::MAINLAND)
Definition: Swaths.cpp:90
MultiLineString.h
f2c::types::Cells
Definition: Cells.h:21
f2c::types::Swaths::back
Swath & back()
Definition: Swaths.cpp:62
f2c::types::Point
Definition: Point.h:21
f2c::types::Swaths::clone
Swaths clone() const
Definition: Swaths.cpp:142
f2c::types::Swaths::sort
void sort()
Definition: Swaths.cpp:127
Cells.h
f2c::types::SwathType
SwathType
Definition: Swath.h:21
f2c::types::Swaths::begin
std::vector< Swath >::iterator begin()
Definition: Swaths.cpp:42
f2c::types::Swaths::data_
std::vector< Swath > data_
Definition: Swaths.h:73
1_basic_types.lines
lines
Definition: 1_basic_types.py:73
f2c::types::Swaths
Definition: Swaths.h:20
f2c::types::Swaths::push_back
void push_back(const Swath &s)
Definition: Swaths.cpp:38


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31