MCPcopy Create free account
hub / github.com/Kitware/VTK / RequestData

Method RequestData

Filters/General/vtkIntersectionPolyDataFilter.cxx:2229–2539  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2227
2228//------------------------------------------------------------------------------
2229int vtkIntersectionPolyDataFilter::RequestData(vtkInformation* vtkNotUsed(request),
2230 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
2231{
2232 vtkInformation* inInfo0 = inputVector[0]->GetInformationObject(0);
2233 vtkInformation* inInfo1 = inputVector[1]->GetInformationObject(0);
2234 vtkInformation* outIntersectionInfo = outputVector->GetInformationObject(0);
2235 vtkInformation* outPolyDataInfo0 = outputVector->GetInformationObject(1);
2236 vtkInformation* outPolyDataInfo1 = outputVector->GetInformationObject(2);
2237
2238 vtkPolyData* input0 = vtkPolyData::SafeDownCast(inInfo0->Get(vtkDataObject::DATA_OBJECT()));
2239
2240 vtkPolyData* input1 = vtkPolyData::SafeDownCast(inInfo1->Get(vtkDataObject::DATA_OBJECT()));
2241
2242 if (input0 == nullptr || input1 == nullptr || input0->GetNumberOfPoints() == 0 ||
2243 input1->GetNumberOfPoints() == 0 || input0->GetNumberOfCells() == 0 ||
2244 input1->GetNumberOfCells() == 0)
2245 {
2246 vtkDebugMacro(<< "Empty input data");
2247 return 1;
2248 }
2249
2250 if (this->CheckInput)
2251 {
2252 vtkDebugMacro(<< "Checking Input 0");
2253 this->CleanAndCheckInput(input0, this->Tolerance);
2254 vtkDebugMacro(<< "Checking Input 1");
2255 this->CleanAndCheckInput(input1, this->Tolerance);
2256 }
2257
2258 vtkPolyData* outputIntersection =
2259 vtkPolyData::SafeDownCast(outIntersectionInfo->Get(vtkDataObject::DATA_OBJECT()));
2260 vtkSmartPointer<vtkPoints> outputIntersectionPoints = vtkSmartPointer<vtkPoints>::New();
2261 outputIntersection->SetPoints(outputIntersectionPoints);
2262
2263 vtkPolyData* outputPolyData0 =
2264 vtkPolyData::SafeDownCast(outPolyDataInfo0->Get(vtkDataObject::DATA_OBJECT()));
2265
2266 vtkPolyData* outputPolyData1 =
2267 vtkPolyData::SafeDownCast(outPolyDataInfo1->Get(vtkDataObject::DATA_OBJECT()));
2268
2269 // Set up new poly data for the inputs to build cells and links.
2270 vtkSmartPointer<vtkPolyData> mesh0 = vtkSmartPointer<vtkPolyData>::New();
2271 mesh0->DeepCopy(input0);
2272
2273 vtkSmartPointer<vtkPolyData> mesh1 = vtkSmartPointer<vtkPolyData>::New();
2274 mesh1->DeepCopy(input1);
2275
2276 // Find the triangle-triangle intersections between mesh0 and mesh1
2277 vtkSmartPointer<vtkOBBTree> obbTree0 = vtkSmartPointer<vtkOBBTree>::New();
2278 obbTree0->SetDataSet(mesh0);
2279 obbTree0->SetNumberOfCellsPerNode(10);
2280 obbTree0->SetMaxLevel(1000000);
2281 obbTree0->SetTolerance(this->Tolerance);
2282 obbTree0->AutomaticOn();
2283 obbTree0->BuildLocator();
2284
2285 if (this->CheckAbort())
2286 {

Callers

nothing calls this directly

Calls 15

CleanAndCheckInputMethod · 0.95
GetInformationObjectMethod · 0.80
CheckAbortMethod · 0.80
SetLinesMethod · 0.80
IntersectWithOBBTreeMethod · 0.80
InsertTuple2Method · 0.80
SetActiveScalarsMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
minFunction · 0.50
maxFunction · 0.50
sqrtFunction · 0.50

Tested by

no test coverage detected