3Depict
|
#include <dataLoad.h>
Public Member Functions | |
DataLoadFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
void | setFilename (const char *name) |
Set the source string. More... | |
void | setFilename (const std::string &name) |
void | guessNumColumns () |
void | setFileMode (unsigned int mode) |
Set the filter to either use text or pos as requested,. More... | |
unsigned int | getType () const |
Get filter type (returns FILTER_TYPE_DATALOAD) More... | |
virtual size_t | numBytesForCache (size_t nOBjects) const |
Get (approx) number of bytes required for cache. More... | |
unsigned int | refresh (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &getOut, ProgressData &progress) |
Refresh object data. More... | |
void | updatePosData () |
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. 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... | |
bool | readState (xmlNodePtr &node, const std::string &packDir) |
Read the state of the filter from XML file. If this. More... | |
virtual unsigned int | getRefreshBlockMask () const |
Get the block mask for this filter (bitmaks of streams blocked from propagation during ::refresh) More... | |
virtual unsigned int | getRefreshEmitMask () const |
Get the refresh mask for this filter (bitmaks of streams emitted during ::refresh) More... | |
virtual unsigned int | getRefreshUseMask () const |
Get the refresh use mask for this filter (bitmaks of streams possibly used during ::refresh) More... | |
virtual void | getStateOverrides (std::vector< std::string > &overrides) const |
Pos 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... | |
std::string | getValueLabel () |
Get the label for the chosen value column. More... | |
virtual bool | monitorNeedsRefresh () const |
Return if we need monitoring or not. More... | |
virtual bool | isPureDataSource () const |
virtual bool | isUsefulAsAppend () 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... | |
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... | |
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 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 () |
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) |
Protected Attributes | |
std::string | ionFilename |
filename from which the ions are being loaded More... | |
unsigned int | fileType |
Type of file to open. More... | |
bool | doSample |
Whether to randomly sample dataset during load or not. More... | |
size_t | maxIons |
Maximum number of ions to load, if performing sampling. More... | |
ColourRGBAf | rgbaf |
Default ion colour vars. More... | |
float | ionSize |
Default ion size (view size) More... | |
unsigned int | numColumns |
Number of columns & type of file. More... | |
unsigned int | index [INDEX_LENGTH] |
index of columns into pos file, if pos data is visualised as a set of float record presented as a table (one line per record) More... | |
bool | enabled |
Is pos load enabled? More... | |
bool | volumeRestrict |
Volume restricted load? More... | |
BoundCube | bound |
volume restriction bounds, not sorted More... | |
THREEDAP_RECON_PARAMS | reconParams |
Reconstruction parameters for OPS files. More... | |
time_t | monitorTimestamp |
size_t | monitorSize |
bool | wantMonitor |
std::string | errStr |
string to use in error situation, set during ::refresh More... | |
std::string | valueLabel |
String to use to set the value type. More... | |
unsigned int | endianMode |
Endian read mode. More... | |
![]() | |
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 | |
static const unsigned int | INDEX_LENGTH = 4 |
![]() | |
static bool | strongRandom = false |
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) |
DataLoadFilter::DataLoadFilter | ( | ) |
References AVAILABLE_FILEDATA_TYPES, bound, Filter::cache, COMPILE_ASSERT, THREEDAP_RECON_PARAMS::detectionEfficiency, FILEDATA_TYPE_ENUM_END, index, THREEDAP_RECON_PARAMS::ionVolume, numColumns, THREEDAP_RECON_PARAMS::radiusCylinder, reconParams, BoundCube::setInverseLimits(), THREEDEP_ARRAYSIZE, and THREEDAP_RECON_PARAMS::useTOFDistortion.
Referenced by cloneUncached(), and monitorNeedsRefresh().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References bound, Filter::cache, Filter::cacheOK, DataLoadFilter(), doSample, enabled, fileType, index, INDEX_LENGTH, ionFilename, ionSize, maxIons, numColumns, reconParams, rgbaf, BoundCube::setBounds(), Filter::userString, volumeRestrict, and wantMonitor.
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), ASSERT, AVAILABLE_FILEDATA_TYPES, choiceString(), FilterProperty::data, DATALOAD_KEY_COLOUR, DATALOAD_KEY_DETECTIONEFFICIENCY, DATALOAD_KEY_ENABLED, DATALOAD_KEY_ENDIANNESS, DATALOAD_KEY_FILE, DATALOAD_KEY_FILETYPE, DATALOAD_KEY_IONSIZE, DATALOAD_KEY_IONVOLUME, DATALOAD_KEY_MONITOR, DATALOAD_KEY_NUMBER_OF_COLUMNS, DATALOAD_KEY_SAMPLE, DATALOAD_KEY_SCALERADIUS, DATALOAD_KEY_SELECTED_COLUMN0, DATALOAD_KEY_SELECTED_COLUMN1, DATALOAD_KEY_SELECTED_COLUMN2, DATALOAD_KEY_SELECTED_COLUMN3, DATALOAD_KEY_SIZE, DATALOAD_KEY_VALUELABEL, FilterProperty::dataSecondary, THREEDAP_RECON_PARAMS::detectionEfficiency, doSample, enabled, ENDIAN_MODE_ENUM_END, ENDIAN_MODE_STR, endianMode, FILEDATA_TYPE_3DAP_OPS, FILEDATA_TYPE_ATO, FILEDATA_TYPE_ENUM_END, FILEDATA_TYPE_POS, FILEDATA_TYPE_TEXT, fileType, FilterProperty::helpText, index, ionFilename, ionSize, THREEDAP_RECON_PARAMS::ionVolume, FilterProperty::key, maxIons, FilterProperty::name, numColumns, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_FILE, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_REAL, PROPERTY_TYPE_STRING, THREEDAP_RECON_PARAMS::radiusCylinder, reconParams, rgbaf, ColourRGBA::rgbaString(), FilterPropGroup::setGroupTitle(), stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, FilterProperty::type, valueLabel, and wantMonitor.
Referenced by typeString().
|
virtual |
Get the block mask for this filter (bitmaks of streams blocked from propagation during ::refresh)
Implements Filter.
Referenced by typeString().
|
virtual |
Get the refresh mask for this filter (bitmaks of streams emitted during ::refresh)
Implements Filter.
References STREAM_TYPE_IONS.
Referenced by typeString().
|
virtual |
Get the refresh use mask for this filter (bitmaks of streams possibly used during ::refresh)
Implements Filter.
Referenced by typeString().
|
virtual |
Get the human readable error string associated with a particular error code during refresh(...)
Implements Filter.
References ASSERT, and errStr.
Referenced by typeString().
|
virtual |
Pos filter has state overrides.
Reimplemented from Filter.
References ionFilename.
Referenced by typeString().
|
inlinevirtual |
Get filter type (returns FILTER_TYPE_DATALOAD)
Implements Filter.
References FILTER_TYPE_DATALOAD, numBytesForCache(), refresh(), and updatePosData().
std::string DataLoadFilter::getValueLabel | ( | ) |
Get the label for the chosen value column.
Referenced by typeString().
void DataLoadFilter::guessNumColumns | ( | ) |
References extension, ionFilename, and numColumns.
Referenced by setFilename().
|
inlinevirtual |
Reimplemented from Filter.
|
inlinevirtual |
Reimplemented from Filter.
|
virtual |
Return if we need monitoring or not.
Reimplemented from Filter.
References AVAILABLE_FILEDATA_TYPES, Filter::cacheOK, DATALOAD_KEY_FILE, DATALOAD_KEY_FILETYPE, DATALOAD_KEY_SAMPLE, DataLoadFilter(), enabled, FILEDATA_TYPE_TEXT, RandNumGen::genUniformDev(), getFilesize(), RandNumGen::initialise(), ionFilename, IonHit::makePos(), monitorSize, monitorTimestamp, refresh(), Filter::setCaching(), setProperty(), Point3D::setValue(), STREAM_TYPE_IONS, TEST, wantMonitor, and WARN.
Referenced by typeString().
|
virtual |
Get (approx) number of bytes required for cache.
Implements Filter.
References doSample, getFilesize(), ionFilename, and maxIons.
Referenced by getType().
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References Filter::convertFileStringToAbsolute(), convertFileStringToNative(), DEFAULT_LABEL, doSample, enabled, FILEDATA_TYPE_ENUM_END, FILEDATA_TYPE_POS, fileType, index, INDEX_LENGTH, ionFilename, ionSize, MAX_IONS_LOAD_DEFAULT, MAX_NUM_FILE_COLS, maxIons, numColumns, parseXMLColour(), rgbaf, splitStrsRef(), stream_cast(), TRANS, Filter::userString, valueLabel, wantMonitor, XMLGetNextElemAttrib(), and XMLHelpFwdToElem().
Referenced by typeString().
|
virtual |
Refresh object data.
Implements Filter.
References IonStreamData::a, ColourRGBAf::a(), ASSERT, IonStreamData::b, ColourRGBAf::b(), Filter::cacheAsNeeded(), Filter::cacheOK, Filter::clearCache(), Filter::consoleOutput, IonStreamData::data, doSample, enabled, ERR_FILE_FORMAT, ERR_FILE_OPEN, errStr, FILEDATA_TYPE_3DAP_OPS, FILEDATA_TYPE_ATO, FILEDATA_TYPE_POS, FILEDATA_TYPE_TAPSIM, FILEDATA_TYPE_TEXT, fileType, ProgressData::filterProgress, IonStreamData::g, ColourRGBAf::g(), GenericLoadFloatFile(), IonHit::getBoundCube(), getFilesize(), index, INDEX_LENGTH, ionFilename, ionSize, IonStreamData::ionSize, BoundCube::isNumericallyBig(), LAWATAP_ATO_ERR_STRINGS, LimitLoadPosFile(), limitLoadTextFile(), LoadATOFile(), loadTapsimBinFile(), loadTextData(), maxIons, ProgressData::maxStep, monitorSize, monitorTimestamp, numColumns, OPS_ENUM_ERRSTRINGS, FilterStreamData::parent, POS_ERR_STRINGS, Filter::propagateCache(), Filter::propagateStreams(), IonStreamData::r, ColourRGBAf::r(), reconParams, reconstruct3DapData(), rgbaf, ProgressData::step, ProgressData::stepName, stlStr(), stream_cast(), Filter::strongRandom, TAPSIM_ERR_STRINGS, TEXT_DELIMINATORS, TEXT_LOAD_ERR_STRINGS, TRANS, valueLabel, IonStreamData::valueType, and wantMonitor.
Referenced by getType(), and monitorNeedsRefresh().
void DataLoadFilter::setFileMode | ( | unsigned int | mode | ) |
Set the filter to either use text or pos as requested,.
References ASSERT, DATALOAD_FLOAT_FILE, DATALOAD_LAWATAP_ATO_FILE, DATALOAD_TEXT_FILE, DATALOAD_THREEDAP_OPS_FILE, FILEDATA_TYPE_3DAP_OPS, FILEDATA_TYPE_ATO, FILEDATA_TYPE_POS, FILEDATA_TYPE_TEXT, and fileType.
Referenced by filterRefreshNoOut().
void DataLoadFilter::setFilename | ( | const char * | name | ) |
Set the source string.
References guessNumColumns(), and ionFilename.
Referenced by filterRefreshNoOut(), and setProperty().
void DataLoadFilter::setFilename | ( | const std::string & | name | ) |
References guessNumColumns(), and ionFilename.
|
virtual |
Set the properties for the nth filter.
Implements Filter.
References IonStreamData::a, ColourRGBAf::a(), Filter::applyPropertyNow(), ASSERT, AVAILABLE_FILEDATA_TYPES, IonStreamData::b, ColourRGBAf::b(), Filter::cacheOK, Filter::clearCache(), DATALOAD_KEY_COLOUR, DATALOAD_KEY_DETECTIONEFFICIENCY, DATALOAD_KEY_ENABLED, DATALOAD_KEY_ENDIANNESS, DATALOAD_KEY_FILE, DATALOAD_KEY_FILETYPE, DATALOAD_KEY_IONSIZE, DATALOAD_KEY_IONVOLUME, DATALOAD_KEY_MONITOR, DATALOAD_KEY_NUMBER_OF_COLUMNS, DATALOAD_KEY_SAMPLE, DATALOAD_KEY_SCALERADIUS, DATALOAD_KEY_SELECTED_COLUMN0, DATALOAD_KEY_SELECTED_COLUMN1, DATALOAD_KEY_SELECTED_COLUMN2, DATALOAD_KEY_SELECTED_COLUMN3, DATALOAD_KEY_SIZE, DATALOAD_KEY_VALUELABEL, THREEDAP_RECON_PARAMS::detectionEfficiency, doSample, enabled, ENDIAN_MODE_ENUM_END, ENDIAN_MODE_STR, endianMode, FILEDATA_TYPE_ENUM_END, fileType, Filter::filterOutputs, IonStreamData::g, ColourRGBAf::g(), index, INDEX_LENGTH, ionSize, IonStreamData::ionSize, THREEDAP_RECON_PARAMS::ionVolume, isNotDirectory(), MAX_NUM_FILE_COLS, maxIons, numColumns, ColourRGBA::parse(), IonStreamData::r, ColourRGBAf::r(), THREEDAP_RECON_PARAMS::radiusCylinder, reconParams, rgbaf, setFilename(), stream_cast(), STREAM_TYPE_IONS, ColourRGBAf::toColourRGBA(), ColourRGBA::toRGBAf(), valueLabel, IonStreamData::valueType, and wantMonitor.
Referenced by monitorNeedsRefresh(), and typeString().
|
virtual |
Set internal property value using a selection binding (Disabled, this filter has no bindings)
Implements Filter.
References ASSERT.
Referenced by typeString().
|
inlinevirtual |
Return filter type as std::string.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), getStateOverrides(), getValueLabel(), monitorNeedsRefresh(), readState(), setProperty(), setPropFromBinding(), TRANS, writePackageState(), and writeState().
void DataLoadFilter::updatePosData | ( | ) |
|
virtual |
write an overridden filename version of the state
Reimplemented from Filter.
References ASSERT, ionFilename, and writeState().
Referenced by typeString().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ColourRGBAf::a(), ASSERT, ColourRGBAf::b(), convertFileStringToCanonical(), THREEDAP_RECON_PARAMS::detectionEfficiency, doSample, enabled, escapeXML(), fileType, ColourRGBAf::g(), index, ionFilename, ionSize, THREEDAP_RECON_PARAMS::ionVolume, maxIons, numColumns, ColourRGBAf::r(), THREEDAP_RECON_PARAMS::radiusCylinder, reconParams, rgbaf, STATE_FORMAT_XML, tabs(), Filter::trueName(), Filter::userString, valueLabel, and wantMonitor.
Referenced by typeString(), and writePackageState().
|
protected |
volume restriction bounds, not sorted
Referenced by cloneUncached(), and DataLoadFilter().
|
protected |
Whether to randomly sample dataset during load or not.
Referenced by cloneUncached(), getProperties(), numBytesForCache(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Is pos load enabled?
Referenced by cloneUncached(), getProperties(), monitorNeedsRefresh(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Endian read mode.
Referenced by getProperties(), and setProperty().
|
protected |
string to use in error situation, set during ::refresh
Referenced by getSpecificErrString(), and refresh().
|
protected |
Type of file to open.
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setFileMode(), setProperty(), and writeState().
|
protected |
index of columns into pos file, if pos data is visualised as a set of float record presented as a table (one line per record)
Referenced by cloneUncached(), DataLoadFilter(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
staticprotected |
Referenced by cloneUncached(), readState(), refresh(), and setProperty().
|
protected |
filename from which the ions are being loaded
Referenced by cloneUncached(), getProperties(), getStateOverrides(), guessNumColumns(), monitorNeedsRefresh(), numBytesForCache(), readState(), refresh(), setFilename(), writePackageState(), and writeState().
|
protected |
Default ion size (view size)
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Maximum number of ions to load, if performing sampling.
Referenced by cloneUncached(), getProperties(), numBytesForCache(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Referenced by monitorNeedsRefresh(), and refresh().
|
protected |
Referenced by monitorNeedsRefresh(), and refresh().
|
protected |
Number of columns & type of file.
Referenced by cloneUncached(), DataLoadFilter(), getProperties(), guessNumColumns(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Reconstruction parameters for OPS files.
Referenced by cloneUncached(), DataLoadFilter(), getProperties(), refresh(), setProperty(), and writeState().
|
protected |
Default ion colour vars.
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
String to use to set the value type.
Referenced by getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Volume restricted load?
Referenced by cloneUncached().
|
protected |
Referenced by cloneUncached(), getProperties(), monitorNeedsRefresh(), readState(), refresh(), setProperty(), and writeState().