Documentation of 'visad.ProjectionControl' Java class
ProjectionControl
visad

Class ProjectionControl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    ProjectionControlJ2D, ProjectionControlJ3D


    public abstract class ProjectionControl
    extends Control
    ProjectionControl is the VisAD interface for controlling the Projection from 3-D to 2-D.

    See Also:
    Serialized Form
    • Field Detail

      • MATRIX2D_LENGTH

        public static final int MATRIX2D_LENGTH
        Length of a 2D matrix
        See Also:
        Constant Field Values
      • MATRIX2D_MAJOR

        public static final int MATRIX2D_MAJOR
        Major dimension of the 2D matrix
        See Also:
        Constant Field Values
      • MATRIX2D_MINOR

        public static final int MATRIX2D_MINOR
        Minor dimension of the 2D matrix
        See Also:
        Constant Field Values
      • MATRIX3D_LENGTH

        public static final int MATRIX3D_LENGTH
        Length of a 2D matrix
        See Also:
        Constant Field Values
      • MATRIX3D_MAJOR

        public static final int MATRIX3D_MAJOR
        Major dimension of the 3D matrix
        See Also:
        Constant Field Values
      • MATRIX3D_MINOR

        public static final int MATRIX3D_MINOR
        Minor dimension of the 3D matrix
        See Also:
        Constant Field Values
      • SCALE2D

        public static final double SCALE2D
        Default scaling factor for 2D matrix
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProjectionControl

        public ProjectionControl(DisplayImpl d)
                          throws VisADException
        Construct a ProjectionControl for the display in question.
        Parameters:
        d - display to control
        Throws:
        VisADException - d already has a ProjectionControl or some other VisAD Error
    • Method Detail

      • getMatrix

        public double[] getMatrix()
        Returns a copy of the graphics projection matrix. The matrix has 6 elements in the 2-D case and 16 elements in the 3-D case.
        Returns:
        A copy of the graphics projection matrix.
      • setMatrix

        public void setMatrix(double[] m)
                       throws VisADException,
                              java.rmi.RemoteException
        Set the matrix that defines the graphics projection
        Parameters:
        m - array of the matrix values (16 elements in Java3D case, 6 elements in Java2D case)
        Throws:
        VisADException - invalid matrix length
        java.rmi.RemoteException - Java RMI failure.
      • getSaveString

        public java.lang.String getSaveString()
        Get a string that can be used to reconstruct this control later
        Specified by:
        getSaveString in class Control
        Returns:
        String representation of this object that can be used for reconstruction.
      • setSaveString

        public void setSaveString(java.lang.String save)
                           throws VisADException,
                                  java.rmi.RemoteException
        Set the properties of this control using the specified save string
        Specified by:
        setSaveString in class Control
        Parameters:
        save - String to use for setting the properties.
        Throws:
        VisADException - VisAD failure.
        java.rmi.RemoteException - Java RMI failure.
      • setAspect

        public abstract void setAspect(double[] aspect)
                                throws VisADException,
                                       java.rmi.RemoteException
        Set aspect ratio of axes
        Parameters:
        aspect - ratios; 3 elements for Java3D, 2 for Java2D
        Throws:
        VisADException - VisAD failure.
        java.rmi.RemoteException - Java RMI failure.
      • setAspectCartesian

        public void setAspectCartesian(double[] aspect)
                                throws VisADException,
                                       java.rmi.RemoteException
        Set aspect ratio of axes, in ScalarMaps rather than matrix
        Parameters:
        aspect - ratios; 3 elements for Java3D, 2 for Java2D
        Throws:
        VisADException - VisAD failure.
        java.rmi.RemoteException - Java RMI failure.
      • getAspectCartesian

        public double[] getAspectCartesian()
      • saveProjection

        public void saveProjection()
        Saves the current display projection matrix. The projection may later be restored by the method resetProjection().
        See Also:
        resetProjection()
      • getSavedProjectionMatrix

        public double[] getSavedProjectionMatrix()
        Get the matrix that defines the saved graphics projection
        Returns:
        array of the matrix values (16 elements in Java3D case, 6 elements in Java2D case)
      • resetProjection

        public void resetProjection()
                             throws VisADException,
                                    java.rmi.RemoteException
        Restores to projection matrix at time of last saveProjection() call -- if one was made -- or to initial projection otherwise.
        Throws:
        VisADException - VisAD failure.
        java.rmi.RemoteException - Java RMI failure.
        See Also:
        saveProjection()
      • matrix2DTo3D

        public static double[] matrix2DTo3D(double[] matrix)
                                     throws VisADException
        Convert a 2D matrix to a 3D matrix, retaining the scale and aspect of the 2D matrix.
        Parameters:
        matrix - 2D matrix to convert
        Throws:
        VisADException - wrong length for matrix (not MATRIX2D_LENGTH)
      • matrix3DTo2D

        public static double[] matrix3DTo2D(double[] matrix)
                                     throws VisADException
        Convert a 3D matrix to a 2D matrix, retaining the scale and aspect of the 3D matrix.
        Parameters:
        matrix - 3D matrix to convert
        Throws:
        VisADException - wrong length for matrix (not MATRIX3D_LENGTH)
      • matrixDConvert

        public static double[] matrixDConvert(double[] matrix)
                                       throws VisADException
        Convert a 3D matrix to a 2D matrix or vice-versa, retaining the scale and aspect of the original matrix. Helper interface to pass an unknown matrix to matrix3DTo2D or matrix2DTo3D.
        Parameters:
        matrix - matrix to convert
        Throws:
        VisADException - wrong length for matrix (not MATRIX3D_LENGTH)
        See Also:
        matrix3DTo2D(double[]), matrix2DTo3D(double[])
      • clearSwitches

        public void clearSwitches(DataRenderer re)
        clear all 'pairs' in switches that involve re
      • syncControl

        public void syncControl(Control rmt)
                         throws VisADException
        Copy the state of a remote control to this control
        Specified by:
        syncControl in class Control
        Parameters:
        rmt - remote control
        Throws:
        VisADException - rmt is null or not a ProjectionControl or some other VisAD error
      • equals

        public boolean equals(java.lang.Object o)
        Check to see if the object in question is equal to this ProjectionControl. The two are equal if they are both ProjectionControls and their projection matrices are equal.
        Overrides:
        equals in class Control
        Parameters:
        o - object in question.
        Returns:
        true if and only if this instance is equal to o
      • clone

        public java.lang.Object clone()
        Create a clone of this ProjectionControl.
        Overrides:
        clone in class Control
        Returns:
        clone
      • toString

        public java.lang.String toString()
        A string representation of this ProjectionControl.
        Overrides:
        toString in class Control
        Returns:
        human readable string that tells the properties of this control.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.