use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class VectorTracingProbe method initRenderProps.
private void initRenderProps(ModelComponent comp) {
RenderProps newProps = createRenderProps();
if (comp instanceof HasRenderProps) {
HasRenderProps rcomp = (HasRenderProps) comp;
RenderProps compProps = rcomp.getRenderProps();
if (compProps == null) {
compProps = rcomp.createRenderProps();
}
newProps.set(compProps);
// line and point colors of render props to match
if (compProps.getPointColorMode() == PropertyMode.Explicit) {
float[] pointColor = compProps.getPointColorF();
newProps.setPointColor(pointColor);
newProps.setLineColor(pointColor);
}
}
newProps.setLineWidth(3);
newProps.setLineStyle(LineStyle.CYLINDER);
setRenderProps(newProps);
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class ColorBar method createRenderProps.
@Override
public RenderProps createRenderProps() {
RenderProps rprops = createDefaultRenderProps();
PropertyUtils.updateInheritedProperties(rprops, this, "renderProps");
return rprops;
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class DicomPlaneViewer method render.
@Override
public synchronized void render(Renderer renderer, int flags) {
RenderProps rprops = getRenderProps();
renderer.pushModelMatrix();
// adjust for widths and location
renderer.mulModelMatrix(location);
AffineTransform3d scaling = new AffineTransform3d();
scaling.applyScaling(widths.x, widths.y, 1);
renderer.mulModelMatrix(scaling);
ColorMapProps oldColorMap = renderer.setColorMap(rprops.getColorMap());
FaceStyle oldFaceStyle = renderer.setFaceStyle(FaceStyle.FRONT_AND_BACK);
Shading oldShading = renderer.setShading(rprops.getShading());
if (!renderer.isSelecting()) {
renderer.setFaceColoring(rprops, isSelected());
}
renderer.drawTriangles(robj, 0);
renderer.setShading(oldShading);
renderer.setFaceStyle(oldFaceStyle);
renderer.setColorMap(oldColorMap);
renderer.popModelMatrix();
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class DicomPlaneViewer method createRenderProps.
@Override
public RenderProps createRenderProps() {
RenderProps props = RenderProps.createLineFaceProps(this);
props.setFaceColor(Color.WHITE);
props.setShading(Shading.NONE);
ColorMapProps cprops = new ColorMapProps();
cprops.setEnabled(true);
cprops.setColorMixing(ColorMixing.MODULATE);
props.setColorMap(cprops);
return props;
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class DicomViewer method createRenderProps.
@Override
public RenderProps createRenderProps() {
RenderProps props = RenderProps.createLineFaceProps(this);
props.setFaceColor(Color.WHITE);
props.setShading(Shading.NONE);
ColorMapProps cprops = new ColorMapProps();
cprops.setEnabled(true);
cprops.setColorMixing(ColorMixing.MODULATE);
props.setColorMap(cprops);
return props;
}
Aggregations