Changeset 151 for cpp/frams/canvas
- Timestamp:
- 03/01/14 22:07:48 (11 years ago)
- Location:
- cpp/frams/canvas
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/canvas/canvasutil.cpp
r147 r151 1 // This file is a part of the Framsticks GDK. 2 // Copyright (C) 2002-2014 Maciej Komosinski and Szymon Ulatowski. See LICENSE.txt for details. 3 // Refer to http://www.framsticks.com/ for further information. 4 1 5 #include "canvasutil.h" 2 6 -
cpp/frams/canvas/neurodiagram.cpp
r147 r151 1 // This file is a part of the Framsticks GDK. 2 // Copyright (C) 2002-2014 Maciej Komosinski and Szymon Ulatowski. See LICENSE.txt for details. 3 // Refer to http://www.framsticks.com/ for further information. 4 1 5 #include "neurodiagram.h" 2 6 #include "nn_layout.h" … … 85 89 void NeuroDiagram::hide() 86 90 { 87 NeuroProbe *pr;88 91 showing_not_alive_label = 0; 89 92 if (o) o->delmodel_list.remove(killnode); 90 for (probes.start(); pr = (NeuroProbe*)probes();) delete pr; 93 FOREACH(NeuroProbe*,pr,probes) 94 delete pr; 91 95 probes.clear(); 92 96 selection.clear(0); … … 287 291 for (int iw = 0; iw < n->getInputCount(); iw++) 288 292 { 289 ns2 = diagram.getNS(n->getInput(iw)->refno); // the other NeuroSymbol (our input will connectoto its output)293 ns2 = diagram.getNS(n->getInput(iw)->refno); // the other NeuroSymbol (our input will connect to its output) 290 294 291 295 int yw = inputY(iw); 292 int xw = yw / 4; // x coordinate of the first corner point, depends on yw to avoid overlapping between inputs296 int xw = yw / 4; // x coordinate of the first corner point, depends on yw to avoid overlapping between inputs 293 297 drawLine(size.x / 4, yw, xw, yw); // first horizontal segment (to the left) 294 298 diagram.setWireColor(ns2->n->state, 0); 295 299 if ((diagram.linetype != 1) || (ns2->pos.x + ns2->size.x / 2 < pos.x)) 296 { // straight line to the other neuron's output ( signal goes forwards)300 { // straight line to the other neuron's output (the signal goes forwards) 297 301 ns2->lineTo(ns2->size.x, ns2->size.y / 2); 298 302 } 299 303 else 300 { // make a loop from 3 segments - vert/horiz/vert (signal goes backwards)304 { // make an U-shaped loop from 3 segments - vert/horiz/vert (the signal goes backwards) 301 305 int y2; 302 306 int down; … … 542 546 { 543 547 NeuroImpl *ni = NeuroNetImpl::getImpl(link->n); 544 if (ni) ni->setCurrentState(st, chsel); //tu bylo odwrotnie!548 if (ni) ni->setCurrentState(st, chsel); 545 549 } 546 550 requestPaint(); … … 645 649 void NeuroDiagram::probeSampling(void*obj, long dummy) 646 650 { 647 NeuroProbe *pr; 648 for (probes.start(); pr = (NeuroProbe*)probes();) pr->sampling(); 651 FOREACH(NeuroProbe*,pr,probes) pr->sampling(); 649 652 requestPaint(); 650 653 }
Note: See TracChangeset
for help on using the changeset viewer.