use of maspack.widgets.VectorField in project artisynth_core by artisynth.
the class FemModel3dAgent method createMeshPropPanel.
private void createMeshPropPanel() {
meshPropPanel = new LabeledComponentPanel();
gridDimField = new VectorField("widths", DEFAULT_GRID_DIM, "%8.3f");
gridDivField = new IntegerMultiField("divisions", DEFAULT_GRID_DIV, "%d");
gridDimField.setStretchable(true);
gridDivField.setStretchable(true);
tubeDimField = new VectorField("widths (L, rin, rout)", DEFAULT_TUBE_DIM, "%8.3f");
tubeDivField = new IntegerMultiField("divisions (nt, nl, nr)", DEFAULT_TUBE_DIV, "%d");
tubeDimField.setStretchable(true);
tubeDivField.setStretchable(true);
torusDimField = new VectorField("widths (R, rin, rout)", DEFAULT_TORUS_DIM, "%8.3f");
torusDivField = new IntegerMultiField("divisions (nt, nl, nr)", DEFAULT_TORUS_DIV, "%d");
torusDimField.setStretchable(true);
torusDivField.setStretchable(true);
sphereNodesField = new IntegerSelector("node count", SPHERE_NODE_OPTIONS);
extrusDepthField = new DoubleField("depth", DEFAULT_EXTRUSION_DEPTH, "%8.3f");
extrusLayersField = new IntegerField("layers", DEFAULT_EXTRUSION_LAYERS, "%d");
extrusFileField = createFileChooser("obj file", null, "obj");
extrusFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
extrusDepthField.setStretchable(true);
extrusLayersField.setStretchable(true);
ansysNodeFileField = createFileChooser("node file", null, "node");
ansysNodeFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
ansysElemFileField = createFileChooser("elem file", null, "elem");
ansysElemFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
tetgenNodeFileField = createFileChooser("node file", null, "node");
tetgenNodeFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
tetgenEleFileField = createFileChooser("ele file", null, "ele");
tetgenEleFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
ucdMeshFileField = createFileChooser("INP file", null, "inp");
ucdMeshFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
surfaceMeshFileField = createFileChooser("OBJ file", null, "obj");
surfaceMeshFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
scaleField = new ScaleField("scale", 1);
scaleField.setStretchable(true);
autoScaleBtn = new JButton("auto scale");
autoScaleBtn.addActionListener(this);
scaleField.addMajorComponent(autoScaleBtn);
restoreDefaultValues();
if (mySettings != null) {
meshSelector.maskValueChangeListeners(true);
meshSelector.setValue(mySettings.meshType);
meshSelector.maskValueChangeListeners(false);
gridDimField.setValue(mySettings.gridWidths);
gridDivField.setValue(mySettings.gridDivisions);
tubeDimField.setValue(mySettings.tubeWidths);
tubeDivField.setValue(mySettings.tubeDivisions);
torusDimField.setValue(mySettings.torusWidths);
torusDivField.setValue(mySettings.torusDivisions);
sphereNodesField.setValue(mySettings.sphereNodes);
extrusDepthField.setValue(mySettings.extrusionDepth);
extrusLayersField.setValue(mySettings.extrusionLayers);
if (new File(mySettings.extrusionFile).isFile()) {
extrusFileField.setValue(mySettings.extrusionFile);
}
if (new File(mySettings.ansysNodeFile).isFile()) {
ansysNodeFileField.setValue(mySettings.ansysNodeFile);
}
if (new File(mySettings.ansysElemFile).isFile()) {
ansysElemFileField.setValue(mySettings.ansysElemFile);
}
if (new File(mySettings.tetgenNodeFile).isFile()) {
tetgenNodeFileField.setValue(mySettings.tetgenNodeFile);
}
if (new File(mySettings.tetgenEleFile).isFile()) {
tetgenEleFileField.setValue(mySettings.tetgenEleFile);
}
if (new File(mySettings.ucdFile).isFile()) {
ucdMeshFileField.setValue(mySettings.ucdFile);
}
if (new File(mySettings.surfaceMeshFile).isFile()) {
surfaceMeshFileField.setValue(mySettings.surfaceMeshFile);
}
}
updateMeshPanel();
}
use of maspack.widgets.VectorField 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);
}
use of maspack.widgets.VectorField in project artisynth_core by artisynth.
the class GeometryInertiaPanel method createGeometryWidgets.
// Called once at panel creation time to create all the widgets
// that may be needed for the Geometry.
protected void createGeometryWidgets() {
myBoxWidthsField = new VectorField("widths", new Vector3d(), "%.4g");
myBoxWidthsField.setResultHolder(new Vector3d());
initWidget(myBoxWidthsField);
myPointRadiusField = new DoubleField("radius", 0, "%.4g");
initWidget(myPointRadiusField);
myPointSlicesField = new IntegerField("slices", 12);
initWidget(myPointSlicesField);
myMeshFileField = new FileNameField("file name", "", 20);
initWidget(myMeshFileField);
myMeshXformWidget = new AffineTransformWidget("", "TRS", new RigidTransform3d());
initWidget(myMeshXformWidget);
myMeshXformWidget.unpackFields();
myMeshXformWidget.getTranslationField().setLabelText("offset");
myMeshXformWidget.getScaleField().setLabelText("scale");
myMeshXformWidget.getRotationField().setLabelText("rotation");
myCOMButton = new JButton("COM");
myCOMButton.addActionListener(this);
myCOMButton.setToolTipText("puts mesh origin at its center of mass");
GuiUtils.setFixedSize(myCOMButton, myMeshFileField.getBrowseButton().getPreferredSize());
myMeshXformWidget.getTranslationField().addMajorComponent(myCOMButton);
}
use of maspack.widgets.VectorField in project artisynth_core by artisynth.
the class FemModel3dAgent method createLocationPanel.
private void createLocationPanel() {
positionField = new VectorField("position", 3);
positionField.setStretchable(true);
positionField.addValueChangeListener(this);
orientationField = new AxisAngleField("orientiation", new AxisAngle());
orientationField.setStretchable(true);
orientationField.addValueChangeListener(this);
LabeledComponentPanel locationPanel = new LabeledComponentPanel();
locationPanel.addWidget(positionField);
locationPanel.addWidget(orientationField);
addWidget(locationPanel);
locationPanel.setBorder(GuiUtils.createTitledPanelBorder("Location"));
}
use of maspack.widgets.VectorField in project artisynth_core by artisynth.
the class RigidBodyAgent method createLocationPanel.
private void createLocationPanel() {
positionField = new VectorField("position", 3);
positionField.setStretchable(true);
positionField.addValueChangeListener(this);
orientationField = new AxisAngleField("orientiation", new AxisAngle());
orientationField.setStretchable(true);
orientationField.addValueChangeListener(this);
LabeledComponentPanel locationPanel = new LabeledComponentPanel();
locationPanel.addWidget(positionField);
locationPanel.addWidget(orientationField);
addWidget(locationPanel);
locationPanel.setBorder(GuiUtils.createTitledPanelBorder("Location"));
}
Aggregations