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

Method RequestData

IO/GeoJSON/vtkGeoJSONReader.cxx:412–456  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

410
411//------------------------------------------------------------------------------
412int vtkGeoJSONReader::RequestData(vtkInformation* vtkNotUsed(request),
413 vtkInformationVector** vtkNotUsed(request), vtkInformationVector* outputVector)
414{
415 // Get the info object
416 vtkInformation* outInfo = outputVector->GetInformationObject(0);
417
418 // Get the output
419 vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
420
421 // Parse either string input of file, depending on mode
422 Json::Value root;
423 int parseResult = 0;
424 if (this->StringInputMode)
425 {
426 parseResult = this->Internal->CanParseString(this->StringInput, root);
427 }
428 else
429 {
430 parseResult = this->Internal->CanParseFile(this->FileName, root);
431 }
432
433 if (parseResult != VTK_OK)
434 {
435 return VTK_ERROR;
436 }
437
438 // If parsed successfully into Json, then convert it
439 // into appropriate vtkPolyData
440 if (root.isObject())
441 {
442 this->Internal->ParseRoot(
443 root, output, this->OutlinePolygons, this->SerializedPropertiesArrayName);
444
445 // Convert Concave Polygons to convex polygons using triangulation
446 if (output->GetNumberOfPolys() && this->TriangulatePolygons)
447 {
448 vtkNew<vtkTriangleFilter> filter;
449 filter->SetInputData(output);
450 filter->Update();
451
452 output->ShallowCopy(filter->GetOutput());
453 }
454 }
455 return VTK_OK;
456}
457
458//------------------------------------------------------------------------------
459void vtkGeoJSONReader::PrintSelf(ostream& os, vtkIndent indent)

Callers

nothing calls this directly

Calls 11

GetInformationObjectMethod · 0.80
CanParseStringMethod · 0.80
isObjectMethod · 0.80
ParseRootMethod · 0.80
GetNumberOfPolysMethod · 0.80
GetMethod · 0.45
CanParseFileMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45
ShallowCopyMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected