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

Method IsLevelDescriptorConsistent

Filters/Sources/vtkHyperTreeGridSource.cxx:902–929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900}
901
902bool vtkHyperTreeGridSource::IsLevelDescriptorConsistent(bool isRootLevel, unsigned int nRefined,
903 unsigned int nLeaves, unsigned int nTotal, unsigned int nNextLevel,
904 const std::ostringstream& descriptor)
905{
906 // Check whether cursor is still at rool level
907 if (isRootLevel)
908 {
909 // Verify that total number of root cells is consistent with descriptor
910 if (nRefined + nLeaves != nTotal)
911 {
912 vtkErrorMacro(<< "String " << this->Descriptor << " describes " << nRefined + nLeaves
913 << " root cells != " << nTotal);
914 return false;
915 }
916 } // if (rootLevel)
917 else
918 {
919 // Verify that level descriptor cardinality matches expected value
920 if (descriptor.str().size() != nNextLevel)
921 {
922 vtkErrorMacro(<< "String level descriptor " << descriptor.str() << " has cardinality "
923 << descriptor.str().size() << " which is not expected value of " << nNextLevel);
924 return false;
925 }
926 }
927
928 return true;
929}
930
931//------------------------------------------------------------------------------
932void vtkHyperTreeGridSource::SubdivideFromStringDescriptor(vtkHyperTreeGrid* output,

Callers 1

Calls 2

sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected