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

Method ExtractPoint

IO/GeoJSON/vtkGeoJSONFeature.cxx:101–129  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

99
100//------------------------------------------------------------------------------
101vtkPolyData* vtkGeoJSONFeature::ExtractPoint(
102 const Json::Value& coordinates, vtkPolyData* outputData)
103{
104 // Check if Coordinates corresponds to Single Point
105 if (!IsPoint(coordinates))
106 {
107 vtkErrorMacro(<< "Wrong data format for a point!");
108 return nullptr;
109 }
110
111 // Obtain point data from Json structure and add to outputData
112 double point[3];
113 CreatePoint(coordinates, point);
114
115 const int PID_SIZE = 1;
116 vtkIdType pid;
117
118 vtkPoints* points = outputData->GetPoints();
119 pid = points->InsertNextPoint(point);
120
121 vtkCellArray* verts = outputData->GetVerts();
122 verts->InsertNextCell(PID_SIZE, &pid);
123
124 vtkAbstractArray* array = outputData->GetCellData()->GetAbstractArray("feature-id");
125 vtkStringArray* ids = vtkArrayDownCast<vtkStringArray>(array);
126 ids->InsertNextValue(this->FeatureId);
127
128 return outputData;
129}
130
131//------------------------------------------------------------------------------
132vtkPolyData* vtkGeoJSONFeature::ExtractMultiPoint(

Callers 1

Calls 7

GetVertsMethod · 0.80
GetAbstractArrayMethod · 0.80
GetPointsMethod · 0.45
InsertNextPointMethod · 0.45
InsertNextCellMethod · 0.45
GetCellDataMethod · 0.45
InsertNextValueMethod · 0.45

Tested by

no test coverage detected