Documentation of 'visad.bom.GridEdit' Java class
GridEdit
visad.bom

Class GridEdit

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener


    public class GridEdit
    extends java.lang.Object
    implements java.awt.event.ActionListener
    GridEdit is the VisAD class for warping and modifying fields.

    Construct a GridEdit object linked to a 2-D grid [a FlatField with MathType ((x, y) -> range)]) or a sequence of 2-D grids [a FieldImpl with MathType (t -> ((x, y) -> range))], and a DisplayImpl. The grid or grids must all have the same domain Set, which must be a Gridded2DSet or a GriddedSet with domain dimension = 2. The domain must be mapped to two spatial DisplayRealTypes. If a sequence of grids, the sequence domain must be mapped to Animation. The grid may have any number of range RealTypes. The GridEdit object operates in a sequence: 1. Invokes its start() method to start. 2. User drags grid warp motion lines with the right mouse button. These lines must lie inside the grid. 3. If user presses SHIFT while dragging a grid warp motion line, the program prompts for increments for values at the dragged location. 4. User can delete lines by clicking the right button on their end points, with CTRL pressed. 5. At any point after start(), the application can invoke stop() to stop the dragging process, and warp the grid. 6. After the grid has been warped, the application can invoke undo() to undo the paste and stop the process. 7. The process can be restarted by invoking start(), any number of times. The main() method illustrates a simple GUI and test case with a sequnece of grids. Run 'java visad.bom.GridEdit' to test with contour values, and run 'java visad.bom.GridEdit 1' to test with color values.

    • Constructor Summary

      Constructors 
      Constructor and Description
      GridEdit(Field gs, DisplayImplJ3D d)
      gs has MathType (t -> ((x, y) -> v)) or ((x, y) -> v) conditions on gs and display: 1.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void actionPerformed(java.awt.event.ActionEvent e) 
      static void main(java.lang.String[] args) 
      void start()
      enable user to draw move vectors with optional deltas
      void stop()
      warp grid according to move vectors drawn by user also interpolate user defined delta values at move points
      void undo()
      undo action of last call to stop()
      static FlatField warpGrid(FlatField ff, float[][][] set_samples, float[][] deltas)
      warpGrid is the workhorse of GridEdit and can be used independently of any instances of the class
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GridEdit

        public GridEdit(Field gs,
                        DisplayImplJ3D d)
                 throws VisADException,
                        java.rmi.RemoteException
             gs has MathType (t -> ((x, y) -> v)) or ((x, y) -> v)
             conditions on gs and display:
             1. x and y mapped to XAxis, YAxis, ZAxis
             2. (x, y) domain GriddedSet
             3. if (t -> ...), then t is mapped to Animation
        
        Throws:
        VisADException
        java.rmi.RemoteException
    • Method Detail

      • start

        public void start()
                   throws VisADException,
                          java.rmi.RemoteException
        enable user to draw move vectors with optional deltas
        Throws:
        VisADException
        java.rmi.RemoteException
      • stop

        public void stop()
                  throws VisADException,
                         java.rmi.RemoteException
        warp grid according to move vectors drawn by user also interpolate user defined delta values at move points
        Throws:
        VisADException
        java.rmi.RemoteException
      • warpGrid

        public static FlatField warpGrid(FlatField ff,
                                         float[][][] set_samples,
                                         float[][] deltas)
                                  throws VisADException,
                                         java.rmi.RemoteException
        warpGrid is the workhorse of GridEdit and can be used independently of any instances of the class
        Parameters:
        ff - A FlatField containing the 2-D grid to be warped.
        set_samples - The move vectors, dimensioned [number_of_moves][2][2] where the second index enumerates x and y and the third index enumerates the "from" and "to" ends of the move. These values are x and y data values
        deltas - Increments for moved values, to be interpolated over the grid, dimensioned [number_of_grid_range_values][number_of_moves]. May be null.
        Returns:
        Warped grid, with motion vectors and deltas applied.
        Throws:
        VisADException - bad parameters
        java.rmi.RemoteException
      • undo

        public void undo()
                  throws VisADException,
                         java.rmi.RemoteException
        undo action of last call to stop()
        Throws:
        VisADException
        java.rmi.RemoteException
      • main

        public static void main(java.lang.String[] args)
                         throws VisADException,
                                java.rmi.RemoteException
        Throws:
        VisADException
        java.rmi.RemoteException
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent e)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.