Class Display3DFrame

All Implemented Interfaces:
ClipboardOwner, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, AppFrame, Hidable, DrawingFrame3D

public class Display3DFrame extends DrawingFrame3D
See Also:
  • Constructor Details

    • Display3DFrame

      public Display3DFrame(String title)
  • Method Details

    • addInteractionListener

      public void addInteractionListener(InteractionListener listener)
      Adds in interaction listener to the 3D drawing panel. InteractionListeners respond to mouse events.
      Parameters:
      listener - InteractionListener
    • enableInteraction

      public void enableInteraction(boolean enable)
      Enables/Disables interaction with the DrawingPanel3D.
      Parameters:
      enable - boolean
    • setPreferredMinMax

      public void setPreferredMinMax(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
      Set the extrema in the X, Y and Z coordinates at once
      Parameters:
      xmin - double
      xmax - double
      ymin - double
      ymax - double
      zmin - double
      zmax - double
    • getCamera

      public Camera getCamera()
      Provides the Camera object used to project the scene in 3D modes.
      Returns:
      Camera
      See Also:
    • addElement

      public void addElement(Element element)
      Adds an Element to this DrawingPanel3D.
      Parameters:
      element - Element
      See Also:
    • setSquareAspect

      public void setSquareAspect(boolean square)
      Whether the panel should try to keep a square aspect. Default value is true.
      Parameters:
      square - boolean
    • setAllowQuickRedraw

      public void setAllowQuickRedraw(boolean allow)
      Whether the scene can be drawn quickly when it is dragged for a new view point.
      Parameters:
      allow - the desired value
    • setIgnoreRepaint

      public void setIgnoreRepaint(boolean ignoreRepaint)
      Sets whether or not paint messages received from the operating system should be ignored. This does not affect paint events generated in software by the AWT, unless they are an immediate response to an OS-level paint message.
      Overrides:
      setIgnoreRepaint in class Component
    • setDecorationType

      public void setDecorationType(int value)
      Types of decoration displayed. One of the following
      • VisualizationHints.DECORATION_NONE: No decoration
      • VisualizationHints.DECORATION_AXES: Display labelled axes
      • VisualizationHints.DECORATION_CUBE: Display the bounding box
      Parameters:
      value - the desired value
    • setAzimuth

      public void setAzimuth(double theta)
      Sets the angle theta angle in spherical polar coordinates (in radians) to rotate the camera about the z axis before projecting. Default is 0.0.
      Parameters:
      theta - the desired angle
    • setAltitude

      public void setAltitude(double phi)
      Sets the angle phi in spherical polar coordiantes (in radians) to rotate the camera away from the z axis before projecting. Default is 0.0.
      Parameters:
      phi - the desired angle
    • setProjectionMode

      public void setProjectionMode(int mode)
      Sets the projection mode for the camera. Possible values are:
      • Camera.MODE_PERSPECTIVE or Camera.MODE_PERSPECTIVE_ON : 3D mode in which objects far away look smaller.
      • Camera.MODE_NO_PERSPECTIVE or Camera.MODE_PERSPECTIVE_OFF: 3D mode in which distance doesn't affect the size of the objects
      • Camera.MODE_PLANAR_XY: 2D mode in which only the X and Y coordinates are displayed.
      • Camera.MODE_PLANAR_XZ: 2D mode in which only the X and Z coordinates are displayed.
      • Camera.MODE_PLANAR_YZ: 2D mode in which only the Y and Z coordinates are displayed.
      Parameters:
      mode - the desired value