C# Class Smrf.NodeXL.Layouts.LayoutBase

Base class for layouts.
This abstract class can serve as a base class for implementations. Its implementations of the public methods provide error checking but defer the actual work to protected abstract methods.
Inheritance: LayoutsBase, ILayout
ファイルを表示 Open project: 2014-sed-team3/term-project

Protected Properties

Property Type Description
MaximumGroupEdgeCountToGrid System.Single
m_bImproveLayoutOfGroups System.Boolean
m_dGroupRectanglePenWidth Double
m_eBoxLayoutAlgorithm BoxLayoutAlgorithm
m_eIntergroupEdgeStyle IntergroupEdgeStyle
m_eLayoutStyle LayoutStyle
m_iBinLength System.Int32
m_iMargin System.Int32
m_iMaximumVerticesPerBin System.Int32
m_oBackgroundWorker System.ComponentModel.BackgroundWorker

Public Methods

Method Description
AssertValid ( ) : void
LayOutGraph ( IGraph graph, LayoutContext layoutContext ) : void
LayOutGraphAsync ( IGraph graph, LayoutContext layoutContext ) : void
LayOutGraphAsyncCancel ( ) : void
LayoutBase ( ) : System

Initializes a new instance of the LayoutBase class.

OnVertexMove ( IVertex vertex ) : void
TransformLayout ( IGraph graph, LayoutContext originalLayoutContext, LayoutContext newLayoutContext ) : void
getConnectivityBetween ( GroupInfo g1, GroupInfo g2, IGraph oGraph ) : bool

Get whether there is connectivity between two groups in a graph.

Protected Methods

Method Description
BackgroundWorker_DoWork ( Object sender, DoWorkEventArgs e ) : void
BackgroundWorker_RunWorkerCompleted ( Object sender, RunWorkerCompletedEventArgs e ) : void
FireLayOutGraphCompleted ( AsyncCompletedEventArgs oAsyncCompletedEventArgs ) : void
GetAdjustedLayoutContext ( IGraph oGraph, LayoutContext oOriginalLayoutContext, LayoutContext &oAdjustedLayoutContext ) : System.Boolean
GetEdgesToLayOut ( IGraph graph, ICollection verticesToLayOut ) : ICollection
GetGroupsToLayOut ( IGraph oGraph ) : List
GetGroupsToLayOutConnectivity ( IGraph oGraph ) : List
GetLayoutToUseForGroup ( IGraph oGraph, ICollection oVerticesInGroup ) : LayoutBase
GetRectangleCenterAndHalfSize ( Rectangle rectangle, Double &centerX, Double &centerY, Double &halfSize ) : void
GetVerticesToLayOut ( IGraph graph ) : ICollection
LayOutGraphCore ( IGraph graph, ICollection verticesToLayOut, LayoutContext layoutContext, BackgroundWorker backgroundWorker ) : System.Boolean
LayOutGraphInternal ( IGraph oGraph, LayoutContext oLayoutContext, BackgroundWorker oBackgroundWorker, DoWorkEventArgs oDoWorkEventArgs ) : void
LayOutGraphUsingForceDirectedGroups ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
LayOutGraphUsingGroups ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
LayOutGraphUsingPackedRectangles ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
OnVertexMoveCore ( IVertex vertex ) : void
RandomizeVertexLocations ( ICollection vertices, LayoutContext layoutContext, Random random ) : void
RandomizeVertexLocations ( IGraph graph, LayoutContext layoutContext ) : void
RandomizeVertexLocations ( IGraph graph, LayoutContext layoutContext, Int32 seed ) : void
TransformIntermediateCurvePoints ( IGraph oGraph, Matrix oTransformationMatrix ) : void
TransformLayoutCore ( IGraph graph, LayoutContext originalLayoutContext, LayoutContext newLayoutContext ) : void
UseGridLayoutForGroup ( ICollection oVerticesInGroup ) : System.Boolean
VertexIsLocked ( IVertex oVertex ) : System.Boolean

Private Methods

Method Description
createGroupVertexProximityGraph ( IGraph graph ) : Graph

Creates the proximity graph (delaunay triangulation) of the node positions in the group graph.

inverse ( System.Single val ) : System.Single
isApproximatelyEqual ( System.Single value1, System.Single value2, System.Single epsilon ) : bool
proximityGraphStressMajorization ( IGraph groupProximityGraph, int maxIterations ) : System.Boolean

