Define ComponentCoordinateExtracter classes in .cpp file (#535)
[geos.git] / include / geos / geom / util / LinearComponentExtracter.h
blob260cc0fbbc54d59e8b4acd36580989975988f6bc
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2006 Refractions Research Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************/
16 #ifndef GEOS_GEOM_UTIL_LINEARCOMPONENTEXTRACTER_H
17 #define GEOS_GEOM_UTIL_LINEARCOMPONENTEXTRACTER_H
20 #include <geos/export.h>
21 #include <vector>
23 #include <geos/geom/GeometryComponentFilter.h>
24 #include <geos/geom/Geometry.h> // to be removed when we have the .inl
25 #include <geos/geom/LineString.h> // to be removed when we have the .inl
26 //#include <geos/platform.h>
28 namespace geos {
29 namespace geom { // geos.geom
30 namespace util { // geos.geom.util
32 /**
33 * Extracts all the 1-dimensional (LineString) components from a Geometry.
35 class GEOS_DLL LinearComponentExtracter: public GeometryComponentFilter {
37 private:
39 LineString::ConstVect &comps;
41 // Declare type as noncopyable
42 LinearComponentExtracter(const LinearComponentExtracter& other);
43 LinearComponentExtracter& operator=(const LinearComponentExtracter& rhs);
45 public:
46 /**
47 * Push the linear components from a single geometry into
48 * the provided vector.
49 * If more than one geometry is to be processed, it is more
50 * efficient to create a single LinearComponentExtracterFilter instance
51 * and pass it to multiple geometries.
53 static void getLines(const Geometry &geom, std::vector<const LineString*> &ret);
54 /**
55 * Constructs a LinearComponentExtracterFilter with a list in which
56 * to store LineStrings found.
58 LinearComponentExtracter(std::vector<const LineString*> &newComps);
60 void filter_rw(Geometry *geom);
62 void filter_ro(const Geometry *geom);
66 } // namespace geos.geom.util
67 } // namespace geos.geom
68 } // namespace geos
70 #endif