MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::UI::WindowRectAllocator Class Reference

A rect allocator specifically for ImGui windows. More...

#include <MRUIRectAllocator.h>

+ Inheritance diagram for MR::UI::WindowRectAllocator:

Public Member Functions

MRVIEWER_API void setFreeNextWindowPos (const char *expectedWindowName, ImVec2 defaultPos, ImGuiCond cond=ImGuiCond_Appearing, ImVec2 pivot=ImVec2())
 
MRVIEWER_API void invalidateClosedWindows ()
 Call this once at the begining of ImGui frame, to remove all closed windows from entries list.
 
- Public Member Functions inherited from MR::UI::RectAllocator
MRVIEWER_API RectAllocator ()
 
MRVIEWER_API FindFreeRectResult findFreeRect (Box2f preferredRect, Box2f preferredBounds, FindPotentiallyOverlappingRects findOverlaps, ImVec2 axisWeights=ImVec2(1, 1))
 

Additional Inherited Members

- Public Types inherited from MR::UI::RectAllocator
using FindPotentiallyOverlappingRects = std::function<void( Box2f target, std::function<void( const char* name, Box2f box )> overlaps )>
 
- Static Public Member Functions inherited from MR::UI::RectAllocator
static bool rectRectOverlap (Box2f a, Box2f b)
 

Detailed Description

A rect allocator specifically for ImGui windows.

Member Function Documentation

◆ invalidateClosedWindows()

MRVIEWER_API void MR::UI::WindowRectAllocator::invalidateClosedWindows ( )

Call this once at the begining of ImGui frame, to remove all closed windows from entries list.

◆ setFreeNextWindowPos()

MRVIEWER_API void MR::UI::WindowRectAllocator::setFreeNextWindowPos ( const char * expectedWindowName,
ImVec2 defaultPos,
ImGuiCond cond = ImGuiCond_Appearing,
ImVec2 pivot = ImVec2() )

Call this before drawing a window. expectedWindowName must match the window name. The remaining parameters are forwarded to ImGui::SetNextWindowPos(), expect for one time where we find a free rect and use it instead. cond must not be ImGuiCond_Always (aka 0), in that case we just forward the arguments and don't try to find a rect. We automatically avoid all windows with [rect_allocator_ignore] anywhere after ## in the name.


The documentation for this class was generated from the following file: