5#include "MRMesh/MRphmap.h"
27 [[nodiscard]]
explicit operator bool()
const {
return ok; }
40 Box2f preferredBounds,
44 ImVec2 axisWeights = ImVec2( 1, 1 )
51 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;
56 phmap::flat_hash_map<Vector2f, float> visitedCoords;
62 std::array<float, 4> overlapWithBounds;
64 std::vector<CoordsToVisit> coordsToVisitHeap;
76 MRVIEWER_API
void setFreeNextWindowPos(
const char* expectedWindowName, ImVec2 defaultPos, ImGuiCond cond = ImGuiCond_Appearing, ImVec2 pivot = ImVec2() );
81 enum class AllocationState
90 AllocationState state_{ AllocationState::None };
92 phmap::flat_hash_map<std::string, WindowEntry> windows_;
107 int lastFrameCount_ = -1;
112 bool visitedThisFrame =
true;
115 std::vector<phmap::flat_hash_map<std::string, Entry>> entries_;
Definition MRUIRectAllocator.h:98
MRVIEWER_API ImVec2 createRect(ViewportId viewportId, std::string id, ImVec2 pos, ImVec2 size, bool forceExactPosition=false)
Definition MRUIRectAllocator.h:19
std::function< void(Box2f target, std::function< void(const char *name, Box2f box)> overlaps)> FindPotentiallyOverlappingRects
Definition MRUIRectAllocator.h:32
MRVIEWER_API RectAllocator()
static bool rectRectOverlap(Box2f a, Box2f b)
Definition MRUIRectAllocator.h:49
MRVIEWER_API FindFreeRectResult findFreeRect(Box2f preferredRect, Box2f preferredBounds, FindPotentiallyOverlappingRects findOverlaps, ImVec2 axisWeights=ImVec2(1, 1))
Definition MRUIRectAllocator.h:69
MRVIEWER_API void setFreeNextWindowPos(const char *expectedWindowName, ImVec2 defaultPos, ImGuiCond cond=ImGuiCond_Appearing, ImVec2 pivot=ImVec2())
MRVIEWER_API void invalidateClosedWindows()
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:29
Definition MRUIRectAllocator.h:24
bool ok
Definition MRUIRectAllocator.h:26
Box2f rect
Definition MRUIRectAllocator.h:25