Search in sources :

Example 1 with SymmetricMatrix3dField

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);
}
Also used : VectorField(maspack.widgets.VectorField) SymmetricMatrix3dField(maspack.widgets.SymmetricMatrix3dField) EnumSelector(maspack.widgets.EnumSelector) DoubleField(maspack.widgets.DoubleField)

Aggregations

DoubleField (maspack.widgets.DoubleField)1 EnumSelector (maspack.widgets.EnumSelector)1 SymmetricMatrix3dField (maspack.widgets.SymmetricMatrix3dField)1 VectorField (maspack.widgets.VectorField)1