6#include "MRMesh/MRphmap.h"
28 [[nodiscard]]
explicit operator bool()
const {
return ok; }
41 Box2f preferredBounds,
45 ImVec2 axisWeights = ImVec2( 1, 1 )
52 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;
57 phmap::flat_hash_map<Vector2f, float> visitedCoords;
63 std::array<float, 4> overlapWithBounds;
65 std::vector<CoordsToVisit> coordsToVisitHeap;
77 MRVIEWER_API
void setFreeNextWindowPos(
const char* expectedWindowName, ImVec2 defaultPos, ImGuiCond cond = ImGuiCond_Appearing, ImVec2 pivot = ImVec2() );
80 int lastFrameCount_ = -1;
82 enum class AllocationState
91 AllocationState state_{ AllocationState::None };
93 phmap::flat_hash_map<std::string, WindowEntry> windows_;
108 int lastFrameCount_ = -1;
113 bool visitedThisFrame =
true;
116 std::vector<phmap::flat_hash_map<std::string, Entry>> entries_;
Definition MRUIRectAllocator.h:99
MRVIEWER_API ImVec2 createRect(ViewportId viewportId, std::string id, ImVec2 pos, ImVec2 size, bool forceExactPosition=false)
Definition MRUIRectAllocator.h:20
std::function< void(Box2f target, std::function< void(const char *name, Box2f box)> overlaps)> FindPotentiallyOverlappingRects
Definition MRUIRectAllocator.h:33
MRVIEWER_API RectAllocator()
static bool rectRectOverlap(Box2f a, Box2f b)
Definition MRUIRectAllocator.h:50
MRVIEWER_API FindFreeRectResult findFreeRect(Box2f preferredRect, Box2f preferredBounds, FindPotentiallyOverlappingRects findOverlaps, ImVec2 axisWeights=ImVec2(1, 1))
Definition MRUIRectAllocator.h:70
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:25
bool ok
Definition MRUIRectAllocator.h:27
Box2f rect
Definition MRUIRectAllocator.h:26