Core::GraphManager
You must manage GraphManager lifecycle. More...
#include "Core/Nodes/GraphManager.h"
Public Functions
Name | |
---|---|
CameraPtr | createCamera() |
Ptr< Core::Cycle > | createCycle()<br>Create Cycle. |
Ptr< Model > | createModel() |
template <EOperatorType T> <br>Ptr< Node > | createNode() |
Ptr< Sequence > | createSequence() |
template <ETransformType T> <br>Ptr< Transform > | createTransform() |
void | destroy() |
std::vector< Ptr< Node > > | getAllInputNodes(const Ptr< Node > & node) |
std::vector< Ptr< Node > > | getAllOutputNodes(Ptr< Node > & node) |
const Operation * | getOperation(const Pin * pin) |
std::vector< Ptr< Node > > | getOutputNodes(const Ptr< Node > & node, size_t index) |
Ptr< Node > | getParent(const Ptr< Node > & node, size_t index =0)<br>Returns parent node of given node (the topmost one). |
void | init() |
ENodePlugResult | isPlugCorrect(const Pin & input, const Pin & output)<br>Is used to check before connecting to avoid cycles in the node graph. |
bool | isTrackingEnabled() |
ENodePlugResult | plug(const Ptr< Core::Node > & lhs, const Ptr< Core::Node > & rhs)<br>Plug first output pin of lhs to the first input pin of rhs. |
ENodePlugResult | plug(const Ptr< Node > & fromNode, const Ptr< Node > & toNode, unsigned fromIndex, unsigned toIndex)<br>Connect given node output pin to this operator input pin. |
ENodePlugResult | plugSequenceValueInput(const Ptr< Node > & seq, const Ptr< Node > & node, unsigned nodeOutputIndex =0) |
ENodePlugResult | plugSequenceValueOutput(const Ptr< Node > & seq, const Ptr< Node > & node, unsigned nodeInputIndex =0) |
void | stopTracking() |
void | unplugAll(const Ptr< Node > & node)<br>Unplug all inputs and outputs. |
void | unplugInput(const Ptr< Core::Node > & node, int index)<br>Unplug plugged node from given input pin of this node. |
void | update(double tick) |
std::vector< Ptr< Core::Cycle > > & | getCycles() |
Detailed Description
class Core::GraphManager;
class Core::GraphManager;
You must manage GraphManager lifecycle.
GraphManager::init();
// interaction with GraphManager
GraphManager::destroy();
GraphManager::init();
// interaction with GraphManager
GraphManager::destroy();
Public Functions Documentation
function createCamera
static inline CameraPtr createCamera()
static inline CameraPtr createCamera()
function createCycle
static inline Ptr< Core::Cycle > createCycle()
static inline Ptr< Core::Cycle > createCycle()
Create Cycle.
function createModel
static Ptr< Model > createModel()
static Ptr< Model > createModel()
function createNode
template <EOperatorType T>
static inline Ptr< Node > createNode()
template <EOperatorType T>
static inline Ptr< Node > createNode()
function createSequence
static Ptr< Sequence > createSequence()
static Ptr< Sequence > createSequence()
TodoMH Temporary workaround:
function createTransform
template <ETransformType T>
static inline Ptr< Transform > createTransform()
template <ETransformType T>
static inline Ptr< Transform > createTransform()
function destroy
static void destroy()
static void destroy()
function getAllInputNodes
static std::vector< Ptr< Node > > getAllInputNodes(
const Ptr< Node > & node
)
static std::vector< Ptr< Node > > getAllInputNodes(
const Ptr< Node > & node
)
Return: All nodes connected to given node inputs.
function getAllOutputNodes
static std::vector< Ptr< Node > > getAllOutputNodes(
Ptr< Node > & node
)
static std::vector< Ptr< Node > > getAllOutputNodes(
Ptr< Node > & node
)
Return: All nodes plugged into given node output pins.
function getOperation
static const Operation * getOperation(
const Pin * pin
)
static const Operation * getOperation(
const Pin * pin
)
function getOutputNodes
static std::vector< Ptr< Node > > getOutputNodes(
const Ptr< Node > & node,
size_t index
)
static std::vector< Ptr< Node > > getOutputNodes(
const Ptr< Node > & node,
size_t index
)
Return: All nodes plugged into node input pin on given index.
function getParent
static Ptr< Node > getParent(
const Ptr< Node > & node,
size_t index =0
)
static Ptr< Node > getParent(
const Ptr< Node > & node,
size_t index =0
)
Returns parent node of given node (the topmost one).
Parameters:
- index input pin index.
Todo: Move me to NodeUtils.
For example for a node plugged into a sequence node, the real parent would be the multiplier node, but the sequence node would be returned.
function init
static void init()
static void init()
function isPlugCorrect
static ENodePlugResult isPlugCorrect(
const Pin & input,
const Pin & output
)
static ENodePlugResult isPlugCorrect(
const Pin & input,
const Pin & output
)
Is used to check before connecting to avoid cycles in the node graph.
Parameters:
The function is used in plug() function.
Algorithm described in panel Algoritmus 1 in [Folta, page 30]
function isTrackingEnabled
static bool isTrackingEnabled()
static bool isTrackingEnabled()
function plug
static ENodePlugResult plug(
const Ptr< Core::Node > & lhs,
const Ptr< Core::Node > & rhs
)
static ENodePlugResult plug(
const Ptr< Core::Node > & lhs,
const Ptr< Core::Node > & rhs
)
Plug first output pin of lhs to the first input pin of rhs.
function plug
static ENodePlugResult plug(
const Ptr< Node > & fromNode,
const Ptr< Node > & toNode,
unsigned fromIndex,
unsigned toIndex
)
static ENodePlugResult plug(
const Ptr< Node > & fromNode,
const Ptr< Node > & toNode,
unsigned fromIndex,
unsigned toIndex
)
Connect given node output pin to this operator input pin.
Parameters:
- parentNode Reference to a unique pointer to a parent node to which parentOutputPinIndex this node should be connected to.
- rightNode node which should be connected to right node output.
- parentOutputPinIndex Index of the output pin of the parent node.
- myInputPinIndex Index of input pin of this node.
See: ENodePlugResult.
Return: Result enum is returned from the function.
Usage:
// Create nodes.
auto vec1 = Core::Builder::createOperator<OperationType::Vector3>();
auto vec2 = Core::Builder::createOperator<OperationType::Vector3>();
auto dotNode =
Core::Builder::createOperator<OperationType::Vector3DotVector3>();
// Plug vector nodes output to dot node inputs.
GraphManager::plug(vec1, dotNode, 0, 0);
GraphManager::plug(vec2, dotNode, 1, 0);
// Create nodes.
auto vec1 = Core::Builder::createOperator<OperationType::Vector3>();
auto vec2 = Core::Builder::createOperator<OperationType::Vector3>();
auto dotNode =
Core::Builder::createOperator<OperationType::Vector3DotVector3>();
// Plug vector nodes output to dot node inputs.
GraphManager::plug(vec1, dotNode, 0, 0);
GraphManager::plug(vec2, dotNode, 1, 0);
function plugSequenceValueInput
static ENodePlugResult plugSequenceValueInput(
const Ptr< Node > & seq,
const Ptr< Node > & node,
unsigned nodeOutputIndex =0
)
static ENodePlugResult plugSequenceValueInput(
const Ptr< Node > & seq,
const Ptr< Node > & node,
unsigned nodeOutputIndex =0
)
function plugSequenceValueOutput
static ENodePlugResult plugSequenceValueOutput(
const Ptr< Node > & seq,
const Ptr< Node > & node,
unsigned nodeInputIndex =0
)
static ENodePlugResult plugSequenceValueOutput(
const Ptr< Node > & seq,
const Ptr< Node > & node,
unsigned nodeInputIndex =0
)
function stopTracking
static void stopTracking()
static void stopTracking()
function unplugAll
static void unplugAll(
const Ptr< Node > & node
)
static void unplugAll(
const Ptr< Node > & node
)
Unplug all inputs and outputs.
function unplugInput
static void unplugInput(
const Ptr< Core::Node > & node,
int index
)
static void unplugInput(
const Ptr< Core::Node > & node,
int index
)
Unplug plugged node from given input pin of this node.
Parameters:
- index Index of the input pin
function update
static void update(
double tick
)
static void update(
double tick
)
Parameters:
- tick in seconds.
function getCycles
inline std::vector< Ptr< Core::Cycle > > & getCycles()
inline std::vector< Ptr< Core::Cycle > > & getCycles()
Updated on 2024-11-06 at 20:16:54 +0000