forked from AmigoCap/ReViVD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote triangles generation to be more flexible; implemented SetTime…
…Window() of TimePath to allow for per-path control of display based on time.
- Loading branch information
Showing
5 changed files
with
93 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Collections.Generic; | ||
|
||
public abstract class TimeVisualization : Visualization { | ||
protected abstract float InterpretTime(string word); | ||
|
||
public abstract IReadOnlyList<TimePath> PathsAsTime { get; } | ||
} | ||
|
||
public abstract class TimePath : Path { | ||
public abstract IReadOnlyList<TimeAtom> AtomsAsTime { get; } | ||
|
||
public void SetTimeWindow(float startTime, float stopTime) { //Met à jour les atomes à afficher en fonction de si leur temps est dans la fenêtre recherchée | ||
bool shouldUpdateTriangles = false; | ||
foreach (TimeAtom a in AtomsAsTime) { | ||
if (a.shouldDisplay != (a.time > startTime && a.time < stopTime)) { | ||
a.shouldDisplay = !a.shouldDisplay; | ||
shouldUpdateTriangles = true; | ||
} | ||
} | ||
if (shouldUpdateTriangles) | ||
GenerateTriangles(); | ||
} | ||
} | ||
|
||
public abstract class TimeAtom : Atom { | ||
public float time; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters