public ClustersDrawer(IMatrixDrawer gridDrawer)
        {
            this.gridDrawer = gridDrawer;

            ClustersIterator clustersIterator =
                new ClustersIterator(new DrawOption(gridDrawer));
        }
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            _matrixDrawer = new CanvasMatrixDrawer(MatrixCanvas, new FirstMatrixScheme());
            var matrixRef = new Ref <IMatrix>(() => _matrix, x => _matrix = x);

            new InitializeAppCommand(matrixRef).Execute();
            DisplayMatrixes();
        }
 public void Draw(IMatrixDrawer matrixDrawer, int startRowIndex, int startColumnIndex, bool toClear)
 {
     if (toClear)
     {
         matrixDrawer.Clear();
     }
     foreach (var matrix in _matrixes)
     {
         matrix.Draw(matrixDrawer, startRowIndex, startColumnIndex, false);
         startColumnIndex += matrix.ColumnCount;
     }
 }
Esempio n. 4
0
        public void Set(int x, int y, int z)
        {
            Console.WriteLine("\n");
            Console.WriteLine($"({x}, {y}, {z})");

            gridDrawer = new MatrixDrawer(AbstractGraph.Clusters[x, y, z].Matrix);
            gridDrawer.Draw();

            foreach (AbstractNode node in AbstractGraph.Clusters[x, y, z].AbstractNodes)
            {
                Console.WriteLine($"\nNode {node.Id}: ({node.LocationL0.X}, {node.LocationL0.Y}, {node.LocationL0.Z})");
                NeighborsPathPrint(node.Id, AbstractGraph.Clusters[x, y, z]);
            }
        }
Esempio n. 5
0
 public override void Draw(IMatrixDrawer matrixDrawer, int startRowIndex = 0, int startColumnIndex = 0, bool toClear = true)
 {
     if (toClear)
     {
         matrixDrawer.Clear();
     }
     for (int i = 0; i < RowCount; i++)
     {
         for (int j = 0; j < ColumnCount; j++)
         {
             matrixDrawer.DrawCell(this, i, j, startRowIndex, startColumnIndex);
         }
     }
 }
Esempio n. 6
0
        void IMatrix.Draw(IMatrixDrawer matrixDrawer, int startRowIndex, int startColumnIndex, bool toClear)
        {
            if (toClear)
            {
                matrixDrawer.Clear();
            }
            var thisMatrix = (IMatrix)this;

            for (int i = 0; i < thisMatrix.RowCount; i++)
            {
                for (int j = 0; j < thisMatrix.ColumnCount; j++)
                {
                    matrixDrawer.DrawCell(this, i, j);
                }
            }
        }
Esempio n. 7
0
 public abstract void Draw(IMatrixDrawer matrixDrawer, int startRowIndex = 0, int startColumnIndex = 0, bool toClear = true);
Esempio n. 8
0
 public DrawOption(IMatrixDrawer gridDrawer)
 {
     this.gridDrawer = gridDrawer;
 }
 private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
 {
     _simpleMatrixDrawer = new CanvasMatrixDrawer(SimpleMatrixCanvas, SelecedVisualizationScheme);
     _sparseMatrixDrawer = new CanvasMatrixDrawer(SparseMatrixCanvas, SelecedVisualizationScheme);
 }
Esempio n. 10
0
 public void SetMatrixDrawer(IMatrixDrawer md)
 {
     _matrixDrawer = md;
     Refresh();
 }