Object: do not include MRBox.h - #6816
Merged
Merged
Conversation
getWorldBox() moves out of line, since its inline `return {}` was the only thing in MRObject.h requiring Box3f to be complete.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MRObject.hno longer includesMRBox.h. The only thing in the header that neededBox3fcomplete was the inlinegetWorldBox()body, so that moves to the .cpp (MRMESH_API virtual, as the override declarations in the holders already are);Box3fin the two remaining declarations is satisfied byMRMeshFwd.h.MRVisualObject.hnow includesMRBox.hitself - it has an inlinecomputeBoundingBox_()returningBox3f()and astd::optional<Box3f>member - which keeps every visual-object descendant supplied.MRObject.cppincludes it forgetWorldTreeBox().Verified with a
cl /Zssweep of MRMesh, MRViewer, MRVoxels and MRSymbolMesh: failing-TU sets identical to the same sweep on master (4 known no-PCH artifacts in MRMesh, 82 in MRViewer, 0 elsewhere). An include-graph pass over the repo - traversing thirdparty and vcpkg headers this time, so std headers reached throughMRBox.h(<algorithm>,<cassert>,<iosfwd>,<limits>,<type_traits>) are accounted for - leaves onlyMRObjectTransformWidget.h, whoseconst Box3f¶meters need no definition.Note this overlaps #6274, which drops
MRBox.halong withMRAffineXf3.h,MRViewportProperty.hand<array>and makes the samegetWorldBox()andMRVisualObject.hchanges; whichever lands second will need a trivial conflict resolution.