Method Details

AssertValid() public method

public AssertValid ( ) : void
return void

BackgroundWorker_DoWork() protected method

protected BackgroundWorker_DoWork ( Object sender, DoWorkEventArgs e ) : void
sender Object
e System.ComponentModel.DoWorkEventArgs
return void

BackgroundWorker_RunWorkerCompleted() protected method

protected BackgroundWorker_RunWorkerCompleted ( Object sender, RunWorkerCompletedEventArgs e ) : void
sender Object
e System.ComponentModel.RunWorkerCompletedEventArgs
return void

FireLayOutGraphCompleted() protected method

protected FireLayOutGraphCompleted ( AsyncCompletedEventArgs oAsyncCompletedEventArgs ) : void
oAsyncCompletedEventArgs System.ComponentModel.AsyncCompletedEventArgs
return void

GetAdjustedLayoutContext() protected method

protected GetAdjustedLayoutContext ( IGraph oGraph, LayoutContext oOriginalLayoutContext, LayoutContext &oAdjustedLayoutContext ) : System.Boolean
oGraph IGraph
oOriginalLayoutContext LayoutContext
oAdjustedLayoutContext LayoutContext
return System.Boolean

GetEdgesToLayOut() protected method

protected GetEdgesToLayOut ( IGraph graph, ICollection verticesToLayOut ) : ICollection
graph IGraph
verticesToLayOut ICollection
return ICollection

GetGroupsToLayOut() protected method

protected GetGroupsToLayOut ( IGraph oGraph ) : List
oGraph IGraph
return List

GetGroupsToLayOutConnectivity() protected method

protected GetGroupsToLayOutConnectivity ( IGraph oGraph ) : List
oGraph IGraph
return List

GetLayoutToUseForGroup() protected method

protected GetLayoutToUseForGroup ( IGraph oGraph, ICollection oVerticesInGroup ) : LayoutBase
oGraph IGraph
oVerticesInGroup ICollection
return LayoutBase

GetRectangleCenterAndHalfSize() protected method

protected GetRectangleCenterAndHalfSize ( Rectangle rectangle, Double &centerX, Double &centerY, Double &halfSize ) : void
rectangle System.Drawing.Rectangle
centerX Double
centerY Double
halfSize Double
return void

GetVerticesToLayOut() protected method

protected GetVerticesToLayOut ( IGraph graph ) : ICollection
graph IGraph
return ICollection

LayOutGraph() public method

public LayOutGraph ( IGraph graph, LayoutContext layoutContext ) : void
graph IGraph
layoutContext LayoutContext
return void

LayOutGraphAsync() public method

public LayOutGraphAsync ( IGraph graph, LayoutContext layoutContext ) : void
graph IGraph
layoutContext LayoutContext
return void

LayOutGraphAsyncCancel() public method

public LayOutGraphAsyncCancel ( ) : void
return void

LayOutGraphCore() protected abstract method

protected abstract LayOutGraphCore ( IGraph graph, ICollection verticesToLayOut, LayoutContext layoutContext, BackgroundWorker backgroundWorker ) : System.Boolean
graph IGraph
verticesToLayOut ICollection
layoutContext LayoutContext
backgroundWorker System.ComponentModel.BackgroundWorker
return System.Boolean

LayOutGraphInternal() protected method

protected LayOutGraphInternal ( IGraph oGraph, LayoutContext oLayoutContext, BackgroundWorker oBackgroundWorker, DoWorkEventArgs oDoWorkEventArgs ) : void
oGraph IGraph
oLayoutContext LayoutContext
oBackgroundWorker System.ComponentModel.BackgroundWorker
oDoWorkEventArgs System.ComponentModel.DoWorkEventArgs
return void

LayOutGraphUsingForceDirectedGroups() protected method

protected LayOutGraphUsingForceDirectedGroups ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
oGraph IGraph
oGroupsToLayout List
oAdjustedLayoutContext LayoutContext
oBackgroundWorker System.ComponentModel.BackgroundWorker
return System.Boolean

LayOutGraphUsingGroups() protected method

protected LayOutGraphUsingGroups ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
oGraph IGraph
oGroupsToLayout List
oAdjustedLayoutContext LayoutContext
oBackgroundWorker System.ComponentModel.BackgroundWorker
return System.Boolean

