3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
SpatialAnalysisFilter Class Reference

Spatial analysis filter. More...

#include <spatialAnalysis.h>

Inheritance diagram for SpatialAnalysisFilter:
Inheritance graph
[legend]
Collaboration diagram for SpatialAnalysisFilter:
Collaboration graph
[legend]

Public Member Functions

 SpatialAnalysisFilter ()
 
FiltercloneUncached () const
 Duplicate filter contents, excluding cache. More...
 
virtual void initFilter (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut)
 Initialise filter prior to tree propagation. More...
 
virtual size_t numBytesForCache (size_t nObjects) const
 Returns -1, as range file cache size is dependant upon input. More...
 
unsigned int getType () const
 Returns FILTER_TYPE_SPATIAL_ANALYSIS. More...
 
unsigned int refresh (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &getOut, ProgressData &progress)
 Apply filter to new data, updating cache as needed. Vector of returned pointers must be deleted manually, first checking ->cached. More...
 
virtual std::string typeString () const
 Get the type string for this fitler. More...
 
void getProperties (FilterPropGroup &propertyList) const
 Get the properties of the filter, in key-value form. First vector is for each output. More...
 
bool setProperty (unsigned int key, const std::string &value, bool &needUpdate)
 Set the properties for the nth filter. More...
 
std::string getSpecificErrString (unsigned int code) const
 Get the human readable error string associated with a particular error code during refresh(...) More...
 
bool writeState (std::ostream &f, unsigned int format, unsigned int depth=0) const
 Dump state to output stream, using specified format. More...
 
virtual bool writePackageState (std::ostream &f, unsigned int format, const std::vector< std::string > &valueOverrides, unsigned int depth=0) const
 write an overridden filename version of the state More...
 
void getStateOverrides (std::vector< string > &externalAttribs) const
 Return the XML elements that refer to external entities (i.e. files) which do not move with the XML files. At this time, only files are supported. These will be looked for on the filesystem and moved as needed. More...
 
bool readState (xmlNodePtr &node, const std::string &packDir)
 Read the state of the filter from XML file. If this. More...
 
unsigned int getRefreshBlockMask () const
 Get the stream types that will be dropped during ::refresh. More...
 
unsigned int getRefreshEmitMask () const
 Get the stream types that will be generated during ::refresh. More...
 
unsigned int getRefreshUseMask () const
 Get the stream types that will be possibly used during ::refresh. More...
 
void setPropFromBinding (const SelectionBinding &b)
 Set internal property value using a selection binding. More...
 
void setUserString (const std::string &s)
 Set a user-specified string return value is. More...
 
- Public Member Functions inherited from Filter
 Filter ()
 
virtual ~Filter ()
 
virtual void clearCache ()
 Erase cache. More...
 
virtual void clearDevices ()
 Erase any active devices. More...
 
std::string getErrString (unsigned int code) const
 Get the human readable error string associated with a particular error code during refresh(...). Do not override this for specific filter errors. Override getSpecificErrString. More...
 
std::string trueName () const
 Return the unique name for a given filter – DO NOT TRANSLATE. More...
 
void setCaching (bool enableCache)
 Enable/disable caching for this filter. More...
 
bool haveCache () const
 Have cached output data? More...
 
virtual std::string getUserString () const
 Return a user-specified string, or just the typestring if user set string not active. More...
 
void getSelectionDevices (std::vector< SelectionDevice *> &devices) const
 Get the selection devices for this filter. MUST be called after refresh() More...
 
void updateOutputInfo (const std::vector< const FilterStreamData *> &dataOut)
 Update the output statistics for this filter (num items of streams of each type output) More...
 
virtual void setPropFromRegion (unsigned int method, unsigned int regionID, float newPos)
 Set a region update. More...
 
virtual bool canBeHazardous () const
 Can this filter perform actions that are potentially a security concern? More...
 
unsigned int getNumOutput (unsigned int streamType) const
 Get the number of outputs for the specified type during the filter's last refresh. More...
 
void getConsoleStrings (std::vector< std::string > &v) const
 Get the filter messages from the console. To erase strings, either call erase, or erase cahche. More...
 
void clearConsole ()
 
virtual bool monitorNeedsRefresh () const
 
