Search in sources :

Example 1 with WayPoint

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;
}
Also used : WayPoint(artisynth.core.probes.WayPoint)

Example 2 with WayPoint

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;
}
Also used : WayPoint(artisynth.core.probes.WayPoint)

Example 3 with WayPoint

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();
        }
    }
}
Also used : WayPoint(artisynth.core.probes.WayPoint) WayPoint(artisynth.core.probes.WayPoint)

Example 4 with WayPoint

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();
}
Also used : WayPoint(artisynth.core.probes.WayPoint)

Example 5 with WayPoint

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();
}
Also used : WayPoint(artisynth.core.probes.WayPoint)

Aggregations

WayPoint (artisynth.core.probes.WayPoint)15 WayPointProbe (artisynth.core.probes.WayPointProbe)2 FemElement (artisynth.core.femmodels.FemElement)1 FemMarker (artisynth.core.femmodels.FemMarker)1 FemNode (artisynth.core.femmodels.FemNode)1 FemNode3d (artisynth.core.femmodels.FemNode3d)1 NumericProbeEditor (artisynth.core.gui.probeEditor.NumericProbeEditor)1 AxialSpring (artisynth.core.mechmodels.AxialSpring)1 MechModel (artisynth.core.mechmodels.MechModel)1 Particle (artisynth.core.mechmodels.Particle)1 RigidBody (artisynth.core.mechmodels.RigidBody)1 Probe (artisynth.core.probes.Probe)1 RootModel (artisynth.core.workspace.RootModel)1 Color (java.awt.Color)1 PolygonalMesh (maspack.geometry.PolygonalMesh)1 Point3d (maspack.matrix.Point3d)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1 Renderable (maspack.render.Renderable)1 StringHolder (maspack.util.StringHolder)1 BooleanSelector (maspack.widgets.BooleanSelector)1