Container providing special behaviors related to relative alignment of its child. More...

#include <Align.hpp>

Public Member Functions

 Align (Instance *)
 
void status (iv::TableDebugView *view)
 
Alignenabled (bool)
 
AligndontExpand (bool)
 
AlignkeepAspect (bool)
 
AlignresizeScales (bool)
 
AligninnerAnchor (float3)
 
Instanceinstance () const
 
- Public Member Functions inherited from iv::OneChildElem< SlotChild >
 OneChildElem (Instance *inst)
 
 ~OneChildElem ()
 
T * createChild (CArgs const &... cargs)
 
T * createChild_Instance (char const *name, CArgs const &... cargs)
 
void setChild (SlotChild *)
 
void removeChild ()
 
- Public Member Functions inherited from iv::Elem
 Elem (Instance *inst)
 
 ~Elem ()
 
void status (iv::TableDebugView *view)
 
Instanceinstance () const
 
void elem_setParent (Elem *)
 
Elemelem_getParent ()
 
virtual Cameraelem_getRoot ()
 
void first_pass (ElementRenderer *)
 
void second_pass (ElementRenderer *)
 
unsigned first_pass_frame_id ()
 
unsigned second_pass_frame_id ()
 
Elemenabled (bool val)
 
void quiet (bool)
 
bool quiet () const
 
float3 FromLocalSpaceToScreenSpace (float3 local_space)
 
float3 FromScreenSpaceToLocalSpace (float3 screen_space)
 
float2 FromScreenPlaneToLocalPlane (float2 screen_space)
 
void Add_InputNode (InputNode *node)
 
void Remove_InputNode (InputNode *node)
 
- Public Member Functions inherited from iv::InputNode
 InputNode (Instance *inst)
 
 ~InputNode ()
 
Instanceinstance () const
 
void status (iv::TableDebugView *view)
 
void inputEnabled (bool)
 
bool inputEnabled ()
 
void quiet (bool)
 
bool quiet () const
 
void input_deactivate ()
 
void input_treeRefresh ()
 
void input_setParent (InputNode *)
 
InputNodeinput_getParent ()
 
virtual InputRootinput_getRoot ()
 
bool input_trigger_visit (InputRoot *root, Input::DeviceKey key)
 
bool input_visit (InputRoot *root, Input::DeviceKey key, bool &press, bool &real, bool &offspace)
 
- Public Member Functions inherited from iv::SlotChild
 SlotChild (Elem *elem)
 
Instanceinstance () const
 
void status (iv::TableDebugView *view)
 
virtual bool picking_test (int2 input_pos) override
 
virtual bool picking_test_pixel_perfect (float2 local_pos)
 
- Public Member Functions inherited from iv::Pickable
 Pickable (Elem *elem)
 
Elemelem ()
 
const Elemelem () const
 

Public Attributes

ClientMarker cm
 
DirtyAttr< bool > attr_dontExpand
 
DirtyAttr< bool > attr_keepAspect
 
DirtyAttr< bool > attr_resizeScales
 
DirtyAttr< float3attr_innerAnchor
 
- Public Attributes inherited from iv::OneChildElem< SlotChild >
ClientMarker cm
 
- Public Attributes inherited from iv::Elem
ClientMarker cm
 
DirtyAttr< bool > attr_enabled
 
DirtyAttr< float4x4modelTransform
 
DirtyAttr< ShaderScissorscissor
 
- Public Attributes inherited from iv::InputNode
ClientMarker cm
 
- Public Attributes inherited from iv::SlotChild
ClientMarker cm
 
DirtyAttr< float3expectedSize
 
DirtyAttr< float3preferredSize
 
DirtyAttr< float3size
 
- Public Attributes inherited from iv::Pickable
ClientMarker cm
 

Protected Member Functions

virtual void first_pass_impl (ElementRenderer *) override
 
virtual void second_pass_impl (ElementRenderer *) override
 
