use of artisynth.core.femmodels.MuscleElementDesc in project artisynth_core by artisynth.
the class MuscleBundleEditor method addElementsNearFibres.
private void addElementsNearFibres(MuscleBundle bundle) {
WidgetDialog dialog = WidgetDialog.createDialog(myMain.getFrame(), "Specify fibre distance", "Set");
DoubleField widget = new DoubleField("distance:", myLastElementFibreDist);
widget.setRange(0, Double.POSITIVE_INFINITY);
dialog.addWidget(widget);
GuiUtils.locateCenter(dialog, myMain.getFrame());
dialog.setVisible(true);
if (dialog.getReturnValue() == OptionPanel.OK_OPTION) {
double dist = widget.getDoubleValue();
LinkedList<MuscleElementDesc> list = bundle.getNewElementsNearFibres(dist);
AddComponentsCommand cmd = new AddComponentsCommand("Add near elements", list, bundle.getElements());
myMain.getUndoManager().saveStateAndExecute(cmd);
myLastElementFibreDist = dist;
}
}
use of artisynth.core.femmodels.MuscleElementDesc in project artisynth_core by artisynth.
the class FemMuscleDemo method createBundle.
protected MuscleBundle createBundle(String name, List<FemElement3d> elems) {
MuscleBundle bundle = new MuscleBundle(name);
if (elems != null) {
for (FemElement3d e : elems) {
MuscleElementDesc desc = new MuscleElementDesc();
desc.setElement(e);
desc.setDirection(Vector3d.X_UNIT);
bundle.addElement(desc);
}
}
return bundle;
}
Aggregations