Search in sources :

Example 61 with RenderProps

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

Example 62 with RenderProps

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

Example 63 with RenderProps

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();
}
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 64 with RenderProps

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

Example 65 with RenderProps

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

Aggregations

RenderProps (maspack.render.RenderProps)86 Color (java.awt.Color)17 Vector3d (maspack.matrix.Vector3d)17 RigidBody (artisynth.core.mechmodels.RigidBody)11 RigidTransform3d (maspack.matrix.RigidTransform3d)11 Shading (maspack.render.Renderer.Shading)10 PolygonalMesh (maspack.geometry.PolygonalMesh)8 Point3d (maspack.matrix.Point3d)8 RenderObject (maspack.render.RenderObject)7 FrameMarker (artisynth.core.mechmodels.FrameMarker)6 File (java.io.File)6 IOException (java.io.IOException)6 Vertex3d (maspack.geometry.Vertex3d)6 AffineTransform3d (maspack.matrix.AffineTransform3d)4 ColorMapProps (maspack.render.ColorMapProps)4 HasRenderProps (maspack.render.HasRenderProps)4 LineRenderProps (maspack.render.LineRenderProps)4 AxialSpring (artisynth.core.mechmodels.AxialSpring)3 Muscle (artisynth.core.mechmodels.Muscle)3 LinkedList (java.util.LinkedList)3