GEOS  3.9.1dev
Public Member Functions | List of all members
geos::geom::CoordinateSequenceFilter Class Referenceabstract

Interface for classes which provide operations that can be applied to the coordinates in a CoordinateSequence. More...

#include <CoordinateSequenceFilter.h>

Inheritance diagram for geos::geom::CoordinateSequenceFilter:
[legend]

Public Member Functions

virtual ~CoordinateSequenceFilter ()
 
virtual void filter_rw (CoordinateSequence &, std::size_t)
 Performs an operation on a coordinate in a CoordinateSequence. More...
 
virtual void filter_ro (const CoordinateSequence &, std::size_t)
 Performs an operation on a coordinate in a CoordinateSequence. More...
 
virtual bool isDone () const =0
 Reports whether the application of this filter can be terminated. More...
 
virtual bool isGeometryChanged () const =0
 Reports whether the execution of this filter has modified the coordinates of the geometry. More...
 

Detailed Description

Interface for classes which provide operations that can be applied to the coordinates in a CoordinateSequence.

A CoordinateSequence filter can either record information about each coordinate or change the coordinate in some way. CoordinateSequence filters can be used to implement such things as coordinate transformations, centroid and envelope computation, and many other functions. For maximum efficiency, the execution of filters can be short-circuited. Geometry classes support the concept of applying a CoordinateSequenceFilter to each CoordinateSequences they contain.

CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern.

See also
Geometry::apply_ro(CoordinateSequenceFilter& filter) const
Geometry::apply_rw(CoordinateSequenceFilter& filter)
Author
Martin Davis

Definition at line 57 of file CoordinateSequenceFilter.h.

Constructor & Destructor Documentation

virtual geos::geom::CoordinateSequenceFilter::~CoordinateSequenceFilter ( )
inlinevirtual

Definition at line 62 of file CoordinateSequenceFilter.h.

Member Function Documentation

virtual void geos::geom::CoordinateSequenceFilter::filter_ro ( const CoordinateSequence ,
std::size_t   
)
inlinevirtual

Performs an operation on a coordinate in a CoordinateSequence.

param seq the CoordinateSequence to which the filter is applied param i the index of the coordinate to apply the filter to

Reimplemented in geos::algorithm::distance::DiscreteHausdorffDistance::MaxDensifiedByFractionDistanceFilter.

Definition at line 83 of file CoordinateSequenceFilter.h.

virtual void geos::geom::CoordinateSequenceFilter::filter_rw ( CoordinateSequence ,
std::size_t   
)
inlinevirtual

Performs an operation on a coordinate in a CoordinateSequence.

param seq the CoordinateSequence to which the filter is applied param i the index of the coordinate to apply the filter to

Definition at line 71 of file CoordinateSequenceFilter.h.

virtual bool geos::geom::CoordinateSequenceFilter::isDone ( ) const
pure virtual

Reports whether the application of this filter can be terminated.

Once this method returns false, it should continue to return false on every subsequent call.

Returns
true if the application of this filter can be terminated.

Implemented in geos::algorithm::distance::DiscreteHausdorffDistance::MaxDensifiedByFractionDistanceFilter.

virtual bool geos::geom::CoordinateSequenceFilter::isGeometryChanged ( ) const
pure virtual

Reports whether the execution of this filter has modified the coordinates of the geometry.

If so, Geometry::geometryChanged() will be executed after this filter has finished being executed.

Most filters can simply return a constant value reflecting whether they are able to change the coordinates.

Returns
true if this filter has changed the coordinates of the geometry

Implemented in geos::algorithm::distance::DiscreteHausdorffDistance::MaxDensifiedByFractionDistanceFilter.


The documentation for this class was generated from the following file: