0.4.1
Loading...
Searching...
No Matches
NAV::gui::widgets::DynamicInputPins Struct Reference

Inputs pins which can be added dynamically. More...

Data Structures

struct  ExtraColumn
 Information to create extra columns. More...
 

Public Member Functions

void addPin (Node *node)
 Adds a pin and call the pinAddCallback.
 
 DynamicInputPins (size_t firstDynamicPinIndex, Node *node, std::function< void(Node *)> pinAddCallback, std::function< void(Node *, size_t)> pinDeleteCallback, size_t defaultInputPins=0)
 Constructor.
 
size_t getFirstDynamicPinIdx () const
 Get the First Dynamic Pin Idx.
 
size_t getNumberOfDynamicPins () const
 Get the number Of dynamic pins.
 
void setFirstDynamicPinIdx (size_t firstDynamicPinIndex)
 Set the First Dynamic Pin Idx.
 
bool ShowGuiWidgets (size_t id, std::vector< InputPin > &inputPins, Node *node, const std::vector< ExtraColumn > &extraColumns={})
 Shows the GUI input to select the options.
 

Private Attributes

int _dragAndDropPinIndex
 Index of the Pin currently being dragged.
 
size_t _firstDynamicPinIdx
 First pin index which is dynamic.
 
size_t _nDynamicInputPins
 Number of dynamic input pins.
 
std::function< void(Node *)> _pinAddCallback
 Function to call to add a new pin.
 
std::function< void(Node *, size_t)> _pinDeleteCallback
 Function to call to delete a pin. Argument is the pin index.
 

Friends

void from_json (const json &j, DynamicInputPins &obj, Node *node)
 Converts the provided json object into a node object.
 
void to_json (json &j, const DynamicInputPins &obj)
 Converts the provided object into json.
 

Detailed Description

Inputs pins which can be added dynamically.

Definition at line 28 of file DynamicInputPins.hpp.

Constructor & Destructor Documentation

◆ DynamicInputPins()

NAV::gui::widgets::DynamicInputPins::DynamicInputPins ( size_t firstDynamicPinIndex,
Node * node,
std::function< void(Node *)> pinAddCallback,
std::function< void(Node *, size_t)> pinDeleteCallback,
size_t defaultInputPins = 0 )

Constructor.

Parameters
[in]firstDynamicPinIndexFirst pin index which is dynamic
[in,out]nodePointer to the calling node (needs to be valid only during construction)
[in]pinAddCallbackFunction to call to add a new pin
[in]pinDeleteCallbackFunction to call to delete a pin
[in]defaultInputPinsDefault value for the input pins

Definition at line 25 of file DynamicInputPins.cpp.

Member Function Documentation

◆ addPin()

void NAV::gui::widgets::DynamicInputPins::addPin ( Node * node)

Adds a pin and call the pinAddCallback.

Parameters
[in,out]nodePointer to the calling node

Definition at line 178 of file DynamicInputPins.cpp.

◆ getFirstDynamicPinIdx()

size_t NAV::gui::widgets::DynamicInputPins::getFirstDynamicPinIdx ( ) const
inlinenodiscard

Get the First Dynamic Pin Idx.

Definition at line 71 of file DynamicInputPins.hpp.

◆ getNumberOfDynamicPins()

size_t NAV::gui::widgets::DynamicInputPins::getNumberOfDynamicPins ( ) const
nodiscard

Get the number Of dynamic pins.

Definition at line 173 of file DynamicInputPins.cpp.

◆ setFirstDynamicPinIdx()

void NAV::gui::widgets::DynamicInputPins::setFirstDynamicPinIdx ( size_t firstDynamicPinIndex)
inline

Set the First Dynamic Pin Idx.

Parameters
[in]firstDynamicPinIndexFirst pin index which is dynamic

Definition at line 68 of file DynamicInputPins.hpp.

◆ ShowGuiWidgets()

bool NAV::gui::widgets::DynamicInputPins::ShowGuiWidgets ( size_t id,
std::vector< InputPin > & inputPins,
Node * node,
const std::vector< ExtraColumn > & extraColumns = {} )

Shows the GUI input to select the options.

Parameters
[in]idUnique id for ImGui.
[in,out]inputPinsInput Pins of the node
[in,out]nodePointer to the calling node
[in]extraColumnsExtra columns to display in the table
Returns
True when changes occurred

Definition at line 39 of file DynamicInputPins.cpp.

Friends And Related Symbol Documentation

◆ from_json

void from_json ( const json & j,
DynamicInputPins & obj,
Node * node )
friend

Converts the provided json object into a node object.

Parameters
[in]jJson object with the needed values
[out]objObject to fill from the json
[in,out]nodePointer to the node calling this

Definition at line 190 of file DynamicInputPins.cpp.

◆ to_json

void to_json ( json & j,
const DynamicInputPins & obj )
friend

Converts the provided object into json.

Parameters
[out]jJson object which gets filled with the info
[in]objObject to convert into json

Definition at line 184 of file DynamicInputPins.cpp.

Field Documentation

◆ _dragAndDropPinIndex

int NAV::gui::widgets::DynamicInputPins::_dragAndDropPinIndex
private

Index of the Pin currently being dragged.

Definition at line 75 of file DynamicInputPins.hpp.

◆ _firstDynamicPinIdx

size_t NAV::gui::widgets::DynamicInputPins::_firstDynamicPinIdx
private

First pin index which is dynamic.

Definition at line 77 of file DynamicInputPins.hpp.

◆ _nDynamicInputPins

size_t NAV::gui::widgets::DynamicInputPins::_nDynamicInputPins
private

Number of dynamic input pins.

Definition at line 79 of file DynamicInputPins.hpp.

◆ _pinAddCallback

std::function<void(Node*)> NAV::gui::widgets::DynamicInputPins::_pinAddCallback
private

Function to call to add a new pin.

Definition at line 81 of file DynamicInputPins.hpp.

◆ _pinDeleteCallback

std::function<void(Node*, size_t)> NAV::gui::widgets::DynamicInputPins::_pinDeleteCallback
private

Function to call to delete a pin. Argument is the pin index.

Definition at line 83 of file DynamicInputPins.hpp.


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