Class SimpleParallel

  • All Implemented Interfaces:
    Projection, ProjectionParallel, VisualizationItem

    public class SimpleParallel
    extends java.lang.Object
    implements ProjectionParallel
    Simple parallel projection Scaled space: reordered, scaled and inverted. Lower dimensionality! [0:1] Render space: not used here; no recentering needed.
    Since:
    0.5.0
    Author:
    Robert Rödler, Erich Schubert
    • Field Detail

      • visDims

        int visDims
        Number of visible dimensions
      • flags

        byte[] flags
        Flags for the dimensions
      • dimOrder

        int[] dimOrder
        Ordering of dimensions
      • FLAG_INVERTED

        static final byte FLAG_INVERTED
        Flag for inverted dimensions TODO: handle inversions via scales?
        See Also:
        Constant Field Values
    • Constructor Detail

      • SimpleParallel

        public SimpleParallel​(Projector p,
                              LinearScale[] scales)
        Constructor.
        Parameters:
        p - Projector
        scales - Scales to use
    • Method Detail

      • getScale

        public LinearScale getScale​(int dim)
        Description copied from interface: Projection
        Get the scale class for a particular dimension.
        Specified by:
        getScale in interface Projection
        Parameters:
        dim - Dimension
        Returns:
        Scale class
      • isAxisInverted

        public boolean isAxisInverted​(int axis)
        Description copied from interface: ProjectionParallel
        Get inversion flag of axis.
        Specified by:
        isAxisInverted in interface ProjectionParallel
        Parameters:
        axis - Axis (reordered) position
        Returns:
        Inversion flag
      • setAxisInverted

        public void setAxisInverted​(int axis,
                                    boolean bool)
        Description copied from interface: ProjectionParallel
        Set inversion flag of axis.
        Specified by:
        setAxisInverted in interface ProjectionParallel
        Parameters:
        axis - Axis (reordered) position
        bool - Value of inversion flag
      • isDimInverted

        public boolean isDimInverted​(int truedim)
        Description copied from interface: ProjectionParallel
        Get inversion flag of dimension.
        Specified by:
        isDimInverted in interface ProjectionParallel
        Parameters:
        truedim - Dimension in original numbering
        Returns:
        Inversion flag
      • setDimInverted

        public void setDimInverted​(int truedim,
                                   boolean bool)
        Description copied from interface: ProjectionParallel
        Set inversion flag of a dimension.
        Specified by:
        setDimInverted in interface ProjectionParallel
        Parameters:
        truedim - Dimension in original numbering
        bool - Value of inversion flag
      • toggleDimInverted

        public void toggleDimInverted​(int truedim)
        Description copied from interface: ProjectionParallel
        Toggle inverted flag of dimension.
        Specified by:
        toggleDimInverted in interface ProjectionParallel
        Parameters:
        truedim - Dimension in original numbering
      • isDimHidden

        protected boolean isDimHidden​(int truedim)
      • isAxisVisible

        public boolean isAxisVisible​(int dim)
        Description copied from interface: ProjectionParallel
        Test whether the current axis is visible
        Specified by:
        isAxisVisible in interface ProjectionParallel
        Parameters:
        dim - Axis (reordered) position
        Returns:
        Visibility of axis
      • setAxisVisible

        public void setAxisVisible​(int dim,
                                   boolean vis)
        Description copied from interface: ProjectionParallel
        Set the visibility of the axis.
        Specified by:
        setAxisVisible in interface ProjectionParallel
        Parameters:
        dim - Axis number
        vis - Visibility status
      • getDimForAxis

        public int getDimForAxis​(int pos)
        Description copied from interface: ProjectionParallel
        Get the dimension for the given axis number
        Specified by:
        getDimForAxis in interface ProjectionParallel
        Parameters:
        pos - Axis number
        Returns:
        Dimension
      • getDimForVisibleAxis

        public int getDimForVisibleAxis​(int pos)
        Description copied from interface: ProjectionParallel
        Get the dimension for the given visible axis
        Specified by:
        getDimForVisibleAxis in interface ProjectionParallel
        Parameters:
        pos - Axis number (visible axes only)
        Returns:
        Dimension
      • swapAxes

        public void swapAxes​(int a,
                             int b)
        Description copied from interface: ProjectionParallel
        Exchange axes A and B
        Specified by:
        swapAxes in interface ProjectionParallel
        Parameters:
        a - First axis
        b - Second axis
      • moveAxis

        public void moveAxis​(int src,
                             int dest)
        Description copied from interface: ProjectionParallel
        shift a dimension to another position
        Specified by:
        moveAxis in interface ProjectionParallel
        Parameters:
        src - axis to shift
        dest - new position
      • fastProjectDataToRenderSpace

        public double[] fastProjectDataToRenderSpace​(double[] data)
        Description copied from interface: ProjectionParallel
        Fast project a vector from data to render space
        Specified by:
        fastProjectDataToRenderSpace in interface ProjectionParallel
        Parameters:
        data - Input vector
        Returns:
        Vector with reordering, inversions and scales applied.
      • fastProjectRenderToDataSpace

        public double fastProjectRenderToDataSpace​(double v,
                                                   int projdim)
        Description copied from interface: ProjectionParallel
        Project a display value back to the original data space
        Specified by:
        fastProjectRenderToDataSpace in interface ProjectionParallel
        Parameters:
        v - transformed value
        projdim - Axis to use for scaling and inversion
        Returns:
        Original value
      • fastProjectDataToRenderSpace

        public double fastProjectDataToRenderSpace​(double value,
                                                   int dim)
        Description copied from interface: ProjectionParallel
        Project the value of a single axis to its display value
        Specified by:
        fastProjectDataToRenderSpace in interface ProjectionParallel
        Parameters:
        value - Input value
        dim - Axis to use for scaling and inversion
        Returns:
        Transformed value
      • getAxisForDim

        public int getAxisForDim​(int truedim)
        Description copied from interface: ProjectionParallel
        Find the axis assigned to the given dimension.
        Specified by:
        getAxisForDim in interface ProjectionParallel
        Parameters:
        truedim - Dimension
        Returns:
        Axis number
      • getInputDimensionality

        public int getInputDimensionality()
        Description copied from interface: Projection
        Get the input dimensionality of the projection.
        Specified by:
        getInputDimensionality in interface Projection
        Returns:
        Input dimensionality
      • getMenuName

        public java.lang.String getMenuName()
        Description copied from interface: VisualizationItem
        Name to display in the menu. May be null or empty string.
        Specified by:
        getMenuName in interface VisualizationItem
        Returns:
        Menu name.
      • getProjector

        public Projector getProjector()
        Description copied from interface: Projection
        Projector used for generating this projection.
        Specified by:
        getProjector in interface Projection
        Returns:
        Projector