Skip to content

Core::TransformImpl< ETransformType::Quat >

Quaternion class Quaternion represents the matrix, crated from quaternion. More...

#include "Core/Nodes/TransformImpl.h"

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

Public Functions

Name
TransformImpl()
const glm::quat &getNormalizedQuat() const
const glm::quat &getQuat() const<br>returns the quaternion or normalized quaternion when synergies
virtual voidinitDefaults() override<br>Init the (non-zero) second level parameters (from LOD::SetValues) via their initDefaults and update the internal transformation matrix).
virtual boolisValid() const override<br>Is the quaternion normalized?
virtual voidresetMatrixFromDefaults() override<br>Update matrix to match the default "quat" value.
virtual voidsetDefaultValueWithSynergies(const std::string & name, Core::Data && val) override<br>set new quat val, and normalize the default "quat" if synergies enabled!
virtual ValueSetResultsetValue(const glm::mat4 & mat) override<br>Lock non-editable values.
virtual ValueSetResultsetValue(const glm::quat & q) override

Additional inherited members

Public Functions inherited from Core::Transform

Name
Transform(const TransformOperation & transformType)
voidcreateDefaults()<br>Prepare storage for second level parameters (std::map with values)
voiddisableSynergies()
voidenableSynergies()
voidfree()
floatgetActivePart() const
intgetCurrentIndex() const
Ptr< Node >getCurrentSequence()
TransformOperation::ValueMapgetDefaultTypes() const
const Data &getDefaultValue(const std::string & name) const<br>Get the value which the transform can hold (current value stored in the transformation).
DefaultValues &getDefaultValues()
const DefaultValues &getSavedDefaults() const
const glm::mat4 &getSavedValue() const
EValueStategetValueState(glm::ivec2 coords) const
boolhasMenuSynergies() const
boolhasSavedValue() const
boolhasSynergies() const
boolisInSequence() const
boolisLocked() const
voidlock()
voidnotifySequence()
voidnullSequence()
TransformOperation *properties() const
voidreloadValue()<br>Restore saved values if they exist.
voidsaveValue()<br>Save current values of the transformation for future reloading.
template <typename T &gt; <br>ValueSetResultsetDefaultValue(const std::string & name, T && val)<br>Setting of one second level parameter defining the transformation (in LOD::SetValues).
template <typename T &gt; <br>voidsetDefaultValueNoUpdate(const std::string & name, T && val)
voidsetDefaultValues(const DefaultValues & values)
voidsetSavedValue(const glm::mat4 & values)<br>Save the value, read from YAML.
voidsetSequence(Node * s, int index)
voidunlock()

Protected Functions inherited from Core::Transform

Name
boolcanSetValue(const ValueMask & mask, glm::ivec2 coords, float value)
Data &getDefaultValueMut(const std::string & name)

Protected Attributes inherited from Core::Transform

Name
DefaultValuesm_defaultValues
boolm_hasMenuSynergies <br>True for transformations, that support synergies, such as scale, eulerAngleXYZ, ortho, frustum, and quaternion ONLY.
boolm_hasSynergies <br>applicable for: uniform scale, eulerAngleXYZ, ortho, frustum, and quat and quaternion.
boolm_isLocked <br>Edit of the matrix is limited to editable values - defined in Operations.h g_transforms.

Friends inherited from Core::Transform

Name
classGraphManager
classMatrixTracker
classSequence
voidsetActivePart(Ptr< Node > node, float value)

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)
voidspreadSignal()<br>Spread signal to all outputs.
voidspreadSignal(size_t outIndex)<br>Spread signal to the selected output outIndex only.
virtual voidupdateValues(int inputIndex =0)<br>Computes new values of outputs based on inputs.
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
classGraphManager
classPin

Detailed Description

cpp
class Core::TransformImpl< ETransformType::Quat >;
class Core::TransformImpl< ETransformType::Quat >;

Quaternion class Quaternion represents the matrix, crated from quaternion.

The inner matrix is always created from a normalized quaternion, so it should always represent a rotation. The default value (LOD SetValue) is either a normalized quaternion (when set with synergies enabled), or a not-normalized quaternion (when set with synergies disabled). isValid() checks the normality of the default quaternion (and matrix determinant, which should be 1 all the times).

Public Functions Documentation

function TransformImpl

cpp
inline explicit TransformImpl()
inline explicit TransformImpl()

> PF: enableSynergies(); means "normalize" the set > >

quaternion

function getNormalizedQuat

cpp
const glm::quat & getNormalizedQuat() const
const glm::quat & getNormalizedQuat() const

function getQuat

cpp
const glm::quat & getQuat() const
const glm::quat & getQuat() const

returns the quaternion or normalized quaternion when synergies

Return: quaternion

function initDefaults

cpp
virtual void initDefaults() override
virtual void initDefaults() override

Init the (non-zero) second level parameters (from LOD::SetValues) via their initDefaults and update the internal transformation matrix).

Reimplements: Core::Transform::initDefaults

It is overriden in all transforms with their default values. This version is for nodes without the default value (now only the Free node)

function isValid

cpp
virtual bool isValid() const override
virtual bool isValid() const override

Is the quaternion normalized?

Return: true if the default "quat" is of unit length

Reimplements: Core::Transform::isValid

function resetMatrixFromDefaults

cpp
virtual void resetMatrixFromDefaults() override
virtual void resetMatrixFromDefaults() override

Update matrix to match the default "quat" value.

Reimplements: Core::Transform::resetMatrixFromDefaults

function setDefaultValueWithSynergies

cpp
virtual void setDefaultValueWithSynergies(
    const std::string & name,
    Core::Data && val
) override
virtual void setDefaultValueWithSynergies(
    const std::string & name,
    Core::Data && val
) override

set new quat val, and normalize the default "quat" if synergies enabled!

Parameters:

  • name quat
  • val new quat value

Reimplements: Core::Transform::setDefaultValueWithSynergies

todo do it per partes

function setValue

cpp
virtual ValueSetResult setValue(
    const glm::mat4 & mat
) override
virtual ValueSetResult setValue(
    const glm::mat4 & mat
) override

Lock non-editable values.

Reimplements: Core::Transform::setValue

And enable synergies, if exist, i.e., hasSynergies() == true

function setValue

cpp
virtual ValueSetResult setValue(
    const glm::quat & q
) override
virtual ValueSetResult setValue(
    const glm::quat & q
) override

Reimplements: Core::Node::setValue


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