Logo Search packages:      
Sourcecode: 3depict version File versions  Download package

VisController Class Reference

#include <viscontrol.h>

List of all members.

Detailed Description

Visualisation controller.

Keeps track of what visualisation controls the user has available such as cameras, filters and data groups. This is essentially responsible for interfacing between program data structures and the user interface.

Only one of these may be instantiated at any time due to abort mechanism

Definition at line 60 of file viscontrol.h.

Public Member Functions

void abort ()
 Call to get viscontrol to abort current operation. Call once per abort.
unsigned int addCam (const std::string &camName)
 Add a new camera to the scene.
bool addFilter (Filter *f, unsigned long long parentId)
 Add a new filter to the tree.
void addStashedToFilters (Filter *parentFilter, unsigned int stashID)
 Add a stash as a subtree for the specified parent filter.
bool copyFilter (unsigned long long toCopy, unsigned long long newParent, bool copyToRoot=false)
 Duplicte a branch of the tree to a new position. Do not copy cache,.
void deleteStash (unsigned int stashID)
 Delete a stash using its uniqueID.
void ensureSceneVisible (unsigned int direction)
 Ensure visible.
unsigned int exportIonStreams (const std::vector< const FilterStreamData * > &selected, const std::string &outFile, unsigned int format=IONFORMAT_POS) const
 export given filterstream data pointers
unsigned int getActiveCamId () const
 Get the active camera ID.
void getCamData (std::vector< std::pair< unsigned int, std::string > > &camData) const
 Get the camera ID-pair data TODO: this is kinda a halfway house between.
const FiltergetFilterById (unsigned long long filterId) const
 Retrieves a filter by its ID (TODO: Refactor. Try to minimise filter pointer exposure. Use ID values where possible).
void getFilterTypes (std::vector< const Filter * > &filters, unsigned int type)
 Return all of a given type of filter from the filter tree.
void getStashList (std::vector< std::pair< std::string, unsigned int > > &stashList) const
 Retreive the stash filters.
void getStashTree (unsigned int stashId, tree< Filter * > &t) const
 Retreive a given stash tree by ID.
unsigned int getUndoSize () const
 Get the size of the udno stack.
bool hasHazardousContents () const
 return true if the viscontrol contains hazardous filters
bool hasUpdates () const
 Returns true if the scene has updates that need to be processed.
void invalidateCache (const Filter *filt)
 Invalidate the cache of a given Filter and all its children. set to 0 to invalidate all.
bool isRefreshing () const
 Returns true if the filter is in the midst of a refresh.
unsigned int LoadIonSet (const std::string &name, unsigned int &totalProgress, unsigned int &filterProgress, const Filter *&curFilter)
 Load the ion set - returns nonzero on fail TODO: Remove me?
bool loadState (const char *filename, std::ostream &f, bool merge=false)
 Load the viscontrol state.
void makeFiltersSafe ()
 Make the filter system safe (non-hazardous).
unsigned int numCams () const
 Return the number of cameras.
unsigned int numFilters () const
 Return the number of filters.
void popUndoStack ()
 restore top filter tree from undo stack
void purgeFilterCache ()
 Force a wipe of all caches in the filter tree.
unsigned int refreshFilterTree (unsigned int &overallProgress, unsigned int &filterProgress, const Filter *&curFilter, std::list< std::pair< Filter *, std::vector< const FilterStreamData * > > > &outData)
 Refresh the entire filter tree. Whilst this is public, great care must be taken in.
bool removeCam (unsigned int uniqueID)
 Remove a camera from the scene.
void removeTreeFilter (unsigned long long id)
 Remove an element and all sub elements from the tree,.
bool reparentFilter (unsigned long long filterID, unsigned long long newParentID)
 Move a branch of the tree to a new position.
void safeDeleteFilterList (std::list< std::pair< Filter *, std::vector< const FilterStreamData * > > > &outData, unsigned long long typeMask=0, bool maskPrevents=true) const
 Safely delete data generated by refreshFilterTree(...).
bool saveState (const char *filename) const
 Save the viscontrol state: writes an XML file containing the viscontrol state.
void setCachePercent (unsigned int percent)
 Set the percentage of ram to use for cache. 0 to disable.
