Search in sources :

Example 1 with ViewerToolBar

use of maspack.widgets.ViewerToolBar 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 2 with ViewerToolBar

use of maspack.widgets.ViewerToolBar in project artisynth_core by artisynth.

the class MenuBarHandler method attachViewerToolbar.

/**
 * author: andreio create a camera toolbar to control the view of the camera
 * on the GlViewer
 */
public void attachViewerToolbar(JPanel panel) {
    if (myViewerToolBar == null) {
        myViewerToolBar = new ViewerToolBar(getMainViewer(), /*allowGridDisplay=*/
        false);
    }
    myViewerToolBar.setOrientation(JToolBar.VERTICAL);
    panel.add(myViewerToolBar, BorderLayout.SOUTH);
    panel.revalidate();
    panel.repaint();
    myViewerToolBar.setVisible(true);
}
Also used : ViewerToolBar(maspack.widgets.ViewerToolBar)

Example 3 with ViewerToolBar

use of maspack.widgets.ViewerToolBar in project artisynth_core by artisynth.

the class MeshViewer method createToolBars.

private void createToolBars() {
    myToolBar = new JPanel();
    myToolBar.setLayout(new BoxLayout(myToolBar, BoxLayout.LINE_AXIS));
    myToolBar.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    myMeshLabel = new JLabel(" ");
    myToolBar.add(myMeshLabel);
    // add glue to separate label from grid display
    myToolBar.add(Box.createHorizontalGlue());
    myGridDisplayIndex = myToolBar.getComponentCount();
    // add a place-holder component for the grid display
    myToolBar.add(GridDisplay.createPlaceHolder());
    getContentPane().add(myToolBar, BorderLayout.NORTH);
    JPanel leftPanel = new JPanel(new BorderLayout());
    ViewerToolBar viewerToolBar = new ViewerToolBar(viewer, /*addGridPanel=*/
    false);
    viewerToolBar.setOrientation(JToolBar.VERTICAL);
    leftPanel.add(viewerToolBar, BorderLayout.SOUTH);
    getContentPane().add(leftPanel, BorderLayout.WEST);
}
Also used : JPanel(javax.swing.JPanel) ViewerToolBar(maspack.widgets.ViewerToolBar) BorderLayout(java.awt.BorderLayout) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel)

Aggregations

ViewerToolBar (maspack.widgets.ViewerToolBar)3 BorderLayout (java.awt.BorderLayout)1 BoxLayout (javax.swing.BoxLayout)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 AxisAngle (maspack.matrix.AxisAngle)1 RotationMatrix3d (maspack.matrix.RotationMatrix3d)1 GLViewer (maspack.render.GL.GLViewer)1 GLViewerFrame (maspack.render.GL.GLViewerFrame)1