|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wilmascope.light.LightManager
public class LightManager
LightManager is the main class to control the light sources.
It maintain 4 vectors:
1 ambLightVector--contains all the ambient lights created.
2 dirLightVector--contains all the directioanl lights created.
3 pointLightVector--contains all the point lights created.
4 spotLightVector--contains all the spot lights created.
Here is an example to create an object of it:
lightManager=new LightManager(bg,bounds,"WILMA_CONSTANTS.properties");
GraphCanvas graphCanvas=graphControl.getGraphCanvas(); graphControl.getGraphCanvas().setPickingEnabled(false); graphControl.getGraphCanvas().getMouseRotate().setEnable(false); graphControl.getGraphCanvas().getMouseTranslate().setEnable(false); graphControl.getGraphCanvas().getMouseZoom().setEnable(false); lightFrame=graphCanvas.getLightManager().getLightFrame(); lightFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { graphControl.getGraphCanvas().setPickingEnabled(true); graphControl.getGraphCanvas().getMouseRotate().setEnable(true); graphControl.getGraphCanvas().getMouseTranslate().setEnable(true); graphControl.getGraphCanvas().getMouseZoom().setEnable(true); } }); lightFrame.setVisible(true);
Constructor Summary | |
---|---|
LightManager(javax.media.j3d.BranchGroup bg,
javax.media.j3d.Bounds bounds,
java.lang.String propertyFileName)
|
Method Summary | |
---|---|
void |
createAmbLight()
creates an ambient light with default values and attach it to the scene graph |
void |
createDirLight()
creates a directional light with default values and attach it to the scene graph |
void |
createPointLight()
creates a point light with default values and attach it to the scene graph |
void |
createSpotLight()
creates a spot light with default values and attach it to the scene graph |
void |
deleteAmbLight(int index)
deletes the ambient light from the scene graph |
void |
deleteDirLight(int index)
deletes the directional light from the scene graph |
void |
deletePointLight(int index)
deletes the point light from the scene graph |
void |
deleteSpotLight(int index)
deletes the spot light from the scene graph |
java.util.Vector |
getAmbLightVector()
|
javax.media.j3d.Bounds |
getBoundingSphere()
|
javax.media.j3d.BranchGroup |
getBranchGroup()
|
java.util.Vector |
getDirLightVector()
|
LightFrame |
getLightFrame()
|
java.util.Vector |
getPointLightVector()
|
java.lang.String |
getPropertyFileName()
|
java.util.Vector |
getSpotLightVector()
|
void |
loadFile(java.lang.String propertyFileName)
loads the light configuration from the specified property file |
void |
saveLight()
Saves the light configuration to the property file |
void |
saveToNewFile(java.lang.String name)
Saves the light configuration to a new file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LightManager(javax.media.j3d.BranchGroup bg, javax.media.j3d.Bounds bounds, java.lang.String propertyFileName)
Method Detail |
---|
public LightFrame getLightFrame()
public void saveLight()
public java.util.Vector getAmbLightVector()
public java.util.Vector getDirLightVector()
public java.util.Vector getPointLightVector()
public java.util.Vector getSpotLightVector()
public javax.media.j3d.BranchGroup getBranchGroup()
public javax.media.j3d.Bounds getBoundingSphere()
public java.lang.String getPropertyFileName()
public void createAmbLight()
public void createDirLight()
public void createPointLight()
public void createSpotLight()
public void deleteAmbLight(int index)
index
- index in the ambient light vector(ambLightVector)public void deleteDirLight(int index)
index
- index in the directional light vector(dirLightVector)public void deletePointLight(int index)
index
- index in the point light vector(pointLightVector)public void deleteSpotLight(int index)
index
- index in the spot light vector(spotLightVector)public void loadFile(java.lang.String propertyFileName)
public void saveToNewFile(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |