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

Method OpenCurrentFile

IO/Geometry/vtkChacoReader.cxx:787–820  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

785
786//------------------------------------------------------------------------------
787int 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.

Callers 2

RequestInformationMethod · 0.95
BuildOutputGridMethod · 0.95

Calls 2

formatFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected