[vtkusers] vtkMergePoints usage

Steve Boyd skboyd at ucalgary.ca
Wed Oct 8 18:05:55 EDT 2003


Hi,

I am trying to locate duplicate points using vtkMergePoints.  I am
successful at finding, for any given point, the closest point using
->FindClosestPoint(p1), but I when I try running ->IsUniquePoint(p1) I
get a runtime error (memory).  Am I using this class incorrectly?

    float p1[3];
    p1[0] = 2.0;
    p1[1] = 1.0;
    p1[2] = 0.5;

    vtkMergePoints *pointLocator = vtkMergePoints::New();
      pointLocator->SetDataSet(ug);	// ug is vtkUnstructuredGrid data
      pointLocator->BuildLocator();

    // this line works fine
    cout << "Closest point is at id " <<
pointLocator->FindClosestPoint(p1) << endl;

    // this line gives a runtime error (regardless if p1 is unique or
not).
    cout << "Is it inserted? " << pointLocator->IsInsertedPoint(p1) <<
endl;

I'm guessing that this isn't a bug, but rather my incorrect usage of the
class.  Can somebody tell me how to use it properly?  

Regards,

Steve

-- 
Steven Boyd

PhD, PEng
Assistant Professor
Department of Mechanical and Manufacturing Engineering
University of Calgary
2500 University Drive, N.W.
Calgary, Alberta, Canada, T2N 1N4

tel. 1.403.220.4173  fax. 1.403.282.8406  skboyd at ucalgary.ca
-------------------------------------------------------------------



More information about the vtkusers mailing list