Documentation of 'jv.viewer.PvLight' Java class
PvLight ("JavaView Reference Manual")
"JavaView? v5.03.003"
jv.viewer

Class PvLight

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf, PvLightIf


    public final class PvLight
    extends PgJvxSrc
    implements PvLightIf
    Light for JavaView display.
    See Also:
    Serialized Form
    Author:
    Konrad Polthier
    Version:
    04.05.14, 2.01 revised (kp) Geometry type mentioned in constructor.
    06.06.06, 2.00 revised (kp) String based methods getLightingModelAsInt and getLightingModelAsString removed.
    29.07.07, 1.50 revised (kp) Shading type added.
    23.07.07, 1.40 revised (kp) Reference coordinate system added.
    31.12.03, 1.30 revised (kp) Additional lights head and sky added.
    18.06.02, 1.20 revised (kp) Lighting models distinguished.
    26.05.02, 1.10 revised (kp) Implementation continued.
    24.02.02, 1.00 created (kp)
    • Constructor Detail

      • PvLight

        public PvLight(PvDisplayIf disp,
                       int type)
        Constructor of a light with type like LIGHT_AMBIENT.
        Parameters:
        disp - display which contains this light
        type - type of this light
      • PvLight

        public PvLight(PvDisplayIf disp)
        Constructor of light.
        Parameters:
        disp - display which contains this light
        Since:
        JavaView 3.90.022
    • Method Detail

      • init

        public void init()
        Initializes and resets current camera.
        Overrides:
        init in class PgJvxSrc
      • clone

        public java.lang.Object clone()
        Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. The parent relationship is maintained only within this class but not to external classes. In general, all links of the clone to external objects are set to null.
        Specified by:
        clone in interface PgGeometryIf
        Overrides:
        clone in class PgJvxSrc
        See Also:
        PgGeometry.copy(jv.object.PsObject)
        Version:
        23.07.05, 1.20 revised (kp) Missing clone of m_matCol added since duplication of light failed.
        16.09.00, 1.10 revised (kp) Cloning of boundary curves added.
        05.07.00, 1.00 created (kp)
      • getDisplay

        public PvDisplayIf getDisplay()
        Get parent display of this light.
      • getReference

        public int getReference()
        Get reference coordinate system of the light among public variables like REFERENCE_SCENE.
        Specified by:
        getReference in interface PvLightIf
        Returns:
        reference coordinate system of this light source
        Since:
        JavaView 3.90.021
      • setReference

        public void setReference(int reference)
        Set reference coordinate system of the light among public variables like REFERENCE_SCENE.
        Specified by:
        setReference in interface PvLightIf
        Parameters:
        reference - new reference coordinate system of this light source
        Since:
        JavaView 3.90.021
      • getShading

        public int getShading()
        Get shading type of the light among public variables like SHADING_SYMMETRIC.
        Specified by:
        getShading in interface PvLightIf
        Returns:
        shading type of this light
        Since:
        JavaView 3.90.022
      • setShading

        public void setShading(int shading)
        Set shading type of the light among public variables like SHADING_SYMMETRIC.
        Specified by:
        setShading in interface PvLightIf
        Parameters:
        shading - new shading type of this light
        Since:
        JavaView 3.90.022
      • getLightType

        public int getLightType()
        Get type of the light among public variables like LIGHT_AMBIENT.
        Specified by:
        getLightType in interface PvLightIf
        Returns:
        type of this light source
      • setLightType

        public void setLightType(int lightType)
        Set type of the light among public variables like LIGHT_AMBIENT.
        Specified by:
        setLightType in interface PvLightIf
        Parameters:
        lightType - new type of this light source
      • isSwitchedOn

        public boolean isSwitchedOn()
        Get flag if light is currently switched on within the scene, i.e. whether is contributes to the total light.
        Specified by:
        isSwitchedOn in interface PvLightIf
      • setSwitchedOn

        public void setSwitchedOn(boolean flag)
        Set flag if light is currently switched on within the scene, i.e. whether is contributes to the total light.
        Specified by:
        setSwitchedOn in interface PvLightIf
        Parameters:
        flag - lights must be switch on in order to illuminate a scene.
      • getDirection

        public PdVector getDirection()
        Get direction of the light as unit length vector from position to interest. Direction is automatically calculated when interest or position is changed.
        Returns:
        direction of the light
        Since:
        JavaView 4.20.001
        Version:
        22.04.14, 1.00 created (kp)
      • getPosition

        public PdVector getPosition()
        Get position of light.
        Specified by:
        getPosition in interface PvLightIf
        Returns:
        position is a 3d vector
      • setPosition

        public void setPosition(PdVector position)
        Set position of light.
        Specified by:
        setPosition in interface PvLightIf
        Parameters:
        position - new position of this light
      • setPosition

        public void setPosition(double x,
                                double y,
                                double z)
        Set position of light.
        Specified by:
        setPosition in interface PvLightIf
        Parameters:
        x - x-coordinate of position of light
        y - y-coordinate of position of light
        z - z-coordinate of position of light
      • getInterest

        public PdVector getInterest()
        Get interest of the light, the point at which the light shines.
        Specified by:
        getInterest in interface PvLightIf
        Returns:
        interest of the light
      • setInterest

        public void setInterest(PdVector interest)
        Set interest of the light, the point at which the light shines. Direction of light will be adjusted to show from position to interest and have unit length.
        Specified by:
        setInterest in interface PvLightIf
        Parameters:
        interest - interest of the light
      • setInterest

        public void setInterest(double x,
                                double y,
                                double z)
        Set interest of the light, the point at which the light shines. Direction of light will be adjusted to show from position to interest and have unit length.
        Specified by:
        setInterest in interface PvLightIf
        Parameters:
        x - x-coordinate of interest of light
        y - y-coordinate of interest of light
        z - z-coordinate of interest of light
      • getColor

        public java.awt.Color getColor()
        Get color of light.
        Specified by:
        getColor in interface PvLightIf
        Returns:
        color of light
      • setColor

        public void setColor(java.awt.Color color)
        Set color of light.
        Specified by:
        setColor in interface PvLightIf
        Parameters:
        color - new color of light
      • getIntensity

        public double getIntensity()
        Get intensity of light.
        Specified by:
        getIntensity in interface PvLightIf
        Returns:
        intensity of light
      • setIntensity

        public void setIntensity(double intensity)
        Set intensity of light.
        Specified by:
        setIntensity in interface PvLightIf
        Parameters:
        intensity - new intensity of light
      • getAngle

        public double getAngle()
        Get angle of spot cone of light.
        Specified by:
        getAngle in interface PvLightIf
        Returns:
        angle of spot cone of light
      • setAngle

        public void setAngle(double angle)
        Set angle of spot cone of light.
        Specified by:
        setAngle in interface PvLightIf
        Parameters:
        angle - angle of spot cone of light
      • getCorona

        public double getCorona()
        Get angle of corona of spot cone.
        Specified by:
        getCorona in interface PvLightIf
        Returns:
        angle of corona of spot cone
      • setCorona

        public void setCorona(double corona)
        Set angle of corona of spot cone.
        Specified by:
        setCorona in interface PvLightIf
        Parameters:
        corona - angle of corona of spot cone
      • getFalloff

        public double getFalloff()
        Get fall off angle of spot cone.
        Specified by:
        getFalloff in interface PvLightIf
        Returns:
        fall off angle of spot cone
      • setFalloff

        public void setFalloff(double falloff)
        Set fall off angle of spot cone.
        Specified by:
        setFalloff in interface PvLightIf
        Parameters:
        falloff - fall off angle of spot cone
      • getExponent

        public double getExponent()
        Get exponent which determines the size of a highlight.
        Specified by:
        getExponent in interface PvLightIf
        Returns:
        specular exponent
      • setExponent

        public void setExponent(double exp)
        Set exponent which determines the size of a highlight.
        Specified by:
        setExponent in interface PvLightIf
        Parameters:
        exp - specular exponent
      • isHighlight

        public boolean isHighlight()
        Determines if light throws a highlight.
        Specified by:
        isHighlight in interface PvLightIf
        Returns:
        flag if light throws a highlight
        Since:
        JavaView 3.90.021
      • setHighlight

        public void setHighlight(boolean bHighlight)
        Enables if light throws a highlight.
        Specified by:
        setHighlight in interface PvLightIf
        Parameters:
        bHighlight - flag
        Since:
        JavaView 3.90.021
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

Ads help maintain this website.