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

Method RequestData

IO/SQL/vtkSQLDatabaseGraphSource.cxx:241–387  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

239
240//------------------------------------------------------------------------------
241int vtkSQLDatabaseGraphSource::RequestData(
242 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
243{
244 if (this->Implementation->URL.empty())
245 return 1;
246
247 if (this->Implementation->EdgeQueryString.empty())
248 return 1;
249
250 // Set Progress Text
251 this->SetProgressText("DatabaseGraphSource");
252
253 // I've started so 1% progress :)
254 this->UpdateProgress(.01);
255
256 // Setup the database if it doesn't already exist ...
257 if (!this->Implementation->Database)
258 {
259 this->Implementation->Database = vtkSQLDatabase::CreateFromURL(this->Implementation->URL);
260 if (!this->Implementation->Database)
261 {
262 vtkErrorMacro(<< "Error creating database using URL: " << this->Implementation->URL);
263 return 0;
264 }
265
266 if (!this->Implementation->Database->Open(this->Implementation->Password))
267 {
268 this->Implementation->Database->Delete();
269 this->Implementation->Database = 0;
270
271 vtkErrorMacro(<< "Error opening database: " << this->Implementation->URL);
272 return 0;
273 }
274 }
275
276 // I have a database: 5% progress
277 this->UpdateProgress(.05);
278
279 // Setup the edge query if it doesn't already exist ...
280 if (!this->Implementation->EdgeQuery)
281 {
282 this->Implementation->EdgeQuery = this->Implementation->Database->GetQueryInstance();
283 if (!this->Implementation->EdgeQuery)
284 {
285 vtkErrorMacro(<< "Internal error creating edge query instance.");
286 return 0;
287 }
288 }
289
290 this->Implementation->EdgeQuery->SetQuery(this->Implementation->EdgeQueryString.c_str());
291 if (!this->Implementation->EdgeQuery->Execute())
292 {
293 vtkErrorMacro(<< "Error executing edge query: " << this->Implementation->EdgeQueryString);
294 return 0;
295 }
296
297 // Executed edge query: 30% progress
298 this->UpdateProgress(.3);

Callers

nothing calls this directly

Calls 15

SetProgressTextMethod · 0.80
GetInformationObjectMethod · 0.80
SetPedigreeIdsMethod · 0.80
GetEdgeDataMethod · 0.80
GetAbstractArrayMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
emptyMethod · 0.45
UpdateProgressMethod · 0.45
OpenMethod · 0.45
GetQueryInstanceMethod · 0.45
SetQueryMethod · 0.45

Tested by

no test coverage detected