Canvas ND framework: Difference between revisions

Jump to navigation Jump to search
Switch to {{gitorious url}} to fix the broken Gitorious links.
(Switch to {{gitorious url}} to fix the broken Gitorious links.)
Line 111: Line 111:
{{FGCquote
{{FGCquote
   |Originally, it was a single monolithic update() method that would basically be called at frame rate using a settimer/maketimer callback.<br/>
   |Originally, it was a single monolithic update() method that would basically be called at frame rate using a settimer/maketimer callback.<br/>
When things were restructured, the conditional parts of this huge method were moved into predicates that reside in a huge hash: [https://gitorious.org/fg/fgdata/source/Nasal/canvas/map/navdisplay.styles#L14 https://gitorious.org/fg/fgdata/source/ ... styles#L14]<br/>
When things were restructured, the conditional parts of this huge method were moved into predicates that reside in a huge hash: {{gitorious url|fg|fgdata|path=Nasal/canvas/map/navdisplay.styles|line=14}}<br/>
Meanwhile, the update() method has been inflated again due to some logic that wasn't added to the hash, e.g. see: [https://gitorious.org/fg/fgdata/source/Nasal/canvas/map/navdisplay.mfd#L476 https://gitorious.org/fg/fgdata/source/ ... y.mfd#L476]<br/>
Meanwhile, the update() method has been inflated again due to some logic that wasn't added to the hash, e.g. see: {{gitorious url|fg|fgdata|path=Nasal/canvas/map/navdisplay.mfd|line=476}}<br/>
<br/>
<br/>
The meat of it still is in update(), and those "layers" are fairly boring meanwhile  because they're separately managed by Philosopher's MapStructure framework.<br/>
The meat of it still is in update(), and those "layers" are fairly boring meanwhile  because they're separately managed by Philosopher's MapStructure framework.<br/>
<br/>
<br/>
But individual ND elements (canvas groups) are basically SVG-driven, i.e. SVG elements that are looked up and then updated/animated via timers and listeners: [https://gitorious.org/fg/fgdata/source/f3df87622ca60eb45f359c05bd913524eeb44667:Nasal/canvas/map/navdisplay.styles#L183 https://gitorious.org/fg/fgdata/source/ ... tyles#L183]<br/>
But individual ND elements (canvas groups) are basically SVG-driven, i.e. SVG elements that are looked up and then updated/animated via timers and listeners: {{gitorious url|fg|fgdata|commit=f3df87622ca60eb45f359c05bd913524eeb44667|path=Nasal/canvas/map/navdisplay.styles|line=183}}<br/>
<br/>
<br/>
The actual code evaluating each SVG predicate is still called via the update() method, but it's just a foreach loop with a few lines:<br/>
The actual code evaluating each SVG predicate is still called via the update() method, but it's just a foreach loop with a few lines:<br/>
[https://gitorious.org/fg/fgdata/source/Nasal/canvas/map/navdisplay.mfd#L760-769 https://gitorious.org/fg/fgdata/source/ ... d#L760-769]<br/>
{{gitorious url|fg|fgdata|path=Nasal/canvas/map/navdisplay.mfd|line=760}}<br/>
<br/>
<br/>
None of this is set in stone, and we're actually looking forward to generalizing this some more.
None of this is set in stone, and we're actually looking forward to generalizing this some more.
Line 454: Line 454:


{{FGCquote
{{FGCquote
   |just so that I don't forget about it: [https://gitorious.org/fg/fgdata/commit/7da1406cfbed8af69c5cefe215b4f327d791423d https://gitorious.org/fg/fgdata/commit/ ... 27d791423d]<br/>
   |just so that I don't forget about it: {{gitorious url|fg|fgdata|commit=7da1406cfbed8af69c5cefe215b4f327d791423d}}<br/>
<br/>
<br/>
<ul>
<ul>

Navigation menu