Search in sources :

Example 1 with Model

use of artisynth.core.modelbase.Model in project artisynth_core by artisynth.

the class RootModel method dispose.

public void dispose() {
    for (Model m : myModels) {
        m.dispose();
    }
    for (Controller c : myControllers) {
        c.dispose();
    }
    for (Monitor m : myMonitors) {
        m.dispose();
    }
    // This dispose code not needed since dispose will now be called
    // be the control panel remove handler
    // for (ControlPanel cp : myControlPanels) {
    // cp.dispose();
    // }
    myControlPanels.removeAll();
    if (myControlPanelsFrame != null) {
        myControlPanelsFrame.setVisible(false);
        myControlPanelTabs.removeAll();
    }
}
Also used : Monitor(artisynth.core.modelbase.Monitor) Model(artisynth.core.modelbase.Model) Controller(artisynth.core.modelbase.Controller)

Example 2 with Model

use of artisynth.core.modelbase.Model in project artisynth_core by artisynth.

the class RootModel method doadvance.

protected void doadvance(double t0, double t1, int flags) {
    double ta = t0;
    if (t0 == 0) {
        applyOutputProbes(myRootInfo.outputProbes, t0, myRootInfo);
    }
    while (ta < t1 && !myStopRequest) {
        double tb = getNextAdvanceTime(myRootInfo.outputProbes, getMaxStepSize(), ta, t1);
        // setDefaultInputs (ta, tb);
        applyInputProbes(myRootInfo.inputProbes, tb);
        applyControllers(myRootInfo.controllers, ta, tb);
        for (Model m : myModels) {
            advanceModel(myModelInfo.get(m), ta, tb, flags);
        }
        applyMonitors(myRootInfo.monitors, ta, tb);
        applyOutputProbes(myRootInfo.outputProbes, tb, myRootInfo);
        ta = tb;
    }
}
Also used : Model(artisynth.core.modelbase.Model)

Example 3 with Model

use of artisynth.core.modelbase.Model in project artisynth_core by artisynth.

the class RootModel method updateBounds.

public void updateBounds(Vector3d pmin, Vector3d pmax) {
    for (Model m : myModels) {
        if (m instanceof Renderable) {
            ((Renderable) m).updateBounds(pmin, pmax);
        }
    }
    myOutputProbes.updateBounds(pmin, pmax);
    myRenderables.updateBounds(pmin, pmax);
}
Also used : Renderable(maspack.render.Renderable) IsRenderable(maspack.render.IsRenderable) Model(artisynth.core.modelbase.Model)

Example 4 with Model

use of artisynth.core.modelbase.Model in project artisynth_core by artisynth.

the class RootModel method prerender.

// implementations for Renderable
public void prerender(RenderList list) {
    for (Controller c : myControllers) {
        if (c instanceof Renderable) {
            list.addIfVisible((Renderable) c);
        }
    }
    for (Model m : myModels) {
        if (m instanceof Renderable) {
            list.addIfVisible((Renderable) m);
        }
    }
    for (Monitor m : myMonitors) {
        if (m instanceof Renderable) {
            list.addIfVisible((Renderable) m);
        }
    }
    list.addIfVisible(myOutputProbes);
    list.addIfVisible(myInputProbes);
    list.addIfVisible(myRenderables);
}
Also used : Renderable(maspack.render.Renderable) IsRenderable(maspack.render.IsRenderable) Monitor(artisynth.core.modelbase.Monitor) Model(artisynth.core.modelbase.Model) Controller(artisynth.core.modelbase.Controller)

Example 5 with Model

use of artisynth.core.modelbase.Model in project artisynth_core by artisynth.

the class RootModel method getModelInfo.

private ModelInfo getModelInfo(ModelAgent agent) {
    ModelInfo info = null;
    Model model = agent.getModel();
    if (model != null) {
        info = myModelInfo.get(model);
    }
    if (info == null) {
        info = myRootInfo;
    }
    return info;
}
Also used : Model(artisynth.core.modelbase.Model)

Aggregations

Model (artisynth.core.modelbase.Model)7 Controller (artisynth.core.modelbase.Controller)4 Monitor (artisynth.core.modelbase.Monitor)4 Probe (artisynth.core.probes.Probe)2 TracingProbe (artisynth.core.probes.TracingProbe)2 WayPointProbe (artisynth.core.probes.WayPointProbe)2 IsRenderable (maspack.render.IsRenderable)2 Renderable (maspack.render.Renderable)2 WayPoint (artisynth.core.probes.WayPoint)1 Point (java.awt.Point)1