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