Class ViewJComponentLightBulbs
java.lang.Object
gov.nih.mipav.view.renderer.J3D.surfaceview.ViewJComponentLightBulbs
Holds parent BranchGroup and an array of 8 spheres that represent the lights on the surface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.media.j3d.BranchGroup[]Arrows representing light bulb directions.private javax.media.j3d.BranchGroup[]Parent of each light bulb.private javax.media.j3d.Material[]Material properties for each light bulb.private com.sun.j3d.utils.geometry.Sphere[]Shapes representing light bulbs.private javax.media.j3d.TransformGroup[]Parent transform group.private javax.media.j3d.BranchGroupParent of all the light bulbs.private javax.vecmath.Color3fA black sphere is off. -
Constructor Summary
ConstructorsConstructorDescriptionViewJComponentLightBulbs(int iNumLights, com.sun.j3d.utils.picking.PickCanvas pickCanvas) Create an array of light bulb objects that can be rendered or picked. -
Method Summary
Modifier and TypeMethodDescriptionintgetPickedLight(javax.media.j3d.Shape3D kPickedShape) Determine if a given shape is the sphere for one of the lights.javax.media.j3d.BranchGroupgetRoot()Accessor that returns the root node for the light bulbs.voidsetLightAttributes(int index, GeneralLight kLight) Update the properties of the specified light bulb.private voidsetLightColor(int i, javax.vecmath.Color3f kColor) Set the light color.private voidsetLightDirection(int i, javax.vecmath.Vector3f kDirection) The the light direction.private voidsetLightDirectional(int i, boolean bDirectional) Enable the light direction arrow.private voidsetLightPosition(int i, javax.vecmath.Point3f kPosition) The the light move positions.
-
Field Details
-
m_akLightArrows
private javax.media.j3d.BranchGroup[] m_akLightArrowsArrows representing light bulb directions. -
m_akLightBG
private javax.media.j3d.BranchGroup[] m_akLightBGParent of each light bulb. -
m_akLightMaterials
private javax.media.j3d.Material[] m_akLightMaterialsMaterial properties for each light bulb. -
m_akLightSpheres
private com.sun.j3d.utils.geometry.Sphere[] m_akLightSpheresShapes representing light bulbs. -
m_akLightTransformGroup
private javax.media.j3d.TransformGroup[] m_akLightTransformGroupParent transform group. -
m_kLightRoot
private javax.media.j3d.BranchGroup m_kLightRootParent of all the light bulbs. -
s_kBlack
private javax.vecmath.Color3f s_kBlackA black sphere is off.
-
-
Constructor Details
-
ViewJComponentLightBulbs
public ViewJComponentLightBulbs(int iNumLights, com.sun.j3d.utils.picking.PickCanvas pickCanvas) Create an array of light bulb objects that can be rendered or picked.- Parameters:
iNumLights- int Number of lights to create in the array.pickCanvas- PickCanvas Used for picking a light from the array.
-
-
Method Details
-
getPickedLight
public int getPickedLight(javax.media.j3d.Shape3D kPickedShape) Determine if a given shape is the sphere for one of the lights.- Parameters:
kPickedShape- Shape3D Reference to a picked shape.- Returns:
- int Index of the corresponding light object in the array, or -1 if picked shape does not correspond to any light object.
-
getRoot
public javax.media.j3d.BranchGroup getRoot()Accessor that returns the root node for the light bulbs.- Returns:
- Root node that holds light bulbs.
-
setLightAttributes
Update the properties of the specified light bulb.- Parameters:
index- int Index of the bulb in the array.kLight- GeneralLight Contains properties which describe the light.
-
setLightColor
private void setLightColor(int i, javax.vecmath.Color3f kColor) Set the light color.- Parameters:
i- light indexkColor- light color
-
setLightDirection
private void setLightDirection(int i, javax.vecmath.Vector3f kDirection) The the light direction.- Parameters:
i- light indexkDirection- lighting direction
-
setLightDirectional
private void setLightDirectional(int i, boolean bDirectional) Enable the light direction arrow.- Parameters:
i- light indexbDirectional- show direction arrow or not.
-
setLightPosition
private void setLightPosition(int i, javax.vecmath.Point3f kPosition) The the light move positions.- Parameters:
i- light indexkPosition- position coordinate
-