Class Data

Note

You have to include the header Data.h.

class Data

Data of a node.

Throws

Error – In any of these commands, if the communication is off, the following error code will be reported ErrorCode::CommunicationError.

// Get the first node of a graph
InstantTerra instantTerra = CreateInstantTerra();
Project project = instantTerra.GetProject();
Graph graph = project.GetGraph();
Node firstNode = graph.GetNode(0);
Connector firstConnector = firstNode.GetConnector(0);

Data data = firstNode.GetData(firstConnector);
DataType Data::GetType()

Returns the type of data.

int Data::GetWidth()

Returns Terrain / Mask / Color map / Vector map width.

Throws

Error – If the data is not of the type [Terrain, Mask, ColorMap, VectorMap], the following error code will be reported ErrorCode::DataIsNotAGrid.

int Data::GetHeight()

Returns Terrain / Mask / Color map / Vector map height.

Throws

Error – If the data is not of the type [Terrain, Mask, ColorMap, VectorMap], the following error code will be reported ErrorCode::DataIsNotAGrid.

void Data::GetFloatContent(float *buffer, int bufferSize, int startingX, int startingY, int width, int height, int resolution)

Returns, in a float buffer, the content of the terrain or mask.

Warning

The size of the buffer should be superior or egal to width * height * sizeof(float).

Values startingX and startingY are the top left point coordinates of the part you want to get.

You can choose between multiple resolutions:

  • 0: Full resolution

  • 1: Half resolution

  • 2: Quarter resolution

Throws

Error – If the data is not of the type [Terrain, Mask], the following error code will be reported ErrorCode::DataIsNotATerrainOrMask.

void Data::ForceDataToBeComputed()

Force data to be computed.