Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2025.
Loading...
Searching...
No Matches
SCloudIterator Class Reference

Provide access to cloud iterator methods. More...

Public Member Functions

Object GetAttributeValue (string attribute)
 Get an attribute value of the point.
 
Object GetColor ()
 Return the color of the point.
If no color is stored in the cloud, GetColor will return -1 for red, green and blue.
 
number GetDeviation ()
 Get the deviation of the point.
 
number GetIntensity ()
 Get the intensity of the point.
 
boolean GetNext ()
 Update iterator with the next point of the cloud.
 
SPoint GetPt ()
 Return the current point associated with the iterator.
 
boolean IsValid ()
 Check for the iterator validity.
 
string toString ()
 Get the type of the variable.
 

Detailed Description

Provide access to cloud iterator methods.

var cloud = SCloud.FromClick().Cloud;
var hasClassif = cloud.HasAttribute("classification")
var attributes = [];
if(hasClassif)
attributes.push("classification");
var cloudIt = cloud.GetIterator(attributes);
var pointIdx = 0;
do
{
Print("Point " + pointIdx + ":");
var colorRes = cloudIt.GetColor();
Print("\tRGB:" + colorRes.Red + ";" + colorRes.Green + ";" + colorRes.Blue);
Print("\tIntensity: " + cloudIt.GetIntensity());
if(hasClassif)
Print("\tClass: " + cloudIt.GetAttributeValue("classification"));
}
while(cloudIt.GetNext());
Provide point cloud edition and creation methods.
Definition Reshaper.h:3297
static Object FromClick()
Launch an interaction to select a SCloud in the scene.

Member Function Documentation

◆ GetAttributeValue()

Object SCloudIterator::GetAttributeValue ( string attribute)

Get an attribute value of the point.

See also
SCloud.GetIterator(), SAttributeUtil
Parameters
attribute(string) The attribute key you want the value of
Return values
ret.ErrorCode(number) Status
  • 0: Success
  • 1: Invalid attribute
  • 2: Attribute not defined for this cloud
ret.Value(number) The attribute value

◆ GetColor()

Object SCloudIterator::GetColor ( )

Return the color of the point.
If no color is stored in the cloud, GetColor will return -1 for red, green and blue.

Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: Index of the point is invalid
ret.Red(number) The red color between [0-1]
ret.Green(number) The green color between [0-1]
ret.Blue(number) The blue color between [0-1]

◆ GetDeviation()

number SCloudIterator::GetDeviation ( )

Get the deviation of the point.

Returns
(number) The deviation of the point. If no deviation is stored in the cloud, UndefinedValue is returned

◆ GetIntensity()

number SCloudIterator::GetIntensity ( )

Get the intensity of the point.

Returns
(number) The intensity of the point. If no intensity is stored in the cloud, UndefinedValue is returned

◆ GetNext()

boolean SCloudIterator::GetNext ( )

Update iterator with the next point of the cloud.

Returns
Whether or not there's still more points to parse
Return values
TrueThe next point is found (has not reached the end of the cloud)
FalseThere is no more point to parse

◆ GetPt()

SPoint SCloudIterator::GetPt ( )

Return the current point associated with the iterator.

Note
Each time you call GetNext() this value will be updated
Returns
(SPoint) The current point associated with the iterator

◆ IsValid()

boolean SCloudIterator::IsValid ( )

Check for the iterator validity.

An iterator can be invalid if it has reached the end of the points to parse or if it tries to iterate through invalid attributes.

Returns
(boolean) true if the iterator is valid, false otherwise

◆ toString()

string SCloudIterator::toString ( )

Get the type of the variable.

Returns
(string) The type name