EWKBSize.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/sqlite/EWKBSize.h
22 
23  \brief A class that helps to determine the size of a SpatiaLite geometry.
24 */
25 
26 #ifndef __TERRALIB_SQLITE_INTERNAL_EWKBSIZE_H
27 #define __TERRALIB_SQLITE_INTERNAL_EWKBSIZE_H
28 
29 // TerraLib
30 #include "../common/Enums.h"
31 #include "../geometry/Visitor.h"
32 
33 namespace te
34 {
35  namespace sqlite
36  {
37  class EWKBSize : public te::gm::Visitor
38  {
39  public:
40 
41  EWKBSize();
42 
43  ~EWKBSize();
44 
45  static std::size_t getEWKBSize(const te::gm::Geometry* g);
46 
47  protected:
48 
49  void visit(const te::gm::Curve& /*visited*/) {}
50  void visit(const te::gm::Geometry& /*visited*/) {}
51  void visit(const te::gm::GeometryCollection& visited);
52  void visit(const te::gm::LinearRing& visited);
53  void visit(const te::gm::LineString& visited);
54  void visit(const te::gm::MultiCurve& /*visited*/) {}
55  void visit(const te::gm::MultiLineString& visited);
56  void visit(const te::gm::MultiPoint& visited);
57  void visit(const te::gm::MultiPolygon& visited);
58  void visit(const te::gm::MultiSurface& /*visited*/) {}
59  void visit(const te::gm::AbstractPoint& /*visited*/) {}
60  void visit(const te::gm::Point& visited);
61  void visit(const te::gm::PointM& visited);
62  void visit(const te::gm::PointZ& visited);
63  void visit(const te::gm::PointZM& visited);
64  void visit(const te::gm::PointKd& /*visited*/) {}
65  void visit(const te::gm::Polygon& visited);
66  void visit(const te::gm::PolyhedralSurface& /*visited*/) {}
67  void visit(const te::gm::Surface& /*visited*/) {}
68  void visit(const te::gm::TIN& /*visited*/) {}
69  void visit(const te::gm::Triangle& /*visited*/) { }
70  void visit(const te::gm::CircularString& /*visited*/) {}
71  void visit(const te::gm::CompoundCurve& /*visited*/) {}
72  void visit(const te::gm::CurvePolygon& /*visited*/) {}
73 
74  private:
75 
76  std::size_t m_size;
77  };
78 
79  } // namespace sqlite
80 } // namespace te
81 
82 #endif // __TERRALIB_SQLITE_INTERNAL_EWKBSIZE_H
PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments...
void visit(const te::gm::Triangle &)
Definition: EWKBSize.h:69
MultiPolygon is a MultiSurface whose elements are Polygons.
Definition: MultiPolygon.h:50
void visit(const te::gm::CompoundCurve &)
Definition: EWKBSize.h:71
void visit(const te::gm::PointKd &)
Definition: EWKBSize.h:64
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
Definition: Curve.h:58
std::size_t m_size
Definition: EWKBSize.h:76
void visit(const te::gm::CircularString &)
Definition: EWKBSize.h:70
void visit(const te::gm::Geometry &)
Definition: EWKBSize.h:50
A point with a z-coordinate value and an associated measurement.
Definition: PointZM.h:51
void visit(const te::gm::Surface &)
Definition: EWKBSize.h:67
void visit(const te::gm::CurvePolygon &)
Definition: EWKBSize.h:72
A point with an associated measure.
Definition: PointM.h:51
TIN (triangulated irregular network) is a PolyhedralSurface consisting only of Triangle patches...
Definition: TIN.h:50
A LinearRing is a LineString that is both closed and simple.
Definition: LinearRing.h:53
A k-dimensional point.
Definition: PointKd.h:53
MultiPoint is a GeometryCollection whose elements are restricted to points.
Definition: MultiPoint.h:50
void visit(const te::gm::TIN &)
Definition: EWKBSize.h:68
A point with z-coordinate value.
Definition: PointZ.h:51
LineString is a curve with linear interpolation between points.
Definition: LineString.h:62
void visit(const te::gm::AbstractPoint &)
Definition: EWKBSize.h:59
Triangle is a polygon with 3 distinct, non-collinear vertices and no interior boundary.
Definition: Triangle.h:50
A point with x and y coordinate values.
Definition: Point.h:50
URI C++ Library.
CompoundCurve is a curve that may have circular and linear segments.
Definition: CompoundCurve.h:53
void visit(const te::gm::MultiCurve &)
Definition: EWKBSize.h:54
CurvePolygon is a planar surface defined by 1 exterior boundary and 0 or more interior boundaries...
Definition: CurvePolygon.h:57
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
void visit(const te::gm::PolyhedralSurface &)
Definition: EWKBSize.h:66
static std::size_t getEWKBSize(const te::gm::Geometry *g)
MultiLineString is a MultiCurve whose elements are LineStrings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
Definition: MultiSurface.h:54
void visit(const te::gm::Curve &)
Definition: EWKBSize.h:49
MultiCurve is a class that represents a 1-dimensional GeometryCollection whose elements are curves...
Definition: MultiCurve.h:50
It is a collection of other geometric objects.
void visit(const te::gm::MultiSurface &)
Definition: EWKBSize.h:58
A base abstract class for 0-dimensional geometric objects that represents a single location in coordi...
Definition: AbstractPoint.h:50
CircularString is a curve with circular interpolation between points.
Surface is an abstract class that represents a 2-dimensional geometric objects.
Definition: Surface.h:54
A visitor interface for the Geometry hierarchy.
Definition: Visitor.h:44