Search in sources :

Example 1 with TracingProbe

use of artisynth.core.probes.TracingProbe in project artisynth_core by artisynth.

the class TracingProbePanel method createProbe.

public TracingProbe createProbe(Traceable tcomp) {
    String traceableName = (String) myTraceSelector.getValue();
    TracingProbe probe = TracingProbe.create(tcomp, traceableName);
    if (getProbeName() != null) {
        probe.setName(getProbeName());
    }
    probe.setStartTime(getStartTime());
    probe.setStopTime(getStartTime() + getDuration());
    probe.setUpdateInterval(getUpdateInterval());
    setProperties(probe, myPrototype);
    return probe;
}
Also used : TracingProbe(artisynth.core.probes.TracingProbe)

Example 2 with TracingProbe

use of artisynth.core.probes.TracingProbe in project artisynth_core by artisynth.

the class RootModel method addTracingProbe.

/**
 * Convenience routine to add a tracing probe to this RootModel. The probe is
 * created for a specified trace of a Traceable component. Start and stop
 * times are given in seconds. The probe's update interval is set to the
 * maximum step size of this RootModel, and the render interval is set to 50
 * msec.
 *
 * @param traceable
 * component to be traced
 * @param traceName
 * name of the trace
 * @param startTime
 * start time (seconds)
 * @param stopTime
 * stop time (seconds)
 * @return created tracing probe
 */
public TracingProbe addTracingProbe(Traceable traceable, String traceName, double startTime, double stopTime) {
    TracingProbe probe = TracingProbe.create(traceable, traceName);
    probe.setStartTime(startTime);
    probe.setStopTime(stopTime);
    probe.setUpdateInterval(getMaxStepSize());
    probe.setRenderInterval(0.05);
    addOutputProbe(probe);
    return probe;
}
Also used : TracingProbe(artisynth.core.probes.TracingProbe)

Example 3 with TracingProbe

use of artisynth.core.probes.TracingProbe in project artisynth_core by artisynth.

the class RootModel method getTraceSet.

public Collection<Traceable> getTraceSet() {
    Collection<TracingProbe> tprobes = getTracingProbes();
    ArrayList<Traceable> traceSet = new ArrayList<Traceable>();
    for (TracingProbe tp : tprobes) {
        traceSet.add((Traceable) tp.getHost(0));
    }
    return traceSet;
}
Also used : TracingProbe(artisynth.core.probes.TracingProbe) Traceable(artisynth.core.modelbase.Traceable)

Example 4 with TracingProbe

use of artisynth.core.probes.TracingProbe in project artisynth_core by artisynth.

the class RootModel method disableAllTracing.

public void disableAllTracing() {
    Collection<TracingProbe> tprobes = getTracingProbes();
    for (TracingProbe tp : tprobes) {
        removeOutputProbe(tp);
    }
    rerender();
}
Also used : TracingProbe(artisynth.core.probes.TracingProbe)

Example 5 with TracingProbe

use of artisynth.core.probes.TracingProbe in project artisynth_core by artisynth.

the class MenuBarHandler method createViewMenu.

private void createViewMenu(JMenu menu) {
    JMenuItem item;
    RootModel root = myMain.getRootModel();
    boolean hasTraceables = root.getNumTraceables() > 0;
    boolean hasTraces = false;
    boolean hasVisibleTrace = false;
    boolean hasInvisibleTrace = false;
    for (Probe p : root.getOutputProbes()) {
        if (p instanceof TracingProbe) {
            hasTraces = true;
            if (RenderableUtils.isVisible((TracingProbe) p)) {
                hasVisibleTrace = true;
            } else {
                hasInvisibleTrace = true;
            }
        }
    }
    if (isTimelineVisible) {
        addMenuItem(menu, "Hide timeline");
    } else {
        addMenuItem(menu, "Show timeline");
    }
    if (JythonInit.jythonIsAvailable()) {
        if (myMain.myJythonFrame != null && myMain.myJythonFrame.isVisible()) {
            addMenuItem(menu, "Hide Jython console");
        } else {
            addMenuItem(menu, "Show Jython console");
        }
    }
    if (InverseManager.inverseControllerExists()) {
        if (InverseManager.isInversePanelVisible()) {
            addMenuItem(menu, "Hide Inverse panel");
        } else {
            addMenuItem(menu, "Show Inverse panel");
        }
    }
    if (isToolbarVisible) {
        addMenuItem(menu, "Hide viewer toolbar");
    } else {
        addMenuItem(menu, "Show viewer toolbar");
    }
    addMenuItem(menu, "Show movie panel");
    menu.add(new JSeparator());
    addMenuItem(menu, "New viewer");
    SelectionManager sm = myMain.getSelectionManager();
    if (sm.getNumSelected() > 0) {
        addMenuItem(menu, "Center view on selection");
    }
    if (getMainViewer().isOrthogonal()) {
        addMenuItem(menu, "Perspective view");
    } else {
        addMenuItem(menu, "Orthographic view");
    }
    menu.add(new JSeparator());
    addMenuItem(menu, "Merge control panels");
    addMenuItem(menu, "Separate control panels");
    addMenuItem(menu, "Show progress");
    if (myFrame.getNavPanel().getHideEmptyComponents()) {
        addMenuItem(menu, "Show empty components in navpanel");
    } else {
        addMenuItem(menu, "Hide empty components in navpanel");
    }
    menu.add(new JSeparator());
    item = addMenuItem(menu, "Clear traces");
    item.setEnabled(hasTraceables);
    item = addMenuItem(menu, "Disable all tracing");
    item.setEnabled(hasTraceables);
    item = addMenuItem(menu, "Remove traces");
    item.setEnabled(hasTraces);
    item = addMenuItem(menu, "Set traces visible");
    item.setEnabled(hasInvisibleTrace);
    item = addMenuItem(menu, "Set traces invisible");
    item.setEnabled(hasVisibleTrace);
}
Also used : SelectionManager(artisynth.core.gui.selectionManager.SelectionManager) RootModel(artisynth.core.workspace.RootModel) TracingProbe(artisynth.core.probes.TracingProbe) JMenuItem(javax.swing.JMenuItem) Probe(artisynth.core.probes.Probe) TracingProbe(artisynth.core.probes.TracingProbe) JSeparator(javax.swing.JSeparator)

Aggregations

TracingProbe (artisynth.core.probes.TracingProbe)10 Traceable (artisynth.core.modelbase.Traceable)2 Probe (artisynth.core.probes.Probe)2 RootModel (artisynth.core.workspace.RootModel)2 TracingProbePanel (artisynth.core.gui.editorManager.TracingProbePanel)1 SelectionManager (artisynth.core.gui.selectionManager.SelectionManager)1 CopyableComponent (artisynth.core.modelbase.CopyableComponent)1 ModelComponent (artisynth.core.modelbase.ModelComponent)1 JMenuItem (javax.swing.JMenuItem)1 JSeparator (javax.swing.JSeparator)1 InternalErrorException (maspack.util.InternalErrorException)1