Skip to content

Core::Sequence

Sequence of matrices. More...

#include "Core/Nodes/Sequence.h"

Inherits from Core::Node, std::enable_shared_from_this< Node >

Public Functions

Name
Sequence(MatrixTracker * tracker)
~Sequence() override
Ptr< Transform > &getMatRef(size_t idx)<br>Get reference to matrix in a sequence at given position.
const Matrices &getMatrices() const
Ptr< Transform >popMatrix(const int index)<br>Pop matrix from a sequence.
ValueSetResultpushMatrix(Ptr< Transform > matrix)<br>Push matrix to the end of the sequence.
ValueSetResultpushMatrix(Ptr< Transform > matrix, size_t index)<br>Pass matrix to a sequence.
MatrixTracker *startTracking(TrackingDirection direction, std::vector< UPtr< IModelProxy >> modelProxy)
voidstopTracking()
voidswap(int from, int to)
virtual voidupdateValues(int inputIndex) override<br>Computes new values of outputs based on inputs.

Friends

Name
classGraphManager
classStorage

Additional inherited members

Public Functions inherited from Core::Node

Name
virtual voidaddDeleteCallback(std::function< void(Node )> callback)<br> The callback parameters: Node = node that has been deleted
virtual voidaddPlugCallback(std::function< void(Node *, Node *, size_t, size_t)> callback)<br>Registers a callback that gets called when the node's output pins get plugged in.
virtual voidaddUnplugCallback(std::function< void(Node *, Node *, size_t, size_t)> callback)<br>Registers a callback that gets called when the node's input pins get unplugged.
virtual voidaddUpdateCallback(std::function< void(Node *)> callback)<br>Registers a callback that gets called on any updateValues() call.
voidappendChildNode(Ptr< Node > node)
boolareAllInputsPlugged()
boolareAllInputsUnplugged() const
boolareInputsPlugged(int numInputs)
template <typename T &gt; <br>Ptr< T >as()
const Data &data(size_t index =0)
voidfinalize()<br>Prepares node for its destruction, after that the destructor can be called.
const Data &getData(size_t index =0)<br>Get Node contents, read only.
IDgetId() const
Pin &getInput(size_t i)
std::vector< Pin > &getInputPins()
Data &getInternalData(size_t index =0)<br>Get data storage for read and write purposes.
const char *getLabel() const
const Operation *getOperation() const
Pin &getOutput(size_t i)
std::vector< Pin > &getOutputPins()
Ptr< Node >getOwner() const<br>Get direct owner of this node.
Ptr< Node >getPtr()<br>Get reference to this node instance.
Ptr< Node >getRootOwner()<br>Get the topmost owner of this node.
std::stringgetSignature()<br>"{node type} #{node ID}"
EValueStategetState(size_t pinIndex =0)
voidinit()<br>Initialize node id, inputs, and outputs according to the preset node type.
voidnotifyOwner()
virtual voidonInit()
booloperator!=(const Node & other) const
booloperator==(const Node & other) const
ENodePlugResultplug(const Ptr< Node > & childNode, unsigned fromIndex, unsigned toIndex)<br>Connect this (parent) node output to the childNode input.
voidpulse(size_t index)
virtual voidreceiveSignal(int inputIndex)<br>Implements the operator reaction to the change of its inputIndex input.
voidsetOwner(Node * owner)
virtual ValueSetResultsetValue(const glm::mat4 & mat)
virtual ValueSetResultsetValue(const glm::mat4 & mat, const DataMap & map)<br>Smart set function, used with constrained transformation for value checking.
virtual ValueSetResultsetValue(const glm::quat & q)
virtual ValueSetResultsetValue(const glm::vec3 & vec)
virtual ValueSetResultsetValue(const glm::vec4 & vec)
template <typename T &gt; <br>ValueSetResultsetValue(const T & value, unsigned index)
virtual ValueSetResultsetValue(float val)<br>Set the value of the node.
virtual ValueSetResultsetValue(float val, glm::ivec2 coords)
virtual ValueSetResultsetValue(void * ptr)
voidspreadSignal()<br>Spread signal to all outputs.
voidspreadSignal(size_t outIndex)<br>Spread signal to the selected output outIndex only.
const DataMap *getDataMap()
const DataMap &getDataMapRef()

Protected Functions inherited from Core::Node

Name
Node(const Operation * operation)<br>Node is never constructed directory.
virtual~Node()<br>Delete node.
virtual ENodePlugResultisPlugCorrect(const Pin & input, const Pin & output)
virtual voidonUnplugInput(size_t index)
template <typename T &gt; <br>voidsetInternalValue(const T & value, size_t index =0)<br>Sets the node value without validation.
voidsetInternalValue(float value, glm::ivec2 coordinates, size_t index =0)
boolshouldPulse(size_t inputIndex, size_t updatedInputIndex)<br>Tests if the updatedInputIndex should be pulsed.
voidtriggerDeleteCallback(Node * node)
voidtriggerPlugCallback(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
voidtriggerUnplugCallback(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
voidtriggerUpdateCallback(Node * node)

Public Attributes inherited from Core::Node

Name
std::vector< EValueState >m_OperatorState

Protected Attributes inherited from Core::Node

Name
std::vector< Node * >m_children <br>Nested nodes.
std::list< std::function< void(Node *)> >m_deleteCallbacks
IDm_id
std::vector< Pin >m_inputs <br>Inputs of the box: Input tabs with glyphs.
std::vector< Data >m_internalData <br>Results of operations.
ENodePlugResult(*)(const Pin &input, const Pin &output)m_isPlugCorrectFn <br>Used by Camera.
const Operation *m_operation <br>Operator node properties.
std::vector< Pin >m_outputs <br>Outputs of the box: output tabs with glyphs.
Node *m_owner <br>Owner of the node, used in complex type of nodes, such as sequence or camera.
std::list< std::function< void(Node *, Node *, size_t, size_t)> >m_plugCallbacks
std::list< std::function< void(Node *, Node *, size_t, size_t)> >m_unplugCallbacks
std::list< std::function< void(Node *)> >m_updateCallbacks

Friends inherited from Core::Node

Name
classPin

Detailed Description

cpp
class Core::Sequence;
class Core::Sequence;

Sequence of matrices.

+------------------------—+ | <M> 0 mul | | 0 mul <M> 1 mat | | 1 mat <M> 2 model | +------------------------—+

Public Functions Documentation

function Sequence

cpp
Sequence(
    MatrixTracker * tracker
)
Sequence(
    MatrixTracker * tracker
)

function ~Sequence

cpp
~Sequence() override
~Sequence() override

function getMatRef

cpp
inline Ptr< Transform > & getMatRef(
    size_t idx
)
inline Ptr< Transform > & getMatRef(
    size_t idx
)

Get reference to matrix in a sequence at given position.

Parameters:

  • idx Index of matrix.

Return: Reference to matrix holt in m_matrices vector.

Be careful not to access matrix via invalid reference after calling popMatrix.

function getMatrices

cpp
inline const Matrices & getMatrices() const
inline const Matrices & getMatrices() const

function popMatrix

cpp
Ptr< Transform > popMatrix(
    const int index
)
Ptr< Transform > popMatrix(
    const int index
)

Pop matrix from a sequence.

Caller takes ownership of returned matrix.

function pushMatrix

cpp
ValueSetResult pushMatrix(
    Ptr< Transform > matrix
)
ValueSetResult pushMatrix(
    Ptr< Transform > matrix
)

Push matrix to the end of the sequence.

Parameters:

  • matrix

Return:

function pushMatrix

cpp
ValueSetResult pushMatrix(
    Ptr< Transform > matrix,
    size_t index
)
ValueSetResult pushMatrix(
    Ptr< Transform > matrix,
    size_t index
)

Pass matrix to a sequence.

Parameters:

  • matrix Matrix to transfer.
  • index New position of matrix.

Sequence takes ownership of matrix.

function startTracking

cpp
MatrixTracker * startTracking(
    TrackingDirection direction,
    std::vector< UPtr< IModelProxy >> modelProxy
)
MatrixTracker * startTracking(
    TrackingDirection direction,
    std::vector< UPtr< IModelProxy >> modelProxy
)

function stopTracking

cpp
void stopTracking()
void stopTracking()

function swap

cpp
void swap(
    int from,
    int to
)
void swap(
    int from,
    int to
)

function updateValues

cpp
virtual void updateValues(
    int inputIndex
) override
virtual void updateValues(
    int inputIndex
) override

Computes new values of outputs based on inputs.

Parameters:

  • inputIndex Index of the modified input.

Reimplements: Core::Node::updateValues

Encodes the box function by updating the output values for a given inputIndex - fired by receiveSignal().

The base class method calls update callbacks registered with addUpdateCallback(). So derived methods should also call their base method if they want to inform any outside observers.

Friends

friend GraphManager

cpp
friend class GraphManager(
    GraphManager 
);
friend class GraphManager(
    GraphManager 
);

friend Storage

cpp
friend class Storage(
    Storage 
);
friend class Storage(
    Storage 
);

Updated on 2024-03-16 at 19:15:01 +0000