use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method refreshWayPoints.
// Refresh the set of waypoint from info the RootModel. Return true if
// changes were made, and false otherwise.
private boolean refreshWayPoints(RootModel root) {
myToolBar.updateToolbarState(root);
if (!wayPointsNeedRefreshing(root)) {
return false;
}
// remove all way infos ...
Iterator<WayPointInfo> it = wayInfos.iterator();
while (it.hasNext()) {
WayPointInfo info = it.next();
it.remove();
info.finalize();
}
// now add new ones from rootModel ...
int idx = 0;
for (WayPoint wayPoint : root.getWayPoints().getPoints()) {
WayPointInfo info = new WayPointInfo(this, wayPoint);
wayInfos.add(info);
info.setIndex(idx++);
}
rebuildWayPointTrack();
return true;
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method deleteWayPoints.
public void deleteWayPoints() {
if (confirmAction("Delete WayPoints?")) {
int count = wayInfos.size();
// Delete all but the 0 waypoint.
for (int j = 1; j < count; j++) {
WayPointInfo info = wayInfos.get(1);
if (info.getTime() != 0) {
info.removeWayPointFromRoot();
deleteWaypoint(1, true);
info.finalize();
}
}
}
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method resetAll.
// /**
// * Called internally when the step time is set by the GUI
// */
// void setStepTime (double newStep) {
// myScheduler.setStepTime (newStep);
// }
/**
* Resets the timeline. Called when it is first created and when new
* models are loaded.
*/
public void resetAll() {
// Assume that caller has ensured the scheduler is not running
// myScheduler.stopRequest();
// myScheduler.waitForPlayingToStop();
RootModel rootModel = myMain.getRootModel();
int count = myInTracks.size();
for (int i = 0; i < count; i++) {
deleteTrack(Track.TYPE_INPUT, 0, false);
}
count = myOutTracks.size();
for (int j = 0; j < count; j++) {
deleteTrack(Track.TYPE_OUTPUT, 0, false);
}
myProbeMap.clear();
// Add the root model on timeline
Track suitableTrack;
// Process all the input probes into proper places
for (Probe p : rootModel.getInputProbes()) {
addProbe(p);
}
// Process all the output probes into proper places
for (Probe p : rootModel.getOutputProbes()) {
if (!(p instanceof WayPointProbe)) {
addProbe(p);
}
}
// Process the waypoints
refreshWayPoints(rootModel);
// for (WayPoint wayPoint : getWayPoints().getPoints ()) {
// addWayPointFromRoot (wayPoint);
// }
// setAppropriateVirtualWaypoint (false);
// timescale.updateTimeCursor (0);
myToolBar.updateToolbarState(rootModel);
closeProbeEditors();
myProbeEditors = new ArrayList<NumericProbeEditor>();
selectedProbes = new ArrayList<ProbeInfo>();
expandToggle.setSelected(false);
muteToggle.setSelected(false);
updateWidgets(rootModel, /*refreshCursor=*/
true);
updateDisplay();
// requestUpdate (UPDATE_WIDGETS | REFRESH_CURSOR);
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class InverseManager method replaceBreakpoint.
public static void replaceBreakpoint(RootModel root, double oldt, double newt) {
WayPoint waypoint = root.getWayPoint(oldt);
if (waypoint != null && waypoint.isBreakPoint()) {
root.removeWayPoint(waypoint);
}
root.addBreakPoint(newt);
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class RootModel method addBreakPoint.
public WayPoint addBreakPoint(double t) {
if (t != 0) {
WayPoint way = new WayPoint(t);
way.setBreakPoint(true);
addWayPoint(way);
return way;
} else {
return null;
}
}
Aggregations