3Depict
|
Range file filter. More...
#include <rangeFile.h>
Public Member Functions | |
void | setFormat (unsigned int format) |
Set the format to assume when loading file. More... | |
std::vector< char > | getEnabledRanges () const |
void | setEnabledRanges (const std::vector< char > &i) |
std::vector< char > | getEnabledIons () const |
RangeFileFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
void | setRangeFilename (std::string filename) |
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_RANGEFILE. More... | |
virtual void | initFilter (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut) |
Propagates a range stream data through the filter init stage. Blocks any other range stream datas. 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... | |
bool | updateRng () |
Force a re-read of the rangefile, returning false on failure, true on success. More... | |
const RangeFile & | getRange () const |
void | setRangeData (const RangeFile &newRange) |
Set the internal data using the specified range object. More... | |
virtual std::string | typeString () const |
Return filter type as std::string. More... | |
unsigned int | getRefreshBlockMask () const |
Get the bitmask encoded list of filterStreams that this filter blocks from propagation. More... | |
unsigned int | getRefreshEmitMask () const |
Get the bitmask encoded list of filterstreams that this filter emits from ::refresh. More... | |
unsigned int | getRefreshUseMask () const |
Mask of filter streams that will be examined by the filter in its computation. 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... | |
virtual void | setPropFromRegion (unsigned int method, unsigned int regionID, float newPos) |
Set a region update. 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 |
Modified version of writeState for packaging. By default simply calls writeState. More... | |
bool | readState (xmlNodePtr &node, const std::string &packDir) |
Read the state of the filter from XML file. If this. More... | |
virtual void | getStateOverrides (std::vector< std::string > &overrides) const |
filter has state overrides More... | |
void | setPropFromBinding (const SelectionBinding &b) |
Set internal property value using a selection binding (Disabled, this filter has no bindings) More... | |
bool | getDropUnranged () const |
![]() | |
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... | |
virtual void | setUserString (const std::string &str) |
Set a user-specified string return value is. 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 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 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 ATOMIC_BOOL * | wantAbort = 0 |
![]() | |
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 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) |
![]() | |
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 bool | strongRandom = false |
Range file filter.
RangeFileFilter::RangeFileFilter | ( | ) |
References RANGE_FORMAT_ORNL.
Referenced by cloneUncached(), getEnabledIons(), and writePackageState().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, RangeFileFilter(), and Filter::userString.
Referenced by getEnabledIons().
|
inline |
|
inline |
References cloneUncached(), and RangeFileFilter().
Referenced by filterAltersComposition().
|
inline |
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), boolStrEnc(), FilterProperty::data, FilterProperty::dataSecondary, RangeFile::getColour(), RangeFile::getIonID(), RangeFile::getName(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeFile::getRange(), FilterProperty::helpText, FilterProperty::key, FilterProperty::name, NUM_ROWS_ION, NUM_ROWS_RANGE, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_FILE, PROPERTY_TYPE_REAL, PROPERTY_TYPE_STRING, RANGE_KEY_DROP_UNRANGED, RANGE_KEY_ENABLE_ALL_IONS, RANGE_KEY_ENABLE_ALL_RANGES, RANGE_KEY_ENABLE_LEGEND, RANGE_KEY_RANGE_FILENAME, RANGEFILE_WX_CONSTANT, ColourRGBA::rgbaString(), FilterPropGroup::setGroupTitle(), stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, and FilterProperty::type.
Referenced by typeString().
|
inline |
References setRangeData().
Referenced by ExportRngDialog::addRangeData(), FilterTree::modifyRangeFiles(), and ExportRngDialog::OnListRangeItemActivate().
|
virtual |
Get the bitmask encoded list of filterStreams that this filter blocks from propagation.
Implements Filter.
References STREAM_TYPE_IONS, and STREAM_TYPE_RANGE.
Referenced by refresh(), and typeString().
|
virtual |
Get the bitmask encoded list of filterstreams that this filter emits from ::refresh.
Implements Filter.
References STREAM_TYPE_DRAW, STREAM_TYPE_IONS, and STREAM_TYPE_RANGE.
Referenced by typeString().
|
virtual |
Mask of filter streams that will be examined by the filter in its computation.
Implements Filter.
References STREAM_TYPE_IONS.
Referenced by typeString().
|
virtual |
Get the human readable error string associated with a particular error code during refresh(...)
Implements Filter.
References ASSERT, COMPILE_ASSERT, RANGEFILE_ERR_ENUM_END, and THREEDEP_ARRAYSIZE.
Referenced by typeString().
|
virtual |
filter has state overrides
Reimplemented from Filter.
Referenced by typeString().
|
inlinevirtual |
Returns FILTER_TYPE_RANGEFILE.
Implements Filter.
References FILTER_TYPE_RANGEFILE, initFilter(), refresh(), and updateRng().
|
virtual |
Propagates a range stream data through the filter init stage. Blocks any other range stream datas.
Reimplemented from Filter.
References ASSERT, FilterStreamData::cached, RangeStreamData::enabledIons, RangeStreamData::enabledRanges, RangeFile::getNumIons(), RangeFile::getNumRanges(), FilterStreamData::parent, RangeStreamData::rangeFile, and STREAM_TYPE_RANGE.
Referenced by getType().
|
virtual |
Returns -1, as range file cache size is dependant upon input.
Implements Filter.
References IONDATA_SIZE.
Referenced by setRangeFilename().
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References boolStrDec(), Filter::convertFileStringToAbsolute(), convertFileStringToNative(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeFile::openGuessFormat(), ColourRGBA::parse(), RangeFile::setColour(), stream_cast(), ColourRGBA::toRGBAf(), ColourRGBAf::toRGBf(), Filter::userString, XMLGetNextElemAttrib(), XMLHelpFwdToElem(), and XMLHelpGetProp().
Referenced by typeString().
|
virtual |
Apply filter to new data, updating cache as needed. Vector of returned pointers must be deleted manually, first checking ->cached.
Implements Filter.
References ASSERT, RGBf::blue, Filter::cache, Filter::cacheAsNeeded(), Filter::cacheOK, IonStreamData::data, RangeStreamData::enabledIons, RangeStreamData::enabledRanges, ProgressData::filterProgress, RangeFile::getColour(), RangeFile::getIonID(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeFile::getRangeID(), getRefreshBlockMask(), RGBf::green, ProgressData::maxStep, NUM_CALLBACK, numElements(), FilterStreamData::parent, Filter::propagateCache(), Filter::propagateStreams(), RangeStreamData::rangeFile, RANGEFILE_ABORT_FAIL, RANGEFILE_BAD_ALLOC, RGBf::red, ProgressData::step, ProgressData::stepName, STREAM_TYPE_IONS, STREAM_TYPE_RANGE, TRANS, and Filter::wantAbort.
Referenced by getType(), and writePackageState().
|
inline |
void RangeFileFilter::setFormat | ( | unsigned int | format | ) |
Set the format to assume when loading file.
References ASSERT, and RANGE_FORMAT_END_OF_ENUM.
|
virtual |
Set the properties for the nth filter.
Implements Filter.
References Filter::applyPropertyNow(), ASSERT, boolStrDec(), Filter::cache, FilterStreamData::cached, Filter::cacheOK, Filter::clearCache(), Filter::filterOutputs, RangeFile::getIonID(), RangeFile::getNumIons(), RangeFile::getNumRanges(), RangeFile::getRange(), RangeFile::moveRange(), NUM_ROWS_ION, NUM_ROWS_RANGE, ColourRGBA::parse(), RANGE_KEY_DROP_UNRANGED, RANGE_KEY_ENABLE_ALL_IONS, RANGE_KEY_ENABLE_ALL_RANGES, RANGE_KEY_ENABLE_LEGEND, RANGE_KEY_RANGE_FILENAME, RangeFile::setColour(), RangeFile::setIonID(), RangeFile::setIonLongName(), RangeFile::setIonShortName(), stream_cast(), STREAM_TYPE_DRAW, ColourRGBA::toRGBAf(), ColourRGBAf::toRGBf(), and updateRng().
Referenced by typeString().
|
virtual |
Set internal property value using a selection binding (Disabled, this filter has no bindings)
Implements Filter.
References ASSERT.
Referenced by typeString().
|
virtual |
Set a region update.
Reimplemented from Filter.
References ASSERT, Filter::clearCache(), RangeFile::getNumRanges(), RangeFile::getRange(), RangeFile::moveBothRanges(), RangeFile::moveRange(), REGION_MOVE_EXTEND_XMINUS, REGION_MOVE_EXTEND_XPLUS, and REGION_MOVE_TRANSLATE_X.
Referenced by typeString().
void RangeFileFilter::setRangeData | ( | const RangeFile & | newRange | ) |
Set the internal data using the specified range object.
References Filter::clearCache(), RangeFile::getNumIons(), and RangeFile::getNumRanges().
Referenced by getRange(), FilterTree::modifyRangeFiles(), MainWindowFrame::OnDropFiles(), and writePackageState().
|
inline |
References numBytesForCache().
Referenced by MainWindowFrame::OnDropFiles().
|
inlinevirtual |
Return filter type as std::string.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), getStateOverrides(), readState(), setProperty(), setPropFromBinding(), setPropFromRegion(), TRANS, writePackageState(), and writeState().
bool RangeFileFilter::updateRng | ( | ) |
Force a re-read of the rangefile, returning false on failure, true on success.
References RangeFile::getNumIons(), RangeFile::getNumRanges(), and RangeFile::openGuessFormat().
Referenced by getType(), and setProperty().
|
virtual |
Modified version of writeState for packaging. By default simply calls writeState.
Reimplemented from Filter.
References RangeFile::addIon(), DrawPointLegendOverlay::addItem(), RangeFile::addRange(), ASSERT, RGBf::blue, IonStreamData::data, DrawStreamData::drawables, RangeFile::getColour(), RangeFile::getName(), RGBf::green, RangeFile::isRanged(), FilterStreamData::parent, RangeFileFilter(), RGBf::red, refresh(), Filter::setCaching(), IonHit::setMassToCharge(), IonHit::setPos(), DrawableOverlay::setPosition(), setRangeData(), STREAM_TYPE_IONS, TEST, and writeState().
Referenced by typeString().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ASSERT, boolStrEnc(), convertFileStringToCanonical(), escapeXML(), RangeFile::getColour(), ColourRGBA::rgbString(), STATE_FORMAT_XML, tabs(), ColourRGBAf::toColourRGBA(), Filter::trueName(), and Filter::userString.
Referenced by typeString(), and writePackageState().