#include <ChangeTimeline.h>
Public Member Functions | |
bool | addEdge (vertexid_t src, vertexid_t tgt) |
adds a new edge from source to target vertex. returns true for success | |
bool | addVertex (vertexid_t id) |
adds a new vertex. Returns true for success (the vertex didnt exist yet) | |
unsigned int | advanceTimeFrame () |
advance the change timeline to the next frame. | |
ChangeTimeline (const class GraphData &graph) | |
constructs a new ChangeTimeline for the given graph | |
void | clear () |
clear the change list | |
bool | delEdge (vertexid_t src, vertexid_t tgt) |
removes an edge from the graph. returns true if it existed. | |
bool | delVertex (vertexid_t id) |
deletes a vertex from the graph. returns true if it existed | |
Changelist & | getChangelist () const |
checks that just one frame exists and returns the changelist | |
Changelist & | getChangelistEnd () const |
returns the full changelist of the last frame | |
Changelist & | getChangelistStart () const |
returns the changelist of the initial frame (before the first nextFrame() call) | |
unsigned int | getFrameCount () const |
the number of animation frames in the list, and also the number of the current frame, because 0 is not stored as a frame. | |
bool | setEdgeAttr (vertexid_t src, vertexid_t tgt, unsigned int attrid, const AnyType &value) |
changes the value of an attribute on the edge | |
bool | setVertexAttr (vertexid_t id, unsigned int attrid, const AnyType &value) |
changes the value of an attribute on the vertex | |
~ChangeTimeline () | |
Protected Types | |
typedef std::deque< class ChangeFrame > | changeframelist_t |
list of frames. | |
Protected Attributes | |
Changelist * | clend |
represents the changes made during the whole timeline, thus is a merged version from clstart with all ChangeFrames. | |
Changelist * | clstart |
the changes made before the first frame is marked as finished. | |
changeframelist_t | frames |
the actual list of frames. | |
GraphData & | graph |
reference to the GraphData object for which these represent changes. | |
Friends | |
class | GraphContainer |
accesses the frames in getArea |
Furthermore it records the changes made in the animation into time slots represented by a list of ChangeFrames.
Definition at line 92 of file ChangeTimeline.h.
typedef std::deque<class ChangeFrame> VGServer::ChangeTimeline::changeframelist_t [protected] |
list of frames.
each frame records which changes happened during it's time. Except for the first time slot, it's saved directly in the clstart.
Definition at line 115 of file ChangeTimeline.h.
VGServer::ChangeTimeline::ChangeTimeline | ( | const class GraphData & | graph | ) |
VGServer::ChangeTimeline::~ChangeTimeline | ( | ) |
bool VGServer::ChangeTimeline::addEdge | ( | vertexid_t | src, | |
vertexid_t | tgt | |||
) |
adds a new edge from source to target vertex. returns true for success
Definition at line 85 of file ChangeTimeline.cc.
References VGServer::Changelist::addEdge(), clend, frames, VGServer::Changelist::getEdgeChange(), and getFrameCount().
Referenced by VGServer::GraphConnection::addEdge().
bool VGServer::ChangeTimeline::addVertex | ( | vertexid_t | id | ) |
adds a new vertex. Returns true for success (the vertex didnt exist yet)
Definition at line 55 of file ChangeTimeline.cc.
References VGServer::Changelist::addVertex(), clend, frames, getFrameCount(), and VGServer::Changelist::getVertexChange().
Referenced by VGServer::GraphConnection::addVertex().
unsigned int VGServer::ChangeTimeline::advanceTimeFrame | ( | ) |
advance the change timeline to the next frame.
returns the number of the next frame.
Definition at line 43 of file ChangeTimeline.cc.
References clend, clstart, frames, and getFrameCount().
Referenced by VGServer::GraphConnection::advanceTimeFrame().
void VGServer::ChangeTimeline::clear | ( | ) |
clear the change list
Definition at line 27 of file ChangeTimeline.cc.
References VGServer::Changelist::clear(), clend, clstart, and frames.
Referenced by VGServer::GraphConnection::commit(), and VGServer::GraphConnection::rollback().
bool VGServer::ChangeTimeline::delEdge | ( | vertexid_t | src, | |
vertexid_t | tgt | |||
) |
removes an edge from the graph. returns true if it existed.
Definition at line 105 of file ChangeTimeline.cc.
References clend, VGServer::Changelist::delEdge(), frames, and getFrameCount().
Referenced by VGServer::GraphConnection::delEdge().
bool VGServer::ChangeTimeline::delVertex | ( | vertexid_t | id | ) |
deletes a vertex from the graph. returns true if it existed
Definition at line 75 of file ChangeTimeline.cc.
References clend, VGServer::Changelist::delVertex(), frames, and getFrameCount().
Referenced by VGServer::GraphConnection::delVertex().
class Changelist& VGServer::ChangeTimeline::getChangelist | ( | ) | const [inline] |
checks that just one frame exists and returns the changelist
Definition at line 172 of file ChangeTimeline.h.
class Changelist& VGServer::ChangeTimeline::getChangelistEnd | ( | ) | const [inline] |
returns the full changelist of the last frame
Definition at line 168 of file ChangeTimeline.h.
References clend.
Referenced by VGServer::GraphConnection::commit(), VGServer::GraphConnection::getEdge(), VGServer::GraphConnection::getEdgeList(), and VGServer::GraphConnection::getVertex().
class Changelist& VGServer::ChangeTimeline::getChangelistStart | ( | ) | const [inline] |
returns the changelist of the initial frame (before the first nextFrame() call)
Definition at line 164 of file ChangeTimeline.h.
References clstart.
Referenced by VGServer::GraphConnection::getNearestNeighbor().
unsigned int VGServer::ChangeTimeline::getFrameCount | ( | ) | const [inline] |
the number of animation frames in the list, and also the number of the current frame, because 0 is not stored as a frame.
Definition at line 157 of file ChangeTimeline.h.
References frames.
Referenced by addEdge(), addVertex(), advanceTimeFrame(), delEdge(), delVertex(), setEdgeAttr(), and setVertexAttr().
bool VGServer::ChangeTimeline::setEdgeAttr | ( | vertexid_t | src, | |
vertexid_t | tgt, | |||
unsigned int | attrid, | |||
const AnyType & | value | |||
) |
changes the value of an attribute on the edge
Definition at line 95 of file ChangeTimeline.cc.
References clend, frames, VGServer::Changelist::getEdgeChange(), getFrameCount(), and VGServer::Changelist::setEdgeAttr().
Referenced by VGServer::GraphConnection::setEdgeAttr().
bool VGServer::ChangeTimeline::setVertexAttr | ( | vertexid_t | id, | |
unsigned int | attrid, | |||
const AnyType & | value | |||
) |
changes the value of an attribute on the vertex
Definition at line 65 of file ChangeTimeline.cc.
References clend, frames, getFrameCount(), VGServer::Changelist::getVertexChange(), and VGServer::Changelist::setVertexAttr().
Referenced by VGServer::GraphConnection::setVertexAttr().
friend class GraphContainer [friend] |
class Changelist* VGServer::ChangeTimeline::clend [protected] |
represents the changes made during the whole timeline, thus is a merged version from clstart with all ChangeFrames.
Definition at line 108 of file ChangeTimeline.h.
Referenced by addEdge(), addVertex(), advanceTimeFrame(), ChangeTimeline(), clear(), delEdge(), delVertex(), getChangelist(), getChangelistEnd(), setEdgeAttr(), setVertexAttr(), and ~ChangeTimeline().
class Changelist* VGServer::ChangeTimeline::clstart [protected] |
the changes made before the first frame is marked as finished.
this structure is used by the query functions of the client, as this is the base for it's animation list.
Definition at line 104 of file ChangeTimeline.h.
Referenced by advanceTimeFrame(), ChangeTimeline(), clear(), getChangelist(), getChangelistStart(), and ~ChangeTimeline().
changeframelist_t VGServer::ChangeTimeline::frames [protected] |
the actual list of frames.
if this is empty, the timeline consist of only one changelist.
Definition at line 119 of file ChangeTimeline.h.
Referenced by addEdge(), addVertex(), advanceTimeFrame(), clear(), delEdge(), delVertex(), getFrameCount(), setEdgeAttr(), and setVertexAttr().
class GraphData& VGServer::ChangeTimeline::graph [protected] |
reference to the GraphData object for which these represent changes.
Definition at line 111 of file ChangeTimeline.h.
Referenced by ChangeTimeline().