1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
13 **********************************************************************/
15 #ifndef GEOS_GEOM_COORDINATEFILTER_H
16 #define GEOS_GEOM_COORDINATEFILTER_H
18 #include <geos/export.h>
19 #include <geos/inline.h>
24 namespace geom
{ // geos::geom
29 * <code>Geometry</code> classes support the concept of applying a
30 * coordinate filter to every coordinate in the <code>Geometry</code>.
32 * A coordinate filter can either record information about each coordinate or
33 * change the coordinate in some way. Coordinate filters implement the
34 * interface <code>CoordinateFilter</code>. (<code>CoordinateFilter</code> is
35 * an example of the Gang-of-Four Visitor pattern). Coordinate filters can be
36 * used to implement such things as coordinate transformations, centroid and
37 * envelope computation, and many other functions.
39 * TODO: provide geom::CoordinateInspector and geom::CoordinateMutator instead
40 * of having the two versions of filter_rw and filter_ro
43 class GEOS_DLL CoordinateFilter
{
45 virtual ~CoordinateFilter() {}
48 * Performs an operation on <code>coord</code>.
50 * @param coord a <code>Coordinate</code> to which the filter is applied.
52 virtual void filter_rw(Coordinate
* /*coord*/) const { assert(0); }
55 * Performs an operation with <code>coord</code>.
57 * @param coord a <code>Coordinate</code> to which the filter is applied.
59 virtual void filter_ro(const Coordinate
* /*coord*/) { assert(0); }
62 } // namespace geos::geom
66 //# include "geos/geom/CoordinateFilter.inl"
69 #endif // ndef GEOS_GEOM_COORDINATEFILTER_H
71 /**********************************************************************
73 * Revision 1.4 2006/06/19 23:33:03 strk
74 * Don't *require* CoordinateFilters to define both read-only and read-write methods.
76 * Revision 1.3 2006/03/24 09:52:41 strk
77 * USE_INLINE => GEOS_INLINE
79 * Revision 1.2 2006/03/13 21:13:54 strk
80 * Added comment about possible refactoring
82 * Revision 1.1 2006/03/09 16:46:49 strk
83 * geos::geom namespace definition, first pass at headers split
85 **********************************************************************/