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

Method getDimensions

ThirdParty/xdmf3/vtkxdmf3/core/XdmfArray.cpp:666–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664}
665
666std::vector<unsigned int>
667XdmfArray::getDimensions() const
668{
669 if(mDimensions.size() == 0) {
670 if(!this->isInitialized() && mHeavyDataControllers.size() > 0) {
671 std::vector<unsigned int> returnDimensions;
672 std::vector<unsigned int> tempDimensions;
673 // Find the controller with the most dimensions
674 int dimControllerIndex = 0;
675 unsigned int dimSizeMax = 0;
676 unsigned int dimTotal = 0;
677 for (unsigned int i = 0; i < mHeavyDataControllers.size(); ++i) {
678 dimTotal += mHeavyDataControllers[i]->getSize();
679 if (mHeavyDataControllers[i]->getSize() > dimSizeMax) {
680 dimSizeMax = mHeavyDataControllers[i]->getSize();
681 dimControllerIndex = i;
682 }
683 }
684 // Total up the size of the lower dimensions
685 int controllerDimensionSubtotal = 1;
686 for (unsigned int i = 0;
687 i < mHeavyDataControllers[dimControllerIndex]->getDimensions().size() - 1;
688 ++i) {
689 returnDimensions.push_back(mHeavyDataControllers[dimControllerIndex]->getDimensions()[i]);
690 controllerDimensionSubtotal *= mHeavyDataControllers[dimControllerIndex]->getDimensions()[i];
691 }
692 // Divide the total contained by the dimensions by the size of the lower dimensions
693 returnDimensions.push_back(dimTotal/controllerDimensionSubtotal);
694 return returnDimensions;
695 }
696 const unsigned int size = this->getSize();
697 return std::vector<unsigned int>(1, size);
698 }
699 return mDimensions;
700}
701
702std::string
703XdmfArray::getDimensionsString() const

Callers 9

getDimensionsStringMethod · 0.95
insertMethod · 0.95
XdmfArrayMethod · 0.45
readControllerMethod · 0.45
XdmfArrayGetDimensionsFunction · 0.45
XDMF_ERROR_WRAP_STARTFunction · 0.45
writeMethod · 0.45
readMethod · 0.45

Calls 5

isInitializedMethod · 0.95
getSizeMethod · 0.95
getSizeMethod · 0.65
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected