Container that divides its space between children according to their priorities. More...

#include <Divider.hpp>

Public Member Functions

 Divider (Instance *inst)
 
void status (iv::TableDebugView *view)
 
Divideraxis (Axis)
 
DivideraxisOrder (AxisOrder)
 
Instanceinstance () const
 
- Public Member Functions inherited from iv::VectorChildrenElem< DividerSlot >
 VectorChildrenElem (Instance *inst)
 
 ~VectorChildrenElem ()
 
T * createChild (CArgs const &... cargs)
 
T * createChild_Instance (char const *name, CArgs const &... cargs)
 
void pushChild (DividerSlot *)
 
void removeChild (DividerSlot *)
 
- 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< Axisattr_axis
 
DirtyAttr< AxisOrderattr_axisOrder
 
- Public Attributes inherited from iv::VectorChildrenElem< DividerSlot >
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::VectorChildrenElem< DividerSlot >
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::VectorChildrenElem< DividerSlot >
std::vector< DividerSlot * > children
 
bool children_dirty
 

Detailed Description

Container that divides its space between children according to their priorities.

Axis along which the space will be divided must be set. Children with higher priority (lower order) will get required space before children with lower priority (higher order). Each child has two orders - DividerSlot::lowerOrder is used when the slot is smaller than its preferred size and DividerSlot::higherOrder is used to allow child to resize above its preferred size.

Example:

auto divider = this->createChild< iv::Divider >()
->axis( iv::Axis::X )
// green square that will have higher priority before it reaches its preferred size
divider->createChild< iv::DividerSlot >()
->lowerOrder( 0 )
->higherOrder( 2 )
->filename( "/ivorium_graphics/generic/white.png" )
// blue square with lower priority; but once both squares reach their preferred size, they will both resize with the same speed (because their higherOrder is equal)
divider->createChild< iv::DividerSlot >()
->lowerOrder( 1 )
->higherOrder( 2 )
->filename( "/ivorium_graphics/generic/white.png" )

Definition at line 71 of file Divider.hpp.

Constructor & Destructor Documentation

◆ Divider()

iv::Divider::Divider ( Instance inst)

Definition at line 40 of file Divider.cpp.

Member Function Documentation

◆ status()

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

Definition at line 63 of file Divider.cpp.

◆ axis()

Divider * iv::Divider::axis ( Axis  val)

Definition at line 51 of file Divider.cpp.

◆ axisOrder()

Divider * iv::Divider::axisOrder ( AxisOrder  val)

Definition at line 57 of file Divider.cpp.

◆ first_pass_impl()

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

Implements iv::Elem.

Definition at line 74 of file Divider.cpp.

◆ second_pass_impl()

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

Reimplemented from iv::Elem.

Definition at line 238 of file Divider.cpp.

◆ instance()

Instance * iv::Elem::instance

Definition at line 57 of file Elem.cpp.

Member Data Documentation

◆ cm

ClientMarker iv::Divider::cm

Definition at line 75 of file Divider.hpp.

◆ attr_axis

DirtyAttr< Axis > iv::Divider::attr_axis

Definition at line 82 of file Divider.hpp.

◆ attr_axisOrder

DirtyAttr< AxisOrder > iv::Divider::attr_axisOrder

Definition at line 83 of file Divider.hpp.


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