OperationService.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 terralin/vp/OperationService.h
22 
23  \brief Represents a service containing useful functions related to an operation
24  */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_OPERATIONSERVICE_H
27 #define __TERRALIB_VP_INTERNAL_OPERATIONSERVICE_H
28 
29 #include "Config.h"
30 
31 #include "../geometry/CommonDataStructures.h"
32 #include "../geometry/Enums.h"
33 #include "../sam/rtree/Index.h"
34 
35 #include <memory>
36 #include <vector>
37 
38 namespace te
39 {
40  namespace gm
41  {
42  class Geometry;
43  class GeometryPtr;
44  }
45 
46  namespace vp
47  {
48  class FeatureSet;
49 
50  using GeometryPair = std::pair<te::gm::GeometryPtr, te::gm::GeometryPtr>;
51 
52  /*!
53  \class OperationService
54 
55  \brief Represents a service containing useful functions related to an operation
56  */
58  {
59  public:
60 
61  //!< No Constructor
62  OperationService() = delete;
63 
64  //!< No Destructor
65  ~OperationService() = delete;
66 
67  //!< Snaps the given featureSets to themselves using the appropriated precison
68  static std::vector<te::vp::FeatureSet> SnapGeometries(const std::vector<te::vp::FeatureSet>& vecInput);
69 
70  //!< Creates an index based on the given featureSet
71  static std::unique_ptr< te::sam::rtree::Index<std::size_t> > CreateIndex(const te::vp::FeatureSet& inputFeatureSet);
72 
73  static std::unique_ptr<GeometryPair> RobustMakeValid(const te::gm::Geometry* g1, const te::gm::Geometry* g2);
74 
75  static te::gm::GeometryPtr RobustIntersection(const te::gm::Geometry* g1, const te::gm::Geometry* g2);
76 
77  static te::gm::GeometryPtr RobustDifference(const te::gm::Geometry* g1, const te::gm::Geometry* g2);
78  };
79  } //end namespace vp
80 } //end namespace te
81 
82 
83 #endif // __TERRALIB_VP_INTERNAL_OPERATIONSERVICE_H
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
An alias for a set of Features.
Definition: Feature.h:60
TerraLib.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:77
std::pair< te::gm::GeometryPtr, te::gm::GeometryPtr > GeometryPair
Configuration flags for the Terrralib Vector Processing module.
Represents a service containing useful functions related to an operation.