#include <Elem.hpp>

Public Member Functions

 Elem (Instance *inst)
 
 ~Elem ()
 
void status (iv::TableDebugView *view)
 
Instanceinstance () const
 
void elem_setParent (Elem *)
 
Elemelem_getParent ()
 
virtual Cameraelem_getRoot ()
 
virtual void elem_eachChild (std::function< void(Elem *) > const &)
 
virtual void elem_childDisconnect (Elem *)
 
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 Attributes

ClientMarker cm
 
DirtyAttr< bool > attr_enabled
 
DirtyAttr< float4x4modelTransform
 
DirtyAttr< ShaderScissorscissor
 
- Public Attributes inherited from iv::InputNode
ClientMarker cm
 

Protected Member Functions

virtual void input_childDisconnect (InputNode *) override
 
virtual void input_eachChild (std::function< void(InputNode *) > const &) override
 
virtual void first_pass_impl (ElementRenderer *)=0
 
virtual void second_pass_impl (ElementRenderer *)
 
- 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)
 

Detailed Description

Definition at line 16 of file Elem.hpp.

Constructor & Destructor Documentation

◆ Elem()

iv::Elem::Elem ( Instance inst)

Definition at line 9 of file Elem.cpp.

◆ ~Elem()

iv::Elem::~Elem ( )

Definition at line 28 of file Elem.cpp.

Member Function Documentation

◆ status()

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

Definition at line 62 of file Elem.cpp.

◆ instance()

Instance * iv::Elem::instance ( ) const

Definition at line 57 of file Elem.cpp.

◆ elem_setParent()

void iv::Elem::elem_setParent ( Elem parent)

Definition at line 52 of file Elem.cpp.

◆ elem_getParent()

Elem * iv::Elem::elem_getParent ( )

Definition at line 39 of file Elem.cpp.

◆ elem_getRoot()

Camera * iv::Elem::elem_getRoot ( )
virtual

Reimplemented in iv::Camera.

Definition at line 44 of file Elem.cpp.

◆ elem_eachChild()

virtual void iv::Elem::elem_eachChild ( std::function< void(Elem *) > const &  )
inlinevirtual

◆ elem_childDisconnect()

◆ first_pass()

void iv::Elem::first_pass ( ElementRenderer er)

Refresh synthesized parameters, from bottom to top. Also refresh everything (except childrens inherited parameters) that depends on synthesized or initialization parameters and does not depend on inherited parameters.

For each child:

  • Call child->first_pass().
  • Check changes in own initialization parameters and childs synthesized parameters. If this change would modify own internal state or own synthesized parameters, then modify them. Changes to internal state caused by this change can also be delayed to second pass, in which case we need to queue for that second pass. This is useful if we realy want to avoid double recomputation of internal state that can be changed both by initialization / synthesized parameters and inherited parameters. If this change would modify childrens inherited parameters, then queue self for second pass. No need to queue self for second pass when own inherited parameters changed - inherited parameters are set from parent and parent calls second_pass automatically on child when this happens.

Definition at line 73 of file Elem.cpp.

◆ second_pass()

void iv::Elem::second_pass ( ElementRenderer er)

Refresh inherited parameters and whatever depends on them, from top to bottom.

Remove self from queue for second pass (necessary only if there is a possibility that it added self in that queue in first pass, not necessary when called from parents second_pass). Regenerate internal state and childrens inherited parameters if they depend on changed inherited parameters. Also regenerate internal states that depend on initialization or synthesized parameters and the regeneration was delayed to second pass. If we changed at leas one synthesized parameter in a child, then we need to call second_pass on that child too (this should be called once after all desired changes to that childs inherited parameters were made).

Definition at line 89 of file Elem.cpp.

◆ first_pass_frame_id()

unsigned iv::Elem::first_pass_frame_id ( )

Definition at line 146 of file Elem.cpp.

◆ second_pass_frame_id()

unsigned iv::Elem::second_pass_frame_id ( )

Definition at line 151 of file Elem.cpp.

◆ enabled()

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

Definition at line 140 of file Elem.cpp.

◆ quiet() [1/2]

void iv::Elem::quiet ( bool  val)

This node being disconnected from scene tree will not be reported in ConsistencyChecks log.

Definition at line 156 of file Elem.cpp.

◆ quiet() [2/2]

bool iv::Elem::quiet ( ) const

Definition at line 161 of file Elem.cpp.

◆ FromLocalSpaceToScreenSpace()

float3 iv::Elem::FromLocalSpaceToScreenSpace ( float3  local_space)

Definition at line 104 of file Elem.cpp.

◆ FromScreenSpaceToLocalSpace()

float3 iv::Elem::FromScreenSpaceToLocalSpace ( float3  screen_space)

Definition at line 116 of file Elem.cpp.

◆ FromScreenPlaneToLocalPlane()

float2 iv::Elem::FromScreenPlaneToLocalPlane ( float2  screen_space)

Definition at line 128 of file Elem.cpp.

◆ Add_InputNode()

void iv::Elem::Add_InputNode ( InputNode node)

Definition at line 166 of file Elem.cpp.

◆ Remove_InputNode()

void iv::Elem::Remove_InputNode ( InputNode node)

Definition at line 177 of file Elem.cpp.

◆ input_childDisconnect()

◆ input_eachChild()

void iv::Elem::input_eachChild ( std::function< void(InputNode *) > const &  )
overrideprotectedvirtual

Should consistently give the same nodes and in the same order, if they could react to the same inputs, causing need for priority resolution. When the given children change, InputNode::input_deactivate should be called on all children that were removed from the set and input_treeChanged should be called

Reimplemented from iv::InputNode.

Reimplemented in iv::ProtectedSlot, iv::VectorChildrenElem< ChildT >, iv::VectorChildrenElem< TextSegment >, iv::VectorChildrenElem< SlotChild >, iv::VectorChildrenElem< DividerSlot >, iv::OneChildElem< ChildT >, and iv::OneChildElem< SlotChild >.

Definition at line 193 of file Elem.cpp.

◆ first_pass_impl()

◆ second_pass_impl()

virtual void iv::Elem::second_pass_impl ( ElementRenderer )
inlineprotectedvirtual

Member Data Documentation

◆ cm

ClientMarker iv::Elem::cm

Definition at line 19 of file Elem.hpp.

◆ attr_enabled

DirtyAttr< bool > iv::Elem::attr_enabled

Elements are enabled by default. Disabled Elements do not call first_pass or second_pass and therefore no children of them are processed or drawn. This also sets InputNode::inputEnabled to the same value during first pass.

Definition at line 87 of file Elem.hpp.

◆ modelTransform

DirtyAttr< float4x4 > iv::Elem::modelTransform

Definition at line 90 of file Elem.hpp.

◆ scissor

DirtyAttr< ShaderScissor > iv::Elem::scissor

Definition at line 91 of file Elem.hpp.


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