jv.viewer
Class PvLight
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.project.PgJvxSrc
-
- jv.viewer.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)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, 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, BLEND_ALPHA, BLEND_MATERIAL, BLEND_REPLACE, FILTER_DIRECT, FILTER_LINEAR, FILTER_QUADRATIC, 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, PERIODIC_BOTH, PERIODIC_HEIGHT, PERIODIC_NONE, PERIODIC_WIDTH, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE, SIDE_BACK, SIDE_BOTH, SIDE_FRONT, SIDE_NONE
-
-
Constructor Summary
Constructors Constructor and Description PvLight(PvDisplayIf disp)Constructor of light.PvLight(PvDisplayIf disp, int type)Constructor of a light with type likeLIGHT_AMBIENT.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.doublegetAngle()Get angle of spot cone of light.java.awt.ColorgetColor()Get color of light.doublegetCorona()Get angle of corona of spot cone.PdVectorgetDirection()Get direction of the light as unit length vector from position to interest.PvDisplayIfgetDisplay()Get parent display of this light.doublegetExponent()Get exponent which determines the size of a highlight.doublegetFalloff()Get fall off angle of spot cone.doublegetIntensity()Get intensity of light.PdVectorgetInterest()Get interest of the light, the point at which the light shines.intgetLightType()Get type of the light among public variables likeLIGHT_AMBIENT.PdVectorgetPosition()Get position of light.intgetReference()Get reference coordinate system of the light among public variables likeREFERENCE_SCENE.intgetShading()Get shading type of the light among public variables likeSHADING_SYMMETRIC.voidinit()Initializes and resets current camera.booleanisHighlight()Determines if light throws a highlight.booleanisSwitchedOn()Get flag if light is currently switched on within the scene, i.e. whether is contributes to the total light.voidsetAngle(double angle)Set angle of spot cone of light.voidsetColor(java.awt.Color color)Set color of light.voidsetCorona(double corona)Set angle of corona of spot cone.voidsetExponent(double exp)Set exponent which determines the size of a highlight.voidsetFalloff(double falloff)Set fall off angle of spot cone.voidsetHighlight(boolean bHighlight)Enables if light throws a highlight.voidsetIntensity(double intensity)Set intensity of light.voidsetInterest(double x, double y, double z)Set interest of the light, the point at which the light shines.voidsetInterest(PdVector interest)Set interest of the light, the point at which the light shines.voidsetLightType(int lightType)Set type of the light among public variables likeLIGHT_AMBIENT.voidsetPosition(double x, double y, double z)Set position of light.voidsetPosition(PdVector position)Set position of light.voidsetReference(int reference)Set reference coordinate system of the light among public variables likeREFERENCE_SCENE.voidsetShading(int shading)Set shading type of the light among public variables likeSHADING_SYMMETRIC.voidsetSwitchedOn(boolean flag)Set flag if light is currently switched on within the scene, i.e. whether is contributes to the total light.booleanupdate(java.lang.Object event)Catch update events sent by children.-
Methods inherited from class jv.project.PgJvxSrc
addElement, addPolygon, addVertex, assureEdgeColors, assureEdgeSizes, assureElementBackColors, assureElementColors, assureElementEdges, assureElementNormals, assureElementTextures, assureNeighbours, assurePolygonColors, assurePolygonNormals, assurePolygonSizes, assureVectorColors, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, copy, getAmbientBounds, getBlendingMode, getBndColor, getBndElementInd, getBndName, getBndNeighbourLocInd, getBndNumVertices, getBndSize, getBndVertexInd, getBndVertices, getBounds, getCreaseAngle, getDimOfElements, getDimOfPolygons, getDimOfTextures, getDimOfVectors, getEdgeColors, getEdges, getEdgeSizes, getElement, getElementBackColors, getElementColors, getElementEdges, 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, getNumBndPolygons, getNumEdges, getNumElements, getNumPolygons, getNumVectorFields, getNumVectors, getNumVertices, getPolygon, getPolygonColors, getPolygonNormals, getPolygons, getPolygonSizes, getShininess, getSpecularColor, getTextureImage, getTextureImageBnd, getTextureImageName, getTexturePeriodic, getTextureSide, getTextureTiling, getTransparency, getVectorFieldColors, getVectorFieldName, getVectors, getVertex, getVertexColors, getVertexFunctions, getVertexNormals, getVertexSizes, getVertexTextures, getVertices, hasEdgeColors, hasElementBackColors, hasElementColors, hasElementNormals, hasElementTextures, hasPolygonColors, hasPolygonNormals, hasTagVertex, hasVertexColors, hasVertexNormals, hasVertexSizes, hasVertexTextures, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingBackface, isShowingBnd, isShowingBndMaterials, isShowingBoundaries, isShowingEdgeColorFromElements, isShowingEdgeColorFromVertices, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdges, isShowingEdgeSizes, isShowingElementBackColor, isShowingElementBackColors, isShowingElementColorFromVertices, isShowingElementColors, isShowingElementFromVertexColors, isShowingElementLabels, isShowingElementNormalArrow, isShowingElementNormals, isShowingElements, isShowingElementTexture, isShowingIndices, isShowingIndividualMaterial, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonLabels, isShowingPolygonNormalArrow, isShowingPolygonNormals, isShowingPolygons, isShowingPolygonSizes, isShowingPolygonStartArrow, isShowingSilhouette, isShowingSmoothEdgeColors, isShowingSmoothElementColors, isShowingSmoothLighting, isShowingTaggedElements, isShowingTaggedPolygons, isShowingTaggedVertices, isShowingTransparency, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVectorFieldMaterials, isShowingVectorFields, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexOutline, isShowingVertexSizes, isShowingVertexTexture, isShowingVertices, isVectorElementBased, makeElementColorsFromXYZ, makeElementFromVertexColors, makeElementNormals, makeQuadrConn, makeVertexNormals, paint, reflect, removePolygonSizes, setBlendingMode, setBndColor, setBndElementInd, setBndName, setBndNeighbourLocInd, setBndNumVertices, setBndSize, setBndVertexInd, setBndVertices, setCreaseAngle, setDefaultLabelEnabled, setDimOfElements, setDimOfPolygons, setDimOfTextures, setDimOfVertices, setEdgeColors, setEdges, setEdgeSizes, setElement, setElementBackColors, setElementColors, setElementEdges, 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, setNumBndPolygons, setNumEdges, setNumElements, setNumPolygons, setNumVectorFields, setNumVectors, setNumVertices, setPolygon, setPolygonColors, setPolygonNormals, setPolygons, setPolygonSizes, setShininess, setSpecularColor, setState, setTagVertex, setTextureImage, setTextureImageBnd, setTextureImageName, setTexturePeriodic, setTextureSide, setTextureTiling, setTransparency, setVectorColors, setVectorElementBased, setVectorFieldName, setVectors, setVertex, setVertexColors, setVertexFunctions, setVertexNormals, setVertexSizes, setVertexTextures, setVertices, showBackface, showBnd, showBndMaterials, showBoundaries, showEdgeColorFromElements, showEdgeColorFromVertices, showEdgeColors, showEdgeLabels, showEdges, showEdgeSizes, showElementBackColor, showElementBackColors, showElementColorFromVertices, showElementColors, showElementFromVertexColors, showElementLabels, showElementNormalArrow, showElementNormals, showElements, showElementTexture, showIndices, showIndividualMaterial, showPolygonColors, showPolygonEndArrow, showPolygonLabels, showPolygonNormalArrow, showPolygonNormals, showPolygons, showPolygonSizes, showPolygonStartArrow, showSilhouette, showSmoothEdgeColors, showSmoothElementColors, showSmoothLighting, showTaggedElements, showTaggedPolygons, showTaggedVertices, showTransparency, showVectorArrows, showVectorColors, showVectorField, showVectorFieldMaterials, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexOutline, showVertexSizes, showVertexTexture, showVertices
-
Methods inherited from class jv.project.PgGeometry
addDisplay, applyAmbientMatrix, applyModelingMatrix, blend, clearTagElement, clearTagPolygon, convertWorldToModel, 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
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Constructor Detail
-
PvLight
public PvLight(PvDisplayIf disp, int type)
Constructor of a light with type likeLIGHT_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
-
-
Method Detail
-
update
public boolean update(java.lang.Object event)
Catch update events sent by children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPgGeometry- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
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 tonull.- Specified by:
clonein interfacePgGeometryIf- Overrides:
clonein classPgJvxSrc- 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 likeREFERENCE_SCENE.- Specified by:
getReferencein interfacePvLightIf- 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 likeREFERENCE_SCENE.- Specified by:
setReferencein interfacePvLightIf- 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 likeSHADING_SYMMETRIC.- Specified by:
getShadingin interfacePvLightIf- 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 likeSHADING_SYMMETRIC.- Specified by:
setShadingin interfacePvLightIf- 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 likeLIGHT_AMBIENT.- Specified by:
getLightTypein interfacePvLightIf- Returns:
- type of this light source
-
setLightType
public void setLightType(int lightType)
Set type of the light among public variables likeLIGHT_AMBIENT.- Specified by:
setLightTypein interfacePvLightIf- 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:
isSwitchedOnin interfacePvLightIf
-
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:
setSwitchedOnin interfacePvLightIf- 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:
getPositionin interfacePvLightIf- Returns:
- position is a 3d vector
-
setPosition
public void setPosition(PdVector position)
Set position of light.- Specified by:
setPositionin interfacePvLightIf- Parameters:
position- new position of this light
-
setPosition
public void setPosition(double x, double y, double z)Set position of light.- Specified by:
setPositionin interfacePvLightIf- 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:
getInterestin interfacePvLightIf- 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:
setInterestin interfacePvLightIf- 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:
setInterestin interfacePvLightIf- 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.
-
setColor
public void setColor(java.awt.Color color)
Set color of light.
-
getIntensity
public double getIntensity()
Get intensity of light.- Specified by:
getIntensityin interfacePvLightIf- Returns:
- intensity of light
-
setIntensity
public void setIntensity(double intensity)
Set intensity of light.- Specified by:
setIntensityin interfacePvLightIf- Parameters:
intensity- new intensity of light
-
getAngle
public double getAngle()
Get angle of spot cone of light.
-
setAngle
public void setAngle(double angle)
Set angle of spot cone of light.
-
getCorona
public double getCorona()
Get angle of corona of spot cone.
-
setCorona
public void setCorona(double corona)
Set angle of corona of spot cone.
-
getFalloff
public double getFalloff()
Get fall off angle of spot cone.- Specified by:
getFalloffin interfacePvLightIf- Returns:
- fall off angle of spot cone
-
setFalloff
public void setFalloff(double falloff)
Set fall off angle of spot cone.- Specified by:
setFalloffin interfacePvLightIf- Parameters:
falloff- fall off angle of spot cone
-
getExponent
public double getExponent()
Get exponent which determines the size of a highlight.- Specified by:
getExponentin interfacePvLightIf- Returns:
- specular exponent
-
setExponent
public void setExponent(double exp)
Set exponent which determines the size of a highlight.- Specified by:
setExponentin interfacePvLightIf- Parameters:
exp- specular exponent
-
isHighlight
public boolean isHighlight()
Determines if light throws a highlight.- Specified by:
isHighlightin interfacePvLightIf- 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:
setHighlightin interfacePvLightIf- Parameters:
bHighlight- flag- Since:
- JavaView 3.90.021
-
-
"