jv.viewer
Class PvLight
java.lang.Object
jv.object.PsObject
jv.project.PgGeometry
jv.project.PgJvxSrc
jv.viewer.PvLight
- All Implemented Interfaces:
- java.lang.Cloneable, PgGeometryIf, PsUpdateIf, PvLightIf, java.io.Serializable
- public final class PvLight
- extends PgJvxSrc
- implements PvLightIf
Light for JavaView display.
- See Also:
- Serialized Form
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS |
| Fields inherited from interface jv.project.PvLightIf |
LIGHT_AMBIENT, LIGHT_DIRECTION, LIGHT_HEAD, LIGHT_POINT, LIGHT_SHADOW, LIGHT_SKY, LIGHT_SPOT, MODEL_LIGHT, MODEL_SURFACE, REFERENCE_CAMERA, REFERENCE_SCENE, SHADING_FULLSPHERE, SHADING_HALFSPHERE, SHADING_SYMMETRIC |
| Fields inherited from interface jv.project.PgGeometryIf |
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, HAS_METHOD_MENU, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, m_numLabelTypes, METHOD_EXT, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE |
|
Method Summary |
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners. |
double |
getAngle()
Get angle of spot cone of light. |
java.awt.Color |
getColor()
Get color of light. |
double |
getCorona()
Get angle of corona of spot cone. |
PvDisplayIf |
getDisplay()
Get parent display of this light. |
double |
getExponent()
Get exponent which determines the size of a highlight. |
double |
getFalloff()
Get fall off angle of spot cone. |
double |
getIntensity()
Get intensity of light. |
PdVector |
getInterest()
Get interest of the light, the point at which the light shines. |
static int |
getLightingModelAsInt(java.lang.String model)
Get lighting model as integer identifier
such as MODEL_LIGHT. |
static java.lang.String |
getLightingModelAsString(int model)
Get lighting model as string representation from an integer identifier
such as MODEL_LIGHT. |
int |
getLightType()
Get type of the light among public variables like
LIGHT_AMBIENT. |
PdVector |
getPosition()
Get position of light. |
int |
getReference()
Get reference coordinate system of the light among public variables like
REFERENCE_SCENE. |
int |
getShading()
Get shading type of the light among public variables like
SHADING_SYMMETRIC. |
void |
init()
Initializes and resets current camera. |
boolean |
isHighlight()
Determines if light throughs a highlight. |
boolean |
isSwitchedOn()
Get flag if light is currently switched on within the scene,
i.e. whether is contributes to the total light. |
void |
setAngle(double angle)
Set angle of spot cone of light. |
void |
setColor(java.awt.Color color)
Set color of light. |
void |
setCorona(double corona)
Set angle of corona of spot cone. |
void |
setExponent(double exp)
Set exponent which determines the size of a highlight. |
void |
setFalloff(double falloff)
Set fall off angle of spot cone. |
void |
setHighlight(boolean bHighlight)
Enables if light throughs a highlight. |
void |
setIntensity(double intensity)
Set intensity of light. |
void |
setInterest(double x,
double y,
double z)
Set interest of the light, the point at which the light shines.
|
void |
setInterest(PdVector interest)
Set interest of the light, the point at which the light shines.
|
void |
setLightType(int lightType)
Set type of the light among public variables like
LIGHT_AMBIENT. |
void |
setPosition(double x,
double y,
double z)
Set position of light. |
void |
setPosition(PdVector position)
Set position of light. |
void |
setReference(int reference)
Set reference coordinate system of the light among public variables like
REFERENCE_SCENE. |
void |
setShading(int shading)
Set shading type of the light among public variables like
SHADING_SYMMETRIC. |
void |
setSwitchedOn(boolean flag)
Set flag if light is currently switched on within the scene,
i.e. whether is contributes to the total light. |
boolean |
update(java.lang.Object event)
Catch update events sent by children. |
| Methods inherited from class jv.project.PgJvxSrc |
addElement, addPolygon, addVertex, assureElementBackColors, assureElementColors, assureElementNormals, assureElementTextures, assureNeighbours, assurePolygonColors, assurePolygonNormals, assurePolygonSizes, assureVectorColors, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, copy, getAmbientBounds, getBlendingMode, getBounds, getCreaseAngle, getDimOfElements, getDimOfPolygons, getDimOfTextures, getDimOfVectors, getEdges, getElement, getElementBackColors, getElementColors, getElementNormals, getElements, getElementTextures, getFilterType, getGlobalBndColor, getGlobalBndSize, getGlobalBndTagColor, getGlobalEdgeColor, getGlobalEdgeNormalColor, getGlobalEdgeNormalLength, getGlobalEdgeNormalSize, getGlobalEdgeSize, getGlobalEdgeTagColor, getGlobalElementBackColor, getGlobalElementColor, getGlobalElementNormalColor, getGlobalElementNormalLength, getGlobalElementNormalSize, getGlobalElementTagColor, getGlobalPolygonColor, getGlobalPolygonNormalColor, getGlobalPolygonNormalLength, getGlobalPolygonNormalSize, getGlobalPolygonSize, getGlobalPolygonTagColor, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getJvx, getNeighbours, getNumEdges, getNumElements, getNumPolygons, getNumVectorFields, getNumVectors, getNumVertices, getPolygon, getPolygonColors, getPolygonNormals, getPolygons, getPolygonSizes, getShininess, getSpecularColor, getTextureImage, getTextureImageBnd, getTextureImageName, getTransparency, getVectorFieldColors, getVectorFieldName, getVectors, getVertex, getVertexColors, getVertexFunctions, getVertexNormals, getVertexSizes, getVertexTextures, getVertices, hasTagVertex, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingBackface, isShowingBoundaries, isShowingEdgeColorFromElements, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdges, isShowingElementBackColor, isShowingElementBackColors, isShowingElementColors, isShowingElementFromVertexColors, isShowingElementLabels, isShowingElementNormalArrow, isShowingElementNormals, isShowingElements, isShowingElementTexture, isShowingIndices, isShowingIndividualMaterial, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonLabels, isShowingPolygonNormalArrow, isShowingPolygonNormals, isShowingPolygons, isShowingPolygonSizes, isShowingPolygonStartArrow, isShowingSilhouette, isShowingSmoothElementColors, isShowingSmoothLighting, isShowingTaggedElements, isShowingTaggedPolygons, isShowingTaggedVertices, isShowingTransparency, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVectorFields, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexOutline, isShowingVertexSizes, isShowingVertexTexture, isShowingVertices, isVectorElementBased, makeElementColorsFromXYZ, makeElementFromVertexColors, makeElementNormals, makeQuadrConn, makeVertexNormals, paint, reflect, removePolygonSizes, setBlendingMode, setCreaseAngle, setDefaultLabelEnabled, setDimOfElements, setDimOfPolygons, setDimOfVertices, setEdges, setElement, setElementBackColors, setElementColors, setElementNormals, setElements, setElementTextures, setEnabledIndexLabels, setFilterType, setGlobalBndColor, setGlobalBndSize, setGlobalBndTagColor, setGlobalEdgeColor, setGlobalEdgeNormalColor, setGlobalEdgeNormalLength, setGlobalEdgeNormalSize, setGlobalEdgeSize, setGlobalEdgeTagColor, setGlobalElementBackColor, setGlobalElementColor, setGlobalElementNormalColor, setGlobalElementNormalLength, setGlobalElementNormalSize, setGlobalElementTagColor, setGlobalPolygonColor, setGlobalPolygonNormalColor, setGlobalPolygonNormalLength, setGlobalPolygonNormalSize, setGlobalPolygonSize, setGlobalPolygonTagColor, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexTagColor, setJvx, setNeighbours, setNumEdges, setNumElements, setNumPolygons, setNumVectorFields, setNumVectors, setNumVertices, setPolygon, setPolygonColors, setPolygonNormals, setPolygons, setPolygonSizes, setShininess, setSpecularColor, setState, setTagVertex, setTextureImage, setTextureImageBnd, setTextureImageName, setTransparency, setVectorColors, setVectorElementBased, setVectorFieldName, setVectors, setVertex, setVertexColors, setVertexFunctions, setVertexNormals, setVertexSizes, setVertexTextures, setVertices, showBackface, showBoundaries, showEdgeColorFromElements, showEdgeColors, showEdgeLabels, showEdges, showElementBackColor, showElementBackColors, showElementColors, showElementFromVertexColors, showElementLabels, showElementNormalArrow, showElementNormals, showElements, showElementTexture, showIndices, showIndividualMaterial, showPolygonColors, showPolygonEndArrow, showPolygonLabels, showPolygonNormalArrow, showPolygonNormals, showPolygons, showPolygonSizes, showPolygonStartArrow, showSilhouette, showSmoothElementColors, showSmoothLighting, showTaggedElements, showTaggedPolygons, showTaggedVertices, showTransparency, showVectorArrows, showVectorColors, showVectorField, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexOutline, showVertexSizes, showVertexTexture, showVertices |
| Methods inherited from class jv.project.PgGeometry |
addDisplay, applyAmbientMatrix, applyModelingMatrix, blend, clearTagElement, clearTagPolygon, copy, fillMethodMenu, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getGeometryInfo, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getState, getTitle, getType, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, intersectionWithLine, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, merge, projectFromAmbientSpace, removeDisplay, removeElement, removeMethodMenus, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setEnabledInstanceSharing, setGeometryInfo, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setTagElement, setTagPolygon, setTitle, setType, setVersion, setVersionType, setVisible, showBndBox, showCenter, showName, showTitle, toString |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PgGeometryIf |
addDisplay, addElement, addPolygon, addVertex, assureInspector, blend, clearTagElement, clearTagPolygon, clearTagVertex, fillMethodMenu, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getControlPanel, getDimOfSimplex, getDimOfVertices, getDisplays, getElement, getGeometryInfo, getInfoPanel, getJvx, getMaterialPanel, getModelMatrix, getName, getPolygon, getTextureImage, getTextureImageName, getTitle, getType, getVertex, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTag, hasTagElement, hasTagPolygon, hasTagVertex, intersectionWithLine, isConfigurable, isVisible, merge, paint, reflect, removeDisplay, removeElement, removeMethodMenus, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setElement, setGeometryInfo, setJvx, setModelMatrix, setPolygon, setState, setTagElement, setTagPolygon, setTagVertex, setTextureImage, setTextureImageName, setTitle, setVertex, setVisible, toString |
PvLight
public PvLight(PvDisplayIf disp,
int type)
- Constructor of a light with type like
LIGHT_AMBIENT.
- Parameters:
disp - display which contains this lighttype - type of this light
PvLight
public PvLight(PvDisplayIf disp)
- Constructor of light.
- Parameters:
disp - display which contains this light- Since:
- JavaView 3.90.022
init
public void init()
- Initializes and resets current camera.
- Overrides:
init in class PgJvxSrc
update
public boolean update(java.lang.Object event)
- Catch update events sent by children.
- Specified by:
update in interface PsUpdateIf- Overrides:
update in class PgGeometry
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)
getDisplay
public PvDisplayIf getDisplay()
- Get parent display of this light.
getLightingModelAsInt
public static int getLightingModelAsInt(java.lang.String model)
- Get lighting model as integer identifier
such as
MODEL_LIGHT.
- Parameters:
model - lighting model as string ("Material" or "Light").
- Returns:
- index of lighting model, or -1 if argument is unknown.
getLightingModelAsString
public static java.lang.String getLightingModelAsString(int model)
- Get lighting model as string representation from an integer identifier
such as
MODEL_LIGHT.
- Parameters:
model - lighting model
- Returns:
- lighting model as string, or null if index out of bounds.
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.
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 lighty - y-coordinate of position of lightz - 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 lighty - y-coordinate of interest of lightz - 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 throughs a highlight.
- Specified by:
isHighlight in interface PvLightIf
- Returns:
- flag if light throughs a highlight
- Since:
- JavaView 3.90.021
setHighlight
public void setHighlight(boolean bHighlight)
- Enables if light throughs a highlight.
- Specified by:
setHighlight in interface PvLightIf
- Parameters:
bHighlight - flag- Since:
- JavaView 3.90.021
The software JavaView© is copyright protected. All Rights Reserved.