virtual bool isPureDataSource () const
 
virtual bool isUsefulAsAppend () const
 
template<>
bool applyPropertyNow (bool &prop, const std::string &val, bool &needUp)
 
template<>
bool applyPropertyNow (Point3D &prop, const std::string &val, bool &needUp)
 
template<>
bool applyPropertyNow (std::string &prop, const std::string &val, bool &needUp)
 

Additional Inherited Members

- Static Public Member Functions inherited from Filter
static void setStrongRandom (bool strongRand)
 Should filters use strong randomisation (where applicable) or not? More...
 
template<typename T >
static void getStreamsOfType (const std::vector< const FilterStreamData *> &vec, std::vector< const T *> &dataOut)
 
- Static Public Attributes inherited from Filter
static ATOMIC_BOOLwantAbort = 0
 
- Protected Member Functions inherited from Filter
void convertFileStringToAbsolute (const string &basePath, std::string &s) const
 
void propagateCache (std::vector< const FilterStreamData *> &dataOut) const
 Propagate the cache into output. More...
 
template<class T >
bool applyPropertyNow (T &oldProp, const std::string &newVal, bool &needUp)
 
void cacheAsNeeded (FilterStreamData *s)
 
- Static Protected Member Functions inherited from Filter
static unsigned int collateIons (const std::vector< const FilterStreamData *> &dataIn, std::vector< IonHit > &outVector, ProgressData &prog, size_t totalDataSize=(size_t) -1)
 
static unsigned int collateIons (const std::vector< const FilterStreamData *> &dataIn, std::vector< Point3D > &outVector, ProgressData &prog, size_t totalDataSize=(size_t) -1)
 
static void propagateStreams (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut, size_t mask=STREAMTYPE_MASK_ALL, bool invertMask=false)
 Propagate the given input data to an output vector. More...
 
static std::string getBaseErrString (unsigned int errCode)
 Get the generic (applies to any filter) error codes. More...
 
template<class T >
static unsigned int extendDataVector (std::vector< T > &dest, const std::vector< IonHit > &vIonData, unsigned int &progress, size_t offset)
 Extend a point data vector using some ion data. More...
 
template<class T >
static size_t buildSplitPoints (const vector< const FilterStreamData *> &dataIn, ProgressData &progress, size_t totalDataSize, const RangeFile *rngF, const vector< bool > &pSourceEnabled, const vector< bool > &pTargetEnabled, vector< T > &pSource, vector< T > &pTarget)
 
static unsigned int getIonstreamIonID (const IonStreamData *d, const RangeFile *r)
 
static void demuxKey (unsigned int key, unsigned int &keyType, unsigned int &ionOffset)
 Hack to merge/extract two bits of information into a single property key. More...
 
static unsigned int muxKey (unsigned int keyType, unsigned int ionOffset)
 
- Protected Attributes inherited from Filter
bool cache
 
bool cacheOK
 
unsigned int numStreamsLastRefresh [NUM_STREAM_TYPES]
 Array of the number of streams propagated on last refresh. More...
 
std::vector< std::string > consoleOutput
 Temporary console output. Should be only nonzero size if messages are present. More...
 
std::string userString
 User settable labelling string (human readable ID, etc etc) More...
 
std::vector< FilterStreamData * > filterOutputs
 
std::vector< SelectionDevice * > devices
 User interaction "Devices" associated with this filter. More...
 
- Static Protected Attributes inherited from Filter
static bool strongRandom = false
 

Detailed Description

Spatial analysis filter.

Constructor & Destructor Documentation

◆ SpatialAnalysisFilter()

SpatialAnalysisFilter::SpatialAnalysisFilter ( )

Member Function Documentation

◆ cloneUncached()

Filter * SpatialAnalysisFilter::cloneUncached ( ) const
virtual

Duplicate filter contents, excluding cache.

Implements Filter.

References Filter::cache, Filter::cacheOK, SpatialAnalysisFilter(), and Filter::userString.

◆ getProperties()

void SpatialAnalysisFilter::getProperties ( FilterPropGroup propertyList) const
virtual

Get the properties of the filter, in key-value form. First vector is for each output.

Implements Filter.

