Changeset 718
- Timestamp:
- 12/21/17 21:45:54 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/canvas/neurodiagram.cpp
r348 r718 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2017 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 69 69 70 70 NeuroDiagram::NeuroDiagram(ColorDefs *cd) 71 :FramDrawToolkit(cd), livewire(false), indestructor(false), showing_not_alive_label(false), o(0),72 warn_if_not_alive(true), selection(*this), drawbackground(true), linetype(true), layouttype(2)71 :FramDrawToolkit(cd), livewire(false), indestructor(false), showing_not_alive_label(false), o(0), 72 warn_if_not_alive(true), selection(*this), drawbackground(true), linetype(true), layouttype(2) 73 73 { 74 74 scroll.setMargin(10, 10); // appropriate size should be adjusted … … 91 91 showing_not_alive_label = 0; 92 92 if (o) o->delmodel_list.remove(killnode); 93 FOREACH(NeuroProbe*, pr,probes)93 FOREACH(NeuroProbe*, pr, probes) 94 94 delete pr; 95 95 probes.clear(); … … 244 244 245 245 NeuroSymbol::NeuroSymbol(NeuroDiagram &nd, Neuro * _n) 246 : selected(0), n(_n), diagram(nd), FramDrawToolkit(nd.getColorDefs())246 :FramDrawToolkit(nd.getColorDefs()), selected(0), n(_n), diagram(nd) 247 247 { 248 248 tooltip = "#"; … … 287 287 } 288 288 289 /*290 291 292 293 294 295 296 297 . ..._____._| \ . | i . 298 . . | \___. | z . 299 . __._| / . | e . 300 . | . | / . | . . 301 . | . |/ . | y . 302 . | .......... v . 303 . | <--------> . 304 305 306 307 308 309 310 311 312 313 314 315 316 289 /* 290 291 NeuroDiagram 292 *........................................ 293 . . 294 . NeuroSymbol . 295 . (pos.x,pos.y)-*......... . 296 . . |\ . ^ s . 297 . ..._____._| \ . | i . 298 . . | \___. | z . 299 . __._| / . | e . 300 . | . | / . | . . 301 . | . |/ . | y . 302 . | .......... v . 303 . | <--------> . 304 . .......... | size.x . 305 . . |\ . | . 306 . __._| \ . | . 307 . . | \___._| . 308 . __._| / . . 309 . | . | / . . 310 . | . |/ . . 311 . | .......... . 312 . | . 313 . |________________... . 314 ......................................... 315 316 */ 317 317 318 318 // NeuroSymbol is also responsible for drawing connection lines from its inputs to other NeuroSymbols' outputs … … 416 416 { 417 417 if ((y >= 0) && (y < size.y)) 418 if (x <size.x / 4)418 if (x < size.x / 4) 419 419 { // inputs? 420 if (n->getInputCount()>0) 420 if (n->getInputCount() > 0) 421 { 422 int i = (y*n->getInputCount()) / size.y; 423 double w; 424 Neuro* target = n->getInput(i, w); 425 if (target) 421 426 { 422 int i = (y*n->getInputCount()) / size.y; 423 double w; 424 Neuro* target = n->getInput(i, w); 425 if (target) 427 SString t = "connected to #"; 428 t += SString::valueOf((int)target->refno); 429 t += " - "; 430 addNeuroDescription(t, target); 431 // if (w!=1.0) 426 432 { 427 SString t = "connected to #"; 428 t += SString::valueOf((int)target->refno); 429 t += " - "; 430 addNeuroDescription(t, target); 431 // if (w!=1.0) 432 { 433 t += ", weight="; 434 t += SString::valueOf(w); 435 } 436 return t; 433 t += ", weight="; 434 t += SString::valueOf(w); 437 435 } 436 return t; 438 437 } 439 438 } 439 } 440 440 return CanvasWindow::hint(x, y); 441 441 } … … 444 444 445 445 NeuroProbe::NeuroProbe(NeuroSymbol* ns) 446 :DCanvasWindow(DCanvasWindow::Title + DCanvasWindow::Border + DCanvasWindow::Close + DCanvasWindow::Size,447 446 :DCanvasWindow(DCanvasWindow::Title + DCanvasWindow::Border + DCanvasWindow::Close + DCanvasWindow::Size, 447 ns->getLabel().c_str(), &neurochart, &neurochart) 448 448 { 449 449 holdismine = 0; … … 683 683 void NeuroDiagram::probeSampling(void*obj, intptr_t dummy) 684 684 { 685 FOREACH(NeuroProbe*, pr,probes) pr->sampling();685 FOREACH(NeuroProbe*, pr, probes) pr->sampling(); 686 686 requestPaint(); 687 687 }
Note: See TracChangeset
for help on using the changeset viewer.