GLG Toolkit, C / C++ API Library  Version 4.6
Node Macros

Detailed Description

This group lists macros for accessing data of the GlgGraphNode object.

Macros

#define GlgNodeAnchor(node)
 Gets or sets a node's anchor flag (char). More...
 
#define GlgNodeData(node)
 Returns data associated with the node. More...
 
#define GlgNodeDisplayPosition(node)
 Returns node display position in the GLG world coordinates within the graph's dimensions. More...
 
#define GlgNodeExternal(node)
 Returns the node's external flag. More...
 
#define GlgNodeGraphics(node)
 Returns the graphic object used to render the node. More...
 
#define GlgNodeLinkArray(node)
 Returns an array of edges connected to this node. More...
 
#define GlgNodeNumLinks(node)
 Returns the number of edge links connected to the node. More...
 
#define GlgNodePosition(node)
 Returns node position in the normalized range (0;1). More...
 
#define GlgNodeType(node)
 Returns node type. More...
 

Macro Definition Documentation

◆ GlgNodeAnchor

#define GlgNodeAnchor (   node)

Gets or sets a node's anchor flag (char).

Setting this flag to True anchors the node: the node will be not moving, while the rest of nodes will move around this node to perform the requested layout.

In the Graph Layout demo, anchoring is used to temporarily suspend the movement of the selected node when it is dragged with the mouse.

Parameters
nodeGlgGraphNode instance.

◆ GlgNodeData

#define GlgNodeData (   node)

Returns data associated with the node.

Parameters
nodeGlgGraphNode instance.
Returns
Data attached to the node (void*).

◆ GlgNodeDisplayPosition

#define GlgNodeDisplayPosition (   node)

Returns node display position in the GLG world coordinates within the graph's dimensions.

The default graph dimensions are [-800; +800].

Parameters
nodeGlgGraphNode instance.
Returns
Pointer to the GlgPoint that contains the node's display position. It points to the internal data structure and should not be modified.

◆ GlgNodeExternal

#define GlgNodeExternal (   node)

Returns the node's external flag.

Parameters
nodeGlgGraphNode instance.
Returns
True if the node is external, False otherwise.

External nodes are created by passing node_type=-1 to the GlgGraphAddNode function, see GlgGraphAddNode.

◆ GlgNodeGraphics

#define GlgNodeGraphics (   node)

Returns the graphic object used to render the node.

Parameters
nodeGlgGraphNode instance.
Returns
The graphic object used to render the node (GlgObject).

◆ GlgNodeLinkArray

#define GlgNodeLinkArray (   node)

Returns an array of edges connected to this node.

Parameters
nodeGlgGraphNode instance.
Returns
An array containing all edges connected to the node (GlgObject).

◆ GlgNodeNumLinks

#define GlgNodeNumLinks (   node)

Returns the number of edge links connected to the node.

Parameters
nodeGlgGraphNode instance.
Returns
Number of links (int).

◆ GlgNodePosition

#define GlgNodePosition (   node)

Returns node position in the normalized range (0;1).

Parameters
nodeGlgGraphNode instance.
Returns
Pointer to the GlgPoint structure that contains the node's position in the normalized coordinates (in the [-1; +1] range).

◆ GlgNodeType

#define GlgNodeType (   node)

Returns node type.

It is a palette index used for selecting different node icons from the palette.

Parameters
nodeGlgGraphNode instance.
Returns
Node type (int).