private RelativeLocation GetTargetLocation(LayoutVertexBase vertex, IReadOnlyLayoutVertexLayers layers) { if (layers.HasLocation(vertex)) { throw new InvalidOperationException($"Vertex {vertex} already has a relative location."); } var toLayerIndex = _properLayoutGraph.GetLayerIndex(vertex); var toIndexInLayer = DetermineIndexInLayer(vertex, toLayerIndex, layers); return(new RelativeLocation(toLayerIndex, toIndexInLayer)); }
private IEnumerable <LayoutVertexBase> GetPrimarySiblingsInLayer( LayoutVertexBase vertex, int layerIndex, IReadOnlyLayoutVertexLayers layers) { return(_properLayoutGraph.GetPrimarySiblings(vertex) .Where(i => layers.HasLocation(i) && layers.GetLayerIndex(i) == layerIndex)); }