Search in sources :

Example 6 with GLViewer

use of maspack.render.GL.GLViewer in project artisynth_core by artisynth.

the class Main method createViewerFrame.

public GLViewerFrame createViewerFrame() {
    GLViewerFrame frame = new GLViewerFrame(myViewer, PROJECT_NAME, 400, 400);
    GLViewer viewer = frame.getViewer();
    // ViewerToolBar toolBar = new ViewerToolBar(viewer, this);
    AxisAngle REW = getDefaultViewOrientation(getRootModel());
    myViewerManager.addViewer(viewer);
    ViewerToolBar toolBar = new ViewerToolBar(viewer, /*addGridPanel=*/
    true);
    frame.getContentPane().add(toolBar, BorderLayout.PAGE_START);
    viewer.setDefaultAxialView(AxisAlignedRotation.getNearest(new RotationMatrix3d(REW)));
    initializeViewer(viewer, REW);
    frame.setVisible(true);
    return frame;
}
Also used : ViewerToolBar(maspack.widgets.ViewerToolBar) GLViewer(maspack.render.GL.GLViewer) AxisAngle(maspack.matrix.AxisAngle) GLViewerFrame(maspack.render.GL.GLViewerFrame) RotationMatrix3d(maspack.matrix.RotationMatrix3d)

Example 7 with GLViewer

use of maspack.render.GL.GLViewer in project artisynth_core by artisynth.

the class MenuBarHandler method updateWidgets.

public void updateWidgets() {
    // frame is being set visible can cause some problems
    if (!myFrame.isVisible()) {
        return;
    }
    GLViewer v = getMainViewer();
    boolean gridOn = v.getGridVisible();
    GLGridPlane grid = v.getGrid();
    if ((myGridDisplay != null) != gridOn) {
        if (gridOn) {
            myGridDisplay = GridDisplay.createAndAdd(grid, myToolBar, myGridDisplayIndex);
        } else {
            GridDisplay.removeAndDispose(myGridDisplay, myToolBar, myGridDisplayIndex);
            myGridDisplay = null;
        }
    }
    if (myGridDisplay != null) {
        myGridDisplay.updateWidgets();
    }
}
Also used : GLViewer(maspack.render.GL.GLViewer) GLGridPlane(maspack.render.GL.GLGridPlane)

Example 8 with GLViewer

use of maspack.render.GL.GLViewer in project artisynth_core by artisynth.

the class ViewerManager method render.

public void render() {
    // System.out.println("vm_render");
    myRenderList = buildRenderList();
    for (GLViewer v : myViewers) {
        v.setExternalRenderList(myRenderList);
        v.rerender();
    }
}
Also used : GLViewer(maspack.render.GL.GLViewer)

Example 9 with GLViewer

use of maspack.render.GL.GLViewer in project artisynth_core by artisynth.

the class ViewerManager method setEllipticSelection.

/**
 * Set whether or not elliptic selection is enabled in all the viewers.
 *
 * @param enable
 * Whether or not elliptic selection is enabled.
 */
public void setEllipticSelection(boolean enable) {
    ellipticSelectionP = enable;
    for (GLViewer v : myViewers) {
        v.setEllipticSelection(enable);
        v.setEllipticCursorActive(enable);
    }
}
Also used : GLViewer(maspack.render.GL.GLViewer)

Example 10 with GLViewer

use of maspack.render.GL.GLViewer in project artisynth_core by artisynth.

the class ViewerManager method resetEllipticCursorSize.

public void resetEllipticCursorSize() {
    for (GLViewer v : myViewers) {
        v.resetEllipticCursorSize();
        v.repaint();
    }
}
Also used : GLViewer(maspack.render.GL.GLViewer)

Aggregations

GLViewer (maspack.render.GL.GLViewer)36 Vector3d (maspack.matrix.Vector3d)9 File (java.io.File)5 RigidTransform3d (maspack.matrix.RigidTransform3d)4 AxisAngle (maspack.matrix.AxisAngle)3 Point3d (maspack.matrix.Point3d)3 GLViewerFrame (maspack.render.GL.GLViewerFrame)3 RigidBody (artisynth.core.mechmodels.RigidBody)2 ExtensionFileFilter (artisynth.core.util.ExtensionFileFilter)2 JFileChooser (javax.swing.JFileChooser)2 FileFilter (javax.swing.filechooser.FileFilter)2 PolygonalMesh (maspack.geometry.PolygonalMesh)2 RotationMatrix3d (maspack.matrix.RotationMatrix3d)2 GLGridPlane (maspack.render.GL.GLGridPlane)2 RenderProps (maspack.render.RenderProps)2 Transrotator3d (maspack.render.Transrotator3d)2 GenericFileFilter (maspack.util.GenericFileFilter)2 InternalErrorException (maspack.util.InternalErrorException)2 ArgParser (argparser.ArgParser)1 IntHolder (argparser.IntHolder)1