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

Provide trajectory management. More...

Inheritance diagram for STrajectory:
SComp

Public Member Functions

Object ConvertToMulti ()
 Convert a STrajectory to a SMultiline. More...
 
Object EstimatePose (number timestamp)
 Estimate the pose of the STrajectory at the given timestamp. More...
 
number GetDuration ()
 Get the total duration of the STrajectory. More...
 
number GetLength ()
 Get the total length of the STrajectory. More...
 
number GetNumberOfPoses ()
 Get the number of poses of the STrajectory. More...
 
Object GetPoseInfo (number index)
 Get the pose and timestamp of the STrajectory at the given index. More...
 
Object GetTimestampRange ()
 Get the start and end time of the STrajectory. More...
 
Object LinkToCloud (SCloud cloud)
 Link the given SCloud to the STrajectory. More...
 
Object Save (string filePath)
 Save the STrajectory to a CSV file. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the STrajectory. More...
 
- Public Member Functions inherited from SComp
 AddToDoc ()
 Add the object to the document. More...
 
 ApplyTransformation (SMatrix matrix)
 Apply a geometric transformation to the current object by making a product with the given matrix. More...
 
Object GetBoundingBox (SMatrix ucs=null)
 Calculate the bounding box of the object. More...
 
Object GetColors ()
 Get the colors of the object. More...
 
string GetFolderName ()
 Get the name of the folder containing the object. More...
 
string GetName ()
 Return the object's name. More...
 
string GetPath ()
 Return the full path of a SComp in the tree. More...
 
 Invert ()
 Invert the normal of the object. More...
 
boolean IsInDoc ()
 Return if the object is in the document or not. More...
 
boolean IsVisible ()
 Get the visibility of the object. More...
 
 MoveToGroup (string groupPath, boolean moveInsideTopParent=true)
 Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More...
 
 RemoveFromDoc ()
 Remove the object from the document. More...
 
 SetClippable (boolean clipping)
 Set clippable or not. More...
 
 SetColors (number red, number green, number blue)
 Set the colors of the object. More...
 
 SetName (string objectName)
 Set the object's name. More...
 
 SetTransparency (number alpha)
 Set the transparency of the object. More...
 
 SetVisibility (boolean visible)
 Set the object to be visible, or not visible. More...
 
string toString ()
 Get the type of the variable. More...
 
 Translate (SVector vector)
 Make a translation of the current object with an SVector. More...
 

Static Public Member Functions

static Array< STrajectoryAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the STrajectory in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a STrajectory in the scene. More...
 
static Object FromFile (string fileName)
 Import a STrajectory from a CSV or TRJ file. More...
 
static Array< STrajectoryFromName (string name)
 Search all the STrajectory with the given name. More...
 
static Array< STrajectoryFromSel ()
 Get all the selected STrajectory. More...
 
- Static Public Member Functions inherited from SComp
static Array< SCompAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SComp in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SComp in the scene. More...
 
static Array< SCompFromName (string name)
 Search all the SComp with the given name. More...
 
static Array< SCompFromSel ()
 Get all the selected SComp. More...
 

Additional Inherited Members

- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Detailed Description

Provide trajectory management.

Member Function Documentation

◆ All()

static Array< STrajectory > STrajectory::All ( VisibilityEnum  visCrit = SComp.ANY_VISIBILITY)
static

Get all the STrajectory in the document.

Parameters
visCrit(VisibilityEnum) Visible selection criteria
Returns
(Array<STrajectory>) Array of all the STrajectory contained in the document, that fulfill the visibility criteria

◆ ConvertToMulti()

Object STrajectory::ConvertToMulti ( )

Convert a STrajectory to a SMultiline.

Return values
ret.Multi(SMultiline) The converted SMultiline

◆ EstimatePose()

Object STrajectory::EstimatePose ( number  timestamp)

Estimate the pose of the STrajectory at the given timestamp.

Parameters
timestamp(number) The timestamp at which to estimate the pose
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The timestamp is not correct
  • 2: An error occurred
ret.Matrix(SMatrix) The SMatrix corresponding to the estimated pose

◆ FromClick()

static Object STrajectory::FromClick ( )
static

Launch an interaction to select a STrajectory in the scene.

Warning
This function will pause the script, and wait for user interaction
Return values
ret.ErrorCode(number) The error code
  • 0: No error, the STrajectory is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.Trajectory(STrajectory) The selected STrajectory

◆ FromFile()

static Object STrajectory::FromFile ( string  fileName)
static

Import a STrajectory from a CSV or TRJ file.

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
fileName(string) The path to the trajectory file, must be a CSV or TRJ file
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The trajectory is invalid
  • 2: The file extension is not supported
  • 3: The file has not been found
  • 4: An error occurred
ret.Trajectory(STrajectory) The loaded STrajectory

◆ FromName()

static Array< STrajectory > STrajectory::FromName ( string  name)
static

Search all the STrajectory with the given name.

Parameters
name(string) The name to find
Returns
(Array<STrajectory>) All the STrajectory with the given name

◆ FromSel()

static Array< STrajectory > STrajectory::FromSel ( )
static

Get all the selected STrajectory.

Returns
(Array<STrajectory>) All the selected STrajectory

◆ GetDuration()

number STrajectory::GetDuration ( )

Get the total duration of the STrajectory.

Returns
(number) The duration

◆ GetLength()

number STrajectory::GetLength ( )

Get the total length of the STrajectory.

Returns
(number) The length

◆ GetNumberOfPoses()

number STrajectory::GetNumberOfPoses ( )

Get the number of poses of the STrajectory.

Returns
(number) The number of poses

◆ GetPoseInfo()

Object STrajectory::GetPoseInfo ( number  index)

Get the pose and timestamp of the STrajectory at the given index.

Parameters
index(number) The index at which to get the pose information
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The index is not correct
  • 2: An error occurred
ret.Matrix(SMatrix) The SMatrix corresponding to the pose at the given index
ret.Timestamp(number) The timestamp at the given index

◆ GetTimestampRange()

Object STrajectory::GetTimestampRange ( )

Get the start and end time of the STrajectory.

Return values
ret.StartTime(number) The timestamp at the start
ret.EndTime(number) The timestamp at the end

◆ LinkToCloud()

Object STrajectory::LinkToCloud ( SCloud  cloud)

Link the given SCloud to the STrajectory.

Parameters
cloud(SCloud) The SCloud to link to the STrajectory
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The previous link has been overwritten

◆ Save()

Object STrajectory::Save ( string  filePath)

Save the STrajectory to a CSV file.

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
filePath(string) The path to the trajectory file, must be a CSV file
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ toString()

string STrajectory::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ ValuesToString()

string STrajectory::ValuesToString ( )

Get a debug string representation of the STrajectory.

Returns
(string) A debug string representing the STrajectory