graph_analysis
Public Member Functions | Public Attributes | List of all members
graph_analysis::gui::EdgeMimeData Class Reference

custom class for drag-n-drop of edges More...

#include <EdgeMimeData.hpp>

Inheritance diagram for graph_analysis::gui::EdgeMimeData:
Inheritance graph
[legend]
Collaboration diagram for graph_analysis::gui::EdgeMimeData:
Collaboration graph
[legend]

Public Member Functions

 EdgeMimeData (Vertex::Ptr &sourceVertex, Vertex::Ptr &targetVertex)
 
bool sourceVertexIsSameAs (const Vertex::Ptr &other) const
 compares the stored reference to the other vertex given. More...
 

Public Attributes

Vertex::Ptr & mpSourceVertex
 
Vertex::Ptr & mpTargetVertex
 

Detailed Description

custom class for drag-n-drop of edges

forgive me for this horrible hack... i hope it never explodes or rots.

the drag-n-drop event on the receiving side, inside the VertexItem, get a "const*" to this mimeData object, which we cannot manipulate. but somehow, i wanna tell the originating side on which vertex the drag event was dropped. so containing to references for the two vertexes.

funny sidenote: having a "mutable" member did result in horrible undefined behaviour, although it should work (tm).

Constructor & Destructor Documentation

◆ EdgeMimeData()

graph_analysis::gui::EdgeMimeData::EdgeMimeData ( Vertex::Ptr &  sourceVertex,
Vertex::Ptr &  targetVertex 
)

Member Function Documentation

◆ sourceVertexIsSameAs()

bool graph_analysis::gui::EdgeMimeData::sourceVertexIsSameAs ( const Vertex::Ptr &  other) const

compares the stored reference to the other vertex given.

protects against "self drops", when edges are considered to not connect one edge to itself.

Parameters
otherthe vertex to check
Returns
true if the given vertex is the as the stored one.

Member Data Documentation

◆ mpSourceVertex

Vertex::Ptr& graph_analysis::gui::EdgeMimeData::mpSourceVertex

◆ mpTargetVertex

Vertex::Ptr& graph_analysis::gui::EdgeMimeData::mpTargetVertex

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