MCPcopy Create free account
hub / github.com/Kitware/VTK / operator==

Method operator==

Common/DataModel/vtkOverlappingAMRMetaData.cxx:945–1010  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

943
944//------------------------------------------------------------------------------
945bool vtkOverlappingAMRMetaData::operator==(const vtkOverlappingAMRMetaData& other) const
946{
947 // Compare with superclass
948 if (!this->Superclass::operator==(other))
949 {
950 return false;
951 }
952
953 for (int i = 0; i < 3; i++)
954 {
955 if (this->Origin[i] != other.Origin[i])
956 {
957 return false;
958 }
959 }
960
961 for (std::size_t i = 0; i < this->Boxes.size(); i++)
962 {
963 if (this->Boxes[i] != other.Boxes[i])
964 {
965 return false;
966 }
967 }
968
969 if (this->SourceIndex && other.SourceIndex)
970 {
971 for (vtkIdType i = 0; i < this->SourceIndex->GetNumberOfTuples(); i++)
972 {
973 if (this->SourceIndex->GetValue(i) != other.SourceIndex->GetValue(i))
974 {
975 return false;
976 }
977 }
978 }
979
980 if (this->Spacing->GetNumberOfTuples() != other.Spacing->GetNumberOfTuples())
981 {
982 return false;
983 }
984 for (vtkIdType i = 0; i < this->Spacing->GetNumberOfTuples(); i++)
985 {
986 if (this->Spacing->GetValue(i) != other.Spacing->GetValue(i))
987 {
988 return false;
989 }
990 }
991
992 if (this->BlockBounds.size() != other.BlockBounds.size())
993 {
994 return false;
995 }
996 for (size_t i = 0; i < this->BlockBounds.size(); i++)
997 {
998 for (unsigned int j = 0; j < 6; j++)
999 {
1000 // Bounds computation can have numerical imprecision
1001 if (!vtkMathUtilities::NearlyEqual(
1002 this->BlockBounds[i].GetBound(j), other.BlockBounds[i].GetBound(j), 1e-5))

Callers

nothing calls this directly

Calls 5

NearlyEqualFunction · 0.85
GetBoundMethod · 0.80
sizeMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected