[vtkusers] help?, and bug in vtkHyperStreamline.cxx

Lauren O'Donnell odonnell at ai.mit.edu
Mon Aug 20 10:35:49 EDT 2001


In vtkHyperStreamline.cxx if the user calls SetStartLocation (instead of
the SetStartPosition used in Hyper.tcl) this information is not used by
the class.  I added what seems like the correct code, but I am having
other problems (see below).

In the Execute method, I added a few lines of code (snippet starts at line
460):
  else //VTK_START_FROM_LOCATION
    {
      sPtr = this->Streamers[0].InsertNextHyperPoint();
	
      // --- these few lines are the part I added:	
      // use start location information from user
      sPtr->CellId = this->StartCell;
      sPtr->SubId = this->StartSubId;
      for (i=0; i<3; i++) 
	{
	  sPtr->P[i] = this->StartPCoords[i];
	}
      // --- end of code that I added.

      cell =  input->GetCell(sPtr->CellId);
      cell->EvaluateLocation(sPtr->SubId, sPtr->P, sPtr->X, w);    
    }


The problem that I am currently having is that I am using vtkCellPicker to
pick locations from which to start hyperstreamlines, and either of these
two things happens:

1.  If I use x,y,z coordinates from the picker, the HyperStreamline class
does not find the same cell as the picker, and often finds no cell (-1).

2. If I use a cell id as input to the HyperStreamline class, the x,y,z
coordinates (found using the above patch) do not match those found by the
picker.  They are not even close, and the output streamline does not
appear near the originally picked point.

There must be something I really don't understand here.  Any help is
appreciated. (A few more boring details are at the end.) 
Thanks!

Lauren


Boring details: Here are some cells I picked with the picker, and their
x,y,z coords according to the picker and to the HyperStreamline class:

User-Selected Cell: 40905  0  1 0 0 , (x,y,z): 123.201 93.4667 4.97678
HyperStreamline input cell: 40905 (x,y,z): 12 68 2 

User-Selected Cell: 40131  0  0 0 0 , (x,y,z): 123.002 88.2196 4.05933
HyperStreamline input cell: 40131 x,y,z: 126 61 2 

User-Selected Cell: 40906  0  0 0 0 , (x,y,z): 125.153 94.694 3.78601
HyperStreamline input cell: 40906 x,y,z: 12 68 2 

I also set the Tolerance of the picker to 0.001 but that didn't help.







More information about the vtkusers mailing list