6
#include "../translation.h"
14
class DataLoadFilter:public Filter
17
//!filename from which the ions are being loaded
18
std::string ionFilename;
20
//!Type of file to open
21
unsigned int fileType;
23
//!Try our best to guess the file type?
26
//!Maximum number of ions to load, 0 if ion limiting disabled
29
//!Default ion colour vars
32
//!Default ion size (view size)
35
//!Number of columns & type of file
36
unsigned int numColumns;
38
static const unsigned int INDEX_LENGTH = 4;
39
//!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)
40
unsigned int index[INDEX_LENGTH];//x,y,z,value
42
//!Is pos load enabled?
45
//!Volume restricted load?
48
//!volume restriction bounds, not sorted
51
//Epoch timestamp for the mointored file. -1 if invalid
52
time_t monitorTimestamp;
54
//File size for monitored file
57
//Do we want to be monitoring
58
//the timestamp of the file
61
//!string to use in error situation, set during ::refresh
64
//!String to use to set the value type
65
std::string valueLabel;
68
//!Duplicate filter contents, excluding cache.
69
Filter *cloneUncached() const;
70
//!Set the source string
71
void setFilename(const char *name);
72
void setFilename(const std::string &name);
73
void guessNumColumns();
75
//!Set the filter to either use text or pos as requested,
76
// this does not require exposing the file parameter key
77
void setFileMode(unsigned int mode);
79
//!Get filter type (returns FILTER_TYPE_POSLOAD)
80
unsigned int getType() const { return FILTER_TYPE_POSLOAD;};
82
//!Get (approx) number of bytes required for cache
83
virtual size_t numBytesForCache(size_t nOBjects) const;
85
//!Refresh object data
86
unsigned int refresh(const std::vector<const FilterStreamData *> &dataIn,
87
std::vector<const FilterStreamData *> &getOut,
88
ProgressData &progress, bool (*callback)(bool));
92
virtual std::string typeString() const { return std::string(TRANS("Pos Data"));}
94
//!Get the properties of the filter, in key-value form. First vector is for each output.
95
void getProperties(FilterProperties &propertyList) const;
97
//!Set the properties for the nth filter
98
bool setProperty(unsigned int set, unsigned int key, const std::string &value, bool &needUpdate);
100
//!Get the human readable error string associated with a particular error code during refresh(...)
101
std::string getErrString(unsigned int code) const;
103
//!Dump state to output stream, using specified format
104
bool writeState(std::ofstream &f,unsigned int format,
105
unsigned int depth=0) const;
107
//!write an overridden filename version of the state
108
virtual bool writePackageState(std::ofstream &f, unsigned int format,
109
const std::vector<std::string> &valueOverrides,unsigned int depth=0) const;
110
//!Read the state of the filter from XML file. If this
111
//fails, filter will be in an undefined state.
112
bool readState(xmlNodePtr &node, const std::string &packDir);
114
//!Get the block mask for this filter (bitmaks of streams blocked from propagation during ::refresh)
115
virtual unsigned int getRefreshBlockMask() const;
116
//!Get the refresh mask for this filter (bitmaks of streams emitted during ::refresh)
117
virtual unsigned int getRefreshEmitMask() const;
119
//!Pos filter has state overrides
120
virtual void getStateOverrides(std::vector<string> &overrides) const;
122
//!Set internal property value using a selection binding (Disabled, this filter has no bindings)
123
void setPropFromBinding(const SelectionBinding &b) {ASSERT(false);} ;
125
//!Get the label for the chosen value column
126
std::string getValueLabel();
128
//!Return if we need monitoring or not
129
virtual bool monitorNeedsRefresh() const;
131
//Are we a pure data source - i.e. can function with no input
132
virtual bool isPureDataSource() const { return true;};