GEOSGeometryFactory.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/GEOSGeometryFactory.h
22 
23  \brief The global factory used by TerraLib in order to create GEOS geometries.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_GEOSGEOMETRYFACTORY_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_GEOSGEOMETRYFACTORY_H
28 
29 // TerraLib
30 #include "../BuildConfig.h"
31 #include "Config.h"
32 
33 // GEOS
34 #ifdef TERRALIB_GEOS_ENABLED
35 #include <geos/geom/GeometryFactory.h>
36 
37 namespace te
38 {
39  namespace gm
40  {
41  /*!
42  \class GEOSGeometryFactory
43 
44  \brief The global factory used by TerraLib in order to create GEOS geometries.
45 
46  \sa Geometry
47  */
48  class TEGEOMEXPORT GEOSGeometryFactory
49  {
50  public:
51 
52  /*!
53  \brief It returns the global Geometry factory used in TerraLib.
54 
55  \return The global Geometry Factory used in TerraLib.
56  */
57  static const geos::geom::GeometryFactory* getGeomFactory();
58 
59  /** @name Factory Initialization Methods
60  * Methods to control the startup and finish of the global Geometry Factory.
61  */
62  //@{
63 
64  /*! \brief It starts up the global Factory. This method will be automatically called by Geometry Platform class initialization. */
65  static void initialize();
66 
67  /*! \brief It terminates the global Factory. This method will be automatically called by Geometry Platform class finalization. */
68  static void finalize();
69 
70  //@}
71 
72  private:
73 
74  /** @name Not Instantiable
75  * You can not create objects from this Class.
76  */
77  //@{
78 
79  /*! Private construtor: not instantiable. */
80  GEOSGeometryFactory();
81 
82  //@}
83 
84  private:
85 
86  static const geos::geom::GeometryFactory* sm_gFactory; //!< The global Geometry Factory.
87  };
88 
89  inline const geos::geom::GeometryFactory* GEOSGeometryFactory::getGeomFactory()
90  {
91  return sm_gFactory;
92  }
93 
94  } // end namespace gm
95 } // end namespace te
96 
97 #endif // TERRALIB_GEOS_ENABLED
98 #endif // __TERRALIB_GEOMETRY_INTERNAL_GEOSGEOMETRYFACTORY_H
99 
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
URI C++ Library.
Configuration flags for the Vector Geometry Model of TerraLib.