VPTissue Reference Manual
SimPT_Editor::EditableEdgeItem Class Reference

Editable graphical representation for Edge. More...

#include <EditableEdgeItem.h>

Inheritance diagram for SimPT_Editor::EditableEdgeItem:
Inheritance graph
Collaboration diagram for SimPT_Editor::EditableEdgeItem:
Collaboration graph

Public Slots

virtual void Update ()
 Update the edge.
 
- Public Slots inherited from SimPT_Editor::EditableItem
virtual void Update ()
 Update this item.
 

Signals

void EdgeMerged (EditableEdgeItem *oldEdge1, EditableEdgeItem *oldEdge2, EditableEdgeItem *edge)
 Emitted when the two given edges should be replaced by the new edge. More...
 
void EdgeSplitted (EditableEdgeItem *oldEdge, EditableEdgeItem *edge1, EditableEdgeItem *edge2)
 Emitted when a given edge should be replaced with two other edges. More...
 

Public Member Functions

 EditableEdgeItem (EditableNodeItem *node1, EditableNodeItem *node2)
 Constructor. More...
 
virtual ~EditableEdgeItem ()
 Destructor.
 
EditableNodeItemConnectingNode (EditableEdgeItem *edge) const
 Returns the connecting node when this edge and the given edge connect. More...
 
bool ContainsEndpoint (EditableNodeItem *endpoint) const
 Checks whether the given endpoint is an endpoint of this edge. More...
 
bool ContainsEndpoints (EditableNodeItem *endpoint1, EditableNodeItem *endpoint2) const
 Checks whether the given endpoints match the endpoints of this edge. More...
 
SimPT_Sim::Edge Edge () const
 Returns the edge associated with this item. More...
 
EditableNodeItemFirst () const
 Returns the first endpoint of the edge item.
 
virtual void Highlight (bool highlighted)
 Highlights the edge in the canvas. More...
 
virtual bool IsAtBoundary () const
 Checks whether the endpoints of the edge are at the boundary of the cell complex. More...
 
EditableEdgeItemMergeEdge (EditableEdgeItem *edge)
 Merge the given edge with this edge into one. More...
 
EditableNodeItemSecond () const
 Returns the second endpoint of the edge item.
 
virtual void SetHighlightColor (const QColor &color=DEFAULT_HIGHLIGHT_COLOR)
 Set the color the item should get when it gets highlighted. More...
 
std::pair< EditableEdgeItem *, EditableEdgeItem * > SplitEdge (EditableNodeItem *node)
 Split the edge in two edges on the given node. More...
 
- Public Member Functions inherited from SimPT_Editor::EditableItem
 EditableItem ()
 Constructor.
 
virtual ~EditableItem ()
 Destructor.
 

Detailed Description

Editable graphical representation for Edge.

Definition at line 35 of file EditableEdgeItem.h.

Constructor & Destructor Documentation

SimPT_Editor::EditableEdgeItem::EditableEdgeItem ( EditableNodeItem node1,
EditableNodeItem node2 
)

Constructor.

Remember that the order of the endpoints doesn't matter.

Parameters
node1The first endpoint of the edge.
node2The second endpoint of the edge.

Definition at line 38 of file EditableEdgeItem.cpp.

References Update().

Referenced by MergeEdge(), and SplitEdge().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

EditableNodeItem * SimPT_Editor::EditableEdgeItem::ConnectingNode ( EditableEdgeItem edge) const

Returns the connecting node when this edge and the given edge connect.

Parameters
edgeThe given edge.
Returns
Nullptr if the edges don't connect.

Definition at line 66 of file EditableEdgeItem.cpp.

Referenced by MergeEdge(), SimPT_Editor::EditableCellItem::ReplaceEdgeWithTwoEdges(), and SimPT_Editor::EditableCellItem::ReplaceTwoEdgesWithEdge().

Here is the caller graph for this function:

bool SimPT_Editor::EditableEdgeItem::ContainsEndpoint ( EditableNodeItem endpoint) const

Checks whether the given endpoint is an endpoint of this edge.

Parameters
endpointThe given endpoint.
Returns
True if the edge contains the endpoint.

Definition at line 56 of file EditableEdgeItem.cpp.

Referenced by ContainsEndpoints().

Here is the caller graph for this function:

bool SimPT_Editor::EditableEdgeItem::ContainsEndpoints ( EditableNodeItem endpoint1,
EditableNodeItem endpoint2 
) const

Checks whether the given endpoints match the endpoints of this edge.

Parameters
endpoint1The first endpoint of the edge.
endpoint2The second endpoint of the edge.
Returns
True if the endpoints do match.

Definition at line 61 of file EditableEdgeItem.cpp.

References ContainsEndpoint().

Referenced by MergeEdge().

Here is the call graph for this function:

Here is the caller graph for this function:

SimPT_Sim::Edge SimPT_Editor::EditableEdgeItem::Edge ( ) const

Returns the edge associated with this item.

Returns
The edge.

Definition at line 79 of file EditableEdgeItem.cpp.

References SimPT_Editor::EditableNodeItem::Node().

Here is the call graph for this function:

void SimPT_Editor::EditableEdgeItem::EdgeMerged ( EditableEdgeItem oldEdge1,
EditableEdgeItem oldEdge2,
EditableEdgeItem edge 
)
signal

Emitted when the two given edges should be replaced by the new edge.

Parameters
oldEdge1The edge which should be replaced.
oldEdge2The first replacement edge.
edgeThe second replacement edge.

Referenced by MergeEdge().

Here is the caller graph for this function:

void SimPT_Editor::EditableEdgeItem::EdgeSplitted ( EditableEdgeItem oldEdge,
EditableEdgeItem edge1,
EditableEdgeItem edge2 
)
signal

Emitted when a given edge should be replaced with two other edges.

Parameters
oldEdgeThe edge which should be replaced.
edge1The first replacement edge.
edge2The second replacement edge.

Referenced by SplitEdge().

Here is the caller graph for this function:

void SimPT_Editor::EditableEdgeItem::Highlight ( bool  highlighted)
virtual

Highlights the edge in the canvas.

Parameters
highlightedTrue if the edge should be highlighted.

Implements SimPT_Editor::EditableItem.

Definition at line 84 of file EditableEdgeItem.cpp.

bool SimPT_Editor::EditableEdgeItem::IsAtBoundary ( ) const
virtual

Checks whether the endpoints of the edge are at the boundary of the cell complex.

Returns
True if the endpoints are at the boundary.

Implements SimPT_Editor::EditableItem.

Definition at line 51 of file EditableEdgeItem.cpp.

References SimPT_Editor::EditableNodeItem::IsAtBoundary().

Here is the call graph for this function:

EditableEdgeItem * SimPT_Editor::EditableEdgeItem::MergeEdge ( EditableEdgeItem edge)

Merge the given edge with this edge into one.

The edges should have exactly one connection point.

Parameters
edgeThe given edge.
Returns
The new edge.

Definition at line 98 of file EditableEdgeItem.cpp.

References ConnectingNode(), ContainsEndpoints(), EdgeMerged(), EditableEdgeItem(), First(), and Second().

Here is the call graph for this function:

void SimPT_Editor::EditableEdgeItem::SetHighlightColor ( const QColor &  color = DEFAULT_HIGHLIGHT_COLOR)
virtual

Set the color the item should get when it gets highlighted.

Parameters
colorThe given color.

Implements SimPT_Editor::EditableItem.

Definition at line 93 of file EditableEdgeItem.cpp.

std::pair< EditableEdgeItem *, EditableEdgeItem * > SimPT_Editor::EditableEdgeItem::SplitEdge ( EditableNodeItem node)

Split the edge in two edges on the given node.

Parameters
nodeThe given node.
Returns
The two new edges.

Definition at line 126 of file EditableEdgeItem.cpp.

References EdgeSplitted(), and EditableEdgeItem().

Here is the call graph for this function:


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