bool setCam (unsigned int uniqueID)
 Set the camera to use in the scene.
bool setCamProperties (unsigned long long camUniqueID, unsigned int set, unsigned int key, const std::string &value)
 Set the properties using a key-value result (as obtaed from updatewxPropertyGrid).
bool setFilterProperties (unsigned long long filterId, unsigned int set, unsigned int key, const std::string &value, bool &needUpdate)
 Set the properties using a key-value result (as obtaed from updatewxPropertyGrid).
bool setFilterString (unsigned long long id, const std::string &s)
 Set the filter user text.
void setPlot (Multiplot *thePlots)
 Set the backend plot.
void setPlotList (wxListBox *box)
 Set the listbox for plot selection.
void setRawGrid (wxGrid *theRawGrid)
 Set the backend grid control for raw data.
void setScene (Scene *theScene)
 Set the backend scene.
void setUpdates ()
 Inform viscontrol that it has new updates to filters from external sources (eg bindings).
void setYieldWindow (wxWindow *win)
 Call to set window to be partially excluded (wx dependant) from blocking during scene updates.
unsigned int stashFilters (unsigned int filterID, const char *stashName)
 Create a new stash. Returns ID for stash.
void updateCamPropertyGrid (wxPropertyGrid *g, unsigned int camUniqueId)
 Update a wxtGrid with the properties for a given filter.
void updateFilterPropertyGrid (wxPropertyGrid *g, unsigned long long filterId)
 Update a wxtGrid with the properties for a given filter.
void updateRawGrid () const
unsigned int updateScene (unsigned int &overallProgress, unsigned int &filterProgresss, const Filter *&curFilter)
 Force an update to the scene.
void updateStashPropertyGrid (wxGrid *g, unsigned int stashId, const Filter *stashFilter) const
 Write out the filters into a wxtreecontrol.
void updateWxTreeCtrl (wxTreeCtrl *t, const Filter *visibleFilter=0)
 Write out the filters into a wxtreecontrol.
void updateWxTreeCtrlFromStash (wxTreeCtrl *t, unsigned int stashId) const
 Write out the filters into a wxtreecontrol.

Private Member Functions

void clear ()
FiltergetFilterByIdNonConst (unsigned long long filterId) const
 Return filter pointer using the filter id value.
void getFilterUpdates ()
 Retreive the updates to the filter tree from the scene.
bool hasHazardous (const tree< Filter * > &tree) const
 Does a particular filter tree contain hazardous contents?
unsigned int loadFilterTree (const xmlNodePtr &treeParent, tree< Filter * > &newTree) const
 internal function for the lading of a filter tree from its XML representation
void popPointerStack (std::list< const FilterStreamData * > &pointerTrackList, std::stack< vector< const FilterStreamData * > > &inDataStack, unsigned int depth)
 Internal function for pointer deletion from stack during refreshing filter tree.
void pushUndoStack ()
 Push the current filter tree onto the undo stack.
void stripHazardousFilters (tree< Filter * > &tree)
 Used to remove potentially hazardous filters.

Private Attributes

bool amRefreshing
 True if viscontrol is in the middle of a refresh operation.
unsigned int cacheStrategy
 Caching stragegy.
bool doProgressAbort
 True if viscontrol should abort current operation.
tree< Filter * > filters
 Filters that provide and act upon data. filters.begin() is posfile.
std::list< std::pair< unsigned
long long, Filter * > > 
 A mapping between wxitem IDs and filters TODO: Replace with uniqueID handler?
float maxCachePercent
 Maximum size for cache (percent of available ram).
unsigned long long nextID
bool pendingUpdates
 True if there are pending updates from the user.
wxListBox * plotSelList
 UI element for selecting plots from a list (for enable/disable).
std::vector< std::pair
< std::string, tree< Filter * > > > 
 Named, stored trees that can be put aside for secondary use.
UniqueIDHandler stashUniqueIDs
 Unique IDs for stash.
Multiplot * targetPlots
wxGrid * targetRawGrid
 Target raw grid.
 Target scene.
std::deque< tree< Filter * > > undoFilterStack
 Undo filter tree stack.

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

Generated by  Doxygen 1.6.0   Back to index