C# Класс Smrf.NodeXL.Visualization.Wpf.GraphDrawer

Draws a NodeXL graph onto a collection of Visual objects.
This is used to draw a NodeXL graph in a WPF application. It contains a collection of Visual objects that represent the graph's vertices and edges. Call DrawGraph to draw a laid-out NodeXL graph onto the contained GraphDrawer.VisualCollection.

GraphDrawer does not lay out the graph. You should lay out the graph using one of the provided layout classes before calling .

A GraphDrawer cannot be directly rendered and is typically not used directly by an application. Applications typically use one of two other NodeXL graph-drawing classes:

NodeXLControl, which is a FrameworkElement that wraps a and hosts its . NodeXLControl is meant for use in WPF desktop applications. It automatically lays out the graph before drawing it. NodeXLVisual, which is a Visual that wraps a and hosts its . This is a lower-level alternative to NodeXLControl and can be used anywhere a Visual is more appropriate than a FrameworkElement. Like GraphDrawer, does not lay out the graph before drawing it.

If you do use GraphDrawer directly, rendering the graph requires a custom wrapper that hosts the GraphDrawer. object.

Наследование: DrawerBase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
m_oAllVertexDrawingVisuals System.Windows.Media.DrawingVisual
m_oBackColor Color
m_oBackgroundImage ImageSource
m_oEdgeDrawer EdgeDrawer
m_oGroupDrawer GroupDrawer
m_oSelectedEdgeDrawingVisuals DrawingVisual
m_oUnselectedEdgeDrawingVisuals DrawingVisual
m_oVertexDrawer VertexDrawer
m_oVisualCollection VisualCollection

Открытые методы

Метод Описание
AddVisualOnTopOfGraph ( Visual visual ) : void
AssertValid ( ) : void
DrawGraph ( IGraph graph, GraphDrawingContext graphDrawingContext ) : void
DrawNewEdge ( IEdge newEdge, GraphDrawingContext graphDrawingContext ) : void
DrawNewVertex ( IVertex newVertex, GraphDrawingContext graphDrawingContext ) : void
GetVerticesFromRectangle ( Rect rectangle ) : ICollection
GraphDrawer ( Visual parentVisual ) : System

Initializes a new instance of the GraphDrawer class.

RedrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
RedrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
RemoveVisualFromTopOfGraph ( Visual visual ) : void
TryGetVertexFromPoint ( Point point, IVertex &vertex ) : System.Boolean
UndrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
UndrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void

Защищенные методы

Метод Описание
DrawBackground ( IGraph oGraph, GraphDrawingContext oGraphDrawingContext ) : void
DrawEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext ) : void
DrawVertex ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext ) : void
GetEdgeDrawingVisuals ( EdgeDrawingHistory oEdgeDrawingHistory ) : System.Windows.Media.DrawingVisual
GetVerticesToDraw ( IGraph oGraph ) : ICollection
RetrieveVertexFromDrawingVisual ( System.Windows.Media.DrawingVisual oDrawingVisual ) : IVertex
SaveVertexOnDrawingVisual ( IVertex oVertex, System.Windows.Media.DrawingVisual oDrawingVisual ) : void

Описание методов

AddVisualOnTopOfGraph() публичный метод

public AddVisualOnTopOfGraph ( Visual visual ) : void
visual Visual
Результат void

AssertValid() публичный метод

public AssertValid ( ) : void
Результат void

DrawBackground() защищенный метод

protected DrawBackground ( IGraph oGraph, GraphDrawingContext oGraphDrawingContext ) : void
oGraph IGraph
oGraphDrawingContext GraphDrawingContext
Результат void

DrawEdge() защищенный метод

protected DrawEdge ( IEdge oEdge, GraphDrawingContext oGraphDrawingContext ) : void
oEdge IEdge
oGraphDrawingContext GraphDrawingContext
Результат void

DrawGraph() публичный метод

public DrawGraph ( IGraph graph, GraphDrawingContext graphDrawingContext ) : void
graph IGraph
graphDrawingContext GraphDrawingContext
Результат void

DrawNewEdge() публичный метод

public DrawNewEdge ( IEdge newEdge, GraphDrawingContext graphDrawingContext ) : void
newEdge IEdge
graphDrawingContext GraphDrawingContext
Результат void

DrawNewVertex() публичный метод

public DrawNewVertex ( IVertex newVertex, GraphDrawingContext graphDrawingContext ) : void
newVertex IVertex
graphDrawingContext GraphDrawingContext
Результат void

DrawVertex() защищенный метод

protected DrawVertex ( IVertex oVertex, GraphDrawingContext oGraphDrawingContext ) : void
oVertex IVertex
oGraphDrawingContext GraphDrawingContext
Результат void

GetEdgeDrawingVisuals() защищенный метод

protected GetEdgeDrawingVisuals ( EdgeDrawingHistory oEdgeDrawingHistory ) : System.Windows.Media.DrawingVisual
oEdgeDrawingHistory EdgeDrawingHistory
Результат System.Windows.Media.DrawingVisual

GetVerticesFromRectangle() публичный метод

public GetVerticesFromRectangle ( Rect rectangle ) : ICollection
rectangle System.Windows.Rect
Результат ICollection

GetVerticesToDraw() защищенный метод

protected GetVerticesToDraw ( IGraph oGraph ) : ICollection
oGraph IGraph
Результат ICollection

GraphDrawer() публичный метод

Initializes a new instance of the GraphDrawer class.
public GraphDrawer ( Visual parentVisual ) : System
parentVisual Visual /// The parent of the contained . This is usually a /// FrameworkElement that is hosting the collection. ///
Результат System

RedrawEdge() публичный метод

public RedrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
edge IEdge
graphDrawingContext GraphDrawingContext
Результат void

RedrawVertex() публичный метод

public RedrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
vertex IVertex
graphDrawingContext GraphDrawingContext
Результат void

RemoveVisualFromTopOfGraph() публичный метод

public RemoveVisualFromTopOfGraph ( Visual visual ) : void
visual Visual
Результат void

RetrieveVertexFromDrawingVisual() защищенный метод

protected RetrieveVertexFromDrawingVisual ( System.Windows.Media.DrawingVisual oDrawingVisual ) : IVertex
oDrawingVisual System.Windows.Media.DrawingVisual
Результат IVertex

SaveVertexOnDrawingVisual() защищенный метод

protected SaveVertexOnDrawingVisual ( IVertex oVertex, System.Windows.Media.DrawingVisual oDrawingVisual ) : void
oVertex IVertex
oDrawingVisual System.Windows.Media.DrawingVisual
Результат void

TryGetVertexFromPoint() публичный метод

public TryGetVertexFromPoint ( Point point, IVertex &vertex ) : System.Boolean
point Point
vertex IVertex
Результат System.Boolean

UndrawEdge() публичный метод

public UndrawEdge ( IEdge edge, GraphDrawingContext graphDrawingContext ) : void
edge IEdge
graphDrawingContext GraphDrawingContext
Результат void

UndrawVertex() публичный метод

public UndrawVertex ( IVertex vertex, GraphDrawingContext graphDrawingContext ) : void
vertex IVertex
graphDrawingContext GraphDrawingContext
Результат void

Описание свойств

m_oAllVertexDrawingVisuals защищенное свойство

protected DrawingVisual,System.Windows.Media m_oAllVertexDrawingVisuals
Результат System.Windows.Media.DrawingVisual

m_oBackColor защищенное свойство

protected Color m_oBackColor
Результат Color

m_oBackgroundImage защищенное свойство

protected ImageSource m_oBackgroundImage
Результат ImageSource

m_oEdgeDrawer защищенное свойство

protected EdgeDrawer m_oEdgeDrawer
Результат EdgeDrawer

m_oGroupDrawer защищенное свойство

protected GroupDrawer m_oGroupDrawer
Результат GroupDrawer

m_oSelectedEdgeDrawingVisuals защищенное свойство

protected DrawingVisual m_oSelectedEdgeDrawingVisuals
Результат DrawingVisual

m_oUnselectedEdgeDrawingVisuals защищенное свойство

protected DrawingVisual m_oUnselectedEdgeDrawingVisuals
Результат DrawingVisual

m_oVertexDrawer защищенное свойство

protected VertexDrawer m_oVertexDrawer
Результат VertexDrawer

m_oVisualCollection защищенное свойство

protected VisualCollection m_oVisualCollection
Результат VisualCollection