6#include "MRMesh/MRphmap.h"
29 [[nodiscard]]
explicit operator bool()
const {
return ok; }
42 Box2f preferredBounds,
46 ImVec2 axisWeights = ImVec2( 1, 1 )
53 return a.max.x > b.min.x && a.min.x < b.max.x && a.max.y > b.min.y && a.min.y < b.max.y;
58 phmap::flat_hash_map<Vector2f, float> visitedCoords;
64 std::array<float, 4> overlapWithBounds;
66 std::vector<CoordsToVisit> coordsToVisitHeap;
78 MRVIEWER_API
void setFreeNextWindowPos(
const char* expectedWindowName, ImVec2 defaultPos, ImGuiCond cond = ImGuiCond_Appearing, ImVec2 pivot = ImVec2() );
81 int lastFrameCount_ = -1;
83 enum class AllocationState
92 AllocationState state_{ AllocationState::None };
94 phmap::flat_hash_map<std::string, WindowEntry> windows_;
109 int lastFrameCount_ = -1;
114 bool visitedThisFrame =
true;
117 std::vector<phmap::flat_hash_map<std::string, Entry>> entries_;
Definition MRUIRectAllocator.h:100
MRVIEWER_API ImVec2 createRect(ViewportId viewportId, std::string id, ImVec2 pos, ImVec2 size, bool forceExactPosition=false)
Definition MRUIRectAllocator.h:21
std::function< void(Box2f target, std::function< void(const char *name, Box2f box)> overlaps)> FindPotentiallyOverlappingRects
Definition MRUIRectAllocator.h:34
MRVIEWER_API RectAllocator()
static bool rectRectOverlap(Box2f a, Box2f b)
Definition MRUIRectAllocator.h:51
MRVIEWER_API FindFreeRectResult findFreeRect(Box2f preferredRect, Box2f preferredBounds, FindPotentiallyOverlappingRects findOverlaps, ImVec2 axisWeights=ImVec2(1, 1))
Definition MRUIRectAllocator.h:71
MRVIEWER_API void setFreeNextWindowPos(const char *expectedWindowName, ImVec2 defaultPos, ImGuiCond cond=ImGuiCond_Appearing, ImVec2 pivot=ImVec2())
Definition MRViewportId.h:16
@ None
special value not to limit path in one slice
Definition MRVoxelPath.h:33
Definition MRUINonOverlappingLabels.h:10
MRVIEWER_API WindowRectAllocator & getDefaultWindowRectAllocator()
MRVIEWER_API LabelRectAllocator & getDefaultLabelRectAllocator()
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
Definition MRUIRectAllocator.h:26
bool ok
Definition MRUIRectAllocator.h:28
Box2f rect
Definition MRUIRectAllocator.h:27