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

#include <state.h>

Public Member Functions

 TreeState ()
 
void operator= (const TreeState &otherState)
 
unsigned int refresh (std::list< FILTER_OUTPUT_DATA > &outData, std::vector< std::pair< const Filter *, std::string > > &consoleMessages, ProgressData &prog)
 
void setAbort ()
 
bool isRefreshing () const
 
void setUpdates ()
 Inform that it has new updates to filters from external sources (eg bindings) More...
 
bool hasUpdates () const
 Returns true if the filter tree has updates that need to be processed. More...
 
bool hasMonitorUpdates () const
 Returns true if the filter tree has updates via a filter monitor. More...
 
void cloneFilterTree (FilterTree &f) const
 
const FilterTreegetTreeRef () const
 
void addFilter (Filter *f, size_t parentId=(size_t) -1)
 Add a new filter to the tree. parentID == -1 for not. More...
 
void addFilterTree (FilterTree &f, size_t parentId=(size_t) -1)
 Add a new subtree to the tree, optionally specifying a parent filter. More...
 
void switchoutFilterTree (FilterTree &f)
 Grab the filter tree from the internal one, and swap the. More...
 
void swapFilterTree (FilterTree &f)
 
void swapFilterMap (std::map< size_t, Filter *> &m)
 
bool copyFilter (size_t toCopy, size_t newParent, bool copyToRoot=false)
 Duplicate a branch of the tree to a new position. Do not copy cache,. More...
 
size_t getIdByFilter (const Filter *f) const
 
const FiltergetFilterById (size_t filterId) const
 
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 purgeFilterCache ()
 Clear the cache for the filters. More...
 
void removeFilterSubtree (size_t filterId)
 Delete a filter and all its children. More...
 
bool reparentFilter (size_t filterID, size_t newParentID)
 
bool respliceFilter (size_t filterID, size_t newParentID)
 
bool setFilterProperty (size_t filterId, unsigned int key, const std::string &value, bool &needUpdate)
 Set the properties using a key-value result. More...
 
void setFilterString (size_t id, const std::string &s)
 Set the filter's string. More...
 
void modifyRangeFiles (const std::map< const RangeFile *, const RangeFile *> &toModify)
 
void clearCache ()
 Clear all caches. More...
 
void clearCacheByType (unsigned int type)
 Clear all caches. More...
 
void clear ()
 
size_t size () const
 
void pushUndoStack ()
 
void popUndoStack (bool restorePopped=true)
 
void popRedoStack ()
 
size_t getUndoSize () const
 
size_t getRedoSize () const
 
void clearUndoRedoStacks ()
 
void stripHazardousContents ()
 
void applyBindingsToTree ()
 Apply external filter modifications that have been changed due to bindings. More...
 
void getAnalysisResults (std::vector< FILTERTREE_ERR > &res) const
 Get the analysis results for the last refresh. More...
 
void setCachePercent (unsigned int newCache)
 Set the cache maximum ram usage (0->100) More...
 
bool hasStateOverrides () const
 
std::vector< SelectionDevice * > & getSelectionDevices ()
 
void elevateModifyLevel (unsigned int newLevel)
 
unsigned int getModifyLevel () const
 
void resetModifyLevel ()
 

Constructor & Destructor Documentation

◆ TreeState()

TreeState::TreeState ( )

References STATE_MODIFIED_NONE.

Member Function Documentation

◆ addFilter()

void TreeState::addFilter ( Filter f,
size_t  parentId = (size_t)-1 
)

Add a new filter to the tree. parentID == -1 for not.

Referenced by getTreeRef().

Here is the caller graph for this function:

◆ addFilterTree()

void TreeState::addFilterTree ( FilterTree f,
size_t  parentId = (size_t)-1 
)

Add a new subtree to the tree, optionally specifying a parent filter.

References ASSERT.

Referenced by AnalysisState::addStashedToFilters(), getTreeRef(), and AnalysisState::merge().

Here is the caller graph for this function:

◆ applyBindingsToTree()

void TreeState::applyBindingsToTree ( )

Apply external filter modifications that have been changed due to bindings.

References STATE_MODIFIED_DATA.

Referenced by VisController::applyBindingsToTree(), and stripHazardousContents().

Here is the caller graph for this function:

◆ clear()

void TreeState::clear ( )
inline

References FilterTreeAnalyse::clear(), and FilterTree::clear().

Referenced by AnalysisState::clear().

Here is the caller graph for this function:

◆ clearCache()

void TreeState::clearCache ( )

Clear all caches.

Referenced by modifyRangeFiles().

Here is the caller graph for this function:

◆ clearCacheByType()

void TreeState::clearCacheByType ( unsigned int  type)
inline

Clear all caches.

References FilterTree::clearCacheByType().

◆ clearUndoRedoStacks()

void TreeState::clearUndoRedoStacks ( )
inline

Referenced by AnalysisState::merge().

Here is the caller graph for this function:

◆ cloneFilterTree()

void TreeState::cloneFilterTree ( FilterTree f) const
inline

Referenced by threeDepictApp::OnCmdLineParsed().

Here is the caller graph for this function:

◆ copyFilter()

bool TreeState::copyFilter ( size_t  toCopy,
size_t  newParent,
bool  copyToRoot = false 
)

Duplicate a branch of the tree to a new position. Do not copy cache,.

Referenced by swapFilterMap().

Here is the caller graph for this function:

◆ elevateModifyLevel()

void TreeState::elevateModifyLevel ( unsigned int  newLevel)

Referenced by getSelectionDevices().

Here is the caller graph for this function:

◆ getAnalysisResults()

void TreeState::getAnalysisResults ( std::vector< FILTERTREE_ERR > &  res) const
inline

Get the analysis results for the last refresh.

References FilterTreeAnalyse::getAnalysisResults(), and setCachePercent().

◆ getFilterById()

const Filter * TreeState::getFilterById ( size_t  filterId) const

References ASSERT.

Referenced by AnalysisState::stashFilters(), and swapFilterMap().

Here is the caller graph for this function:

◆ getFiltersByType()

void TreeState::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.

Referenced by swapFilterMap().

Here is the caller graph for this function:

◆ getIdByFilter()

size_t TreeState::getIdByFilter ( const Filter f) const

References ASSERT.

Referenced by AnalysisState::addStashedToFilters(), and swapFilterMap().

Here is the caller graph for this function:

◆ getModifyLevel()

unsigned int TreeState::getModifyLevel ( ) const

References ASSERT, and STATE_MODIFIED_ENUM_END.

Referenced by getSelectionDevices(), and AnalysisState::getStateModifyLevel().

Here is the caller graph for this function:

◆ getRedoSize()

size_t TreeState::getRedoSize ( ) const
inline

◆ getSelectionDevices()

std::vector<SelectionDevice *>& TreeState::getSelectionDevices ( )
inline

References elevateModifyLevel(), getModifyLevel(), and resetModifyLevel().

Referenced by VisController::getSelectionDevices().

Here is the caller graph for this function:

◆ getTreeRef()

const FilterTree& TreeState::getTreeRef ( ) const
inline

References addFilter(), addFilterTree(), and switchoutFilterTree().

Referenced by AnalysisState::merge(), AnalysisState::save(), and AnalysisState::stashFilters().

Here is the caller graph for this function:

◆ getUndoSize()

size_t TreeState::getUndoSize ( ) const
inline

◆ hasMonitorUpdates()

bool TreeState::hasMonitorUpdates ( ) const

Returns true if the filter tree has updates via a filter monitor.

Referenced by setUpdates().

Here is the caller graph for this function:

◆ hasStateOverrides()

bool TreeState::hasStateOverrides ( ) const
inline

References FilterTree::hasStateOverrides().

Referenced by AnalysisState::hasStateData(), and AnalysisState::hasStateOverrides().

Here is the caller graph for this function:

◆ hasUpdates()

bool TreeState::hasUpdates ( ) const

Returns true if the filter tree has updates that need to be processed.

Referenced by setUpdates().

Here is the caller graph for this function:

◆ isRefreshing()

bool TreeState::isRefreshing ( ) const
inline

References FilterTree::isRefreshing().

