RemoveCollapsedSegments.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/RemoveCollapsedSegments.h
22 
23  \brief An abstract class to represent and algorithm that validates an geometry
24  */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_REMOVECOLLAPSEDSEGMENTS_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_REMOVECOLLAPSEDSEGMENTS_H
28 
29  // TerraLib
30 #include "AbstractValidator.h"
31 
32 #include "../CommonDataStructures.h"
33 #include "../Config.h"
34 
35 #include <map>
36 #include <vector>
37 
38 namespace te
39 {
40  namespace gm
41  {
42  struct Coord2D;
43  class LineString;
44 
45  using VecCoords = std::vector<te::gm::Coord2D>;
46  using VecFragments = std::vector<VecCoords>;
47  using MapFragments = std::map<te::gm::Coord2D, VecFragments>;
48 
50  {
51  public:
52 
54 
55  virtual ~RemoveCollapsedSegments() = default;
56 
57  protected:
58 
59  virtual te::gm::GeometryPtr validateLine(const te::gm::LineString* lineString, bool& wasChanged) const override;
60 
61  bool removeCollapsedSegmentsAndGetFragments(const te::gm::LineString* lineString, VecFragments& fragments) const;
62 
63  VecCoords joinFragments(const VecFragments& vecFragments) const;
64  };
65 
66  } // end namespace gm
67 } // end namespace te
68 
69 #endif // __TERRALIB_GEOMETRY_INTERNAL_VALIDATION_REMOVECOLLAPSEDSEGMENTS_H
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::gm::VecCoords
std::vector< te::gm::Coord2D > VecCoords
Definition: RemoveCollapsedSegments.h:45
te::gm::RemoveCollapsedSegments::validateLine
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.
te::gm::VecFragments
std::vector< VecCoords > VecFragments
Definition: RemoveCollapsedSegments.h:46
TEGEOMEXPORT
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
te::gm::GeometryPtr
Definition: Geometry.h:968
te::gm::AbstractValidator
An abstract class to represent an algorithm that validates an geometry.
Definition: AbstractValidator.h:52
te::gm::RemoveCollapsedSegments::RemoveCollapsedSegments
RemoveCollapsedSegments()=default
te::gm::RemoveCollapsedSegments::removeCollapsedSegmentsAndGetFragments
bool removeCollapsedSegmentsAndGetFragments(const te::gm::LineString *lineString, VecFragments &fragments) const
te::gm::RemoveCollapsedSegments::~RemoveCollapsedSegments
virtual ~RemoveCollapsedSegments()=default
te::gm::LineString
LineString is a curve with linear interpolation between points.
Definition: LineString.h:65
te::gm::RemoveCollapsedSegments::joinFragments
VecCoords joinFragments(const VecFragments &vecFragments) const
te::gm::RemoveCollapsedSegments
Definition: RemoveCollapsedSegments.h:50
AbstractValidator.h
An abstract class to represent an algorithm that validates an geometry.
te::gm::MapFragments
std::map< te::gm::Coord2D, VecFragments > MapFragments
Definition: RemoveCollapsedSegments.h:47