3Depict
|
Spectrum plot filter. More...
#include <spectrumPlot.h>
Public Member Functions | |
SpectrumPlotFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
unsigned int | getType () const |
Returns FILTER_TYPE_SPECTRUMPLOT. More... | |
size_t | numBytesForCache (size_t nObjects) const |
Get approx number of bytes for caching output. More... | |
unsigned int | refresh (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &getOut, ProgressData &progress) |
update filter More... | |
virtual std::string | typeString () const |
Return filter type as std::string. 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. Returns true if prop set OK. More... | |
std::string | getSpecificErrString (unsigned int code) const |
Get the human readable error string associated with a particular error code during refresh(...) More... | |
void | setUserString (const std::string &s) |
Set the user string. More... | |
bool | writeState (std::ostream &f, unsigned int format, unsigned int depth=0) const |
Dump state to output stream, using specified format. 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 (Disabled, this filter has no bindings) More... | |
bool | needsUnrangedData () const |
Does the filer need unranged data to operate? More... | |
![]() | |
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... | |
virtual void | initFilter (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut) |
Initialise the filter's internal state using limited filter stream data propagation. More... | |
virtual void | getStateOverrides (std::vector< std::string > &overrides) 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... | |
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 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... | |
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 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 |
Spectrum plot filter.
SpectrumPlotFilter::SpectrumPlotFilter | ( | ) |
References NORMALISE_NONE.
Referenced by cloneUncached(), and needsUnrangedData().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, SpectrumPlotFilter(), and Filter::userString.
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), ASSERT, BACKGROUND_MODE_STRING, boolStrEnc(), choiceString(), FilterProperty::data, FIT_MODE_CONST_TOF, FIT_MODE_ENUM_END, FIT_MODE_NONE, FilterProperty::helpText, FilterProperty::key, KEY_SPECTRUM_AUTOEXTREMA, KEY_SPECTRUM_BACKMODE, KEY_SPECTRUM_BACKMODE_FLAT_END, KEY_SPECTRUM_BACKMODE_FLAT_START, KEY_SPECTRUM_BINWIDTH, KEY_SPECTRUM_COLOUR, KEY_SPECTRUM_CORRECTED_ONLY, KEY_SPECTRUM_LOGARITHMIC, KEY_SPECTRUM_MAX, KEY_SPECTRUM_MIN, KEY_SPECTRUM_NORMALISE, KEY_SPECTRUM_NORMALISE_LOWERBOUND, KEY_SPECTRUM_NORMALISE_UPPERBOUND, KEY_SPECTRUM_PLOTTYPE, FilterProperty::name, NORMALISE_ENUM_END, NORMALISE_MAX_IN_BOUND, NORMALISE_STRING, PLOT_LINE_LINES, PLOT_LINE_STEM, plotString(), PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_REAL, ColourRGBA::rgbaString(), FilterPropGroup::setGroupTitle(), stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, and FilterProperty::type.
Referenced by typeString().
|
virtual |
Get the stream types that will be dropped during ::refresh.
Implements Filter.
References STREAMTYPE_MASK_ALL.
Referenced by typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References STREAM_TYPE_PLOT.
Referenced by typeString().
|
virtual |
Get the stream types that will be possibly used during ::refresh.
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, SPECTRUM_ERR_ENUM_END, and THREEDEP_ARRAYSIZE.
Referenced by typeString().
|
inlinevirtual |
Returns FILTER_TYPE_SPECTRUMPLOT.
Implements Filter.
References FILTER_TYPE_SPECTRUMPLOT, numBytesForCache(), and refresh().
bool SpectrumPlotFilter::needsUnrangedData | ( | ) | const |
Does the filer need unranged data to operate?
References PlotStreamData::b, IonStreamData::data, FIT_MODE_CONST_TOF, PlotStreamData::g, KEY_SPECTRUM_COLOUR, KEY_SPECTRUM_LOGARITHMIC, PlotStreamData::r, refresh(), Filter::setCaching(), IonHit::setMassToCharge(), IonHit::setPos(), setProperty(), SpectrumPlotFilter(), STREAM_TYPE_PLOT, TEST, and PlotStreamData::xyData.
Referenced by needsUnrangedData(), and typeString().
|
virtual |
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References boolStrDec(), NORMALISE_NONE, parseXMLColour(), PLOT_LINE_NONE, stream_cast(), Filter::userString, XMLGetNextElemAttrib(), XMLHelpFwdToElem(), and XMLHelpGetProp().
Referenced by typeString().
|
virtual |
update filter
Implements Filter.
References PlotStreamData::a, ColourRGBAf::a(), ASSERT, PlotStreamData::b, ColourRGBAf::b(), BACKGROUND_PARAMS::binWidth, Filter::cacheAsNeeded(), Filter::cacheOK, Filter::consoleOutput, createMassBackground(), IonStreamData::data, PlotStreamData::dataLabel, doFitBackground(), RangeStreamData::enabledIons, RangeStreamData::enabledRanges, ProgressData::filterProgress, FIT_MODE_NONE, PlotStreamData::g, ColourRGBAf::g(), RangeFile::getColour(), RangeFile::getIonID(), RangeFile::getName(), RangeFile::getNumRanges(), RangeFile::getRange(), Filter::getUserString(), PlotStreamData::index, BACKGROUND_PARAMS::intensity, PlotStreamData::logarithmic, BACKGROUND_PARAMS::massEnd, BACKGROUND_PARAMS::massStart, ProgressData::maxStep, BACKGROUND_PARAMS::mode, NORMALISE_INTEGRAL_ONE, NORMALISE_MAX, NORMALISE_MAX_IN_BOUND, NORMALISE_NONE, NUM_CALLBACK, numElements(), FilterStreamData::parent, PLOT_MODE_1D, PlotStreamData::plotMode, PlotStreamData::plotStyle, Filter::propagateCache(), PlotStreamData::r, ColourRGBAf::r(), RangeStreamData::rangeFile, SPECTRUM_ABORT_FAIL, SPECTRUM_AUTO_MAX_BINS, SPECTRUM_BAD_ALLOC, SPECTRUM_MAX_BINS, ProgressData::step, ProgressData::stepName, STREAM_TYPE_IONS, STREAM_TYPE_RANGE, TRANS, IonStreamData::valueType, Filter::wantAbort, PlotStreamData::xLabel, PlotStreamData::xyData, PlotStreamData::yLabel, and YLABEL_STRING.
Referenced by getType(), and needsUnrangedData().
|
virtual |
Set the properties for the nth filter. Returns true if prop set OK.
Implements Filter.
References Filter::applyPropertyNow(), ASSERT, PlotStreamData::b, ColourRGBAf::b(), BACKGROUND_MODE_STRING, Filter::cacheOK, Filter::clearCache(), Filter::filterOutputs, FIT_MODE_ENUM_END, PlotStreamData::g, ColourRGBAf::g(), KEY_SPECTRUM_AUTOEXTREMA, KEY_SPECTRUM_BACKMODE, KEY_SPECTRUM_BACKMODE_FLAT_END, KEY_SPECTRUM_BACKMODE_FLAT_START, KEY_SPECTRUM_BINWIDTH, KEY_SPECTRUM_COLOUR, KEY_SPECTRUM_CORRECTED_ONLY, KEY_SPECTRUM_LOGARITHMIC, KEY_SPECTRUM_MAX, KEY_SPECTRUM_MIN, KEY_SPECTRUM_NORMALISE, KEY_SPECTRUM_NORMALISE_LOWERBOUND, KEY_SPECTRUM_NORMALISE_UPPERBOUND, KEY_SPECTRUM_PLOTTYPE, PlotStreamData::logarithmic, NORMALISE_ENUM_END, NORMALISE_STRING, ColourRGBA::parse(), PLOT_LINE_NONE, plotID(), PlotStreamData::plotStyle, PlotStreamData::r, ColourRGBAf::r(), stream_cast(), STREAM_TYPE_PLOT, and ColourRGBA::toRGBAf().
Referenced by needsUnrangedData(), and 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 the user string.
Reimplemented from Filter.
References Filter::cacheOK, Filter::clearCache(), and Filter::userString.
Referenced by typeString().
|
inlinevirtual |
Return filter type as std::string.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), needsUnrangedData(), readState(), setProperty(), setPropFromBinding(), setUserString(), TRANS, and writeState().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ColourRGBAf::a(), ASSERT, ColourRGBAf::b(), boolStrEnc(), escapeXML(), ColourRGBAf::g(), ColourRGBAf::r(), STATE_FORMAT_XML, tabs(), Filter::trueName(), and Filter::userString.
Referenced by typeString().