Referenced by Scene::applyDevice(), and Scene::drawOverlays().

Here is the caller graph for this function:

◆ modifyRangeFiles()

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

◆ operator=()

void TreeState::operator= ( const TreeState otherState)

References ASSERT.

◆ popRedoStack()

void TreeState::popRedoStack ( )

References ASSERT, MAX_UNDO_SIZE, and STATE_MODIFIED_DATA.

Referenced by size().

Here is the caller graph for this function:

◆ popUndoStack()

void TreeState::popUndoStack ( bool  restorePopped = true)

References ASSERT, MAX_UNDO_SIZE, and STATE_MODIFIED_DATA.

Referenced by size().

Here is the caller graph for this function:

◆ purgeFilterCache()

void TreeState::purgeFilterCache ( )
inline

◆ pushUndoStack()

void TreeState::pushUndoStack ( )

References MAX_UNDO_SIZE.

Referenced by AnalysisState::addStashedToFilters(), and size().

Here is the caller graph for this function:

◆ refresh()

unsigned int TreeState::refresh ( std::list< FILTER_OUTPUT_DATA > &  outData,
std::vector< std::pair< const Filter *, std::string > > &  consoleMessages,
ProgressData prog 
)

References ASSERT, and ProgressData::reset().

Referenced by RefreshController::refresh().

Here is the caller graph for this function:

◆ removeFilterSubtree()

void TreeState::removeFilterSubtree ( size_t  filterId)

Delete a filter and all its children.

Referenced by purgeFilterCache().

Here is the caller graph for this function:

◆ reparentFilter()

bool TreeState::reparentFilter ( size_t  filterID,
size_t  newParentID 
)

Referenced by purgeFilterCache().

Here is the caller graph for this function:

◆ resetModifyLevel()

void TreeState::resetModifyLevel ( )

◆ respliceFilter()

bool TreeState::respliceFilter ( size_t  filterID,
size_t  newParentID 
)

Referenced by purgeFilterCache().

Here is the caller graph for this function:

◆ setAbort()

void TreeState::setAbort ( )
inline

Referenced by Scene::applyDevice().

Here is the caller graph for this function:

◆ setCachePercent()

void TreeState::setCachePercent ( unsigned int  newCache)

Set the cache maximum ram usage (0->100)

Referenced by getAnalysisResults().

Here is the caller graph for this function:

◆ setFilterProperty()

bool TreeState::setFilterProperty ( size_t  filterId,
unsigned int  key,
const std::string &  value,
bool &  needUpdate 
)

Set the properties using a key-value result.

References STATE_MODIFIED_DATA.

Referenced by purgeFilterCache().

Here is the caller graph for this function:

◆ setFilterString()

void TreeState::setFilterString ( size_t  id,
const std::string &  s 
)

Set the filter's string.

References Filter::setUserString().

Referenced by purgeFilterCache().

Here is the caller graph for this function:

◆ setUpdates()

void TreeState::setUpdates ( )
inline

Inform that it has new updates to filters from external sources (eg bindings)

References hasMonitorUpdates(), and hasUpdates().

Referenced by Scene::applyDevice().

Here is the caller graph for this function:

◆ size()

size_t TreeState::size ( ) const
inline

References popRedoStack(), popUndoStack(), pushUndoStack(), and FilterTree::size().

Referenced by AnalysisState::clear(), and AnalysisState::hasStateData().

Here is the caller graph for this function:

◆ stripHazardousContents()

void TreeState::stripHazardousContents ( )
inline

◆ swapFilterMap()

void TreeState::swapFilterMap ( std::map< size_t, Filter *> &  m)
inline

◆ swapFilterTree()

void TreeState::swapFilterTree ( FilterTree f)
inline

References FilterTree::swap().

Referenced by resetModifyLevel(), and AnalysisState::save().

Here is the caller graph for this function:

◆ switchoutFilterTree()

void TreeState::switchoutFilterTree ( FilterTree f)

Grab the filter tree from the internal one, and swap the.

References ASSERT, FilterTree::depthBegin(), FilterTree::depthEnd(), and FilterTree::swap().

Referenced by getTreeRef().

Here is the caller graph for this function:

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