LayOutGraphUsingPackedRectangles() protected method

protected LayOutGraphUsingPackedRectangles ( IGraph oGraph, List oGroupsToLayout, LayoutContext oAdjustedLayoutContext, BackgroundWorker oBackgroundWorker ) : System.Boolean
oGraph IGraph
oGroupsToLayout List
oAdjustedLayoutContext LayoutContext
oBackgroundWorker System.ComponentModel.BackgroundWorker
return System.Boolean

LayoutBase() public method

Initializes a new instance of the LayoutBase class.
public LayoutBase ( ) : System
return System

OnVertexMove() public method

public OnVertexMove ( IVertex vertex ) : void
vertex IVertex
return void

OnVertexMoveCore() protected method

protected OnVertexMoveCore ( IVertex vertex ) : void
vertex IVertex
return void

RandomizeVertexLocations() protected method

protected RandomizeVertexLocations ( ICollection vertices, LayoutContext layoutContext, Random random ) : void
vertices ICollection
layoutContext LayoutContext
random System.Random
return void

RandomizeVertexLocations() protected method

protected RandomizeVertexLocations ( IGraph graph, LayoutContext layoutContext ) : void
graph IGraph
layoutContext LayoutContext
return void

RandomizeVertexLocations() protected method

protected RandomizeVertexLocations ( IGraph graph, LayoutContext layoutContext, Int32 seed ) : void
graph IGraph
layoutContext LayoutContext
seed System.Int32
return void

TransformIntermediateCurvePoints() protected method

protected TransformIntermediateCurvePoints ( IGraph oGraph, Matrix oTransformationMatrix ) : void
oGraph IGraph
oTransformationMatrix Matrix
return void

TransformLayout() public method

public TransformLayout ( IGraph graph, LayoutContext originalLayoutContext, LayoutContext newLayoutContext ) : void
graph IGraph
originalLayoutContext LayoutContext
newLayoutContext LayoutContext
return void

TransformLayoutCore() protected method

protected TransformLayoutCore ( IGraph graph, LayoutContext originalLayoutContext, LayoutContext newLayoutContext ) : void
graph IGraph
originalLayoutContext LayoutContext
newLayoutContext LayoutContext
return void

UseGridLayoutForGroup() protected method

protected UseGridLayoutForGroup ( ICollection oVerticesInGroup ) : System.Boolean
oVerticesInGroup ICollection
return System.Boolean

VertexIsLocked() protected method

protected VertexIsLocked ( IVertex oVertex ) : System.Boolean
oVertex IVertex
return System.Boolean

getConnectivityBetween() public method

Get whether there is connectivity between two groups in a graph.
public getConnectivityBetween ( GroupInfo g1, GroupInfo g2, IGraph oGraph ) : bool
g1 Smrf.NodeXL.Core.GroupInfo /// Group 1 ///
g2 Smrf.NodeXL.Core.GroupInfo /// Group 2 ///
oGraph IGraph /// The graph these groups are in ///
return bool

Property Details

MaximumGroupEdgeCountToGrid protected_oe property

protected Single,System MaximumGroupEdgeCountToGrid
return System.Single

m_bImproveLayoutOfGroups protected_oe property

protected Boolean,System m_bImproveLayoutOfGroups
return System.Boolean

m_dGroupRectanglePenWidth protected_oe property

protected Double m_dGroupRectanglePenWidth
return Double

m_eBoxLayoutAlgorithm protected_oe property

protected BoxLayoutAlgorithm m_eBoxLayoutAlgorithm
return BoxLayoutAlgorithm

m_eIntergroupEdgeStyle protected_oe property

protected IntergroupEdgeStyle m_eIntergroupEdgeStyle
return IntergroupEdgeStyle

m_eLayoutStyle protected_oe property

protected LayoutStyle m_eLayoutStyle
return LayoutStyle

m_iBinLength protected_oe property

protected Int32,System m_iBinLength
return System.Int32

m_iMargin protected_oe property

protected Int32,System m_iMargin
return System.Int32

m_iMaximumVerticesPerBin protected_oe property

protected Int32,System m_iMaximumVerticesPerBin
return System.Int32

m_oBackgroundWorker protected_oe property

protected BackgroundWorker,System.ComponentModel m_oBackgroundWorker
return System.ComponentModel.BackgroundWorker