3Depict
|
Tree of filters, which link together to perform an analysis. More...
#include <filtertree.h>
Public Member Functions | |
FilterTree () | |
~FilterTree () | |
FilterTree (const FilterTree &orig) | |
void | swap (FilterTree &) |
const FilterTree & | operator= (const FilterTree &orig) |
tree< Filter * >::pre_order_iterator | depthBegin () const |
tree< Filter * >::pre_order_iterator | depthEnd () const |
size_t | maxDepth () const |
size_t | depth (const tree< Filter *>::pre_order_iterator &it) const |
const tree< Filter * > & | getTree () const |
size_t | size () const |
Return the number of filters. More... | |
void | clear () |
Remove all tree contents. More... | |
bool | contains (const Filter *f) const |
void | initFilterTree () const |
Run the initialisation stage of the filter processing. More... | |
bool | setFilterProperty (Filter *f, unsigned int key, const std::string &value, bool &needUpdate) |
unsigned int | refreshFilterTree (std::list< FILTER_OUTPUT_DATA > &outData, std::vector< SelectionDevice *> &devices, std::vector< std::pair< const Filter *, std::string > > &consoleMessages, ProgressData &curProg, ATOMIC_BOOL &abortRefresh) const |
Refresh the entire filter tree. Whilst this is public, great care must be taken in. More... | |
void | getAccumulatedPropagationMaps (std::map< Filter *, size_t > &emitTypes, std::map< Filter *, size_t > &blockTypes) const |
compute the integrated (accumulated) propagation maps for emission and blocking. More... | |
bool | isRefreshing () const |
unsigned int | loadXML (const xmlNodePtr &treeParent, std::ostream &errStream, const std::string &stateDir) |
function for the loading of a filter tree from its XML representation More... | |
bool | saveXML (std::ofstream &f, std::map< std::string, std::string > &fileMapping, bool writePackage, bool useRelativePaths, unsigned int minTabDepth=0) const |
void | serialiseToStringPaths (std::map< const Filter *, std::string > &serialisedPaths) const |
Convert tree to a series of flat strings representing the topology. More... | |
void | serialiseToStringPaths (std::map< std::string, const Filter *> &serialisedPaths) const |
void | removeSubtree (Filter *f) |
Remove an element and all sub elements from the tree,. More... | |
void | addFilter (Filter *f, const Filter *parent) |
Add a new filter to the tree. Note that pointer will be released. More... | |
void | addFilterTree (FilterTree &f, const Filter *parent) |
Add a new tree as a subtree to a node. More... | |
bool | reparentFilter (Filter *f, const Filter *newParent) |
Move a branch of the tree to a new position. More... | |
bool | copyFilter (Filter *id, const Filter *newParent) |
Duplicate a branch of the tree to a new position. Do not copy cache,. More... | |
void | cloneSubtree (FilterTree &f, const Filter *targetFilt) const |
Obtain a copy of the filters from the specified subtree,. More... | |
bool | respliceFilter (Filter *toMove, const Filter *newParent) |
Move a filter from one point in the tree to another, with the. More... | |
bool | setFilterString (Filter *, const std::string &s) |
Set the filter user text. More... | |
void | clearCache (const Filter *filt, bool includeSelf=true) |
Invalidate the cache of a given Filter and all its children. More... | |
void | clearCacheByType (unsigned int type) |
Invalidate the cache of a given type of filter. More... | |
void | getFiltersByType (std::vector< const Filter *> &filters, unsigned int type) const |
Return all of a given type of filter from the filter tree. Type must be the exact type of filter - it is not a mask. More... | |
void | removeHazardousContents () |
Make the filter system safe (non-hazardous) More... | |
void | stripHazardousContents () |
Used to remove potentially hazardous filters. More... | |
bool | hasHazardousContents () const |
return true if the tree contains hazardous filters More... | |
void | purgeCache () |
Force a wipe of all caches in the filter tree. More... | |
bool | hasStateOverrides () const |
bool | hasUpdates () const |
void | setCachePercent (unsigned int newCache) |
void | modifyRangeFiles (const std::map< const RangeFile *, const RangeFile *> &toModify) |
size_t | cacheCount (unsigned int typeMask=STREAMTYPE_MASK_ALL) const |
Static Public Member Functions | |
static std::string | getRefreshErrString (unsigned int errCode) |
static void | safeDeleteFilterList (std::list< FILTER_OUTPUT_DATA > &outData, size_t typeMask=STREAMTYPE_MASK_ALL, bool maskPrevents=false) |
Safely delete data generated by refreshFilterTree(...). More... | |
Tree of filters, which link together to perform an analysis.
FilterTree::FilterTree | ( | ) |
References CACHE_DEPTH_FIRST, and DEFAULT_MAX_CACHE_PERCENT.
FilterTree::~FilterTree | ( | ) |
FilterTree::FilterTree | ( | const FilterTree & | orig | ) |
Add a new filter to the tree. Note that pointer will be released.
References tree< T, tree_node_allocator >::append_child(), ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::empty(), tree< T, tree_node_allocator >::end(), initFilterTree(), tree< T, tree_node_allocator >::insert(), and tree< T, tree_node_allocator >::insert_after().
Referenced by filterRefreshNoOut(), filterTreeTests(), isRefreshing(), MainWindowFrame::OnDropFiles(), and TreeState::resetModifyLevel().
void FilterTree::addFilterTree | ( | FilterTree & | f, |
const Filter * | parent | ||
) |
Add a new tree as a subtree to a node.
References tree< T, tree_node_allocator >::append_child(), ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::clear(), tree< T, tree_node_allocator >::empty(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::erase(), tree< T, tree_node_allocator >::insert_subtree(), tree< T, tree_node_allocator >::insert_subtree_after(), and size().
Referenced by filterTreeTests(), and isRefreshing().
size_t FilterTree::cacheCount | ( | unsigned int | typeMask = STREAMTYPE_MASK_ALL | ) | const |
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by isRefreshing().
void FilterTree::clear | ( | ) |
Remove all tree contents.
References tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::clear(), and tree< T, tree_node_allocator >::end().
Referenced by TreeState::clear(), filterTreeTests(), loadXML(), operator=(), AnalysisState::save(), and size().
void FilterTree::clearCache | ( | const Filter * | filt, |
bool | includeSelf = true |
||
) |
Invalidate the cache of a given Filter and all its children.
References tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), and tree< T, tree_node_allocator >::end().
Referenced by clearCacheByType(), isRefreshing(), and modifyRangeFiles().
void FilterTree::clearCacheByType | ( | unsigned int | type | ) |
Invalidate the cache of a given type of filter.
References tree< T, tree_node_allocator >::begin(), clearCache(), and tree< T, tree_node_allocator >::end().
Referenced by TreeState::clearCacheByType(), and isRefreshing().
void FilterTree::cloneSubtree | ( | FilterTree & | f, |
const Filter * | targetFilt | ||
) | const |
Obtain a copy of the filters from the specified subtree,.
References ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::insert(), tree< T, tree_node_allocator >::replace(), and tree< T, tree_node_allocator >::size().
Referenced by isRefreshing(), and AnalysisState::stashFilters().
bool FilterTree::contains | ( | const Filter * | f | ) | const |
References ASSERT, tree< T, tree_node_allocator >::begin(), FilterStreamData::cached, IonStreamData::data, DrawStreamData::drawables, tree< T, tree_node_allocator >::end(), getBitNum(), Filter::getRefreshEmitMask(), Filter::getSelectionDevices(), FilterStreamData::getStreamType(), Filter::getUserString(), Filter::haveCache(), FilterStreamData::parent, VoxelStreamData::representationType, STREAM_NAMES, STREAM_TYPE_DRAW, STREAM_TYPE_IONS, STREAM_TYPE_PLOT, STREAM_TYPE_VOXEL, STREAMTYPE_MASK_ALL, and VOXEL_REPRESENT_END.
Referenced by filterTreeTests(), size(), and upWxTreeCtrl().
Duplicate a branch of the tree to a new position. Do not copy cache,.
References tree< T, tree_node_allocator >::append_child(), ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::end(), initFilterTree(), tree< T, tree_node_allocator >::insert(), tree< T, tree_node_allocator >::insert_after(), and tree< T, tree_node_allocator >::replace().
Referenced by filterTreeTests(), and isRefreshing().
References ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), and tree< T, tree_node_allocator >::end().
Referenced by depthEnd(), StashDialog::OnTreeSelChange(), respliceFilter(), saveXML(), serialiseToStringPaths(), and upWxTreeCtrl().
References tree< T, tree_node_allocator >::begin().
Referenced by StashDialog::OnTreeSelChange(), TreeState::switchoutFilterTree(), and upWxTreeCtrl().
References depth(), tree< T, tree_node_allocator >::end(), and maxDepth().
Referenced by StashDialog::OnTreeSelChange(), TreeState::switchoutFilterTree(), and upWxTreeCtrl().
void FilterTree::getAccumulatedPropagationMaps | ( | std::map< Filter *, size_t > & | emitTypes, |
std::map< Filter *, size_t > & | blockTypes | ||
) | const |
compute the integrated (accumulated) propagation maps for emission and blocking.
References ASSERT, tree< T, tree_node_allocator >::iterator_base::begin(), tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::begin_breadth_first(), tree< T, tree_node_allocator >::begin_leaf(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::iterator_base::end(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::end_breadth_first(), tree< T, tree_node_allocator >::end_leaf(), tree< T, tree_node_allocator >::is_valid(), tree< T, tree_node_allocator >::max_depth(), tree< T, tree_node_allocator >::parent(), tree< T, tree_node_allocator >::size(), and STREAMTYPE_MASK_ALL.
Referenced by FilterTreeAnalyse::analyse(), and size().
void FilterTree::getFiltersByType | ( | std::vector< const Filter *> & | filters, |
unsigned int | type | ||
) | const |
Return all of a given type of filter from the filter tree. Type must be the exact type of filter - it is not a mask.
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by isRefreshing().
|
static |
References FILTERTREE_REFRESH_ERR_BEGIN.
Referenced by MainWindowFrame::OnComboFilter(), and size().
Referenced by FilterTreeAnalyse::analyse(), filterAffectedByComposition(), and filterAltersComposition().
bool FilterTree::hasHazardousContents | ( | ) | const |
return true if the tree contains hazardous filters
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by isRefreshing(), and threeDepictApp::OnCmdLineParsed().
bool FilterTree::hasStateOverrides | ( | ) | const |
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by TreeState::hasStateOverrides(), and isRefreshing().
bool FilterTree::hasUpdates | ( | ) | const |
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by isRefreshing().
void FilterTree::initFilterTree | ( | ) | const |
Run the initialisation stage of the filter processing.
References ASSERT, tree< T, tree_node_allocator >::begin(), FilterRefreshCollector::collectToLevel(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), FilterRefreshCollector::getLevel(), popPointerStack(), and FilterRefreshCollector::trackPointers().
Referenced by addFilter(), copyFilter(), refreshFilterTree(), removeSubtree(), reparentFilter(), setFilterProperty(), and size().
|
inline |
References addFilter(), addFilterTree(), cacheCount(), clearCache(), clearCacheByType(), cloneSubtree(), copyFilter(), getFiltersByType(), hasHazardousContents(), hasStateOverrides(), hasUpdates(), loadXML(), modifyRangeFiles(), purgeCache(), removeHazardousContents(), removeSubtree(), reparentFilter(), respliceFilter(), saveXML(), serialiseToStringPaths(), setCachePercent(), setFilterString(), STREAMTYPE_MASK_ALL, and stripHazardousContents().
Referenced by TreeState::isRefreshing().
unsigned int FilterTree::loadXML | ( | const xmlNodePtr & | treeParent, |
std::ostream & | errStream, | ||
const std::string & | stateDir | ||
) |
function for the loading of a filter tree from its XML representation
References tree< T, tree_node_allocator >::append_child(), ASSERT, tree< T, tree_node_allocator >::begin(), clear(), tree< T, tree_node_allocator >::empty(), tree< T, tree_node_allocator >::insert(), isValidFilterName(), makeFilter(), Filter::readState(), tree< T, tree_node_allocator >::size(), TRANS, and XMLHelpNextType().
Referenced by filterTreeTests(), isRefreshing(), and AnalysisState::save().
size_t FilterTree::maxDepth | ( | ) | const |
References tree< T, tree_node_allocator >::max_depth().
Referenced by depthEnd(), and filterTreeTests().
void FilterTree::modifyRangeFiles | ( | const std::map< const RangeFile *, const RangeFile *> & | toModify | ) |
References tree< T, tree_node_allocator >::begin(), clearCache(), tree< T, tree_node_allocator >::end(), FILTER_TYPE_RANGEFILE, RangeFileFilter::getRange(), and RangeFileFilter::setRangeData().
Referenced by isRefreshing(), and TreeState::modifyRangeFiles().
const FilterTree & FilterTree::operator= | ( | const FilterTree & | orig | ) |
void FilterTree::purgeCache | ( | ) |
Force a wipe of all caches in the filter tree.
References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().
Referenced by isRefreshing(), and TreeState::purgeFilterCache().
unsigned int FilterTree::refreshFilterTree | ( | std::list< FILTER_OUTPUT_DATA > & | outData, |
std::vector< SelectionDevice *> & | devices, | ||
std::vector< std::pair< const Filter *, std::string > > & | consoleMessages, | ||
ProgressData & | curProg, | ||
ATOMIC_BOOL & | abortRefresh | ||
) | const |
Refresh the entire filter tree. Whilst this is public, great care must be taken in.
References ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::begin_leaf(), CACHE_DEPTH_FIRST, CACHE_NEVER, FilterStreamData::cached, Filter::clearConsole(), Filter::clearDevices(), ProgressData::clock(), FilterRefreshCollector::collectAll(), FilterRefreshCollector::collectToLevel(), ProgressData::curFilter, tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::end_leaf(), FILTER_ERR_ABORT, ProgressData::filterProgress, FILTERTREE_REFRESH_ERR_MEM, FilterRefreshCollector::forgetPointers(), getAvailRAM(), Filter::getConsoleStrings(), Filter::getSelectionDevices(), Filter::getUserString(), Filter::haveCache(), initFilterTree(), ProgressData::maxStep, Filter::numBytesForCache(), numElements(), popPointerStack(), Filter::refresh(), Filter::setCaching(), tree< T, tree_node_allocator >::size(), ProgressData::step, ProgressData::totalNumFilters, FilterRefreshCollector::trackPointers(), Filter::updateOutputInfo(), Filter::wantAbort, and WARN.
Referenced by ExportPosDialog::initialiseData(), size(), and testFilterTree().
void FilterTree::removeHazardousContents | ( | ) |
Make the filter system safe (non-hazardous)
Referenced by isRefreshing().
void FilterTree::removeSubtree | ( | Filter * | f | ) |
Remove an element and all sub elements from the tree,.
References ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::erase(), tree< T, tree_node_allocator >::erase_children(), and initFilterTree().
Referenced by filterTreeTests(), isRefreshing(), and stripHazardousContents().
Move a branch of the tree to a new position.
References tree< T, tree_node_allocator >::append_child(), ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::erase(), initFilterTree(), tree< T, tree_node_allocator >::insert_after(), and tree< T, tree_node_allocator >::replace().
Referenced by filterTreeTests(), isRefreshing(), and respliceFilter().
Move a filter from one point in the tree to another, with the.
References tree< T, tree_node_allocator >::iterator_base::begin(), tree< T, tree_node_allocator >::begin(), depth(), tree< T, tree_node_allocator >::iterator_base::end(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::parent(), and reparentFilter().
Referenced by isRefreshing().
|
static |
Safely delete data generated by refreshFilterTree(...).
References FilterStreamData::cached, FilterStreamData::getStreamType(), and vectorMultiErase().
Referenced by ExportPosDialog::initialiseData(), MainWindowFrame::OnFileExportFilterVideo(), size(), and testFilterTree().
bool FilterTree::saveXML | ( | std::ofstream & | f, |
std::map< std::string, std::string > & | fileMapping, | ||
bool | writePackage, | ||
bool | useRelativePaths, | ||
unsigned int | minTabDepth = 0 |
||
) | const |
References tree< T, tree_node_allocator >::begin(), depth(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), onlyFilename(), splitFileData(), STATE_FORMAT_XML, stream_cast(), and tabs().
Referenced by filterTreeTests(), isRefreshing(), and AnalysisState::save().
void FilterTree::serialiseToStringPaths | ( | std::map< const Filter *, std::string > & | serialisedPaths | ) | const |
Convert tree to a series of flat strings representing the topology.
References ASSERT, tree< T, tree_node_allocator >::begin(), depth(), tree< T, tree_node_allocator >::end(), PATH_NONCE, tree< T, tree_node_allocator >::size(), and stream_cast().
Referenced by ExportAnimationDialog::getPathMapping(), and isRefreshing().
void FilterTree::serialiseToStringPaths | ( | std::map< std::string, const Filter *> & | serialisedPaths | ) | const |
void FilterTree::setCachePercent | ( | unsigned int | newCache | ) |
References ASSERT, CACHE_DEPTH_FIRST, and CACHE_NEVER.
Referenced by isRefreshing().
bool FilterTree::setFilterProperty | ( | Filter * | f, |
unsigned int | key, | ||
const std::string & | value, | ||
bool & | needUpdate | ||
) |
References ASSERT, tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), initFilterTree(), and Filter::setProperty().
Referenced by filterTreeTests(), ExportAnimationDialog::getModifiedTree(), and size().
bool FilterTree::setFilterString | ( | Filter * | , |
const std::string & | s | ||
) |
|
inline |
Return the number of filters.
References ATOMIC_BOOL, clear(), contains(), getAccumulatedPropagationMaps(), getRefreshErrString(), initFilterTree(), refreshFilterTree(), safeDeleteFilterList(), setFilterProperty(), tree< T, tree_node_allocator >::size(), and STREAMTYPE_MASK_ALL.
Referenced by addFilterTree(), filterTreeTests(), ExportAnimationDialog::getPathMapping(), AnalysisState::merge(), TreeState::resetModifyLevel(), AnalysisState::save(), and TreeState::size().
void FilterTree::stripHazardousContents | ( | ) |
Used to remove potentially hazardous filters.
References tree< T, tree_node_allocator >::begin(), tree< T, tree_node_allocator >::depth(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::parent(), and removeSubtree().
Referenced by isRefreshing(), threeDepictApp::OnCmdLineParsed(), and TreeState::stripHazardousContents().
void FilterTree::swap | ( | FilterTree & | other | ) |
Referenced by filterTreeTests(), ExportPosDialog::swapFilterTree(), TreeState::swapFilterTree(), and TreeState::switchoutFilterTree().