3Depict
|
Ion spatial clipping filter. More...
#include <ionClip.h>
Public Member Functions | |
IonClipFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
unsigned int | getType () const |
Returns FILTER_TYPE_IONCLIP. 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 human readable name for filter. 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... | |
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. 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 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 |
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) |
Protected Attributes | |
unsigned int | primitiveType |
Number explaining basic primitive type. More... | |
bool | invertedClip |
Whether to reverse the clip. True means that the interior is excluded. More... | |
bool | showPrimitive |
Whether to show the primitive or not. More... | |
std::vector< Point3D > | vectorParams |
Vector paramaters for different primitives. More... | |
std::vector< float > | scalarParams |
Scalar paramaters for different primitives. More... | |
bool | lockAxisMag |
![]() | |
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... | |
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) |
![]() | |
static bool | strongRandom = false |
Ion spatial clipping filter.
IonClipFilter::IonClipFilter | ( | ) |
References COMPILE_ASSERT, PRIMITIVE_END, PRIMITIVE_NAMES, THREEDEP_ARRAYSIZE, and vectorParams.
Referenced by cloneUncached(), and setPropFromBinding().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, invertedClip, IonClipFilter(), lockAxisMag, primitiveType, scalarParams, showPrimitive, Filter::userString, and vectorParams.
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References FilterPropGroup::addProperty(), ASSERT, boolStrEnc(), choiceString(), invertedClip, KEY_AXIS_LOCKMAG, KEY_CORNER, KEY_NORMAL, KEY_ORIGIN, KEY_PRIMITIVE_INVERTCLIP, KEY_PRIMITIVE_SHOW, KEY_PRIMITIVE_TYPE, KEY_RADIUS, lockAxisMag, PRIMITIVE_AAB, PRIMITIVE_CYLINDER, PRIMITIVE_PLANE, PRIMITIVE_SPHERE, primitiveStringFromID(), primitiveType, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_POINT3D, PROPERTY_TYPE_REAL, scalarParams, FilterPropGroup::setGroupTitle(), showPrimitive, stream_cast(), TRANS, and vectorParams.
Referenced by typeString().
|
virtual |
Get the stream types that will be dropped during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS.
Referenced by typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References showPrimitive, STREAM_TYPE_DRAW, and STREAM_TYPE_IONS.
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, IONCLIP_ERR_ENUM_END, and THREEDEP_ARRAYSIZE.
Referenced by typeString().
|
inlinevirtual |
Returns FILTER_TYPE_IONCLIP.
Implements Filter.
References FILTER_TYPE_IONCLIP, numBytesForCache(), and refresh().
|
virtual |
Get approx number of bytes for caching output.
Implements Filter.
References IONDATA_SIZE.
Referenced by getType().
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References ASSERT, boolStrDec(), invertedClip, lockAxisMag, PRIMITIVE_AAB, PRIMITIVE_CYLINDER, PRIMITIVE_END, PRIMITIVE_PLANE, PRIMITIVE_SPHERE, primitiveType, readScalarsXML(), readVectorsXML(), scalarParams, showPrimitive, Filter::userString, vectorParams, XMLGetNextElemAttrib(), and XMLHelpFwdToElem().
Referenced by typeString().
|
virtual |
update filter
Implements Filter.
References IonStreamData::a, SelectionDevice::addBinding(), ASSERT, IonStreamData::b, BAD_ALLOC, BIND_MODE_FLOAT_TRANSLATE, BIND_MODE_POINT3D_ROTATE, BIND_MODE_POINT3D_ROTATE_LOCK, BIND_MODE_POINT3D_SCALE, BIND_MODE_POINT3D_TRANSLATE, BINDING_CYLINDER_DIRECTION, BINDING_CYLINDER_ORIGIN, BINDING_CYLINDER_RADIUS, BINDING_PLANE_DIRECTION, BINDING_PLANE_ORIGIN, BINDING_RECT_CORNER_MOVE, BINDING_RECT_TRANSLATE, BINDING_SPHERE_ORIGIN, BINDING_SPHERE_RADIUS, Filter::cacheAsNeeded(), FilterStreamData::cached, Filter::cacheOK, CALLBACK_FAIL, DrawableObj::canSelect, Filter::clearDevices(), CROP_AAB_INSIDE, CROP_AAB_OUTSIDE, CROP_CYLINDER_INSIDE_AXIAL, CROP_CYLINDER_OUTSIDE, CROP_PLANE_BACK, CROP_PLANE_FRONT, CROP_SPHERE_INSIDE, CROP_SPHERE_OUTSIDE, IonStreamData::data, Filter::devices, DRAW_CYLINDER_BIND_DIRECTION, DRAW_CYLINDER_BIND_ORIGIN, DRAW_CYLINDER_BIND_RADIUS, DRAW_FLAT, DRAW_RECT_BIND_CORNER_MOVE, DRAW_RECT_BIND_TRANSLATE, DRAW_SPHERE_BIND_ORIGIN, DRAW_SPHERE_BIND_RADIUS, DRAW_VECTOR_BIND_ORIENTATION, DrawStreamData::drawables, Filter::filterOutputs, ProgressData::filterProgress, FLAG_CMD, FLAG_SHIFT, IonStreamData::g, DrawSphere::getOrigin(), DrawSphere::getRadius(), DrawVector::getVector(), invertedClip, IonStreamData::ionSize, lockAxisMag, numElements(), FilterStreamData::parent, PRIMITIVE_AAB, PRIMITIVE_CYLINDER, PRIMITIVE_PLANE, PRIMITIVE_SPHERE, primitiveType, IonStreamData::r, CropHelper::runFilter(), scalarParams, SELECT_BUTTON_LEFT, SELECT_BUTTON_MIDDLE, SELECT_BUTTON_RIGHT, DrawRectPrism::setAxisAligned(), SelectionBinding::setBinding(), DrawSphere::setColour(), SelectionBinding::setFloatLimits(), SelectionBinding::setInteractionMode(), DrawSphere::setLatSegments(), DrawSphere::setLongSegments(), DrawVector::setOrigin(), DrawSphere::setOrigin(), DrawCylinder::setOrigin(), DrawSphere::setRadius(), DrawVector::setVector(), showPrimitive, STREAM_TYPE_IONS, vectorParams, and DrawableObj::wantsLight.
Referenced by getType(), and setPropFromBinding().
|
virtual |
Set the properties for the nth filter. Returns true if prop set OK.
Implements Filter.
References Filter::applyPropertyNow(), ASSERT, Filter::clearCache(), invertedClip, KEY_AXIS_LOCKMAG, KEY_CORNER, KEY_NORMAL, KEY_ORIGIN, KEY_PRIMITIVE_INVERTCLIP, KEY_PRIMITIVE_SHOW, KEY_PRIMITIVE_TYPE, KEY_RADIUS, lockAxisMag, Point3D::normalise(), PRIMITIVE_AAB, PRIMITIVE_CYLINDER, PRIMITIVE_PLANE, PRIMITIVE_SPHERE, primitiveID(), primitiveType, scalarParams, showPrimitive, and vectorParams.
Referenced by setPropFromBinding(), and typeString().
|
virtual |
Set internal property value using a selection binding.
Implements Filter.
References ASSERT, BINDING_CYLINDER_DIRECTION, BINDING_CYLINDER_ORIGIN, BINDING_CYLINDER_RADIUS, BINDING_PLANE_DIRECTION, BINDING_PLANE_ORIGIN, BINDING_RECT_CORNER_MOVE, BINDING_RECT_TRANSLATE, BINDING_SPHERE_ORIGIN, BINDING_SPHERE_RADIUS, Filter::clearCache(), BoundCube::containsPt(), IonStreamData::data, Point3D::dotProd(), BoundCube::expand(), DrawCylinder::getBoundingBox(), SelectionBinding::getID(), SelectionBinding::getValue(), IonClipFilter(), KEY_CORNER, KEY_NORMAL, KEY_ORIGIN, KEY_PRIMITIVE_INVERTCLIP, KEY_PRIMITIVE_SHOW, KEY_PRIMITIVE_TYPE, KEY_RADIUS, Point3D::normalise(), PRIMITIVE_AAB, PRIMITIVE_CYLINDER, PRIMITIVE_PLANE, PRIMITIVE_SPHERE, primitiveStringFromID(), refresh(), scalarParams, BoundCube::setBounds(), Filter::setCaching(), DrawCylinder::setDirection(), DrawCylinder::setLength(), IonHit::setMassToCharge(), DrawCylinder::setOrigin(), IonHit::setPos(), setProperty(), DrawCylinder::setRadius(), Point3D::sqrDist(), Point3D::sqrMag(), stream_cast(), STREAM_TYPE_IONS, TEST, and vectorParams.
Referenced by typeString().
|
inlinevirtual |
Return human readable name for filter.
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(), invertedClip, lockAxisMag, primitiveType, scalarParams, showPrimitive, STATE_FORMAT_XML, tabs(), Filter::trueName(), Filter::userString, vectorParams, writeScalarsXML(), and writeVectorsXML().
Referenced by typeString().
|
protected |
Whether to reverse the clip. True means that the interior is excluded.
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Number explaining basic primitive type.
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Scalar paramaters for different primitives.
Referenced by cloneUncached(), getProperties(), readState(), refresh(), setProperty(), setPropFromBinding(), and writeState().
|
protected |
Whether to show the primitive or not.
Referenced by cloneUncached(), getProperties(), getRefreshEmitMask(), readState(), refresh(), setProperty(), and writeState().
|
protected |
Vector paramaters for different primitives.
Referenced by cloneUncached(), getProperties(), IonClipFilter(), readState(), refresh(), setProperty(), setPropFromBinding(), and writeState().