Package geomss.j3d

Class J3DRenderingPrefs

  • All Implemented Interfaces:
    javolution.lang.Immutable

    public class J3DRenderingPrefs
    extends java.lang.Object
    implements javolution.lang.Immutable
    A class that contains a set of Java3D rendering preferences for this application.

    Modified by: Joseph A. Huwaldt

    Version:
    June 4, 2023
    Author:
    Joseph A. Huwaldt, Date: December 21, 2013
    • Constructor Detail

      • J3DRenderingPrefs

        public J3DRenderingPrefs()
        Construct a default set of rendering preferences.
    • Method Detail

      • getDefaultPointColor

        public static java.awt.Color getDefaultPointColor()
        Returns:
        the default Color used to render points.
      • getDefaultLineColor

        public static java.awt.Color getDefaultLineColor()
        Returns:
        the default Color used to render lines.
      • getPointColor

        public java.awt.Color getPointColor()
        Returns:
        the Color used to render points.
      • changePointColor

        public J3DRenderingPrefs changePointColor​(java.awt.Color color)
        Return a set of rendering preferences that are identical to this one, but with the point color changed to the specified color.
        Parameters:
        color - The new color to use for rendering points.
        Returns:
        A copy of this set of rendering preferences with the point color changed.
      • getPointSize

        public int getPointSize()
        Returns:
        the size in pixels used for rendering points.
      • changePointSize

        public J3DRenderingPrefs changePointSize​(int pixels)
        Return a set of rendering preferences that are identical to this one, but with the point size changed to the specified value.
        Parameters:
        pixels - The new size, in pixels, to use for rendering points.
        Returns:
        A copy of this set of rendering preferences with the point size changed.
      • getLineColor

        public java.awt.Color getLineColor()
        Returns:
        the Color used to render lines and curves.
      • changeLineColor

        public J3DRenderingPrefs changeLineColor​(java.awt.Color color)
        Return a set of rendering preferences that are identical to this one, but with the line or curve color changed to the specified color.
        Parameters:
        color - The color to use for rendering lines and curves.
        Returns:
        A copy of this set of rendering preferences with the line color changed.
      • getLineWidth

        public int getLineWidth()
        Returns:
        the width in pixels used for rendering lines and curves.
      • changeLineWidth

        public J3DRenderingPrefs changeLineWidth​(int pixels)
        Return a set of rendering preferences that are identical to this one, but with the line width changed to the specified value.
        Parameters:
        pixels - The width, in pixels, to use when rendering lines and curves.
        Returns:
        A copy of this set of rendering preferences with the line width changed.
      • getDrawTolerance

        public Parameter<javax.measure.quantity.Length> getDrawTolerance()
        Returns:
        the tolerance used when rendering parametric objects.
      • changeDrawTolerance

        public J3DRenderingPrefs changeDrawTolerance​(Parameter<javax.measure.quantity.Length> tol)
        Return a set of rendering preferences that are identical to this one, but with the draw tolerance changed to the specified value. This tolerance is used when determining how to subdivide parametric objects for rendering. If the input value is null or equal to 0, it will be silently ignored.
        Parameters:
        tol - The geometric tolerance to use when rendering parametric objects. May not be null.
        Returns:
        A copy of this set of rendering preferences with the draw tolerance changed.
      • getSurfaceAppearance

        public org.jogamp.java3d.Appearance getSurfaceAppearance()
        Returns:
        the Java 3D Appearance used when rendering surfaces.
      • getSurfaceColor

        public java.awt.Color getSurfaceColor​(SurfaceColorType colorType)
        Get the color (of the specified type) used to render surfaces and point-arrays.
        Parameters:
        colorType - The aspect or type of the surface color that is being set. If AMBIENT_AND_DIFFUSE is passed in, then only the ambient color is returned!
        Returns:
        The color used for the specified type of surface color. Alpha is ignored.
        See Also:
        getSurfaceAlpha()
      • changeSurfaceColor

        public J3DRenderingPrefs changeSurfaceColor​(SurfaceColorType colorType,
                                                    java.awt.Color color)
        Return a set of rendering preferences that are identical to this one, but with the specified type of color used to render surfaces and point-arrays changed.
        Parameters:
        colorType - The aspect or type of the surface color that is being set.
        color - The color to use for the specified type of surface color. The alpha, if present, is ignored.
        Returns:
        A copy of this set of rendering preferences with the surface color changed.
        See Also:
        changeSurfaceAlpha(float)
      • getSurfaceAlpha

        public float getSurfaceAlpha()
        Get the alpha or transparency used when rendering surfaces or point-arrays.
        Returns:
        The alpha value used (0.0=completely transparent, 1.0=completely opaque).
      • changeSurfaceAlpha

        public J3DRenderingPrefs changeSurfaceAlpha​(float alpha)
        Return a set of rendering preferences that are identical to this one, but with the alpha or transparency used to render surfaces and point-arrays changed.
        Parameters:
        alpha - The alpha value to use (0.0=completely transparent, 1.0=completely opaque).
        Returns:
        A copy of this set of rendering preferences with the surface alpha changed.
      • getSurfaceShininess

        public float getSurfaceShininess()
        Get the shininess used when rendering surfaces and point-arrays.
        Returns:
        The shininess to use in the range [0.0, 1.0] where 0.0 is not shiny and 1.0 is very shiny.
      • changeSurfaceShininess

        public J3DRenderingPrefs changeSurfaceShininess​(float shininess)
        Return a set of rendering preferences that are identical to this one, but with the shininess used when rendering surfaces and point-arrays changed.
        Parameters:
        shininess - The shininess to use in the range [0.0, 1.0] where 0.0 is not shiny and 1.0 is very shiny. Values outside this range are clamped.
        Returns:
        A copy of this set of rendering preferences with the surface shininess changed.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this J3DRenderingPrefs against the specified object for strict equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this set of preferences is identical to that one; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code for this set of preferences.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value.