21 #ifndef EMODNET_QMGC_TIN_CREATOR_H 22 #define EMODNET_QMGC_TIN_CREATOR_H 25 #include "tin_creation_cgal_types.h" 26 #include "base/misc_utils.h" 42 , m_minX(-1.0), m_minY(-1.0), m_minZ(-1.0), m_maxX(-1.0), m_maxY(-1.0), m_maxZ(-1.0)
43 , m_boundsSet(false) {}
58 virtual Polyhedron
create(
const std::vector<Point_3> &dataPts,
59 const bool &constrainEasternVertices,
60 const bool &constrainWesternVertices,
61 const bool &constrainNorthernVertices,
62 const bool &constrainSouthernVertices) = 0;
77 void setScaleZ(
const double& scale) { m_scaleZ = scale; }
91 void setBounds(
const double& minX,
const double& minY,
const double& minZ,
92 const double& maxX,
const double& maxY,
const double& maxZ ) {
93 m_minX = minX; m_minY = minY; m_minZ = minZ;
94 m_maxX = maxX; m_maxY = maxY; m_maxZ = maxZ;
111 bool hasOriginalBoundingBox()
const {
return m_boundsSet; }
115 std::vector<Point_3>
convertUVHToECEF(
const std::vector<Point_3>& pts)
const;
119 std::vector<Point_3>
convertECEFToUVH(
const std::vector<Point_3>& pts)
const;
131 double m_minX, m_minY, m_minZ, m_maxX, m_maxY, m_maxZ;
153 void setCreator(std::shared_ptr<TinCreationStrategy> creator) { m_creator = creator; }
168 Polyhedron
create(
const std::vector<Point_3> &dataPts,
169 const bool &constrainEasternVertices =
false,
170 const bool &constrainWesternVertices =
false,
171 const bool &constrainNorthernVertices =
false,
172 const bool &constrainSouthernVertices =
false) {
173 return m_creator->create(dataPts,
174 constrainEasternVertices,
175 constrainWesternVertices,
176 constrainNorthernVertices,
177 constrainSouthernVertices);
188 m_creator->setParamsForZoom(zoom);
195 void setScaleZ(
const double& scale) { m_creator->setScaleZ(scale); }
206 void setBounds(
const double& minX,
const double& minY,
const double& minZ,
207 const double& maxX,
const double& maxY,
const double& maxZ) {
208 m_creator->setBounds(minX, minY, minZ, maxX, maxY, maxZ);
209 double scaleZ = remap( 1.0, 0.0, maxZ-minZ, 0.0, 1.0 );
215 std::shared_ptr<TinCreationStrategy> m_creator;
220 #endif //EMODNET_QMGC_TIN_CREATOR_H double getMinZ() const
Get the minimum Z coordinate.
Definition: tin_creator.h:103
double getScaleZ()
Get the scale in Z.
Definition: tin_creator.h:80
void setBounds(const double &minX, const double &minY, const double &minZ, const double &maxX, const double &maxY, const double &maxZ)
Definition: tin_creator.h:206
This namespace contains all the types/classes/functions required to create a TIN out of a regularly g...
double getMaxX() const
Get the maximum X coordinate.
Definition: tin_creator.h:105
void setCreator(std::shared_ptr< TinCreationStrategy > creator)
Sets the actual TIN creator algorithm.
Definition: tin_creator.h:153
TinCreationStrategy()
Constructor.
Definition: tin_creator.h:40
TinCreator()
Constructor.
Definition: tin_creator.h:147
double getMinY() const
Get the minimum Y coordinate.
Definition: tin_creator.h:101
double getMinX() const
Get the minimum X coordinate.
Definition: tin_creator.h:99
void setScaleZ(const double &scale)
Definition: tin_creator.h:195
double getMaxZ() const
Get the maximum Z coordinate.
Definition: tin_creator.h:109
Main class used to create a TIN from an input set of points.
Definition: tin_creator.h:143
void setScaleZ(const double &scale)
Definition: tin_creator.h:77
void setBounds(const double &minX, const double &minY, const double &minZ, const double &maxX, const double &maxY, const double &maxZ)
Definition: tin_creator.h:91
void setParamsForZoom(const unsigned int &zoom)
Adapts the parameters of the algorithm for the desired zoom level.
Definition: tin_creator.h:187
std::vector< Point_3 > convertUVHToECEF(const std::vector< Point_3 > &pts) const
Convert points to ECEF assuming that they are on a UVH format, and given the limits of the tile...
Definition: tin_creator.cpp:28
std::vector< Point_3 > convertECEFToUVH(const std::vector< Point_3 > &pts) const
Convert points from local UVH to ECEF given the limits of the tile.
Definition: tin_creator.cpp:47
virtual Polyhedron create(const std::vector< Point_3 > &dataPts, const bool &constrainEasternVertices, const bool &constrainWesternVertices, const bool &constrainNorthernVertices, const bool &constrainSouthernVertices)=0
Create a TIN from a set of points.
virtual void setParamsForZoom(const unsigned int &zoom)=0
Adapts the parameters of the algorithm for the desired zoom level.
Polyhedron create(const std::vector< Point_3 > &dataPts, const bool &constrainEasternVertices=false, const bool &constrainWesternVertices=false, const bool &constrainNorthernVertices=false, const bool &constrainSouthernVertices=false)
Create a TIN from a set of points.
Definition: tin_creator.h:168
double getMaxY() const
Get the maximum Y coordinate.
Definition: tin_creator.h:107
Defines the interphase of a TIN creation algorithm.
Definition: tin_creator.h:37