use of maspack.render.ColorMapProps 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.ColorMapProps 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.ColorMapProps 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;
}
use of maspack.render.ColorMapProps in project artisynth_core by artisynth.
the class DicomViewer method render.
@Override
public synchronized void render(Renderer renderer, int flags) {
RenderProps rprops = getRenderProps();
renderer.pushModelMatrix();
renderer.setModelMatrix(myRenderTransform);
if (drawBox) {
// draw box
Shading savedShading = renderer.setShading(Shading.NONE);
renderer.setLineColoring(rprops, isSelected());
renderer.drawLines(robj, 0);
renderer.setShading(savedShading);
}
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());
}
for (int i = 0; i < 3; i++) {
if (drawSlice[i]) {
renderer.drawTriangles(robj, i);
}
}
renderer.setShading(oldShading);
renderer.setFaceStyle(oldFaceStyle);
renderer.setColorMap(oldColorMap);
renderer.popModelMatrix();
}
use of maspack.render.ColorMapProps in project artisynth_core by artisynth.
the class ImageProbe method setImage.
public void setImage(double t) {
if (imageBasename == null || imageDirectory == null)
return;
int frameNum = (int) (t * frameRate) + 1;
String filename = String.format(fileNameFormat, imageBasename, frameNum, imageFileExt);
ColorMapProps tprops = imagePlane.getRenderProps().getColorMap();
tprops.setFileName(imageDirectory.getAbsolutePath() + "/" + filename);
imagePlane.getRenderProps().setColorMap(tprops);
}
Aggregations