use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class Main method addWayPoint.
public WayPoint addWayPoint(double t) {
WayPoint way = new WayPoint(t, false);
getRootModel().addWayPoint(way);
// getTimeline().addWayPointFromRoot (way);
return way;
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class Main method addBreakPoint.
public WayPoint addBreakPoint(double t) {
WayPoint brk = new WayPoint(t, true);
getRootModel().addWayPoint(brk);
// getTimeline().addWayPointFromRoot (brk);
return brk;
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method addWayPoint.
/**
* Adds a waypoint to the timelime.
*/
public void addWayPoint(double wayTime, boolean isBreakPoint) {
WayPointInfo tempWay = null;
WayPoint way = getWayPoint(wayTime);
if (way == null) {
// Search through the waypoint list for the appropriate index
// the list is sorted in the order of ascending waypointTime
int insertIndex = wayInfos.size();
for (int i = 0; i < wayInfos.size(); i++) {
tempWay = wayInfos.get(i);
if (wayTime < tempWay.getTime()) {
insertIndex = i;
break;
}
}
// Create the new waypoint object
WayPointInfo newWay = new WayPointInfo(this, wayTime);
if (isBreakPoint) {
newWay.myWaypoint.setBreakPoint(true);
}
wayInfos.add(insertIndex, newWay);
// Update the waypoint index after insertion
for (WayPointInfo info : wayInfos) {
info.updateWaypointIndex();
}
wayTrack.add(newWay);
requestUpdateDisplay();
} else {
if (way.isBreakPoint() != isBreakPoint) {
way.setBreakPoint(isBreakPoint);
requestUpdateDisplay();
}
}
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method removeWayPointFromRoot.
/**
* Removes a wayPoint at the request of the system. This means that the
* system does not need to be informed about its removal.
*/
public void removeWayPointFromRoot(WayPoint way) {
int idx = -1;
for (int i = 0; i < wayInfos.size(); i++) {
if (wayInfos.get(i).myWaypoint == way) {
idx = i;
break;
}
}
if (idx != -1) {
wayInfos.remove(idx);
// Re-index waypoints
for (int i = 0; i < wayInfos.size(); i++) {
wayInfos.get(i).setIndex(i);
}
rebuildWayPointTrack();
}
requestUpdateDisplay();
}
use of artisynth.core.probes.WayPoint in project artisynth_core by artisynth.
the class TimelineController method deleteWaypoint.
/**
* Called when clearTimeline is requested on the timeline, or an action
* is performed requesting "Delete Waypoint".
*/
public void deleteWaypoint(int idx, boolean isTimelineReset) {
// the user had confirmed deletion of the selected waypoint.
if ((isTimelineReset) || (confirmAction("Delete this waypoint?"))) {
if (!isTimelineReset) {
// Remove the waypoint from the root
wayInfos.get(idx).removeWayPointFromRoot();
}
wayInfos.remove(idx);
// Re-index waypoints
for (int i = 0; i < wayInfos.size(); i++) {
wayInfos.get(i).setIndex(i);
}
rebuildWayPointTrack();
}
requestUpdateDisplay();
}
Aggregations