PolygonToLineMemory.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 PolygonToLineMemory.h
22 
23  \brief
24 
25  \ingroup vp
26 */
27 
28 #ifndef __TERRALIB_VP_INTERNAL_POLYGONTOLINE_MEMORY_H
29 #define __TERRALIB_VP_INTERNAL_POLYGONTOLINE_MEMORY_H
30 
31 //Terralib
32 #include "../common/Exception.h"
33 #include "../geometry/Geometry.h"
34 #include "../geometry/GeometryCollection.h"
35 #include "../geometry/LineString.h"
36 #include "../geometry/MultiLineString.h"
37 #include "../geometry/Polygon.h"
38 
39 #include "PolygonToLineOp.h"
40 #include "Config.h"
41 #include "Exception.h"
42 
43 // STL
44 #include <memory>
45 #include <vector>
46 
47 namespace te
48 {
49  namespace vp
50  {
52  {
53 
54  public:
55 
57 
59 
60  bool run() throw(te::common::Exception);
61 
62  private:
63 
64  std::unique_ptr<te::gm::MultiLineString> polygon2Line(te::gm::Geometry* geom);
65 
66  void getLines(te::gm::Geometry* geom, std::vector<te::gm::LineString*>& lines);
67 
68  void getLines(te::gm::GeometryCollection* gc, std::vector<te::gm::LineString*>& lines);
69 
70  void getLines(te::gm::Polygon* p, std::vector<te::gm::LineString*>& lines);
71 
72  void getLines(te::gm::LineString* l, std::vector<te::gm::LineString*>& lines);
73 
74  }; // end class
75  } // end namespace vp
76 } // end namespace te
77 
78 #endif // __TERRALIB_VP_INTERNAL_POLYGONTOLINE_MEMORY_H
79 
te::gm::GeometryCollection * gc
LineString is a curve with linear interpolation between points.
Definition: LineString.h:62
URI C++ Library.
Definition: Attributes.h:37
te::gm::Polygon * p
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
Polygon to line operation.
Configuration flags for the Terrralib Vector Processing module.
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
It is a collection of other geometric objects.