Loading...
Searching...
No Matches
AddProjectedCoordinates.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20 /*!
21 \file terralib/geometry/validation/AbstractValidationAlgorithm.h
22
23 \brief An abstract class to represent and algorithm that validates an geometry
24 */
25
26#ifndef __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_ADDPROJECTEDCOORDINATES_H
27#define __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_ADDPROJECTEDCOORDINATES_H
28
29 // TerraLib
30#include "AbstractValidator.h"
31
32#include "../CommonDataStructures.h"
33#include "../Config.h"
34
35#include <vector>
36
37namespace te
38{
39 namespace gm
40 {
41 struct Coord2D;
42 class LineString;
43
45 {
46 public:
47
49
50 virtual ~AddProjectedCoordinates() = default;
51
52 virtual te::gm::GeometryPtr validate(const te::gm::Geometry* geometry, bool& wasChanged) const override;
53
54 void setCoordinateIndex(KdTreeSingle* coordinateIndex);
55
56 protected:
57
58 virtual te::gm::GeometryPtr validateLine(const te::gm::LineString* lineString, bool& wasChanged) const override;
59
60 std::vector<te::gm::Coord2D> getIntermediateProjectedCoordinates(const te::gm::Coord2D& c1, const te::gm::Coord2D& c2, const te::gm::KdTreeSingle& spatialIndex, double distance) const;
61
62 protected:
63
64 mutable std::unique_ptr<te::gm::KdTreeSingle> m_coordinateIndex;
65 };
66
67 } // end namespace gm
68} // end namespace te
69
70#endif // __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_ADDPROJECTEDCOORDINATES_H
An abstract class to represent an algorithm that validates an geometry.
An abstract class to represent an algorithm that validates an geometry.
std::vector< te::gm::Coord2D > getIntermediateProjectedCoordinates(const te::gm::Coord2D &c1, const te::gm::Coord2D &c2, const te::gm::KdTreeSingle &spatialIndex, double distance) const
std::unique_ptr< te::gm::KdTreeSingle > m_coordinateIndex
virtual te::gm::GeometryPtr validateLine(const te::gm::LineString *lineString, bool &wasChanged) const override
Validates a line, an returns additional variable to inform if the geometry has been changed or not.
virtual te::gm::GeometryPtr validate(const te::gm::Geometry *geometry, bool &wasChanged) const override
Validates a geometry, an returns additional variable to inform if the geometry has been changed or no...
virtual ~AddProjectedCoordinates()=default
void setCoordinateIndex(KdTreeSingle *coordinateIndex)
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
LineString is a curve with linear interpolation between points.
Definition: LineString.h:65
A class that represents a two dimensional K-d Tree (2-d Tree).
Definition: Index.h:68
TerraLib.
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:41
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76