use of artisynth.core.femmodels.MuscleBundle.DirectionRenderType in project artisynth_core by artisynth.
the class MuscleElementDesc method render.
public void render(Renderer renderer, RenderProps props, int flags) {
double widgetSize = 0;
double directionLength = 0;
ModelComponent gparent = getGrandParent();
DirectionRenderType renderType = DirectionRenderType.ELEMENT;
if (gparent instanceof MuscleBundle) {
MuscleBundle bundle = (MuscleBundle) gparent;
widgetSize = bundle.getElementWidgetSize();
directionLength = bundle.getDirectionRenderLen();
renderType = bundle.getDirectionRenderType();
}
if (widgetSize != 0) {
Shading savedShading = renderer.setPropsShading(props);
if (myWidgetColor != null) {
renderer.setFaceColoring(props, myWidgetColor, isSelected());
} else {
renderer.setFaceColoring(props, isSelected());
}
myElement.renderWidget(renderer, widgetSize, props);
renderer.setShading(savedShading);
}
if (directionLength > 0) {
Matrix3d F = new Matrix3d();
Vector3d dir = new Vector3d();
float[] coords0 = new float[3];
float[] coords1 = new float[3];
renderDirection(renderer, props, coords0, coords1, F, dir, directionLength, renderType);
}
}
Aggregations