<< Click to Display Table of Contents >> Navigation: Using SMILE > Anatomy of a node > Other node attributes |
Node attributes that not related to inference are grouped in the DSL_nodeInfo object, accessible through DSL_node::Info method. In turn, the DSL_nodeInfo provides access to the following objects:
•header: textual attributes, like node identifier, name, and description, through DSL_nodeInfo::Header method returning a reference to DSL_header object. For convenience, these attributes are also available directly through DSL_node member functions, like DSL_node::GetName.
•screen information: position, colors, border thickness, etc., through DSL_nodeInfo::Screen method returning a reference to DSL_screenInfo object.
•user properties: a list of key/value pairs used for application-specific purposes, through DSL_nodeInfo::UserProperties method returning a reference to DSL_userProperties object.
The example below displays a node's screen position and size:
int nodeHandle = …;
DSL_node *node = net.GetNode(nodeHandle);
DSL_nodeInfo &info = node->Info();
const DSL_rectangle &pos = info.Screen().position;
printf("Node center: (%d, %d), size: (%d,%d)\n",
pos.center_X, pos.center_Y,
pos.width, pos.height);