Search in sources :

Example 6 with ColorMapProps

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();
}
Also used : FaceStyle(maspack.render.Renderer.FaceStyle) ColorMapProps(maspack.render.ColorMapProps) LineRenderProps(maspack.render.LineRenderProps) RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading) AffineTransform3d(maspack.matrix.AffineTransform3d)

Example 7 with ColorMapProps

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;
}
Also used : ColorMapProps(maspack.render.ColorMapProps) LineRenderProps(maspack.render.LineRenderProps) RenderProps(maspack.render.RenderProps)

Example 8 with ColorMapProps

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;
}
Also used : ColorMapProps(maspack.render.ColorMapProps) LineRenderProps(maspack.render.LineRenderProps) RenderProps(maspack.render.RenderProps)

Example 9 with ColorMapProps

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();
}
Also used : FaceStyle(maspack.render.Renderer.FaceStyle) ColorMapProps(maspack.render.ColorMapProps) LineRenderProps(maspack.render.LineRenderProps) RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading)

Example 10 with ColorMapProps

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);
}
Also used : ColorMapProps(maspack.render.ColorMapProps)

Aggregations

ColorMapProps (maspack.render.ColorMapProps)12 RenderProps (maspack.render.RenderProps)5 LineRenderProps (maspack.render.LineRenderProps)4 BumpMapProps (maspack.render.BumpMapProps)3 NormalMapProps (maspack.render.NormalMapProps)3 FaceStyle (maspack.render.Renderer.FaceStyle)3 Shading (maspack.render.Renderer.Shading)3 Color (java.awt.Color)2 Renderer (maspack.render.Renderer)2 GL2GL3 (com.jogamp.opengl.GL2GL3)1 GL3 (com.jogamp.opengl.GL3)1 GLContext (com.jogamp.opengl.GLContext)1 JFrame (javax.swing.JFrame)1 JPanel (javax.swing.JPanel)1 PolygonalMesh (maspack.geometry.PolygonalMesh)1 AffineTransform3d (maspack.matrix.AffineTransform3d)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1 Vector3d (maspack.matrix.Vector3d)1 IsRenderable (maspack.render.IsRenderable)1 RenderList (maspack.render.RenderList)1