Class FSAAlgorithm<TObject, TParameters>
Force-Scan Algorithm (FSA).
Inheritance
Inherited Members
Namespace: GraphShape.Algorithms.OverlapRemoval
Assembly: GraphShape.dll
Syntax
public class FSAAlgorithm<TObject, TParameters> : OverlapRemovalAlgorithmBase<TObject, TParameters>, IOverlapRemovalAlgorithm<TObject, TParameters>, IOverlapRemovalAlgorithm<TObject>, IAlgorithm where TParameters : IOverlapRemovalParameters
Type Parameters
Name | Description |
---|---|
TObject | Object type. |
TParameters | Algorithm parameters type. |
Constructors
| Improve this Doc View SourceFSAAlgorithm(IDictionary<TObject, Rect>, TParameters)
Initializes a new instance of the FSAAlgorithm<TObject, TParameters> class.
Declaration
public FSAAlgorithm(IDictionary<TObject, Rect> rectangles, TParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<TObject, Rect> | rectangles | Overlap rectangles. |
TParameters | parameters | Algorithm parameters. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Methods
| Improve this Doc View SourceForce(Rect, Rect)
Specifies the bounding force of the two rectangles.
Declaration
protected Vector Force(Rect vi, Rect vj)
Parameters
Type | Name | Description |
---|---|---|
Rect | vi | First rectangle. |
Rect | vj | Second rectangle. |
Returns
Type | Description |
---|---|
Vector | Force vector. |
Force2(Rect, Rect)
Specifies the bounding force of the two rectangles (version 2).
Declaration
protected Vector Force2(Rect vi, Rect vj)
Parameters
Type | Name | Description |
---|---|---|
Rect | vi | First rectangle. |
Rect | vj | Second rectangle. |
Returns
Type | Description |
---|---|
Vector | Force vector. |
Horizontal()
Horizontal offset rectangles.
Declaration
protected void Horizontal()
HorizontalImproved()
Horizontal improvement.
Declaration
protected double HorizontalImproved()
Returns
Type | Description |
---|---|
System.Double |
RemoveOverlap()
Removes overlap.
Declaration
protected override void RemoveOverlap()
Overrides
Vertical()
Vertical offset rectangles.
Declaration
protected void Vertical()
VerticalImproved()
Vertical improvement.
Declaration
protected double VerticalImproved()
Returns
Type | Description |
---|---|
System.Double |
XComparison(RectangleWrapper<TObject>, RectangleWrapper<TObject>)
Compares both rectangle center on X axis.
Declaration
protected int XComparison(RectangleWrapper<TObject> r1, RectangleWrapper<TObject> r2)
Parameters
Type | Name | Description |
---|---|---|
RectangleWrapper<TObject> | r1 | First rectangle. |
RectangleWrapper<TObject> | r2 | Second rectangle. |
Returns
Type | Description |
---|---|
System.Int32 | 0 if both rectangle have same X center,
-1 if |
YComparison(RectangleWrapper<TObject>, RectangleWrapper<TObject>)
Compares both rectangle center on Y axis.
Declaration
protected int YComparison(RectangleWrapper<TObject> r1, RectangleWrapper<TObject> r2)
Parameters
Type | Name | Description |
---|---|---|
RectangleWrapper<TObject> | r1 | First rectangle. |
RectangleWrapper<TObject> | r2 | Second rectangle. |
Returns
Type | Description |
---|---|
System.Int32 | 0 if both rectangle have same Y center,
-1 if |