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

Method AddOrCreateDataset

IO/HDF/vtkHDFWriterImplementation.cxx:859–893  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

857
858//------------------------------------------------------------------------------
859bool vtkHDFWriter::Implementation::AddOrCreateDataset(
860 hid_t group, const char* name, hid_t type, vtkAbstractArray* dataArray)
861{
862 if (!dataArray)
863 {
864 vtkWarningWithObjectMacro(this->Writer, "Skipping null array " << name);
865 return true;
866 }
867
868 if (!this->Subfiles.empty())
869 {
870 if (this->SubFilesReady)
871 {
872 return this->CreateVirtualDataset(group, name, type, dataArray->GetNumberOfComponents());
873 }
874 return true;
875 }
876
877 if (!H5Lexists(group, name, H5P_DEFAULT))
878 {
879 // Dataset needs to be created
880 return this->CreateDatasetFromDataArray(group, name, type, dataArray) != H5I_INVALID_HID;
881 }
882 else
883 {
884 // Simply append the array to an existing dataset
885 vtkHDF::ScopedH5DHandle dataset = H5Dopen(group, name, H5P_DEFAULT);
886 if (dataset == -1)
887 {
888 vtkErrorWithObjectMacro(this->Writer, "Could not open dataset " << name);
889 return false;
890 }
891 return this->AddArrayToDataset(dataset, dataArray);
892 }
893}
894
895//------------------------------------------------------------------------------
896bool vtkHDFWriter::Implementation::CreateVirtualDataset(

Callers 6

AppendCellTypesMethod · 0.80
AppendOffsetsMethod · 0.80
AppendConnectivityMethod · 0.80
AppendPointsMethod · 0.80
AppendFieldDataArraysMethod · 0.80

Calls 5

CreateVirtualDatasetMethod · 0.95
AddArrayToDatasetMethod · 0.95
emptyMethod · 0.45
GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected