tessellationConfigsEqual checks if two tessellation configurations are equal.
(cfg1, cfg2 *storepb.TessellationConfig)
| 916 | |
| 917 | // tessellationConfigsEqual checks if two tessellation configurations are equal. |
| 918 | func tessellationConfigsEqual(cfg1, cfg2 *storepb.TessellationConfig) bool { |
| 919 | if cfg1 == nil && cfg2 == nil { |
| 920 | return true |
| 921 | } |
| 922 | if cfg1 == nil || cfg2 == nil { |
| 923 | return false |
| 924 | } |
| 925 | |
| 926 | if cfg1.Scheme != cfg2.Scheme { |
| 927 | return false |
| 928 | } |
| 929 | |
| 930 | if !boundingBoxesEqual(cfg1.BoundingBox, cfg2.BoundingBox) { |
| 931 | return false |
| 932 | } |
| 933 | |
| 934 | if !gridLevelsEqual(cfg1.GridLevels, cfg2.GridLevels) { |
| 935 | return false |
| 936 | } |
| 937 | |
| 938 | if cfg1.CellsPerObject != cfg2.CellsPerObject { |
| 939 | return false |
| 940 | } |
| 941 | |
| 942 | return true |
| 943 | } |
| 944 | |
| 945 | // boundingBoxesEqual checks if two bounding boxes are equal. |
| 946 | func boundingBoxesEqual(bb1, bb2 *storepb.BoundingBox) bool { |
no test coverage detected