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

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

Data Structures

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.
 

Data Fields

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.
 

Static Private Attributes

static constexpr int m_PinIconSize
 Size of the Pin Icons in [px].
 

Detailed Description

Pins in the GUI for information exchange.

Definition at line 42 of file Pin.hpp.

Constructor & Destructor Documentation

◆ Pin() [1/2]

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

Definition at line 272 of file Pin.hpp.

◆ Pin() [2/2]

NAV::Pin::Pin ( )
protecteddefault

Default constructor.

Member Function Documentation

◆ canCreateLink()

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

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

Definition at line 29 of file Pin.cpp.

◆ createLink()

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

Definition at line 143 of file Pin.cpp.

◆ dataIdentifierHaveCommon()

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

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

Definition at line 59 of file Pin.cpp.

◆ deleteLink()

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

Definition at line 206 of file Pin.cpp.

◆ 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

Definition at line 98 of file Pin.cpp.

◆ getIconColor()

ImColor NAV::Pin::getIconColor ( ) const
nodiscard

Get the Icon Color object.

Returns
Color struct

Definition at line 65 of file Pin.cpp.

◆ recreateLink()

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

Definition at line 196 of file Pin.cpp.

Field Documentation

◆ dataIdentifier

std::vector<std::string> NAV::Pin::dataIdentifier

One or multiple Data Identifiers (Unique name which is used for data flows)

Definition at line 305 of file Pin.hpp.

◆ id

ax::NodeEditor::PinId NAV::Pin::id

Unique Id of the Pin.

Definition at line 297 of file Pin.hpp.

◆ kind

Kind NAV::Pin::kind

Kind of the Pin (Input/Output)

Definition at line 303 of file Pin.hpp.

◆ m_PinIconSize

int NAV::Pin::m_PinIconSize
staticconstexprprivate

Size of the Pin Icons in [px].

Definition at line 333 of file Pin.hpp.

◆ name

std::string NAV::Pin::name

Name of the Pin.

Definition at line 299 of file Pin.hpp.

◆ parentNode

Node* NAV::Pin::parentNode

Reference to the parent node.

Definition at line 307 of file Pin.hpp.

◆ type

Type NAV::Pin::type

Type of the Pin.

Definition at line 301 of file Pin.hpp.


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