Note
You have to include the header Data.h.
Data
Data of a node.
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);
Data::
GetWidth
()Returns Terrain / Mask / color map / color map width.
Error − If the data
is not of the type [Terrain, Mask, ColorMap, VectorMap], the
following error code will be reported ErrorCode::DataIsNotAGrid
.
Data::
GetHeight
()Returns Terrain / Mask / color map / color map height.
Error − If the data
is not of the type [Terrain, Mask, ColorMap, VectorMap], the
following error code will be reported ErrorCode::DataIsNotAGrid
.
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.
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
…
Error − If the data
is not of the type [Terrain, Mask], the following error code will
be reported ErrorCode::DataIsNotATerrainOrMask
.
Data::
ForceDataToBeComputed
()Force data to be computed.
Data::
GetResolution
(bool
&completed, int startingX, int
startingY, int width, int
height)Get the currently computed resolution of a part of a terrain, a
mask, a color map or a color map.
Return value:
0 = all points have been computed (full resolution).
1 = one point every 2 points has been computed (half
resolution).
2 = one point every 4 points has been computed (quarter
resolution).
Etc.
The method returns NOT_COMPUTED if this part of
the grid has not been computed yet.
completed is set to true if the computation is
completed.
completed is set to false if the computation is not
completed, for instance because there is an erosion node that is
currently been computed. (modifié)
startingX, startingY: coordinates in points of
the top left region to test.
width, height: size in points of the region to
test.
Error The following
error code may be reported ErrorCode::DataIsNotAGrid
.
Data
::
NOT_COMPUTED
NOT_COMPUTED is a constant equal to -1.
Copyright © 2022 · All Rights Reserved · Wysilab