Search in sources :

Example 1 with AxisAlignedRotation

use of maspack.matrix.AxisAlignedRotation in project artisynth_core by artisynth.

the class ViewerToolBar method updateIcons.

public void updateIcons() {
    if (myAxialViewMenuItems == null) {
        // has finished constructing
        return;
    }
    AxisAlignedRotation defaultView = myViewer.getDefaultAxialView();
    if (defaultView != myDefaultAxialView) {
        // default view has changed; rebuild the icon list
        myDefaultAxialView = defaultView;
        RotationMatrix3d RDefault = defaultView.getMatrix();
        for (AxialViewMenuItem item : myAxialViewMenuItems) {
            if (item != myCurrentViewMenuItem) {
                item.setRelativeAxialView(RDefault);
            }
        }
    }
    // now look for the current view in the list.
    AxisAlignedRotation currentView = myViewer.getAxialView();
    if (myCurrentViewMenuItem.getAxialView() != currentView) {
        myCurrentViewMenuItem.setAxialView(currentView);
        setAxialViewIcon(myCurrentViewMenuItem.getIcon());
    }
}
Also used : AxisAlignedRotation(maspack.matrix.AxisAlignedRotation) RotationMatrix3d(maspack.matrix.RotationMatrix3d)

Example 2 with AxisAlignedRotation

use of maspack.matrix.AxisAlignedRotation in project artisynth_core by artisynth.

the class LineSegment method alignToWorld.

RigidTransform3d alignToWorld(RigidTransform3d GTW) {
    RigidTransform3d ATW = new RigidTransform3d();
    double res = getResolution().getMajorCellSize();
    ATW.p.x = res * Math.round(GTW.p.x / res);
    ATW.p.y = res * Math.round(GTW.p.y / res);
    ATW.p.z = res * Math.round(GTW.p.z / res);
    AxisAlignedRotation alignedRot = AxisAlignedRotation.getNearest(GTW.R);
    alignedRot.getMatrix(ATW.R);
    return ATW;
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) AxisAlignedRotation(maspack.matrix.AxisAlignedRotation)

Example 3 with AxisAlignedRotation

use of maspack.matrix.AxisAlignedRotation in project artisynth_core by artisynth.

the class ViewerToolBar method createViewPopup.

private JPopupMenu createViewPopup(ArrayList<AxialViewMenuItem> itemList) {
    JPopupMenu menu = new JPopupMenu();
    menu.add(myCurrentViewMenuItem);
    AxisAlignedRotation currentView = myCurrentViewMenuItem.getAxialView();
    for (AxialViewMenuItem item : itemList) {
        if (item.getAxialView() != currentView) {
            menu.add(item);
        }
    }
    return menu;
}
Also used : AxisAlignedRotation(maspack.matrix.AxisAlignedRotation) JPopupMenu(javax.swing.JPopupMenu)

Example 4 with AxisAlignedRotation

use of maspack.matrix.AxisAlignedRotation in project artisynth_core by artisynth.

the class ViewerManager method resetViewers.

public void resetViewers(AxisAngle frontView) {
    AxisAlignedRotation view = AxisAlignedRotation.getNearest(new RotationMatrix3d(frontView));
    for (GLViewer v : myViewers) {
        v.setDefaultAxialView(view);
        resetViewer(v);
    }
}
Also used : AxisAlignedRotation(maspack.matrix.AxisAlignedRotation) GLViewer(maspack.render.GL.GLViewer) RotationMatrix3d(maspack.matrix.RotationMatrix3d)

Aggregations

AxisAlignedRotation (maspack.matrix.AxisAlignedRotation)4 RotationMatrix3d (maspack.matrix.RotationMatrix3d)2 JPopupMenu (javax.swing.JPopupMenu)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1 GLViewer (maspack.render.GL.GLViewer)1