------------------------------------------------------------------------------
| 785 | |
| 786 | //------------------------------------------------------------------------------ |
| 787 | int vtkChacoReader::OpenCurrentFile() |
| 788 | { |
| 789 | int result = 0; |
| 790 | |
| 791 | if (this->CurrentGeometryFP == nullptr) |
| 792 | { |
| 793 | auto coordsFilename = vtk::format("{:s}.coords", this->BaseName); |
| 794 | this->CurrentGeometryFP = vtksys::SystemTools::Fopen(coordsFilename, "r"); |
| 795 | if (this->CurrentGeometryFP == nullptr) |
| 796 | { |
| 797 | vtkErrorMacro(<< "Problem opening " << coordsFilename.c_str()); |
| 798 | this->SetCurrentBaseName(nullptr); |
| 799 | } |
| 800 | else |
| 801 | { |
| 802 | auto graphFilename = vtk::format("{:s}.graph", this->BaseName); |
| 803 | this->CurrentGraphFP = vtksys::SystemTools::Fopen(graphFilename, "r"); |
| 804 | if (this->CurrentGraphFP == nullptr) |
| 805 | { |
| 806 | vtkErrorMacro(<< "Problem opening " << graphFilename.c_str()); |
| 807 | this->SetCurrentBaseName(nullptr); |
| 808 | fclose(this->CurrentGeometryFP); |
| 809 | this->CurrentGeometryFP = nullptr; |
| 810 | } |
| 811 | else |
| 812 | { |
| 813 | this->SetCurrentBaseName(this->GetBaseName()); |
| 814 | result = 1; |
| 815 | } |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | return result; |
| 820 | } |
| 821 | |
| 822 | //------------------------------------------------------------------------------ |
| 823 | // Code to read Chaco files. |
no test coverage detected