Class Node

class Node

This class represents an InstantTerra node.

InstantTerra instantTerra = new InstantTerra();
Node myNode = instantTerra.GetProject().GetGraph().GetAllNodes()[0];  // Get the first node

bool HasParameter (string parameterName)

Returns

True if the parameter exists, otherwise False.

bool goodParameter = myNode.HasParameter("offset_x"); // true
bool badParameter = myNode.HasParameter("unknown"); // false

string[] GetParameterList ()

Returns

List of parameters name.

Returns the list of node parameters name.

string[] parameters = myNode.GetParameterList();

string GetParameterValue (string parameterName)

Returns

Value of the parameter.

Returns the value of the parameter.

string parameterValue = myNode.GetParameterValue("max_height");

bool SetParameterValue (string parameterName, string value)

Sets the value of the parameter.

myNode.SetParameterValue("max_height", "100.0");
Console.WriteLine(myNode.GetParameterValue("max_height"));

Dictionary<Connector.ConnectorMode, List<Connector>> GetConnectors ()

Returns a dictionnary of connectors of the Node and if they are connected.

Dictionary<Connector.ConnectorMode, List<Connector>> connectors = myNode.GetConnectors();

string GetName ()

Returns the name of the node.

string nodeName = myNode.GetName();

void SetName (string newName)

Change the name of the node.

myNode.SetName("new name");

string GetComment ()

Returns the comment of the node.

string nodeComment = myNode.GetComment();

void SetComment (string newComment)

Change the comment of the node.

myNode.SetComment("new comment");

string GetNodeType ()

Returns the type of the node.

string nodeType = myNode.GetNodeType();

bool IsEnabled ()

True if the node is enabled, False if the node is disabled.

bool nodeIsEnabled  = myNode.IsEnabled();

void SetIsEnabled ()

If enabled is true, enables the node.
If enabled is false, disables the node.

// Disable the node
myNode.SetIsEnabled(false);

float GetMaximumValue ()

Maximum elevation of the terrain in meters/ maximum value of the mask between 0 and 1
Calling this method triggers the calculation of the node if not already done. When the project contains a lot of nodes, this calculation may last several seconds to several minutes.
If the node contains several output terrains or masks (such as erosion nodes), the first terrain or first mask is used.
As export nodes do not have any output terrain or mask, the method has to be called from the previous node.

Error – If the node has no output terrain or mask, the following error will be reported: NoOutputTerrainOrMaskException .

float MaxValue = myNode.GetMaximumValue();

float GetMinimumValue ()

Minimum elevation of the terrain in meters/ maximum value of the mask between 0 and 1
Calling this method triggers the calculation of the node if not already done. When the project contains a lot of nodes, this calculation may last several seconds to several minutes.
If the node contains several output terrains or masks (such as erosion nodes), the first terrain or first mask is used.
As export nodes do not have any output terrain or mask, the method has to be called from the previous node.

Error – If the node has no output terrain or mask, the following error will be reported: NoOutputTerrainOrMaskException .

float MinValue = myNode.GetMinimumValue();

Copyright © 2020 · All Rights Reserved · Wysilab