show the mesh and id of the point farthest from the other mesh
This commit is contained in:
parent
f4597b0144
commit
52f26364fd
@ -142,6 +142,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
maxDistanceFilter->Update();
|
||||
std::cerr << "Max distance: " << maxDistanceFilter->GetMaxDist() << "\n"
|
||||
<< "Max dist point id: " << maxDistanceFilter->GetMaxId()
|
||||
<< " in " << (maxDistanceFilter->GetMaxInput() == 0 ? "tetMesh\n" : "polyMesh\n")
|
||||
<< "Average min angle: " << dihedralAnglesFilter->GetAverageMinDegrees() << "\n"
|
||||
<< "Min min angle: " << dihedralAnglesFilter->GetMinMinDegrees() << "\n";
|
||||
|
||||
|
@ -51,7 +51,11 @@ vtkTypeBool MaxDistanceFilter::RequestData(vtkInformation *request,
|
||||
double vec[3];
|
||||
double dist;
|
||||
closestPolyMeshPoint(input2, point, tree2, links2, vec, &dist);
|
||||
MaxDist = std::max(dist, MaxDist);
|
||||
if (dist > MaxDist) {
|
||||
MaxDist = dist;
|
||||
MaxId = i;
|
||||
MaxInput = 0;
|
||||
}
|
||||
}
|
||||
for (vtkIdType i = 0; i < input2->GetNumberOfPoints(); i++) {
|
||||
vtkIdType nCells = links2->GetNcells(i);
|
||||
@ -61,7 +65,11 @@ vtkTypeBool MaxDistanceFilter::RequestData(vtkInformation *request,
|
||||
double vec[3];
|
||||
double dist;
|
||||
closestPolyMeshPoint(input1, point, tree1, links1, vec, &dist);
|
||||
MaxDist = std::max(dist, MaxDist);
|
||||
if (dist > MaxDist) {
|
||||
MaxDist = dist;
|
||||
MaxId = i;
|
||||
MaxInput = 1;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -14,9 +14,13 @@ public:
|
||||
vtkInformationVector **inputVector,
|
||||
vtkInformationVector *outputVector) override;
|
||||
vtkGetMacro(MaxDist, double);
|
||||
vtkGetMacro(MaxId, vtkIdType);
|
||||
vtkGetMacro(MaxInput, vtkIdType);
|
||||
|
||||
protected:
|
||||
double MaxDist;
|
||||
vtkIdType MaxId;
|
||||
vtkIdType MaxInput;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user