References FilterPropGroup::addProperty(), ALGORITHM_AXIAL_DF, ALGORITHM_BINOMIAL, ALGORITHM_DENSITY, ALGORITHM_DENSITY_FILTER, ALGORITHM_ENUM_END, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, ALGORITHM_REPLACE, ASSERT, boolStrEnc(), choiceString(), FilterProperty::data, FilterProperty::dataSecondary, FilterProperty::helpText, FilterProperty::key, KEY_ALGORITHM, KEY_BINOMIAL_EXTRUDE_DIR, KEY_BINOMIAL_MAX_ASPECT, KEY_COLOUR, KEY_CUTOFF, KEY_DISTMAX, KEY_ENABLE_NUMERATOR_ALL, KEY_ENABLE_SOURCE_ALL, KEY_ENABLE_TARGET_ALL, KEY_NNMAX, KEY_NNMAX_NORMALISE, KEY_NNMAX_SHOWRANDOM, KEY_NORMAL, KEY_NUMBINS, KEY_NUMIONS, KEY_REDUCTIONDIST, KEY_REMOVAL, KEY_REPLACE_ALGORITHM, KEY_REPLACE_FILE, KEY_REPLACE_TOLERANCE, KEY_REPLACE_VALUE, KEY_RETAIN_UPPER, KEY_SHOW_BINOM_3D_GRID, KEY_SHOW_BINOM_FREQ, KEY_SHOW_BINOM_NORM_FREQ, KEY_SHOW_BINOM_THEOR_FREQ, KEY_STOPMODE, KEYTYPE_ENABLE_NUMERATOR, KEYTYPE_ENABLE_SOURCE, KEYTYPE_ENABLE_TARGET, Filter::muxKey(), FilterProperty::name, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_FILE, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_POINT3D, PROPERTY_TYPE_REAL, REPLACE_ALGORITHMS, REPLACE_MODE_ENUM_END, REPLACE_MODE_SUBTRACT, ColourRGBA::rgbaString(), ColourRGBA::rgbString(), FilterPropGroup::setGroupTitle(), SPATIAL_ALGORITHMS, STOP_MODE_NEIGHBOUR, STOP_MODE_RADIUS, STOP_MODES, stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, and FilterProperty::type.

Referenced by typeString().

Here is the caller graph for this function:

◆ getRefreshBlockMask()

unsigned int SpatialAnalysisFilter::getRefreshBlockMask ( ) const
virtual

Get the stream types that will be dropped during ::refresh.

Implements Filter.

References STREAM_TYPE_IONS, STREAM_TYPE_RANGE, and WANT_RANGE_PROPAGATION.

Referenced by refresh(), and typeString().

Here is the caller graph for this function:

◆ getRefreshEmitMask()

unsigned int SpatialAnalysisFilter::getRefreshEmitMask ( ) const
virtual

Get the stream types that will be generated during ::refresh.

Implements Filter.

References ALGORITHM_AXIAL_DF, ALGORITHM_BINOMIAL, ALGORITHM_RDF, STREAM_TYPE_DRAW, STREAM_TYPE_IONS, and STREAM_TYPE_PLOT.

Referenced by typeString().

Here is the caller graph for this function:

◆ getRefreshUseMask()

unsigned int SpatialAnalysisFilter::getRefreshUseMask ( ) const
virtual

Get the stream types that will be possibly used during ::refresh.

Implements Filter.

References STREAM_TYPE_IONS.

Referenced by typeString().

Here is the caller graph for this function:

◆ getSpecificErrString()

std::string SpatialAnalysisFilter::getSpecificErrString ( unsigned int  code) const
virtual

Get the human readable error string associated with a particular error code during refresh(...)

Implements Filter.

References ASSERT, COMPILE_ASSERT, SPAT_ERR_END_OF_ENUM, THREEDEP_ARRAYSIZE, and TRANS.

Referenced by typeString().

Here is the caller graph for this function:

◆ getStateOverrides()

void SpatialAnalysisFilter::getStateOverrides ( std::vector< string > &  overrides) const
virtual

Return the XML elements that refer to external entities (i.e. files) which do not move with the XML files. At this time, only files are supported. These will be looked for on the filesystem and moved as needed.

Reimplemented from Filter.

Referenced by typeString().

Here is the caller graph for this function:

◆ getType()

unsigned int SpatialAnalysisFilter::getType ( ) const
inlinevirtual

Returns FILTER_TYPE_SPATIAL_ANALYSIS.

Implements Filter.

References FILTER_TYPE_SPATIAL_ANALYSIS, and refresh().

◆ initFilter()

void SpatialAnalysisFilter::initFilter ( const std::vector< const FilterStreamData *> &  dataIn,
std::vector< const FilterStreamData *> &  dataOut 
)
virtual

Initialise filter prior to tree propagation.

Reimplemented from Filter.

References RangeStreamData::enabledIons, RangeFile::getName(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeStreamData::rangeFile, STREAM_TYPE_RANGE, and WANT_RANGE_PROPAGATION.

Referenced by setPropFromBinding().

Here is the caller graph for this function:

◆ numBytesForCache()

size_t SpatialAnalysisFilter::numBytesForCache ( size_t  nObjects) const
virtual

Returns -1, as range file cache size is dependant upon input.

Implements Filter.

References IONDATA_SIZE.

◆ readState()

bool SpatialAnalysisFilter::readState ( xmlNodePtr &  node,
const std::string &  packDir 
)
virtual

◆ refresh()

unsigned int SpatialAnalysisFilter::refresh ( const std::vector< const FilterStreamData *> &  dataIn,
std::vector< const FilterStreamData *> &  dataOut,
ProgressData progress 
)
virtual

◆ setProperty()

bool SpatialAnalysisFilter::setProperty ( unsigned int  key,
const std::string &  value,
bool &  needUpdate 
)
virtual

◆ setPropFromBinding()

void SpatialAnalysisFilter::setPropFromBinding ( const SelectionBinding b)
virtual

Set internal property value using a selection binding.

Implements Filter.

References IonStreamData::a, RangeFile::addIon(), RangeFile::addRange(), ALGORITHM_AXIAL_DF, ALGORITHM_DENSITY, ALGORITHM_LOCAL_CHEMISTRY, ALGORITHM_RDF, ALGORITHM_REPLACE, ASSERT, IonStreamData::b, PlotStreamData::b, ColourRGBAf::b(), BINDING_CYLINDER_DIRECTION, BINDING_CYLINDER_ORIGIN, BINDING_CYLINDER_RADIUS, BINOMIAL_NO_MEM, BINOMIAL_SEGMENT_AUTO_BRICK, RGBf::blue, K3DTreeMk2::build(), K3DTree::buildByRef(), Filter::buildSplitPoints(), Filter::cacheAsNeeded(), FilterStreamData::cached, BINOMIAL_STATS::chiSquare, Filter::clearCache(), Filter::collateIons(), BINOMIAL_STATS::comparisonCoeff, computeBinomialStats(), Filter::consoleOutput, countBinnedIons(), createTmpFilename(), IonStreamData::data, PlotStreamData::dataLabel, DEFAULT_AXIAL_DISTANCE, DISTANCE_EPSILON, DrawStreamData::drawables, RangeStreamData::enabledIons, RangeStreamData::enabledRanges, EQ_TOL, ERR_ABORT_FAIL, ERR_BINOMIAL_BIN_FAIL, ERR_BINOMIAL_NO_MEM, IonStreamData::estimateIonParameters(), SEGMENT_OPTION::extrudeMaxRatio, SEGMENT_OPTION::extrusionDirection, FILTER_ERR_ABORT, Filter::filterOutputs, ProgressData::filterProgress, K3DTree::findKNearest(), K3DTree::findNearest(), K3DTreeMk2::findNearestWithSkip(), IonStreamData::g, PlotStreamData::g, ColourRGBAf::g(), genBinomialHistogram(), generate1DAxialDistHist(), generate1DAxialNNHist(), generateDistHist(), generateKnnTheoreticalDist(), generateNNHist(), K3DTreeMk2::getBoundCube(), RangeFile::getColour(), SelectionBinding::getID(), RangeFile::getIonID(), Filter::getIonstreamIonID(), RangeFile::getName(), IonStreamData::getNumBasicObjects(), RangeFile::getNumIons(), K3DTreeMk2::getOrigIndex(), IonHit::getPos(), K3DTreeMk2::getPtRef(), GetReducedHullPts(), Filter::getUserString(), SelectionBinding::getValue(), RGBf::green, PlotStreamData::index, initFilter(), INSUFFICIENT_SIZE_ERR, IonStreamData::ionSize, KEY_ALGORITHM, KEY_DISTMAX, KEY_NNMAX, KEY_NORMAL, KEY_ORIGIN, KEY_RADIUS, KEY_REMOVAL, KEY_REPLACE_ALGORITHM, KEY_REPLACE_FILE, KEY_REPLACE_VALUE, KEY_STOPMODE, KEYTYPE_ENABLE_DENOMINATOR, KEYTYPE_ENABLE_NUMERATOR, KEYTYPE_ENABLE_SOURCE, M_PI, IonHit::makePos(), BINOMIAL_HIST::mapIonFrequencies, ProgressData::maxStep, BINOMIAL_STATS::mean, Filter::muxKey(), SEGMENT_OPTION::nIons, K3DTree::nodeCount(), Point3D::normalise(), BINOMIAL_HIST::normalisedFrequencies, NUM_CALLBACK, FilterStreamData::parent, PLOT_LINE_STEM, PLOT_LINE_STEPS, PLOT_MODE_1D, PlotStreamData::plotMode, PlotStreamData::plotStyle, K3DTreeMk2::ptsInSphere(), BINOMIAL_STATS::pValue, BINOMIAL_STATS::pValueOK, IonStreamData::r, PlotStreamData::r, ColourRGBAf::r(), RangeFile::rangeByIon(), RangeStreamData::rangeFile, RDF_ABORT_FAIL, RDF_ERR_INSUFFICIENT_INPUT_POINTS, RGBf::red, refresh(), REPLACE_ALGORITHMS, REPLACE_MODE_INTERSECT, REPLACE_MODE_SUBTRACT, REPLACE_MODE_UNION, K3DTreeMk2::resetPts(), DrawRectPrism::setAxisAligned(), BoundCube::setBounds(), Filter::setCaching(), DrawRectPrism::setColour(), DrawRectPrism::setLineWidth(), IonHit::setMassToCharge(), IonHit::setPos(), setProperty(), SPAT_ERR_END_OF_ENUM, SPATIAL_ALGORITHMS, SpatialAnalysisFilter(), Point3D::sqrDist(), Point3D::sqrMag(), ProgressData::step, ProgressData::stepName, STOP_MODE_NEIGHBOUR, STOP_MODE_RADIUS, STOP_MODES, SEGMENT_OPTION::strategy, stream_cast(), STREAM_TYPE_IONS, STREAM_TYPE_PLOT, STREAM_TYPE_RANGE, TEST, BINOMIAL_HIST::theoreticFrequencies, BINOMIAL_HIST::theoreticNormalisedFrequencies, TRANS, IonStreamData::valueType, Filter::wantAbort, weightedMean(), PlotStreamData::xLabel, xorFunc(), PlotStreamData::xyData, and PlotStreamData::yLabel.

Referenced by typeString().

Here is the caller graph for this function:

◆ setUserString()

void SpatialAnalysisFilter::setUserString ( const std::string &  str)
virtual

Set a user-specified string return value is.

Reimplemented from Filter.

References ALGORITHM_ENUM_END, Filter::clearCache(), COMPILE_ASSERT, THREEDEP_ARRAYSIZE, and Filter::userString.

Referenced by typeString().

Here is the caller graph for this function:

◆ typeString()

virtual std::string SpatialAnalysisFilter::typeString ( ) const
inlinevirtual

◆ writePackageState()

bool SpatialAnalysisFilter::writePackageState ( std::ostream &  f,
unsigned int  format,
const std::vector< std::string > &  valueOverrides,
unsigned int  depth = 0 
) const
virtual

write an overridden filename version of the state

Reimplemented from Filter.

References ASSERT, and writeState().

Referenced by typeString().

Here is the caller graph for this function:

◆ writeState()

bool SpatialAnalysisFilter::writeState ( std::ostream &  f,
unsigned int  format,
unsigned int  depth = 0 
) const
virtual

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