| 408 | return retVal; |
| 409 | } |
| 410 | vtkUnstructuredGrid* vtkPChacoReader::GetGrid(vtkMultiProcessController* contr, int from) |
| 411 | { |
| 412 | vtkUnstructuredGrid* grid = nullptr; |
| 413 | |
| 414 | vtkIdType bufsize = 0; |
| 415 | int ack = 1; |
| 416 | |
| 417 | contr->Receive(&bufsize, 1, from, 0x11); |
| 418 | |
| 419 | if (bufsize == 0) |
| 420 | { |
| 421 | // Node zero is reporting an error |
| 422 | return nullptr; |
| 423 | } |
| 424 | |
| 425 | char* buf = new char[bufsize]; |
| 426 | |
| 427 | if (buf) |
| 428 | { |
| 429 | contr->Send(&ack, 1, from, 0x12); |
| 430 | contr->Receive(buf, bufsize, from, 0x13); |
| 431 | grid = this->UnMarshallDataSet(buf, bufsize); |
| 432 | delete[] buf; |
| 433 | } |
| 434 | else |
| 435 | { |
| 436 | ack = 0; |
| 437 | contr->Send(&ack, 1, 0, 0x12); |
| 438 | } |
| 439 | return grid; |
| 440 | } |
| 441 | |
| 442 | vtkUnstructuredGrid* vtkPChacoReader::SubGrid(vtkUnstructuredGrid* ug, vtkIdType from, vtkIdType to) |
| 443 | { |
no test coverage detected