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;
}
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;
}
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;
}
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();
}
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);
}
Aggregations