Package snap.gfx3d

Class CubeView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class CubeView extends View
A View subclass to render.
  • Field Details

  • Constructor Details

    • CubeView

      public CubeView()
      Constructor.
  • Method Details

    • getCameraView

      public CameraView getCameraView()
      Returns the CameraView to sync with.
    • setCameraView

      public void setCameraView(CameraView aCameraView)
      Sets the CameraView to sync with.
    • getCamera

      public Camera getCamera()
      Returns the camera as a vector.
    • getScene

      public Scene3D getScene()
      Returns the Scene3D.
    • getYaw

      public double getYaw()
      Returns the rotation about the Y axis in degrees.
    • setYaw

      public void setYaw(double aValue)
      Sets the rotation about the Y axis in degrees.
    • getPitch

      public double getPitch()
      Returns the rotation about the X axis in degrees.
    • setPitch

      public void setPitch(double aValue)
      Sets the rotation about the X axis in degrees.
    • getRoll

      public double getRoll()
      Returns the rotation about the Z axis in degrees.
    • setRoll

      public void setRoll(double aValue)
      Sets the rotation about the Z axis in degrees.
    • addCube

      protected void addCube()
      Adds cube to view.
    • getSideAtViewXY

      public Side3D getSideAtViewXY(double aX, double aY)
      Returns the shape hit by camera ray going through point in view coords.
    • setCameraViewToSideAndPosAnimated

      public void setCameraViewToSideAndPosAnimated(Side3D aSide, Pos aPos)
      Set camera view to given side.
    • paintFront

      protected void paintFront(Painter aPntr)
      Paints camera.
      Overrides:
      paintFront in class View
    • processEvent

      public void processEvent(ViewEvent anEvent)
      Viewer method.
      Overrides:
      processEvent in class View
    • setWidth

      public void setWidth(double aValue)
      Override to forward to camera.
      Overrides:
      setWidth in class View
    • setHeight

      public void setHeight(double aValue)
      Override to forward to camera.
      Overrides:
      setHeight in class View
    • cameraChanged

      protected void cameraChanged(PropChange aPC)
      Called when scene changes.
    • getPropValue

      public Object getPropValue(String aPropName)
      Returns the value for given key.
      Overrides:
      getPropValue in class View
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Sets the value for given key.
      Overrides:
      setPropValue in class View