EMODnet Quantized Mesh Generator for Cesium
borders_data.h
1 // Copyright (c) 2018 Coronis Computing S.L. (Spain)
2 // All rights reserved.
3 //
4 // This file is part of EMODnet Quantized Mesh Generator for Cesium.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <https://www.gnu.org/licenses/>.
18 //
19 // Author: Ricard Campos (ricardcd@gmail.com)
20 
21 #ifndef EMODNET_QMGC_BORDERS_DATA_H
22 #define EMODNET_QMGC_BORDERS_DATA_H
23 
24 #include "tin_creation/tin_creation_cgal_types.h"
25 
31 {
32  typedef TinCreation::Point_3 Point_3;
33 
34  std::vector<Point_3> tileEastVertices;
35  std::vector<Point_3> tileWestVertices;
36  std::vector<Point_3> tileNorthVertices;
37  std::vector<Point_3> tileSouthVertices;
42  Point_3 northWestCorner;
43  Point_3 northEastCorner;
44  Point_3 southWestCorner;
45  Point_3 southEastCorner;
46 
51  : tileEastVertices()
52  , tileWestVertices()
53  , tileNorthVertices()
54  , tileSouthVertices()
55  , northWestCorner(-1, -1, -1)
56  , northEastCorner(-1, -1, -1)
57  , southWestCorner(-1, -1, -1)
58  , southEastCorner(-1, -1, -1)
59  , constrainNorthWestCorner(false)
60  , constrainNorthEastCorner(false)
61  , constrainSouthWestCorner(false)
62  , constrainSouthEastCorner(false) {}
63 
68  BordersData(const BordersData& bd) {
69  tileEastVertices = bd.tileEastVertices;
70  tileWestVertices = bd.tileWestVertices;
71  tileNorthVertices = bd.tileNorthVertices;
72  tileSouthVertices = bd.tileSouthVertices;
73  northWestCorner = bd.northWestCorner;
74  northEastCorner = bd.northEastCorner;
75  southWestCorner = bd.southWestCorner;
76  southEastCorner = bd.southEastCorner;
77  constrainNorthWestCorner = bd.constrainNorthWestCorner;
78  constrainNorthEastCorner = bd.constrainNorthEastCorner;
79  constrainSouthWestCorner = bd.constrainSouthWestCorner;
80  constrainSouthEastCorner = bd.constrainSouthEastCorner;
81  }
82 
88  return !tileNorthVertices.empty() || !tileWestVertices.empty();
89  }
90 
96  return !tileNorthVertices.empty() || !tileEastVertices.empty();
97  }
98 
104  return !tileSouthVertices.empty() || !tileWestVertices.empty();
105  }
106 
112  return !tileSouthVertices.empty() || !tileEastVertices.empty();
113  }
114 
120  return constrainNorthWestCorner && !isNorthWestCornerConstrainedByBorders();
121  }
122 
128  return constrainNorthEastCorner && !isNorthEastCornerConstrainedByBorders();
129  }
130 
136  return constrainSouthWestCorner && !isSouthWestCornerConstrainedByBorders();
137  }
138 
144  return constrainSouthEastCorner && !isSouthEastCornerConstrainedByBorders();
145  }
146 
147 };
148 
149 #endif //EMODNET_TOOLS_BORDERS_DATA_H
BordersData(const BordersData &bd)
Copy constructor.
Definition: borders_data.h:68
bool useNorthWestCorner()
Check wether north-west corner needs to be used.
Definition: borders_data.h:119
bool useSouthWestCorner()
Check wether south-west corner needs to be used.
Definition: borders_data.h:135
bool useSouthEastCorner()
Check wether south-east corner needs to be used.
Definition: borders_data.h:143
bool isNorthEastCornerConstrainedByBorders()
Check if the north-east corner is already constrained by one of the borders.
Definition: borders_data.h:95
Structure storing the data for the borders of a tile. This includes the 4 east-west-north-south borde...
Definition: borders_data.h:30
bool isSouthEastCornerConstrainedByBorders()
Check if the south-east corner is already constrained by one of the borders.
Definition: borders_data.h:111
Point_3 southEastCorner
The south-east corner to maintain (if constrainSouthEastCorner is set)
Definition: borders_data.h:45
bool isSouthWestCornerConstrainedByBorders()
Check if the south-west corner is already constrained by one of the borders.
Definition: borders_data.h:103
std::vector< Point_3 > tileSouthVertices
Vertices to maintain for the southern border of the tile.
Definition: borders_data.h:37
Point_3 southWestCorner
The south-west corner to maintain (if constrainSouthWestCorner is set)
Definition: borders_data.h:44
Point_3 northEastCorner
The north-east corner to maintain (if constrainNorthEastCorner is set)
Definition: borders_data.h:43
bool isNorthWestCornerConstrainedByBorders()
Check if the north-west corner is already constrained by one of the borders.
Definition: borders_data.h:87
bool useNorthEastCorner()
Check wether north-east corner needs to be used.
Definition: borders_data.h:127
BordersData()
Default constructor.
Definition: borders_data.h:50
bool constrainSouthWestCorner
Flag indicating whether the south-west corner should be constrained.
Definition: borders_data.h:40
bool constrainNorthEastCorner
Flag indicating whether the north-east corner should be constrained.
Definition: borders_data.h:39
std::vector< Point_3 > tileEastVertices
Vertices to maintain for the eastern border of the tile.
Definition: borders_data.h:34
std::vector< Point_3 > tileWestVertices
Vertices to maintain for the western border of the tile.
Definition: borders_data.h:35
bool constrainSouthEastCorner
Flag indicating whether the north-east corner should be constrained.
Definition: borders_data.h:41
bool constrainNorthWestCorner
Flag indicating whether the north-west corner should be constrained.
Definition: borders_data.h:38
Point_3 northWestCorner
The north-west corner to maintain (if constrainNorthWestCorner is set)
Definition: borders_data.h:42
std::vector< Point_3 > tileNorthVertices
Vertices to maintain for the northern border of the tile.
Definition: borders_data.h:36