예제 #1
0
파일: Node.cs 프로젝트: ogxd/node-graph-wpf
        public OutputDock addOutput(int type)
        {
            OutputDock dock = new OutputDock(this, type);

            stackOutputs.Children.Add(dock);
            return(dock);
        }
예제 #2
0
        public Pipe(OutputDock output, InputDock input)
        {
            bezier = new BezierSegment()
            {
                IsStroked = true
            };

            // Set up the Path to insert the segments
            PathGeometry pathGeometry = new PathGeometry();

            pathFigure          = new PathFigure();
            pathFigure.IsClosed = false;
            pathGeometry.Figures.Add(pathFigure);

            this.inputDock  = input;
            this.outputDock = output;
            if (input == null || output == null)
            {
                EditingPipe = this;
            }

            pathFigure.Segments.Add(bezier);
            path = new Path();
            path.IsHitTestVisible = false;
            path.Stroke           = graph.context.getPipeColor((input != null)? input.type : output.type);
            path.StrokeThickness  = 2;
            path.Data             = pathGeometry;

            graph.canvas.Children.Add(path);
            ((UIElement)graph.canvas.Parent).MouseMove += Canvas_MouseMove;
        }