-
Notifications
You must be signed in to change notification settings - Fork 100
Managing graph states
Alexander Smirnov edited this page Jul 13, 2016
·
1 revision
< Back to contents >
Last checked against version: 2.1.8
All graph states operations are performed through GraphArea::StateStorage property. Following methods are exposed for the end user:
- public bool ContainsState(string id) - returns true if state with specified ID exists within states collection.
- public GraphState<TVertex, TEdge, TGraph> GetState(string id) - get graph state by specified id. Null value will be returned if no state with such id exists.
- public Dictionary<string, GraphState<TVertex, TEdge, TGraph>> GetStates() - get the list of all available states.
- public void LoadState(string id) - load and display graph state by specified id. Note that GraphArea::Graph, GraphArea::VertexList, GraphArea::EdgesList properties will be overwritten.
- public void RemoveState(string id) - remove state by specified id.
- public void SaveState(string id, string description = "") - save current graph state using specified id and optional state description.
When graph state is saved then following actions are performed:
- GraphArea::Graph property are copied.
- Vertex positions are copied.
- All visible edges data with route points are copied.
Note that algorithms and animations are NOT currently being saved into the states.
When graph state is loaded then following actions are performed:
- All vertex and edge visual controls are deleted.
- GraphArea::Graph property loaded from state.
- All visual vertices are loaded and saved positions are applied.
- All visual edges are loaded.