- Protected Member Functions inherited from iv::OneChildElem< SlotChild >
virtual void elem_eachChild (std::function< void(Elem *) > const &) override
 
virtual void elem_childDisconnect (Elem *) override
 
virtual void input_eachChild (std::function< void(InputNode *) > const &f) override
 
virtual void input_childDisconnect (InputNode *child) override
 
- Protected Member Functions inherited from iv::InputNode
virtual bool input_trigger_process (InputRoot *root, Input::DeviceKey key)
 
virtual void input_process (InputRoot *root, Input::DeviceKey key, bool &press, bool &real, bool &offspace)
 

Additional Inherited Members

- Protected Attributes inherited from iv::OneChildElem< SlotChild >
DirtyAttr< SlotChild * > child
 

Detailed Description

Container providing special behaviors related to relative alignment of its child.

Use of Align::Border is encouraged for simple positioning tasks over Align (not because performance, but because it covers more usual use cases).

Typical core use cases:

  1. Simple alignment - Align::dontExpand is set to true - Child retains its preferred size if possible and is positioned relatively inside according to Align::innerAnchor size.
  2. Keep aspect ratio - Align::keepAspect is set to true - Child can be shrinked or expanded according to size of its parent, but it will always retain its aspect ration by reducing its size along some axes. Align::innerAnchor determines relative positioning along those reduced axes.
  3. Simple alignment and keep aspect ratio - Both Align::dontExpand and Align::keepAspect are set to true - Child does not expand above its preferred size and when it shrinks due to small parent container, it retains its preferred size.
  4. Scale child instead of resizing - Align::resizeScales is set to true - Child always gets its preferred size (on the inside), but is then scaled in order to fit into available space. This can be combined with the above use cases but it can also be used on its own.

Definition at line 22 of file Align.hpp.

Constructor & Destructor Documentation

◆ Align()

iv::Align::Align ( Instance inst)

Definition at line 6 of file Align.cpp.

Member Function Documentation

◆ status()

void iv::Align::status ( iv::TableDebugView view)

Definition at line 18 of file Align.cpp.

◆ enabled()

Align * iv::Align::enabled ( bool  val)

Definition at line 165 of file Align.cpp.

◆ dontExpand()

Align * iv::Align::dontExpand ( bool  val)

Definition at line 171 of file Align.cpp.

◆ keepAspect()

Align * iv::Align::keepAspect ( bool  val)

Definition at line 177 of file Align.cpp.

◆ resizeScales()

Align * iv::Align::resizeScales ( bool  val)

Definition at line 189 of file Align.cpp.

◆ innerAnchor()

Align * iv::Align::innerAnchor ( float3  val)

Definition at line 183 of file Align.cpp.

◆ first_pass_impl()

void iv::Align::first_pass_impl ( ElementRenderer er)
overrideprotectedvirtual

Implements iv::Elem.

Definition at line 33 of file Align.cpp.

◆ second_pass_impl()

void iv::Align::second_pass_impl ( ElementRenderer er)
overrideprotectedvirtual

Reimplemented from iv::Elem.

Definition at line 125 of file Align.cpp.

◆ instance()

Instance * iv::Elem::instance

Definition at line 57 of file Elem.cpp.

Member Data Documentation

◆ cm

ClientMarker iv::Align::cm

Definition at line 25 of file Align.hpp.

◆ attr_dontExpand

DirtyAttr< bool > iv::Align::attr_dontExpand

Definition at line 32 of file Align.hpp.

◆ attr_keepAspect

DirtyAttr< bool > iv::Align::attr_keepAspect

Definition at line 33 of file Align.hpp.

◆ attr_resizeScales

DirtyAttr< bool > iv::Align::attr_resizeScales

Definition at line 34 of file Align.hpp.

◆ attr_innerAnchor

DirtyAttr< float3 > iv::Align::attr_innerAnchor

Definition at line 35 of file Align.hpp.


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