CGeometry
- Module
- Miri
- Header
#include "Miri/Framework/CGeometry.h"- Namespace
Miri
Constructors
| Signature | Name | Description |
|---|---|---|
CGeometry() = default | CGeometry | |
CGeometry(const MiriVec2& localPosition, const MiriVec2& localSize, const CMiriR… | CGeometry |
Public functions
| Returns | Name | Description |
|---|---|---|
CGeometry | MakeRoot | Root geometry covering the whole surface |
CGeometry | MakeChild | Child offset within this parent |
CGeometry | MakeChild | Child with an explicit transform instead of an offset |
CGeometry | MakeChildTransformed | A child whose layout rect stays axis-aligned but whose pixels are painted through an extra absolute-space transform. |
CGeometry | WithPaintTransform | The same layout rect painted through one more absolute-space transform — a widget's own render transform, applied where its parent arranges it so its whole subtree inherits it. |
MiriVec2 | GetLocalSize | |
float | GetLocalWidth | |
float | GetLocalHeight | |
MiriVec2 | GetAbsolutePosition | |
MiriVec2 | GetAbsoluteSize | |
MiriRect | GetAbsoluteRect | |
MiriRect | GetPaintAbsoluteRect | |
float | GetScale | |
const CMiriRenderTransform& | GetAccumulatedRenderTransform | |
const MiriMat3& | GetPaintTransform | |
bool | HasPaintTransform | |
MiriVec2 | AbsoluteToLocalSpace | Maps a screen-space point into the widget's own axis-aligned layout space. |
bool | IsUnderLocation |
Function details
CGeometry
CGeometry() = defaultCGeometry
CGeometry(const MiriVec2& localPosition, const MiriVec2& localSize, const CMiriRenderTransform& accumulatedTransform, float scale = 1.0f) : m_localPosition(localPosition), m_localSize(localSize), m_accumulatedTransform(accumulatedTransform), m_scale(scale)MakeRoot
static CGeometry MakeRoot(float width, float height, float scale = 1.0f)Root geometry covering the whole surface
MakeChild
CGeometry MakeChild(const MiriVec2& localOffset, const MiriVec2& localSize) constChild offset within this parent
MakeChild
CGeometry MakeChild(const MiriVec2& localSize, const CMiriRenderTransform& localTransform) constChild with an explicit transform instead of an offset
MakeChildTransformed
CGeometry MakeChildTransformed(const MiriVec2& localOffset, const MiriVec2& localSize, const MiriMat3& absoluteTransform) constA child whose layout rect stays axis-aligned but whose pixels are painted through an extra absolute-space transform. The subtree keeps arranging and painting against the unrotated rect (the renderer's transform stack bends the emitted geometry); the inverse of the accumulated paint transform maps a screen pointer back onto that rect for hit testing.
WithPaintTransform
CGeometry WithPaintTransform(const MiriMat3& absoluteTransform) constThe same layout rect painted through one more absolute-space transform — a widget's own render transform, applied where its parent arranges it so its whole subtree inherits it.
GetLocalSize
MiriVec2 GetLocalSize() constGetLocalWidth
float GetLocalWidth() constGetLocalHeight
float GetLocalHeight() constGetAbsolutePosition
MiriVec2 GetAbsolutePosition() constGetAbsoluteSize
MiriVec2 GetAbsoluteSize() constGetAbsoluteRect
MiriRect GetAbsoluteRect() constGetPaintAbsoluteRect
MiriRect GetPaintAbsoluteRect() constGetScale
float GetScale() constGetAccumulatedRenderTransform
const CMiriRenderTransform& GetAccumulatedRenderTransform() constGetPaintTransform
const MiriMat3& GetPaintTransform() constHasPaintTransform
bool HasPaintTransform() constAbsoluteToLocalSpace
MiriVec2 AbsoluteToLocalSpace(const MiriVec2& absolutePosition) constMaps a screen-space point into the widget's own axis-aligned layout space. Identity outside a rotated/scaled subtree, so the common case is the same rect test it always was.
IsUnderLocation
bool IsUnderLocation(const MiriVec2& absolutePosition) const