Example #1
0
 public MainWindow()
 {
     InitializeComponent();
     _grView = new graph_view(canvas, true);
     _grViewCS = new graph_viewCS(canvasCS, false);
     
     PanelsHidden();            
 }
 public DestinationAlgorithms(Canvas canvas, graph_view _graph_view, graph_viewCS _graph_viewCS)
 {
     this.canvas = canvas;
     this._graph_view = _graph_view;
     this._graph_viewCS = _graph_viewCS;
     countCS = _graph_viewCS.TopList.Count;
     matrixCS = new int[countCS, countCS];
     stopWatch.Start();
 }
Example #3
0
 public node_view(graph_viewCS _graph_viewCS)
 {
     this._graph_viewCS = _graph_viewCS;
     _graph_viewCS.Tops().Add(this);
     _grNode = new graphNodeCS(this);
     _grNode.lblId_node.Content = _grNode.txtId_node.Text = (_graph_viewCS.maxTopID() + 1).ToString();
     id = int.Parse(_grNode.txtId_node.Text);
     _graph_viewCS.GRCanvas.Children.Add(_grNode);
     pointPositionChange += _graph_viewCS.OnPointPositionChanged;
     IsValid              = false;
 }
Example #4
0
        public MainWindow()
        {
            InitializeComponent();
            _grView = new graph_view(canvas, true);
            _grViewCS = new graph_viewCS(canvasCS, false);
            
      //      _grView.LoadGraph(_grView.OpenGraphFrom("C:\\Users\\Annet\\Documents\\Visual Studio 2012\\Projects\\labs\\labs\\bin\\Debug\\Граф задачі\\GraphTask0.txt"));
        //    _grViewCS.LoadGraph(_grViewCS.OpenGraphFrom("C:\\Users\\Annet\\Documents\\Visual Studio 2012\\Projects\\labs\\labs\\bin\\Debug\\Граф КС\\GraphCSKP.txt"));

            PanelsHidden();            
        }
Example #5
0
 public node_view(graph_viewCS _graph_viewCS)
 {
     this._graph_viewCS = _graph_viewCS;
     _graph_viewCS.Tops().Add(this);
     _grNode = new graphNodeCS(this);
     _grNode.lblId_node.Content = _grNode.txtId_node.Text = (_graph_viewCS.maxTopID() + 1).ToString();
     id = int.Parse(_grNode.txtId_node.Text);
     _graph_viewCS.GRCanvas.Children.Add(_grNode);
     pointPositionChange += _graph_viewCS.OnPointPositionChanged;
     IsValid = false;
 }
Example #6
0
 public Window1(graph_view _grView, graph_viewCS _grViewCS, DestinationAlgorithms _destin_alg, double propuskChannels,
     double proizvodProcessors, bool isDuplex, int countLinks, Canvas canvas)
 {
     InitializeComponent();
     this.proizvodProcessors = proizvodProcessors;
     this.propuskChannels = propuskChannels;
     this.isDuplex = isDuplex;
     this.countLinks = countLinks;
     this.canvas = canvas;
     this._grView = _grView;
     this._grViewCS = _grViewCS;
     this._destin_alg = _destin_alg;
 }
 public DestinationAlgorithms(Canvas canvas, graph_view _graph_view, graph_viewCS _graph_viewCS, double propuskChannels,
     double proizvodProcessors, bool isDuplex, int countLinks)
 {
     this.canvas = canvas;
     this._graph_view = _graph_view;
     this._graph_viewCS = _graph_viewCS;
     this.propuskChannels = propuskChannels;
     this.proizvodProcessors = proizvodProcessors;
     this.isDuplex = isDuplex;
     this.countLinks = countLinks;
     countCS = _graph_viewCS.TopList.Count;
     matrixCS = new int[countCS, countCS];
     stopWatch.Start();
 }
Example #8
0
        public edge_view(graph_viewCS _graph, node_view from_node, node_view to_node)
        {
            this._graph = _graph;
            if (from_node != to_node)
            {
                isLine = true;
            }
            else
            {
                isLine = false;
            }
            if (isLine)
            {
                Line = new Line();
            }
            else
            {
                Line = new Ellipse();
            }

            Line.MouseLeftButtonDown += new MouseButtonEventHandler(Line_MouseLeftButtonDown);
            Line.Stroke          = Brushes.Black;
            Line.StrokeThickness = 1;
            if (isLine)
            {
                ((Line)Line).X1 = 0;
                ((Line)Line).Y1 = 0;
            }
            else
            {
                ((Ellipse)Line).Width  = 50;
                ((Ellipse)Line).Height = 50;
            }
            if (Lines == null)
            {
                Lines = new List <Shape>();
                Lines.Add(Line);
            }
            _graph.GRCanvas.Children.Add(Line);
            Canvas.SetZIndex(Line, 0);
            this.from_node = from_node;
            this.to_node   = to_node;
            to_node.pointPositionChange   += new graph_viewCS.PointPositionChanged(OnPointPositionChanged);
            from_node.pointPositionChange += new graph_viewCS.PointPositionChanged(OnPointPositionChanged);
            OnPointPositionChanged(to_node);
            if (isLine)
            {
                OnPointPositionChanged(from_node);
            }
        }
Example #9
0
        public edge_view(graph_viewCS _graph, node_view from_node, node_view to_node)
        {
            this._graph = _graph;
            if (from_node != to_node)
                isLine = true;
            else
                isLine = false;
            if (isLine)
                Line = new Line();
            else
                Line = new Ellipse();

            Line.MouseLeftButtonDown += new MouseButtonEventHandler(Line_MouseLeftButtonDown);
            Line.Stroke = Brushes.Black;
            Line.StrokeThickness = 1;
            if (isLine)
            {
                ((Line)Line).X1 = 0;
                ((Line)Line).Y1 = 0;              
            }
            else
            {
                ((Ellipse)Line).Width = 50;
                ((Ellipse)Line).Height = 50;
            }
            if (Lines == null)
            {
                Lines = new List<Shape>();
                Lines.Add(Line);
            }
            _graph.GRCanvas.Children.Add(Line);
            Canvas.SetZIndex(Line, 0);
            this.from_node = from_node;
            this.to_node = to_node;
            to_node.pointPositionChange += new graph_viewCS.PointPositionChanged(OnPointPositionChanged);
            from_node.pointPositionChange += new graph_viewCS.PointPositionChanged(OnPointPositionChanged);
            OnPointPositionChanged(to_node);
            if (isLine)
                OnPointPositionChanged(from_node);
        }