use of maspack.widgets.SymmetricMatrix3dField in project artisynth_core by artisynth.
the class GeometryInertiaPanel method createInertiaWidgets.
// Called once at panel creation time to create and add the widgets needed
// for controlling the inertia.
protected void createInertiaWidgets() {
myInertiaMethodSelector = new EnumSelector("set inertia by", InertiaMethod.values());
myInertiaMethodSelector.addValueChangeListener(this);
addWidget(myInertiaMethodSelector);
myDensityField = new DoubleField("density", 1, "%.6g");
myDensityField.addValueChangeListener(this);
myDensityField.setGUIVoidEnabled(true);
myDensityField.setStretchable(true);
myDensityField.addValueCheckListener(new PositiveValueCheck());
addWidget(myDensityField);
myMassField = new DoubleField("mass");
myMassField.addValueChangeListener(this);
myMassField.setStretchable(true);
myMassField.addValueCheckListener(new PositiveValueCheck());
addWidget(myMassField);
myInertiaField = new SymmetricMatrix3dField("rotational inertia");
myInertiaField.setFormat("%.5g");
myInertiaField.addValueChangeListener(this);
myInertiaField.setStretchable(true);
addWidget(myInertiaField);
myCOMField = new VectorField("center of mass", new Point3d(), "%.5g");
myCOMField.setResultHolder(new Point3d());
myCOMField.addValueChangeListener(this);
myCOMField.setStretchable(true);
addWidget(myCOMField);
// if myOriginalInertia was not set from widgets, then this will
// default to the identity inertia
// setInertiaWidgets (myOriginalInertia);
}
Aggregations