Ejemplo n.º 1
0
		public void GetsData()
		{
			// Get the parent PipelineVM and add DiagramNode
			var vm = MainViewModelTest.GetInstance().PipelineViewModel;
			var node = new NodeViewModel(new HistogramNode(), vm);
			vm.Nodes.Add(node);
			vm.Parent.Model.Graph.AddNode(node.Model);

			var hvm = new HistogramViewModel((HistogramNode)vm.Nodes.Single().Model);

			// Generates an array of 1 Frame with randomly filled Data
			var testSize = new Size(5, 5);
			Frame[] inputs = { new Frame(testSize) };
			for (var x = 0; x < testSize.Width; x++) {
				for (var y = 0; y < testSize.Height; y++) {
					inputs[0][x, y] = new Rgb((byte)(x + y), (byte)(x + y), (byte)(x + y));
				}
			}

			hvm.NodeModel.Type = HistogramType.R;

			// porcess one frame with chosen type
			hvm.NodeModel.Process(inputs, 0);
			hvm.Handle(null);

			Assert.NotEmpty(hvm.Data.Data);
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Initializes an InOutputViewModel instance with a model of type Node.Input or Node.Output
		/// and the model's node's view model.
		/// </summary>
		public InOutputViewModel(object model, NodeViewModel parent)
		{
			Model = model;
			Parent = parent;
		}
Ejemplo n.º 3
0
 /// <summary>
 /// Cancels any drag operations.
 /// </summary>
 public void MouseUp()
 {
     CullInputs();
     draggedNode = null;
     DraggedEdge = null;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes an InOutputViewModel instance with a model of type Node.Input or Node.Output
 /// and the model's node's view model.
 /// </summary>
 public InOutputViewModel(object model, NodeViewModel parent)
 {
     Model  = model;
     Parent = parent;
 }