0.2.0
Loading...
Searching...
No Matches
NAV::Pin Class Reference

Pins in the GUI for information exchange. More...

Classes

struct  Kind
 Kind of the Pin (Input/Output) More...
 
struct  Link
 Link between two pins. More...
 
struct  Type
 Type of the data on the Pin. More...
 

Public Member Functions

void drawPinIcon (bool connected, int alpha) const
 Draw the Pin Icon.
 
ImColor getIconColor () const
 Get the Icon Color object.
 
 Pin (ax::NodeEditor::PinId id, const char *name, Type type, Kind kind, Node *parentNode)
 Constructor.
 

Static Public Member Functions

static bool canCreateLink (const OutputPin &startPin, const InputPin &endPin)
 Checks if pins can connect.
 
static bool dataIdentifierHaveCommon (const std::vector< std::string > &a, const std::vector< std::string > &b)
 Checks if the first list of data identifiers has a common entry with the second.
 

Public Attributes

std::vector< std::string > dataIdentifier
 One or multiple Data Identifiers (Unique name which is used for data flows)
 
ax::NodeEditor::PinId id
 Unique Id of the Pin.
 
Kind kind
 Kind of the Pin (Input/Output)
 
std::string name
 Name of the Pin.
 
NodeparentNode
 Reference to the parent node.
 
Type type
 Type of the Pin.
 

Protected Member Functions

 Pin ()=default
 Default constructor.
 

Static Protected Member Functions

static bool createLink (OutputPin &startPin, InputPin &endPin, ax::NodeEditor::LinkId linkId=0)
 Create a Link between the two given pins.
 
static void deleteLink (OutputPin &startPin, InputPin &endPin)
 Disconnects the link.
 
static bool recreateLink (OutputPin &startPin, InputPin &endPin)
 Destroys and recreates a link from this pin to another.
 

Detailed Description

Pins in the GUI for information exchange.

Constructor & Destructor Documentation

◆ Pin()

NAV::Pin::Pin ( ax::NodeEditor::PinId id,
const char * name,
Type type,
Kind kind,
Node * parentNode )
inline

Constructor.

Parameters
[in]idUnique Id of the Pin
[in]nameName of the Pin
[in]typeType of the Pin
[in]kindKind of the Pin (Input/Output)
[in]parentNodeReference to the parent node

Member Function Documentation

◆ canCreateLink()

static bool NAV::Pin::canCreateLink ( const OutputPin & startPin,
const InputPin & endPin )
static

Checks if pins can connect.

Parameters
[in]startPinThe start pin to create a link to
[in]endPinThe end pin to create a link to
Returns
True if the pins can create a link

◆ createLink()

static bool NAV::Pin::createLink ( OutputPin & startPin,
InputPin & endPin,
ax::NodeEditor::LinkId linkId = 0 )
staticprotected

Create a Link between the two given pins.

Parameters
[in]startPinStart Pin of the link
[in]endPinEnd Pin of the link
[in]linkIdId of the link to create
Returns
True if the link could be created

◆ dataIdentifierHaveCommon()

static bool NAV::Pin::dataIdentifierHaveCommon ( const std::vector< std::string > & a,
const std::vector< std::string > & b )
static

Checks if the first list of data identifiers has a common entry with the second.

Parameters
[in]aFirst list of data identifiers
[in]bSecond list of data identifiers
Returns
True if they have a common entry

◆ deleteLink()

static void NAV::Pin::deleteLink ( OutputPin & startPin,
InputPin & endPin )
staticprotected

Disconnects the link.

Parameters
[in]startPinStart Pin of the link
[in]endPinEnd Pin of the link

◆ drawPinIcon()

void NAV::Pin::drawPinIcon ( bool connected,
int alpha ) const

Draw the Pin Icon.

Parameters
[in]connectedFlag if the pin is connected
[in]alphaAlpha value of the pin

◆ getIconColor()

ImColor NAV::Pin::getIconColor ( ) const

Get the Icon Color object.

Returns
Color struct

◆ recreateLink()

static bool NAV::Pin::recreateLink ( OutputPin & startPin,
InputPin & endPin )
staticprotected

Destroys and recreates a link from this pin to another.

Parameters
[in]startPinStart Pin of the link
[in]endPinEnd Pin of the link
Returns
True if the link could be created

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