Mouse events using PickManipulationRendererJ3D (and brushing) problems ...

We're putting together an application where we're creating multiple 2D/3D 
scatterplot views of the same data using all the usual widgets, which works 
fine.  The next hurdle is adding picking so that the user can see a complete 
listing of all data associated with the picked object.  We've following the 
"cookbook" from one of your examples, and on the surface things appear to work. 
 The problem is that after using the right mouse button for picking, which 
works correctly, subsequent mouse events using other buttons are hosed, e.g., 
the left mouse now brings up the 3D cursor, and when released causes a 
doAction() to be fired.  All this of course means that the usual left mouse 
button fuctionality is lost.  

One other thing that we've noticed is that after brushing one of the data 
fields to exclude specific data values, we still see some of the excluded 
points appearing in the display, or at least the values for them returned when 
they are picked by a getValues() call says that they're there...

A snippet of source code is attached below that shows what we're doing.  Again, 
as long as we're just picking with the right mouse, everything works fine, but 
when we start to mingle left/right mouse interactions, we're hosed.

thanks...  dlf


      // set up object picking for J3D plot
      if ( plotType.equalsIgnoreCase ( "scatter3D" ) ) {
        pmrJ3D = new PickManipulationRendererJ3D();
        dr     = plotObj.getDisplayImpl().getDisplayRenderer();
        dr.setPickThreshhold( 0.05f );

        //  add data ref to plot
        try  {
          plotObj.getDisplayImpl().addReferences( pmrJ3D, 
masterSplitPane.getDataRef() );

          CellImpl cellField = new CellImpl() {
            private boolean first = true;
            public void doAction() throws VisADException, RemoteException {
              System.out.println(">>>  got an event");
              if( first ) first = false;
              else {
                int i = pmrJ3D.getCloseIndex();
                System.out.println(">>> object picked: index: " + i );

                FlatField ff = 
(FlatField)masterSplitPane.getDataRef().getData();
                double[] pickedPt = ff.getValues( i );

                JPanel resultsPanel = new JPanel();
                resultsPanel.setLayout( new BoxLayout ( resultsPanel, 
BoxLayout.Y_AXIS ) );
                for( int k=0; k<pickedPt.length; k++ ) {
                  System.out.println(" k: " + k + "   value: " + pickedPt[k]);
                  resultsPanel.add( new JLabel( realType[k].getName() + ":  " + 
String.valueOf(pickedPt[k] )));
                  }

                JOptionPane.showMessageDialog( parent, resultsPanel, "Picked 
Design Point", JOptionPane.PLAIN_MESSAGE, null);
                first = true;
                }
              }
            };
          cellField.addReference( masterSplitPane.getDataRef() );
          }
        catch ( Exception e3 )  {
          e3.printStackTrace ();
          }
      }




>  -----Original Message-----
> From:         Flaggs, Don  
> Sent: Monday, October 25, 2004 6:13 PM
> To:   'visad@xxxxxxxxxxxxxxxx'
> Subject:      Sharing brushing (DISPLAY.SelectRange) across multiple displays
> 
> Hi all,
> 
> I'm putting together an application where I'd like to create multiple 2D/3D 
> scatterplot views of the same data, to include brushing.  Assigning the same 
> data refs to the multiple views works great.  Is there an easy way of 
> effectively doing the same kind of thing with SelectRangeWidget(s) or 
> something else such that "brushing" is automatically reflected in all views?  
> The VisAD documentation for SelectRangeWidget currently says "The 
> DisplayRealType of smap ... should already be added to a Display" which 
> implies that the standard brushing is display-specific.
> 
> thanks in advance...  dlf

  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: