Graph manipulation

What is the project's "graph"?

The project's Graph represents all of your project.

// Create an instance
InstantTerraApi::InstantTerra it = InstantTerraApi::CreateInstantTerra();

// Get the current graph
InstantTerraApi::Graph graph = it.GetProject().GetGraph();

Retrieving the number of nodes in the graph

// Returns the numbers of nodes in the graph
int numberOfNodes = graph.nodesGetNodeCount();

See GetNodeCount() in the documentation.

Getting a node from the graph with its index

// Returns the first node of the graph (index: 0)
Node firstNode = graph.GetNode(0);

The GetNode(int index) method returns the node with the specified index, from the graph.

Copyright © 2021 · All Rights Reserved · Wysilab