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

A rect allocator for labels. More...

#include <MRUIRectAllocator.h>

+ Inheritance diagram for MR::UI::LabelRectAllocator:

Public Member Functions

MRVIEWER_API ImVec2 createRect (ViewportId viewportId, std::string id, ImVec2 pos, ImVec2 size, bool forceExactPosition=false)
 
- 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 for labels.

Member Function Documentation

◆ createRect()

MRVIEWER_API ImVec2 MR::UI::LabelRectAllocator::createRect ( ViewportId viewportId,
std::string id,
ImVec2 pos,
ImVec2 size,
bool forceExactPosition = false )

Call this every frame to maintain a rectangle. Using the same ID more than once per frame triggers an assertion. Returns the free position closest to pos. Separate label lists are maintained per viewport. If forceExactPosition == true, the input position is returned unchanged, but the rect is still added to the internal list to push away other rects.


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