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

Method UpdateDimensions

IO/NetCDF/vtkMPASReader.cxx:2679–2714  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2677
2678//------------------------------------------------------------------------------
2679void vtkMPASReader::UpdateDimensions(bool force)
2680{
2681 if (!force && this->Internals->dimMetaDataTime < this->Internals->extraDimTime)
2682 {
2683 return;
2684 }
2685
2686 this->Internals->extraDims->Reset();
2687
2688 if (!this->Internals->ncFile)
2689 {
2690 this->Internals->extraDimTime.Modified();
2691 return;
2692 }
2693
2694 std::set<std::string> dimSet;
2695
2696 typedef Internal::DimMetaDataMap::const_iterator Iter;
2697 const Internal::DimMetaDataMap& map = this->Internals->dimMetaDataMap;
2698 for (Iter it = map.begin(), itEnd = map.end(); it != itEnd; ++it)
2699 {
2700 if (this->Internals->isExtraDim(it->first))
2701 {
2702 dimSet.insert(it->first);
2703 }
2704 }
2705
2706 typedef std::set<std::string>::const_iterator SetIter;
2707 this->Internals->extraDims->Allocate(static_cast<vtkIdType>(dimSet.size()));
2708 for (SetIter it = dimSet.begin(), itEnd = dimSet.end(); it != itEnd; ++it)
2709 {
2710 this->Internals->extraDims->InsertNextValue(it->c_str());
2711 }
2712
2713 this->Internals->extraDimTime.Modified();
2714}
2715
2716//------------------------------------------------------------------------------
2717// Return the output.

Callers 7

ReleaseNcDataMethod · 0.95
GetNumberOfDimensionsMethod · 0.95
GetDimensionNameMethod · 0.95
GetAllDimensionsMethod · 0.95
GetDimensionSizeMethod · 0.95

Calls 10

isExtraDimMethod · 0.80
ResetMethod · 0.45
ModifiedMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
AllocateMethod · 0.45
sizeMethod · 0.45
InsertNextValueMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected