예제 #1
0
 public override GH_ObjectResponse RespondToMouseUp(GH_Canvas sender, GH_CanvasMouseEvent e)
 {
     if (e.Button == MouseButtons.Left && draggingWire)
     {
         //var docs = Owner.OnPingDocument().Objects;
         foreach (IGH_DocumentObject d in Owner.OnPingDocument().Objects)
         {
             if (d.GetType() == typeof(NeuralNetAlgorithmComponent) || d.GetType() == typeof(NeuralNetAlgorithmVariableParamComponent))
             {
                 var nn = (NeuralNetAlgorithmComponent)d;
                 if (d.Attributes.Bounds.Contains(e.CanvasLocation))
                 {
                     //component.HasBeenLinked = true;
                     neuralNetAttributes = (NeuralNetAttributes)nn.Attributes;
                     component.LinkNeuralNetComponent(ref nn);// (NeuralNetAlgorithmComponent)d;
                     //(IGH_Param)Owner.
                     //Owner.AddVolatileData(Owner.VolatileData.get_Path(0), 0, nn.Network);
                     break;
                 }
             }
         }
         draggingWire  = false;
         sender.Cursor = Cursors.WaitCursor;
         return(GH_ObjectResponse.Release);
     }
     else
     {
         return(base.RespondToMouseUp(sender, e));
     }
 }
예제 #2
0
 public override void CreateAttributes()
 {
     m_attributes = new NeuralNetAttributes(this);
 }