internal static Point[] InitNodePositionsAndBoxes(OverlapRemovalSettings overlapRemovalSettings,
                                                   Node[] nodes, out Point[] nodePositions,
                                                   out Size[] nodeSizes)
 {
     nodePositions = nodes.Select(v => v.Center).ToArray();
     //make sure no two points are the same
     RandomizePoints(nodePositions, new Random(overlapRemovalSettings.RandomizationSeed),
                     overlapRemovalSettings.Epsilon,
                     overlapRemovalSettings.RandomizeAllPointsOnStart);
     nodeSizes = GetNodeSizesByPaddingWithHalfSeparation(nodes, overlapRemovalSettings.NodeSeparation);
     return(nodePositions);
 }
 internal static Point[] InitNodePositionsAndBoxes(OverlapRemovalSettings overlapRemovalSettings,
                                                   GeometryGraph geometryGraph, out Point[] nodePositions,
                                                   out Size[] nodeSizes)
 {
     nodePositions = geometryGraph.Nodes.Select(v => v.Center).ToArray();
     //make sure no two points are the same
     RandomizePoints(nodePositions, new Random(overlapRemovalSettings.RandomizationSeed),
                     overlapRemovalSettings.Epsilon,
                     overlapRemovalSettings.RandomizeAllPointsOnStart);
     //TODO replace boxes with double[] for width and height.
     nodeSizes = GetNodeSizesByPaddingWithHalfSeparation(geometryGraph, overlapRemovalSettings.NodeSeparation);
     return(nodePositions);
 }
 void IOverlapRemoval.Settings(OverlapRemovalSettings settingsPar)
 {
     Settings = settingsPar;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings"></param>
 public ProximityOverlapRemoval(OverlapRemovalSettings settings)
 {
     Settings = settings;
 }
 void InitializeSettings()
 {
     Settings = new OverlapRemovalSettings();
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public ProximityOverlapRemoval(OverlapRemovalSettings settings, GeometryGraph graph)
 {
     Graph    = graph;
     Settings = settings;
 }
  /// <summary>
  /// Clones the settings together with the stressmajorization settings
  /// </summary>
  /// <returns></returns>
  public OverlapRemovalSettings Clone() {
      OverlapRemovalSettings settings = new OverlapRemovalSettings();
      settings.Method = Method;
      settings.Epsilon = this.Epsilon;
      settings.IterationsMax = this.IterationsMax;
      settings.StopOnMaxIterat = StopOnMaxIterat;
      settings.NodeSeparation = NodeSeparation;
      settings.RandomizationSeed = RandomizationSeed;
      settings.RandomizeAllPointsOnStart = randomizeAllPointsOnStart;
      settings.InitialScaling = this.InitialScaling;
      settings.WorkInInches = this.WorkInInches;
 
      settings.StressSettings=new StressMajorizationSettings();
      settings.StressSettings.MaxStressIterations = StressSettings.MaxStressIterations;
      settings.StressSettings.SolvingMethod = StressSettings.SolvingMethod;
      settings.StressSettings.UpdateMethod = StressSettings.UpdateMethod;
      settings.StressSettings.StressChangeTolerance = StressSettings.StressChangeTolerance;
      settings.StressSettings.CancelOnStressConvergence = StressSettings.CancelOnStressConvergence;
      settings.StressSettings.CancelOnStressMaxIteration = StressSettings.CancelOnStressMaxIteration;
      //relevant for conjugate gradient methods only
      settings.StressSettings.ResidualTolerance =StressSettings.ResidualTolerance;
      settings.StressSettings.CancelAfterFirstConjugate = StressSettings.CancelAfterFirstConjugate;
      settings.StressSettings.MaxSolverIterations = StressSettings.MaxSolverIterations;
      settings.StressSettings.SolverMaxIteratMethod = StressSettings.SolverMaxIteratMethod;
      settings.StressSettings.Parallelize = StressSettings.Parallelize;
      settings.StressSettings.ParallelDegree = StressSettings.ParallelDegree;
      return settings;
  }
 void IOverlapRemoval.Settings(OverlapRemovalSettings settingsPar) {
     Settings = settingsPar;
 }
 internal static Point[] InitNodePositionsAndBoxes(OverlapRemovalSettings overlapRemovalSettings,
                                                   Node[] nodes, out Point[] nodePositions,
                                                   out Size[] nodeSizes) {
     nodePositions = nodes.Select(v => v.Center).ToArray();
     //make sure no two points are the same
     RandomizePoints(nodePositions, new Random(overlapRemovalSettings.RandomizationSeed),
                     overlapRemovalSettings.Epsilon,
                     overlapRemovalSettings.RandomizeAllPointsOnStart);
     nodeSizes = GetNodeSizesByPaddingWithHalfSeparation(nodes, overlapRemovalSettings.NodeSeparation);
     return nodePositions;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings"></param>
 public ProximityOverlapRemoval(OverlapRemovalSettings settings) {
     Settings = settings;
 }
  void InitializeSettings() {
     Settings = new OverlapRemovalSettings();
 }