3Depict
|
Filter that does voxelisation for various primitives (copied from CompositionFilter) More...
#include <voxelise.h>
Public Member Functions | |
VoxeliseFilter () | |
~VoxeliseFilter () | |
Filter * | cloneUncached () const |
Duplicate filter contents, excluding cache. More... | |
virtual void | clearCache () |
Erase cache. More... | |
size_t | numBytesForCache (size_t nObjects) const |
Get approx number of bytes for caching output. More... | |
unsigned int | getType () const |
return type ID 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... | |
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... | |
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 ued during ::refresh. More... | |
void | setPropFromBinding (const SelectionBinding &b) |
Set internal property value using a selection binding. More... | |
void | calculateWidthsFromNumBins (Point3D &widths, unsigned long long *nb) const |
calculate the widths of the bins in 3D More... | |
void | calculateNumBinsFromWidths (Point3D &widths, unsigned long long *nb) const |
set the number of the bins in 3D More... | |
![]() | |
Filter () | |
virtual | ~Filter () |
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 | 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) |
Static Public Member Functions | |
static std::string | getNormaliseTypeString (int type) |
Get the human-readable options for the normalisation, based upon enum. More... | |
static std::string | getFilterTypeString (int type) |
Get the human-readable options for filtering, based upon enum. More... | |
static std::string | getRepresentTypeString (int type) |
Get the human-readable options for the visual representation (enum) More... | |
static std::string | getFilterBoundTypeString (int type) |
Get the human-readable options for boundary behaviour during filtering, based upon enum. More... | |
![]() | |
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) |
Additional Inherited Members | |
![]() | |
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 that does voxelisation for various primitives (copied from CompositionFilter)
VoxeliseFilter::VoxeliseFilter | ( | ) |
References Filter::cache, Filter::cacheOK, calculateWidthsFromNumBins(), COLOURMAP_VIRIDIS, COMPILE_ASSERT, Point3D::normalise(), NORMALISE_TYPE_STRING, REPRESENTATION_TYPE_STRING, BoundCube::setBounds(), THREEDEP_ARRAYSIZE, VOX_INTERP_NONE, VOXEL_REPRESENT_END, VOXEL_REPRESENT_KEEPCACHE, VOXEL_REPRESENT_POINTCLOUD, VOXELISE_FILTER_TYPE_STRING, VOXELISE_FILTERTYPE_MAX, VOXELISE_FILTERTYPE_NONE, and VOXELISE_NORMALISETYPE_MAX.
Referenced by cloneUncached(), and getRefreshUseMask().
|
inline |
References clearCache(), cloneUncached(), and numBytesForCache().
|
inline |
set the number of the bins in 3D
References BoundCube::getBounds().
Referenced by refresh(), and setProperty().
|
inline |
calculate the widths of the bins in 3D
References BoundCube::getBounds().
Referenced by refresh(), setProperty(), and VoxeliseFilter().
|
virtual |
Erase cache.
Reimplemented from Filter.
References Voxels< T >::clear(), and Filter::clearCache().
Referenced by setProperty(), and ~VoxeliseFilter().
|
virtual |
Duplicate filter contents, excluding cache.
Implements Filter.
References Filter::cache, Filter::cacheOK, Filter::userString, and VoxeliseFilter().
Referenced by ~VoxeliseFilter().
|
static |
Get the human-readable options for boundary behaviour during filtering, based upon enum.
Referenced by typeString().
|
static |
Get the human-readable options for filtering, based upon enum.
References ASSERT, TRANS, VOXELISE_FILTER_TYPE_STRING, and VOXELISE_FILTERTYPE_MAX.
Referenced by getProperties(), setProperty(), and typeString().
|
static |
Get the human-readable options for the normalisation, based upon enum.
References ASSERT, NORMALISE_TYPE_STRING, TRANS, and VOXELISE_NORMALISETYPE_MAX.
Referenced by getProperties(), setProperty(), and typeString().
|
virtual |
Get the properties of the filter, in key-value form. First vector is for each output.
Implements Filter.
References ColourRGBAf::a(), FilterPropGroup::addProperty(), ASSERT, boolStrEnc(), choiceString(), COLOURMAP_ENUM_END, FilterProperty::data, RangeStreamData::enabledIons, getColourMapName(), getFilterTypeString(), RangeFile::getName(), getNormaliseTypeString(), getRepresentTypeString(), FilterProperty::helpText, FilterProperty::key, KEY_COLOUR, KEY_ENABLE_DENOMINATOR, KEY_ENABLE_NUMERATOR, KEY_FILTER_MODE, KEY_FILTER_RATIO, KEY_FILTER_STDEV, KEY_FIXEDWIDTH, KEY_ISOLEVEL, KEY_MAPEND, KEY_MAPSTART, KEY_NBINSX, KEY_NBINSY, KEY_NBINSZ, KEY_NORMALISE_TYPE, KEY_SHOW_COLOURBAR, KEY_SPOTSIZE, KEY_TRANSPARENCY, KEY_VOXEL_COLOURMODE, KEY_VOXEL_REPRESENTATION_MODE, KEY_VOXEL_SLICE_AXIS, KEY_VOXEL_SLICE_COLOURAUTO, KEY_VOXEL_SLICE_INTERP, KEY_VOXEL_SLICE_NORMAL3D, KEY_VOXEL_SLICE_OFFSET, KEY_VOXEL_SLICE_OFFSET3D, KEY_WIDTHBINSX, KEY_WIDTHBINSY, KEY_WIDTHBINSZ, Filter::muxKey(), FilterProperty::name, PROPERTY_TYPE_BOOL, PROPERTY_TYPE_CHOICE, PROPERTY_TYPE_COLOUR, PROPERTY_TYPE_INTEGER, PROPERTY_TYPE_POINT3D, PROPERTY_TYPE_REAL, RangeStreamData::rangeFile, ColourRGBA::rgbString(), FilterPropGroup::setGroupTitle(), stream_cast(), ColourRGBAf::toColourRGBA(), TRANS, FilterProperty::type, VOX_INTERP_ENUM_END, VOXEL_REPRESENT_AXIAL_SLICE, VOXEL_REPRESENT_END, VOXEL_REPRESENT_ISOSURF, VOXEL_REPRESENT_POINTCLOUD, VOXEL_REPRESENT_SLICE, VOXELISE_FILTERTYPE_MAX, VOXELISE_FILTERTYPE_NONE, VOXELISE_NORMALISETYPE_ALLATOMSINVOXEL, VOXELISE_NORMALISETYPE_COUNT2INVOXEL, VOXELISE_NORMALISETYPE_NONE, VOXELISE_NORMALISETYPE_VOLUME, and VOXELISE_SLICE_INTERP_STRING.
Referenced by typeString().
|
virtual |
Get the stream types that will be dropped during ::refresh.
Implements Filter.
References STREAM_TYPE_IONS, STREAM_TYPE_PLOT, and STREAM_TYPE_VOXEL.
Referenced by refresh(), and typeString().
|
virtual |
Get the stream types that will be generated during ::refresh.
Implements Filter.
References STREAM_TYPE_DRAW, and STREAM_TYPE_VOXEL.
Referenced by typeString().
|
virtual |
Get the stream types that will be possibly ued during ::refresh.
Implements Filter.
References RangeFile::addIon(), RangeFile::addRange(), ASSERT, RGBf::blue, colourMapWrap(), IonStreamData::data, VoxelStreamData::data, RangeStreamData::enabledIons, RangeStreamData::enabledRanges, Voxels< T >::getAxisBounds(), Voxels< T >::getBounds(), Voxels< T >::getData(), Voxels< T >::getInterpSlice(), RangeFile::getNumIons(), RangeFile::getNumRanges(), Voxels< T >::getSize(), RGBf::green, initFilter(), KEY_NBINSX, KEY_NBINSY, KEY_NBINSZ, KEY_NORMALISE_TYPE, Voxels< T >::max(), maxValue(), Voxels< T >::min(), minValue(), NORMALISE_TYPE_STRING, RangeStreamData::rangeFile, RGBf::red, refresh(), DrawTexturedQuad::resize(), rotate3(), Filter::setCaching(), DrawTexturedQuad::setData(), setProperty(), DrawQuad::setVertices(), stream_cast(), STREAM_TYPE_IONS, STREAM_TYPE_RANGE, STREAM_TYPE_VOXEL, sumVoxels(), TEST, TRANS, VOXELISE_NORMALISETYPE_ALLATOMSINVOXEL, and VoxeliseFilter().
Referenced by typeString().
|
static |
Get the human-readable options for the visual representation (enum)
References ASSERT, REPRESENTATION_TYPE_STRING, TRANS, and VOXEL_REPRESENT_END.
Referenced by getProperties(), setProperty(), and typeString().
|
virtual |
Get the human readable error string associated with a particular error code during refresh(...)
Implements Filter.
References ASSERT, COMPILE_ASSERT, THREEDEP_ARRAYSIZE, and VOXELISE_ERR_ENUM_END.
Referenced by typeString().
|
inlinevirtual |
|
virtual |
Initialise the filter's internal state using limited filter stream data propagation.
Reimplemented from Filter.
References RangeFile::getNumIons(), RangeStreamData::rangeFile, STREAM_TYPE_RANGE, VOXELISE_NORMALISETYPE_ALLATOMSINVOXEL, VOXELISE_NORMALISETYPE_COUNT2INVOXEL, and VOXELISE_NORMALISETYPE_NONE.
Referenced by getRefreshUseMask(), and getType().
|
virtual |
Get approx number of bytes for caching output.
Implements Filter.
Referenced by ~VoxeliseFilter().
|
virtual |
Read the state of the filter from XML file. If this.
Implements Filter.
References boolStrDec(), COLOURMAP_JET, parseXMLColour(), splitStrsRef(), stream_cast(), Filter::userString, VOX_INTERP_ENUM_END, VOXEL_REPRESENT_END, VOXELISE_NORMALISETYPE_MAX, XMLGetAttrib(), XMLGetNextElemAttrib(), and XMLHelpFwdToElem().
Referenced by typeString().
|
virtual |
update filter
Implements Filter.
References VoxelStreamData::a, ColourRGBAf::a(), SelectionDevice::addBinding(), ASSERT, VoxelStreamData::b, ColourRGBAf::b(), BIND_MODE_POINT3D_ROTATE, BIND_MODE_POINT3D_TRANSLATE, BINDING_PLANE_DIRECTION, BINDING_PLANE_ORIGIN, Filter::cache, FilterStreamData::cached, Filter::cacheOK, Voxels< T >::calculateDensity(), calculateNumBinsFromWidths(), calculateWidthsFromNumBins(), DrawableObj::canSelect, Voxels< T >::clear(), colourMapWrap(), Filter::consoleOutput, countPoints(), IonStreamData::data, VoxelStreamData::data, Filter::devices, do2DDelaunay(), DRAW_QUAD_BIND_ORIGIN, DRAW_TRIMESH_BIND_ORIGIN, DRAW_VECTOR_BIND_ORIENTATION, DrawStreamData::drawables, BoundCube::expand(), Voxels< T >::fill(), Filter::filterOutputs, ProgressData::filterProgress, VoxelStreamData::g, ColourRGBAf::g(), IonHit::getBoundCube(), DrawTriangleMesh::getBoundingBox(), Voxels< T >::getBounds(), BoundCube::getBounds(), BoundCube::getCentroid(), Voxels< T >::getInterpolatedData(), RangeFile::getIonID(), Filter::getIonstreamIonID(), IonStreamData::getNumBasicObjects(), DrawQuad::getOrigin(), Voxels< T >::getPitch(), BoundCube::getPlaneIntersectVertices(), getRefreshBlockMask(), Voxels< T >::getSize(), getTotalSizeByType(), Voxels< T >::init(), RandNumGen::initTimer(), BoundCube::isFlat(), VoxelStreamData::isoLevel, Voxels< T >::isotropicGaussianSmooth(), BoundCube::isValid(), Voxels< T >::laplaceOfGaussian(), M_PI, makeColourBar(), ProgressData::maxStep, Voxels< T >::minMax(), FilterStreamData::parent, Filter::propagateCache(), Filter::propagateStreams(), VoxelStreamData::r, ColourRGBAf::r(), RangeStreamData::rangeFile, VoxelStreamData::representationType, scatterPointsInPolygon(), SELECT_BUTTON_LEFT, DrawTriangleMesh::setAlpha(), SelectionBinding::setBinding(), BoundCube::setBounds(), DrawQuad::setColour(), DrawTriangleMesh::setData(), SelectionBinding::setFloatLimits(), SelectionBinding::setInteractionMode(), BoundCube::setInverseLimits(), DrawVector::setOrigin(), DrawVector::setVector(), VoxelStreamData::splatSize, ProgressData::step, ProgressData::stepName, stream_cast(), STREAM_TYPE_IONS, TRANS, VOXEL_REPRESENT_AXIAL_SLICE, VOXEL_REPRESENT_ISOSURF, VOXEL_REPRESENT_POINTCLOUD, VOXEL_REPRESENT_SLICE, VOXELISE_ABORT_ERR, VOXELISE_BOUNDS_INVALID_ERR, VOXELISE_FILTERTYPE_GAUSS, VOXELISE_FILTERTYPE_LAPLACE, VOXELISE_FILTERTYPE_NONE, VOXELISE_NORMALISETYPE_ALLATOMSINVOXEL, VOXELISE_NORMALISETYPE_COUNT2INVOXEL, VOXELISE_NORMALISETYPE_VOLUME, Filter::wantAbort, and DrawableObj::wantsLight.
Referenced by getRefreshUseMask(), and getType().
|
virtual |
Set the properties for the nth filter. Returns true if prop set OK.
Implements Filter.
References VoxelStreamData::a, ColourRGBAf::a(), Filter::applyPropertyNow(), ASSERT, VoxelStreamData::b, ColourRGBAf::b(), boolStrDec(), Filter::cacheOK, calculateNumBinsFromWidths(), calculateWidthsFromNumBins(), clearCache(), Filter::clearCache(), COLOURMAP_ENUM_END, Filter::demuxKey(), Filter::filterOutputs, VoxelStreamData::g, ColourRGBAf::g(), getColourMapName(), getFilterTypeString(), getNormaliseTypeString(), getRepresentTypeString(), VoxelStreamData::isoLevel, KEY_COLOUR, KEY_ENABLE_DENOMINATOR, KEY_ENABLE_NUMERATOR, KEY_FILTER_MODE, KEY_FILTER_RATIO, KEY_FILTER_STDEV, KEY_FIXEDWIDTH, KEY_ISOLEVEL, KEY_MAPEND, KEY_MAPSTART, KEY_NBINSX, KEY_NBINSY, KEY_NBINSZ, KEY_NORMALISE_TYPE, KEY_SHOW_COLOURBAR, KEY_SPOTSIZE, KEY_TRANSPARENCY, KEY_VOXEL_COLOURMODE, KEY_VOXEL_REPRESENTATION_MODE, KEY_VOXEL_SLICE_AXIS, KEY_VOXEL_SLICE_COLOURAUTO, KEY_VOXEL_SLICE_INTERP, KEY_VOXEL_SLICE_NORMAL3D, KEY_VOXEL_SLICE_OFFSET, KEY_VOXEL_SLICE_OFFSET3D, KEY_WIDTHBINSX, KEY_WIDTHBINSY, KEY_WIDTHBINSZ, ColourRGBA::parse(), VoxelStreamData::r, ColourRGBAf::r(), VoxelStreamData::representationType, VoxelStreamData::splatSize, stream_cast(), ColourRGBA::toRGBAf(), TRANS, VOX_INTERP_ENUM_END, VOXEL_REPRESENT_END, VOXEL_REPRESENT_KEEPCACHE, VOXELISE_FILTERTYPE_MAX, VOXELISE_NORMALISETYPE_MAX, and VOXELISE_SLICE_INTERP_STRING.
Referenced by getRefreshUseMask(), and typeString().
|
virtual |
Set internal property value using a selection binding.
Implements Filter.
References ASSERT, BINDING_PLANE_DIRECTION, BINDING_PLANE_ORIGIN, BoundCube::getBound(), BoundCube::getBounds(), SelectionBinding::getID(), SelectionBinding::getValue(), BoundCube::isValid(), Point3D::normalise(), VOXEL_REPRESENT_AXIAL_SLICE, and VOXEL_REPRESENT_SLICE.
Referenced by typeString().
|
inlinevirtual |
Return filter type as std::string.
Implements Filter.
References getFilterBoundTypeString(), getFilterTypeString(), getNormaliseTypeString(), getProperties(), getRefreshBlockMask(), getRefreshEmitMask(), getRefreshUseMask(), getRepresentTypeString(), getSpecificErrString(), readState(), setProperty(), setPropFromBinding(), 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().