IFilter Class Referenceabstract
+ Inheritance diagram for IFilter:

Classes

struct  IResult
 

Public Types

enum  ReadAccess { coordinatesAttributes, neighbors, basePoint = neighbors << 1, full = (basePoint << 1) - 1 }
 Choose which type of data to support reading from. More...
 
enum  WriteAccess {
  none, coordinates, attributes = coordinates << 1, coordinatesAttributes = coordinates | attributes,
  delayedResults = attributes << 1, full = (delayedResults << 1) - 1
}
 Choose which type of data to support writing to. More...
 
enum  TriBool { indeterminate = -1, false_, true_ }
 
using ResultHandle = Handle< IResult >
 

Public Member Functions

virtual IFilterclone () const =0
 
virtual bool validate (IGeometry &geom, IGeometry const *const *neighbors=0, unsigned nNeighbors=0, const IPoint *basePoint=nullptr) const =0
 Only applicable for filters (filter trees) that don't use caching. Otherwise: throw. More...
 
virtual bool validate (const IGeometry &geom, IGeometry const *const *neighbors=0, unsigned nNeighbors=0, const IPoint *basePoint=nullptr) const =0
 
virtual void submit (GeometryHandle geom, const void *userData=0) const =0
 Also applicable for filters (filter trees) that use caching.
 
virtual void flush () const =0
 
virtual ResultHandle fetch () const =0
 
virtual bool mayBeValid (const IBox &box, const IAddInfoStatistics &addInfoStats) const =0
 returns false if data inside box having statistics of addInfoStats will surely not pass through (-> e.g. skip this ODM tile)
 
virtual TriBool validateRange (const IBox &box, const IAddInfoStatistics &addInfoStats) const =0
 
virtual WindowHandle boundingWindow () const =0
 Get the window outside which surely no data will pass through, or a default-constructed window if no such finite window exists. More...
 
virtual void provideOrigObjects (bool val=true)=0
 Provides the original, unchanged geometries and attributes in Result::orig and FilterStats::accumulate.
 
virtual void stats (FilterStatsHandle obj) const =0
 accumulates statistical information about the results of filtering More...
 
virtual FilterStatsHandle stats () const =0
 
virtual bool writesCoordinates () const =0
 returns true iff this actually writes to coordinates. More...
 
virtual bool writesAttributes () const =0
 returns true iff this actually writes to attributes. More...
 
virtual bool delaysResults () const =0
 returns true iff this provides delayed results. More...
 
virtual bool readsNeighbors () const =0
 returns true iff this actually accesses neighbor geometries. More...
 
virtual bool readsBasePoint () const =0
 returns true iff this actually accesses the base point. More...
 
virtual std::vector< std::string > readAttributeNames () const =0
 returns the (case-insensitive) union of names of attributes read from geom, neighbors, or basePoint - in lexicographical order.
 
virtual std::vector< std::string > writtenAttributeNames () const =0
 returns the names of attributes written to geom - in lexicographical order, and without (case-insensitive) duplicates. More...
 
virtual std::vector< std::string > accessedAttributeNames () const =0
 returns the union of readAttributeNames and writtenAttributeNames.
 
virtual void print (std::ostream &) const =0
 
virtual const char * text () const =0
 
- Public Member Functions inherited from ObjectBase
virtual void Delete ()
 

Static Public Member Functions

static IFilterNew ()
 
static IFilterNew (const char *text, WriteAccess=WriteAccess::none, ReadAccess=ReadAccess::coordinatesAttributes)
 

Member Enumeration Documentation

◆ ReadAccess

enum ReadAccess
strong

Choose which type of data to support reading from.

Enumerator
coordinatesAttributes 

coordinates and attributes may always be accessed

neighbors 

grant read access to neighbors

basePoint 

grant read access to the base point

full 

full read access

◆ WriteAccess

enum WriteAccess
strong

Choose which type of data to support writing to.

Enumerator
none 

support no write access at all

coordinates 

support write access to coordinates

attributes 

support write access to attributes

delayedResults 

support filters that provide delayed results; use IFilter::submit(.) / IFilter::fetch() instead of IFilter::validate(.)

full 

full write access

Member Function Documentation

◆ boundingWindow()

virtual WindowHandle boundingWindow ( ) const
pure virtual

Get the window outside which surely no data will pass through, or a default-constructed window if no such finite window exists.

For non-inverted region filters, returns the bounding window of their valid 2D-region. For inverted region filters and all other filters, returns a default-constructed (empty) window. Sub-filters combined with

  • OR return empty windows.
  • AND return the union of their non-empty bounding windows.

◆ delaysResults()

virtual bool delaysResults ( ) const
pure virtual

returns true iff this provides delayed results.

submit/fetch/flush must be used then, and not validate. For such a filter to be parsed successfully, WriteAccess::delayedResults is a precondition.

◆ fetch()

virtual ResultHandle fetch ( ) const
pure virtual

returns the next available result. Performance note: call fetch() alternately with submit(), to keep the (eventual) internal cache size small Note that a single submission yields an arbitrary number of results, including zero. Thus, call submit once, and call fetch repeatedly until it returns an empty pointer in Result::filtered

◆ flush()

virtual void flush ( ) const
pure virtual

Indicates that no more data will be submitted. The rest of the already submitted geometries will be returned by subsequent calls to fetch() Do not call submit() after flush() has been called.

◆ readsBasePoint()

virtual bool readsBasePoint ( ) const
pure virtual

returns true iff this actually accesses the base point.

For such a filter to be parsed successfully, ReadAccess::basePoint is a precondition.

◆ readsNeighbors()

virtual bool readsNeighbors ( ) const
pure virtual

returns true iff this actually accesses neighbor geometries.

For such a filter to be parsed successfully, ReadAccess::neighbors is a precondition.

◆ stats()

virtual void stats ( FilterStatsHandle  obj) const
pure virtual

accumulates statistical information about the results of filtering

Statistics are not considered part of the state of a filter, hence const.

◆ validate()

virtual bool validate ( IGeometry geom,
IGeometry const *const *  neighbors = 0,
unsigned  nNeighbors = 0,
const IPoint basePoint = nullptr 
) const
pure virtual

Only applicable for filters (filter trees) that don't use caching. Otherwise: throw.

neighbors are represented as "n" in text, to be indexed as e.g. "n[0]" basePoint is represented as "b" in text.

◆ validateRange()

virtual TriBool validateRange ( const IBox box,
const IAddInfoStatistics addInfoStats 
) const
pure virtual

returns true_ if surely all data within box having addInfoStats would pass through the filter. returns false_ if surely none of the data within box having addInfoStats would pass through the filter. returns indeterminate_ otherwise.

◆ writesAttributes()

virtual bool writesAttributes ( ) const
pure virtual

returns true iff this actually writes to attributes.

For such a filter to be parsed successfully, WriteAccess::attributes is a precondition.

◆ writesCoordinates()

virtual bool writesCoordinates ( ) const
pure virtual

returns true iff this actually writes to coordinates.

For such a filter to be parsed successfully, WriteAccess::coordinates is a precondition.

◆ writtenAttributeNames()

virtual std::vector<std::string> writtenAttributeNames ( ) const
pure virtual

returns the names of attributes written to geom - in lexicographical order, and without (case-insensitive) duplicates.

For "Remove" - filters, this returns the names of explicitly given attributes, as in Remove[GPSTime Amplitude]. If no attribute names are given (Remove[]), this returns nothing, even though "Remove" - filters remove all attributes then.