Class AbstractViewport3d

  • All Implemented Interfaces:
    IViewport3d

    public abstract class AbstractViewport3d
    extends java.lang.Object
    implements IViewport3d
    • Field Detail

      • spacecontroller

        protected ISpaceController spacecontroller
        The Space Controller
      • canvas_

        protected java.awt.Canvas canvas_
        Canvas for graphical output.
      • size_

        protected Vector3Double size_
        Size of the viewport without padding.
      • preserveAR_

        protected boolean preserveAR_
        Flag aspect ratio preservation.
      • areaSize_

        protected IVector3 areaSize_
        Maximum displayable area
      • paddedSize_

        protected Vector2Double paddedSize_
        Real size of the viewport including padding.
      • drawObjects_

        protected java.util.Set<java.lang.Object> drawObjects_
        Known drawable Objects.
      • position_

        protected IVector3 position_
        Virtual Viewport position.
      • pixPosition_

        protected IVector2 pixPosition_
        Pixel-corrected viewport position.
      • perspective

        protected IPerspective perspective
        IPropertyObject holding properties for layers.
      • rendering

        protected volatile boolean rendering
        Flag to indicate that rendering is in progress.
    • Constructor Detail

      • AbstractViewport3d

        public AbstractViewport3d​(IPerspective perspective,
                                  IVector3 areasize,
                                  boolean isGrid,
                                  boolean shader,
                                  java.lang.String camera,
                                  ISpaceController spaceController)
    • Method Detail

      • getCanvas

        public java.awt.Canvas getCanvas()
        Returns the canvas that is used for displaying the objects.
        Specified by:
        getCanvas in interface IViewport3d
      • getSize

        public IVector3 getSize()
        Gets the size of the display area.
        Returns:
        size of the display area, may be padded to preserve aspect ratio
      • getAreaSize

        public IVector3 getAreaSize()
        Gets the maximum displayable size.
        Specified by:
        getAreaSize in interface IViewport3d
        Returns:
        maximum area size.
      • getAreaSize3d

        public IVector3 getAreaSize3d()
        Gets the maximum displayable size.
        Returns:
        maximum area size.
      • setAreaSize

        public void setAreaSize​(IVector3 areaSize)
        Sets the maximum displayable size.
        Specified by:
        setAreaSize in interface IViewport3d
        Parameters:
        areaSize - maximum area size.
      • getPaddedSize

        public IVector2 getPaddedSize()
        Returns the padded size
        Returns:
        padded size
      • getCanvasSize

        public IVector2 getCanvasSize()
        Returns the size of the canvas as a vector.
        Returns:
        size of the canvas in pixel
      • getPosition

        public IVector3 getPosition()
        Gets the position of the viewport.
      • isShowing

        public boolean isShowing()
        Checks if this IViewport is showing on screen.
        Returns:
        true if the IViewport is showing, false otherwise
      • addViewportListener

        public void addViewportListener​(IViewportListener listener)
        Adds a IViewportListener
        Parameters:
        listener - new listener
      • removeViewportListener

        public void removeViewportListener​(IViewportListener listener)
        Removes a IViewportListener
        Parameters:
        listener - the listener
      • isGridSpace

        public void isGridSpace​(boolean isGrid)
        Specified by:
        isGridSpace in interface IViewport3d
      • isShader

        public boolean isShader()
      • setShader

        public void setShader​(boolean shader)
      • getCamera

        public java.lang.String getCamera()
      • setCamera

        public void setCamera​(java.lang.String camera)
      • getSpaceController

        public void getSpaceController​(ISpaceController spacecontroller)