vmm3d.core3D
Class View3DWithLightSettings
- java.lang.Object
-
- vmm3d.core.View
-
- vmm3d.core3D.View3D
-
- vmm3d.core3D.View3DWithLightSettings
-
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
- Direct Known Subclasses:
- SurfaceImplicit.ImplicitSurfaceView, View3DLit
public class View3DWithLightSettings extends View3D
A 3D view, with associated light settings. This class is the base class forView3DLit, which adds a varitey of other lighting controls. A View3DWithLightSettings was introduced for use with implicit surfaces, where many of the lighting controls in View3DLit are not appropriate.
-
-
Field Summary
-
Fields inherited from class vmm3d.core3D.View3D
CROSS_EYE_STEREO_VIEW, MONOCULAR_VIEW, RED_GREEN_STEREO_VIEW, STEREOGRAPH_VIEW
-
-
Constructor Summary
Constructors Constructor and Description View3DWithLightSettings()Create the view, with a default LightSettings object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)Overridden to add light settings info.booleangetLightingEnabled()Check whether lighting is currently enabled.LightSettingsgetLightSettings()Retrieve the currentLightSettingsfor this view.ActionListgetSettingsCommands()Adds a checkbox for setting the lighting and dragAsSurface commands to any settings contributed by the superclass.voidreadExtraXML(org.w3c.dom.Element viewInfo)Overridden to read back the light settings info.voidsetLightingEnabled(boolean lightingEnabled)Set whether lighting is currently enabled.voidsetLightSettings(LightSettings lightSettings)Sets the current light settings for this view.voidsetViewStyle(int viewStyle)Overridden in this subclass to swap in the anaglyph or non-anaglph light settings, as appropriate.-
Methods inherited from class vmm3d.core3D.View3D
clip, drawCollaredCurve, drawCollaredCurve, drawCollaredCurve, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawPixel, drawPixelDirect, drawPixels, drawString, drawWireframeSurface, finish, getDefaultMouseTask, getEnableThreeD, getOrthographicProjection, getTransform3D, getViewCommands, getViewPoint, getViewStyle, getViewUp, moveStereographImages, setBackground, setDisplay, setEnableThreeD, setExhibit, setOrthographicProjection, setTransform, setViewPoint, setViewUp, setWindowForUseWhileThreeDDisabled, stateChanged, stereographLeftEyeRect, stereographRightEyeRect, takeExhibit
-
Methods inherited from class vmm3d.core.View
addDecoration, addParameter, beginDrawToOffscreenImage, clearDecorations, drawCurve, drawCurve, drawCurve, drawDot, drawLine, drawLine, drawLineDirect, drawPixel, drawPixel, drawPixels, drawString, drawString, endDrawToOffscreenImage, fillRectDirect, forceRedraw, getActions, getActionsForViewAndExhibit, getAdditionalAnimations, getAdditionalAnimationsForViewAndExhibit, getAntialiased, getApplyGraphics2DTransform, getBackground, getColor, getCurrentGraphics, getDecorations, getDisplay, getExhibit, getFastDrawing, getForeground, getImage, getName, getNeedRecalculate, getNeedRedraw, getParameterByName, getParameters, getPreserveAspect, getRequestedWindow, getSettingsCommandsForViewAndExhibit, getShowAxes, getStatusText, getTitle, getTransform, getViewAndExhibitParameters, getWindow, parameterChanged, removeDecoration, removeParameter, render, setAntialiased, setApplyGraphics2DTransform, setColor, setCurrentGraphics, setFastDrawing, setFastDrawing, setForeground, setName, setNeedRecalculate, setNeedRedraw, setPreserveAspect, setShowAxes, setStrokeSizeMultiplier, setWindow, setWindow
-
-
-
-
Constructor Detail
-
View3DWithLightSettings
public View3DWithLightSettings()
Create the view, with a default LightSettings object.
-
-
Method Detail
-
getLightSettings
public LightSettings getLightSettings()
Retrieve the currentLightSettingsfor this view. The return value can depend on whether the current view style is anaglyph. By default, the same light settings object is used for both; this can only change if eithersetAnaglyphLightSettings(LightSettings)orsetNonAnaglyphLightSettings(LightSettings)is called in a subclass.
-
setLightSettings
public void setLightSettings(LightSettings lightSettings)
Sets the current light settings for this view. Note that calling this method does not automatically force a redraw; it simply replaces the current light settings in the view. IfsetAnaglyphLightSettings(LightSettings)orsetNonAnaglyphLightSettings(LightSettings)has been called, then this only affects the light settings for the current view style; otherwise, the new light settings replaces the light settings that are used for all view styles.- Parameters:
lightSettings- the new light settings; if this is null, the current light settings are not changed.
-
getLightingEnabled
public boolean getLightingEnabled()
Check whether lighting is currently enabled.- See Also:
setLightingEnabled(boolean)
-
setLightingEnabled
public void setLightingEnabled(boolean lightingEnabled)
Set whether lighting is currently enabled. When lighting is enabled, surface colors are computed based on intrinsic color plus illumination. When it is disabled, surface patches are drawn using intrinsic color only (leading to a completely flat appearance). The default value is true.- Parameters:
lightingEnabled-
-
setViewStyle
public void setViewStyle(int viewStyle)
Overridden in this subclass to swap in the anaglyph or non-anaglph light settings, as appropriate. SeesetAnaglyphLightSettings(LightSettings)andsetNonAnaglyphLightSettings(LightSettings).- Overrides:
setViewStylein classView3D- Parameters:
viewStyle- the new view style. This is ignored if it is not one of the four legal options.
-
getSettingsCommands
public ActionList getSettingsCommands()
Adds a checkbox for setting the lighting and dragAsSurface commands to any settings contributed by the superclass.- Overrides:
getSettingsCommandsin classView3D- See Also:
View#getSettingsCommands()
-
addExtraXML
public void addExtraXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element viewElement)Overridden to add light settings info.- Overrides:
addExtraXMLin classView3D- Parameters:
containingDocument- The overall XML document that contains the view Element that is being created. This parameter is necessary because it is needed to create any nested subelements that are to be added to the view element.viewElement- The XML element that is being constructed. This element already exists; the purpose of this method to add any extra information that would be needed to reconstruct this view object from the XML represenation.- See Also:
View.readExtraXML(Element)
-
readExtraXML
public void readExtraXML(org.w3c.dom.Element viewInfo) throws java.io.IOExceptionOverridden to read back the light settings info.- Overrides:
readExtraXMLin classView3D- Parameters:
viewInfo- The <view> element from the XML file that contains the information about this view. Some methods from theSaveAndRestoreclass might be useful for getting the data.- Throws:
java.io.IOException- If an error is found, an exception of type IOException should be thrown. This will abort the whole processing of the XML file.
-
-
DMelt 3.0 © DataMelt by jWork.ORG