3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | List of all members
FilterTree Class Reference

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 FilterTreeoperator= (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...
 

Detailed Description

Tree of filters, which link together to perform an analysis.

Constructor & Destructor Documentation

◆ FilterTree() [1/2]

FilterTree::FilterTree ( )

◆ ~FilterTree()

FilterTree::~FilterTree ( )

◆ FilterTree() [2/2]

FilterTree::FilterTree ( const FilterTree orig)

Member Function Documentation

◆ addFilter()

void FilterTree::addFilter ( Filter f,
const Filter parent 
)

◆ addFilterTree()

void FilterTree::addFilterTree ( FilterTree f,
const Filter parent 
)

◆ cacheCount()

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().

Here is the caller graph for this function:

◆ clear()

void FilterTree::clear ( )

◆ clearCache()

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().

Here is the caller graph for this function:

◆ clearCacheByType()

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().

Here is the caller graph for this function:

◆ cloneSubtree()

void FilterTree::cloneSubtree ( FilterTree f,
const Filter targetFilt 
) const

◆ contains()

bool FilterTree::contains ( const Filter f) const

◆ copyFilter()

bool FilterTree::copyFilter ( Filter id,
const Filter newParent 
)

◆ depth()

size_t FilterTree::depth ( const tree< Filter *>::pre_order_iterator &  it) const

◆ depthBegin()

tree<Filter *>::pre_order_iterator FilterTree::depthBegin ( ) const
inline

References tree< T, tree_node_allocator >::begin().

Referenced by StashDialog::OnTreeSelChange(), TreeState::switchoutFilterTree(), and upWxTreeCtrl().

Here is the caller graph for this function:

◆ depthEnd()

tree<Filter *>::pre_order_iterator FilterTree::depthEnd ( ) const
inline

References depth(), tree< T, tree_node_allocator >::end(), and maxDepth().

Referenced by StashDialog::OnTreeSelChange(), TreeState::switchoutFilterTree(), and upWxTreeCtrl().

Here is the caller graph for this function:

◆ getAccumulatedPropagationMaps()

void FilterTree::getAccumulatedPropagationMaps ( std::map< Filter *, size_t > &  emitTypes,
std::map< Filter *, size_t > &  blockTypes 
) const

◆ getFiltersByType()

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().

Here is the caller graph for this function:

◆ getRefreshErrString()

string FilterTree::getRefreshErrString ( unsigned int  errCode)
static

References FILTERTREE_REFRESH_ERR_BEGIN.

Referenced by MainWindowFrame::OnComboFilter(), and size().

Here is the caller graph for this function:

◆ getTree()

const tree<Filter*>& FilterTree::getTree ( ) const
inline

Referenced by FilterTreeAnalyse::analyse(), filterAffectedByComposition(), and filterAltersComposition().

Here is the caller graph for this function:

◆ hasHazardousContents()

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().

Here is the caller graph for this function:

◆ hasStateOverrides()

bool FilterTree::hasStateOverrides ( ) const

References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().

Referenced by TreeState::hasStateOverrides(), and isRefreshing().

Here is the caller graph for this function:

◆ hasUpdates()

bool FilterTree::hasUpdates ( ) const

References tree< T, tree_node_allocator >::begin(), and tree< T, tree_node_allocator >::end().

Referenced by isRefreshing().

Here is the caller graph for this function:

◆ initFilterTree()

void FilterTree::initFilterTree ( ) const

◆ isRefreshing()

bool FilterTree::isRefreshing ( ) const
inline

◆ loadXML()

unsigned int FilterTree::loadXML ( const xmlNodePtr &  treeParent,
std::ostream &  errStream,
const std::string &  stateDir 
)

◆ maxDepth()

size_t FilterTree::maxDepth ( ) const

References tree< T, tree_node_allocator >::max_depth().

Referenced by depthEnd(), and filterTreeTests().

Here is the caller graph for this function:

◆ modifyRangeFiles()

void FilterTree::modifyRangeFiles ( const std::map< const RangeFile *, const RangeFile *> &  toModify)

◆ operator=()

const FilterTree & FilterTree::operator= ( const FilterTree orig)

◆ purgeCache()

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().

Here is the caller graph for this function:

◆ refreshFilterTree()

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

◆ removeHazardousContents()

void FilterTree::removeHazardousContents ( )

Make the filter system safe (non-hazardous)

Referenced by isRefreshing().

Here is the caller graph for this function:

◆ removeSubtree()

void FilterTree::removeSubtree ( Filter f)

◆ reparentFilter()

bool FilterTree::reparentFilter ( Filter f,
const Filter newParent 
)

◆ respliceFilter()

bool FilterTree::respliceFilter ( Filter toMove,
const Filter newParent 
)

◆ safeDeleteFilterList()

void FilterTree::safeDeleteFilterList ( std::list< FILTER_OUTPUT_DATA > &  outData,
size_t  typeMask = STREAMTYPE_MASK_ALL,
bool  maskPrevents = false 
)
static

Safely delete data generated by refreshFilterTree(...).

References FilterStreamData::cached, FilterStreamData::getStreamType(), and vectorMultiErase().

Referenced by ExportPosDialog::initialiseData(), MainWindowFrame::OnFileExportFilterVideo(), size(), and testFilterTree().

Here is the caller graph for this function:

◆ saveXML()

bool FilterTree::saveXML ( std::ofstream &  f,
std::map< std::string, std::string > &  fileMapping,
bool  writePackage,
bool  useRelativePaths,
unsigned int  minTabDepth = 0 
) const

◆ serialiseToStringPaths() [1/2]

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().

Here is the caller graph for this function:

◆ serialiseToStringPaths() [2/2]

void FilterTree::serialiseToStringPaths ( std::map< std::string, const Filter *> &  serialisedPaths) const

◆ setCachePercent()

void FilterTree::setCachePercent ( unsigned int  newCache)

References ASSERT, CACHE_DEPTH_FIRST, and CACHE_NEVER.

Referenced by isRefreshing().

Here is the caller graph for this function:

◆ setFilterProperty()

bool FilterTree::setFilterProperty ( Filter f,
unsigned int  key,
const std::string &  value,
bool &  needUpdate 
)

◆ setFilterString()

bool FilterTree::setFilterString ( Filter ,
const std::string &  s 
)

Set the filter user text.

Referenced by isRefreshing().

Here is the caller graph for this function:

◆ size()

size_t FilterTree::size ( ) const
inline

◆ stripHazardousContents()

void FilterTree::stripHazardousContents ( )

◆ swap()

void FilterTree::swap ( FilterTree other)

The documentation for this class was generated from the following files: