3Depict
|
Filter to place drawing objects to help annotate. More...
#include <annotation.h>
Public Member Functions | |
AnnotateFilter () | |
Constructor. More... | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
unsigned int | refresh (const std::vector< const FilterStreamData *> &dataIn, std::vector< const FilterStreamData *> &dataOut, ProgressData &progress) |
Apply filter to new data, updating cache as needed. Vector. More... | |
size_t | numBytesForCache (size_t nObjects) const |
Get (approx) number of bytes required for cache. More... | |
unsigned int | getType () const |
return type ID More... | |
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) |
void | setPropFromBinding (const SelectionBinding &b) |
Set the binding value for a float. 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) const |
Dump state to output stream, using specified format. More... | |
bool | readState (xmlNodePtr &n, const std::string &packDir="") |
Read state from XML stream, using xml format. 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 |
Get the refresh's ignore mask - filter streams that will not be considered. More... | |
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... | |
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 void | setUserString (const std::string &str) |
Set a user-specified string return value is. 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 |
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 |
Filter to place drawing objects to help annotate.
AnnotateFilter::AnnotateFilter | ( | ) |
Constructor.
References ANNOTATION_MODE_END, ANNOTATION_TEXT, annotationModeStrings, Filter::cache, Filter::cacheOK, COMPILE_ASSERT, and THREEDEP_ARRAYSIZE.
Referenced by cloneUncached(), and setPropFromBinding().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References AnnotateFilter(), Filter::cache, Filter::cacheOK, 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(), ANNOTATION_ANGLE_MEASURE, ANNOTATION_ARROW, ANNOTATION_LINEAR_MEASURE, ANNOTATION_MODE_END, ANNOTATION_TEXT, ANNOTATION_TEXT_WITH_ARROW, annotationModeStrings, ASSERT, boolStrEnc(), choiceString(), FilterProperty::data, FilterProperty::helpText, FilterProperty::key, KEY_ACROSSVEC, KEY_ANGLE_FORMAT_STRING, KEY_ANGLE_POS_ONE, KEY_ANGLE_POS_TWO, KEY_ANGLE_POS_ZERO, KEY_ANGLE_TEXT_VISIBLE, KEY_ANNOTATE_TEXT, KEY_ARROW_SIZE, KEY_COLOUR, KEY_ENABLE, KEY_LINEAR_FIXED_TICKS, KEY_LINEAR_FONTSIZE, KEY_LINEAR_NUMTICKS, KEY_LINEAR_TICKSPACING, KEY_LINESIZE, KEY_MODE, KEY_POSITION, KEY_REFLEXIVE, KEY_SPHERE_ANGLE_SIZE, KEY_TARGET, KEY_TEXTSIZE, KEY_UPVEC, FilterProperty::name, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_POINT3D, PROPERTY_TYPE_REAL, PROPERTY_TYPE_STRING, ColourRGBA::rgbString(), FilterPropGroup::setGroupTitle(), stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, and FilterProperty::type.
Referenced by typeString().
|
virtual |
Get the bitmask encoded list of filterStreams that this filter blocks from propagation.
Implements Filter.
Referenced by typeString().
|
virtual |
Get the bitmask encoded list of filterstreams that this filter emits from ::refresh.
Implements Filter.
References STREAM_TYPE_DRAW.
Referenced by typeString().
|
virtual |
Get the refresh's ignore mask - filter streams that will not be considered.
Implements Filter.
Referenced by typeString().
|
virtual |
Get the human readable error string associated with a particular error code during refresh(...)
Implements Filter.
References ASSERT.
Referenced by typeString().
|
inlinevirtual |
|
inlinevirtual |
Reimplemented from Filter.
|
virtual |
Get (approx) number of bytes required for cache.
Implements Filter.
|
virtual |
Read state from XML stream, using xml format.
Implements Filter.
References ANNOTATION_MODE_END, boolStrDec(), Point3D::orthogonalise(), Point3D::parse(), ColourRGBA::parse(), ColourRGBA::toRGBAf(), Filter::userString, XMLGetAttrib(), XMLGetNextElemAttrib(), and XMLHelpFwdToElem().
Referenced by typeString().
|
virtual |
Apply filter to new data, updating cache as needed. Vector.
Implements Filter.
References ColourRGBAf::a(), SelectionDevice::addBinding(), Point3D::angle(), ANNOTATION_ANGLE_MEASURE, ANNOTATION_ARROW, ANNOTATION_LINEAR_MEASURE, ANNOTATION_TEXT, ANNOTATION_TEXT_WITH_ARROW, ColourRGBAf::b(), BIND_MODE_FLOAT_TRANSLATE, BIND_MODE_POINT3D_TRANSLATE, BINDING_ANGLE_ORIGIN, BINDING_ANGLE_SPHERERADIUS, BINDING_ARROW_ORIGIN, BINDING_ARROW_VECTOR, BINDING_LINEAR_ORIGIN, BINDING_LINEAR_SPHERERADIUS, BINDING_LINEAR_TARGET, BINDING_TEXT_ORIGIN, FilterStreamData::cached, DrawableObj::canSelect, Filter::clearDevices(), Filter::devices, Point3D::dotProd(), DRAW_SPHERE_BIND_ORIGIN, DRAW_SPHERE_BIND_RADIUS, DRAW_TEXT_BIND_ORIGIN, DRAW_VECTOR_BIND_ORIGIN, DRAW_VECTOR_BIND_TARGET, DrawStreamData::drawables, DRAWTEXT_ALIGN_CENTRE, ProgressData::filterProgress, FLAG_SHIFT, FTGL_POLYGON, ColourRGBAf::g(), getDefaultFontFile(), DrawVector::getOrigin(), DrawGLText::getOrigin(), DrawSphere::getRadius(), DrawVector::getVector(), M_PI, ProgressData::maxStep, Point3D::negate(), Point3D::normalise(), FilterStreamData::parent, Filter::propagateStreams(), ColourRGBAf::r(), SELECT_BUTTON_LEFT, DrawGLText::setAlignment(), DrawVector::setArrowSize(), SelectionBinding::setBinding(), DrawVector::setColour(), DrawSphere::setColour(), DrawGLText::setColour(), DrawVector::setDrawArrow(), SelectionBinding::setFloatLimits(), SelectionBinding::setInteractionMode(), DrawVector::setLineSize(), DrawVector::setOrigin(), DrawSphere::setOrigin(), DrawGLText::setOrigin(), DrawSphere::setRadius(), DrawGLText::setSize(), DrawGLText::setString(), DrawGLText::setTextDir(), DrawGLText::setUp(), DrawVector::setVector(), Point3D::sqrDist(), Point3D::sqrMag(), ProgressData::step, ProgressData::stepName, stream_cast(), tickSpacingsFromFixedNum(), tickSpacingsFromInterspace(), TRANS, and DrawableObj::wantsLight.
Referenced by setPropFromBinding().
|
virtual |
Set the properties for the nth filter, needUpdate tells us if filter output changes due to property set
Implements Filter.
References ANNOTATION_MODE_END, annotationModeStrings, Filter::applyPropertyNow(), ASSERT, Point3D::crossProd(), KEY_ACROSSVEC, KEY_ANGLE_FORMAT_STRING, KEY_ANGLE_POS_ONE, KEY_ANGLE_POS_TWO, KEY_ANGLE_POS_ZERO, KEY_ANGLE_TEXT_VISIBLE, KEY_ANNOTATE_TEXT, KEY_ARROW_SIZE, KEY_COLOUR, KEY_ENABLE, KEY_LINEAR_FIXED_TICKS, KEY_LINEAR_FONTSIZE, KEY_LINEAR_NUMTICKS, KEY_LINEAR_TICKSPACING, KEY_LINESIZE, KEY_MODE, KEY_POSITION, KEY_REFLEXIVE, KEY_SPHERE_ANGLE_SIZE, KEY_TARGET, KEY_TEXTSIZE, KEY_UPVEC, Point3D::normalise(), Point3D::parse(), ColourRGBA::parse(), Point3D::sqrMag(), stream_cast(), stripWhite(), ColourRGBA::toRGBAf(), and TRANS.
Referenced by setPropFromBinding(), and typeString().
|
virtual |
Set the binding value for a float.
Implements Filter.
References AnnotateFilter(), ANNOTATION_ANGLE_MEASURE, ANNOTATION_ARROW, ANNOTATION_LINEAR_MEASURE, ANNOTATION_TEXT_WITH_ARROW, annotationModeStrings, ASSERT, BINDING_ANGLE_FIRST, BINDING_ANGLE_ORIGIN, BINDING_ANGLE_SECOND, BINDING_ANGLE_SPHERERADIUS, BINDING_ARROW_ORIGIN, BINDING_ARROW_VECTOR, BINDING_LINEAR_ORIGIN, BINDING_LINEAR_TARGET, BINDING_TEXT_ORIGIN, DRAW_TYPE_GLTEXT, DRAW_TYPE_SPHERE, DRAW_TYPE_VECTOR, DrawStreamData::drawables, SelectionBinding::getID(), DrawVector::getOrigin(), SelectionBinding::getValue(), KEY_ANGLE_POS_ONE, KEY_ANGLE_POS_TWO, KEY_ANGLE_POS_ZERO, KEY_LINEAR_TICKSPACING, KEY_MODE, KEY_POSITION, KEY_TARGET, refresh(), Filter::setCaching(), setProperty(), stream_cast(), STREAM_TYPE_DRAW, TEST, and TRANS.
Referenced by typeString().
|
inlinevirtual |
Return filter type as std::string.
Implements Filter.
References getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getSpecificErrString(), readState(), setProperty(), setPropFromBinding(), TRANS, and writeState().
|
virtual |
Dump state to output stream, using specified format.
Implements Filter.
References ASSERT, escapeXML(), ColourRGBA::rgbaString(), STATE_FORMAT_XML, tabs(), ColourRGBAf::toColourRGBA(), Filter::trueName(), and Filter::userString.
Referenced by typeString().