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

Provide labeling features, to annotate objects in the 3D scene and extract analysis values. More...

Inheritance diagram for SLabel:
SComp

Public Types

enum  SLabelBackgroundType { NO_BACKGROUND = 0 , SCENE_BACKGROUND_COLOR = 1 , SPECIAL_COLOR = 2 , TOLERANCE_COLOR = 3 }
 The type of background. More...
 
enum  SLabelCol {
  Reference = 0 , Measure = 1 , Deviation = 2 , TolMin = 3 ,
  TolMax = 4 , Note = 5 , Flushing = 6 , EmptyCol = 7 ,
  Nominal = 8 , BBoxMin = 9 , BBoxMax = 10 , Size = 11 ,
  Centroid = 12 , LowestPoint = 13 , UppestPoint = 14 , Count = 15 ,
  UndefinedCol = 16
}
 The column headers. More...
 
enum  SLabelLine {
  XX = 0 , YY = 1 , ZZ = 2 , NormalX = 3 ,
  NormalY = 4 , NormalZ = 5 , Radius = 6 , Diameter = 7 ,
  Angle = 8 , Circularity = 9 , Cylindricity = 10 , Planeity = 11 ,
  Distance = 12 , AngleX = 13 , AngleY = 14 , AngleZ = 15 ,
  AngleCompX = 16 , AngleCompY = 17 , AngleCompZ = 18 , AngleSuppX = 19 ,
  AngleSuppY = 20 , AngleSuppZ = 21 , AngleC = 22 , AngleS = 23 ,
  Dev3D = 24 , Curv = 25 , EmptyLine = 26 , Length = 27 ,
  Width = 28 , Linearity = 29 , Sphericity = 30 , DistanceXY = 31 ,
  DistanceYZ = 32 , DistanceXZ = 33 , DistanceX = 34 , DistanceY = 35 ,
  DistanceZ = 36 , Volume = 37 , Intensity = 38 , VolumeOver = 39 ,
  VolumeUnder = 40 , Perpendicularity = 41 , Parallelism = 42 , Level = 43 ,
  Surface = 44 , NbPoints = 45 , NbTriangles = 46 , NbPieces = 47 ,
  NbFreeCont = 48 , UndefinedLine = 49 , Flatness = 50
}
 The line headers. More...
 
enum  SLabelType { LONG = 0 , MEDIUM = 1 , SMALL = 2 , MINIMUM = 3 }
 The size of the label. More...
 
- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

 AddSComp (Array< SComp > tblSComp)
 Add some SComp to the label.
The label and the SComp will be one entity. More...
 
 AddToDoc ()
 Add the SLabel to the current document. More...
 
 AttachToPoint (SPoint attachedPoint)
 Attach the label to a 3D point in the scene. More...
 
Object GetCell (number idxLine, number idxColumn)
 Get the content of a cell. More...
 
Object GetCol (number idxColumn)
 Get all the contents of the column with given index. More...
 
Object GetColByType (SLabelCol colType)
 Get the indices of the columns with given column type. More...
 
string GetComment ()
 Get the comment associated to the label. More...
 
Object GetLine (number idxLine)
 Get all the contents of the line with given index. More...
 
Object GetLineByType (SLabelLine lineType)
 Get the index of the line with given line type. More...
 
Object SetCell (number idxLine, number idxColumn, number value)
 Set the content of a cell. More...
 
Object SetCol (number idxColumn, Array< number > valueTbl)
 Set the content of all the columns with given index. More...
 
Object SetColType (Array< SLabelCol > colType)
 Set the type for all columns. More...
 
 SetComment (string comment)
 Set a comment to the label. More...
 
Object SetLine (number idxLine, Array< number > valueTbl)
 Set the content of all the lines with given index. More...
 
Object SetLineType (Array< SLabelLine > lineType)
 Set the type for all lines. More...
 
 SetTolerance (number lowerTol, number upperTol)
 Set the default tolerance. More...
 
Object SetVisibleColumn (number columnIndex, boolean isVisible)
 Hide/show one column with a given index. More...
 
Object SetVisibleRow (number rowIndex, boolean isVisible)
 Hide/show one row with a given index. More...
 
 ShowComment (boolean showComment)
 Show or hide the comment. More...
 
 SLabel ()
 Default constructor. More...
 
 SLabel (number nbLine, number nbColumn)
 Construct a SLabel with given number of lines and columns. More...
 
 SLabel (SLabel other)
 Construct a SLabel by copying the SLabel other. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the label. 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 ()
 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< SLabelAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SLabel in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SLabel in the scene. More...
 
static Array< SLabelFromName (string name)
 Search all the SLabel with the given name. More...
 
static Array< SLabelFromSel ()
 Get all the selected SLabel. More...
 
static SLabel New (number nbLine, number nbColumn)
 Construct a SLabel with given number of lines and columns. More...
 
static SLabel New (SLabel other)
 Construct a SLabel by copying the SLabel other. More...
 
static SetBackgroundColor (number red, number green, number blue, number transparency)
 Define the SLabel background color. More...
 
static SetBackgroundType (SLabelBackgroundType backgroundType)
 Define the background type. More...
 
static SetDecimalNumber (number nbDecimal)
 Define number of decimals to display in the SLabel. More...
 
static SetLineColor (number red, number green, number blue)
 Define the color of line contour and text. More...
 
static SetSizeType (SLabelType labelType)
 Define how the SLabel is displayed. More...
 
static UseEngineeringNotation (boolean use)
 Define if SLabel use engineering notation ( Xe+y ) 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...
 

Detailed Description

Provide labeling features, to annotate objects in the 3D scene and extract analysis values.

Member Enumeration Documentation

◆ SLabelBackgroundType

The type of background.

Enumerator
NO_BACKGROUND 

No label background.

SCENE_BACKGROUND_COLOR 

Same color as scene background.

SPECIAL_COLOR 

Use defined color.

TOLERANCE_COLOR 

Use tolerance related color.

◆ SLabelCol

The column headers.

Enumerator
Reference 

Reference.

Measure 

Measure.

Deviation 

Deviation.

TolMin 

Min. tolerance.

TolMax 

Max. tolerance.

Note 

Note.

Flushing 

Flushing.

EmptyCol 

Empty.

Nominal 

Nominal.

BBoxMin 

Bounding box min.

BBoxMax 

Bounding box max.

Size 

Size.

Centroid 

Centroid.

LowestPoint 

Lowest point.

UppestPoint 

Highest point.

Count 

Count.

UndefinedCol 

Undefined.

◆ SLabelLine

The line headers.

Enumerator
XX 

X.

YY 

Y.

ZZ 

Z.

NormalX 

Normal X.

NormalY 

Normal Y.

NormalZ 

Normal Z.

Radius 

Radius.

Diameter 

Diameter.

Angle 

Angle.

Circularity 

Circularity.

Cylindricity 

Cylindricity.

Planeity 

Planeity.

Distance 

Distance.

AngleX 

Angle X.

AngleY 

Angle Y.

AngleZ 

Angle Z.

AngleCompX 

Angle complementary X.

AngleCompY 

Angle complementary Y.

AngleCompZ 

Angle complementary Z.

AngleSuppX 

Angle supplementary X.

AngleSuppY 

Angle supplementary Y.

AngleSuppZ 

Angle supplementary Z.

AngleC 

Angle Complementary.

AngleS 

Angle Supplementary.

Dev3D 

3D Deviation

Curv 

Curv.

EmptyLine 

Empty.

Length 

Length.

Width 

Width.

Linearity 

Linearity.

Sphericity 

Sphericity.

DistanceXY 

Distance XY.

DistanceYZ 

Distance YZ.

DistanceXZ 

Distance XZ.

DistanceX 

Distance X.

DistanceY 

Distance Y.

DistanceZ 

Distance Z.

Volume 

Volume.

Intensity 

Intensity.

VolumeOver 

Volume over.

VolumeUnder 

Volume under.

Perpendicularity 

Perpendicularity.

Parallelism 

Parallelism.

Level 

Level.

Surface 

Surface.

NbPoints 

Number of points.

NbTriangles 

Number of triangles.

NbPieces 

Number of pieces.

NbFreeCont 

Number of free contours.

UndefinedLine 

Undefined.

Flatness 

Flatness.

◆ SLabelType

The size of the label.

Enumerator
LONG 

Display all data defined as visible.

MEDIUM 

Display only necessary data.

SMALL 

Display a small label.

MINIMUM 

Display only label number.

Constructor & Destructor Documentation

◆ SLabel() [1/3]

SLabel::SLabel ( )

Default constructor.

◆ SLabel() [2/3]

SLabel::SLabel ( SLabel  other)

Construct a SLabel by copying the SLabel other.

Parameters
other(SLabel) The SLabel to copy

◆ SLabel() [3/3]

SLabel::SLabel ( number  nbLine,
number  nbColumn 
)

Construct a SLabel with given number of lines and columns.

Parameters
nbLine(number) The number of lines
nbColumn(number) The number of columns

Member Function Documentation

◆ AddSComp()

SLabel::AddSComp ( Array< SComp tblSComp)

Add some SComp to the label.
The label and the SComp will be one entity.

Warning
If one SComp is in the document, you cannot add it.If one SComp is associated with a label, you must not add it to the current document.To add the associated SComp, you must add the SLabel to the document
See also
RemoveFromDoc()
Parameters
tblSComp(Array<SComp>) The list of SComp to draw with the label

◆ AddToDoc()

SLabel::AddToDoc ( )

Add the SLabel to the current document.

◆ All()

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

Get all the SLabel in the document.

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

◆ AttachToPoint()

SLabel::AttachToPoint ( SPoint  attachedPoint)

Attach the label to a 3D point in the scene.

Parameters
attachedPoint(SPoint) The SPoint used to attach the label

◆ FromClick()

static Object SLabel::FromClick ( )
static

Launch an interaction to select a SLabel 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 SLabel is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.Label(SLabel) The selected SLabel

◆ FromName()

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

Search all the SLabel with the given name.

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

◆ FromSel()

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

Get all the selected SLabel.

Returns
(Array<SLabel>) All the selected SLabel

◆ GetCell()

Object SLabel::GetCell ( number  idxLine,
number  idxColumn 
)

Get the content of a cell.

Parameters
idxLine(number) The line index (0 <= idxLine < Nb Line)
idxColumn(number) The column index (0 <= idxColumn < Nb Column)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Value(number) The value associated to the cell

◆ GetCol()

Object SLabel::GetCol ( number  idxColumn)

Get all the contents of the column with given index.

Parameters
idxColumn(number) The column index (0 <= idxColumn < Nb Column)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.ValueTbl(Array<number>) A table of all values associated to the column
ret.Header(number) The type of the column (see SLabelCol)

◆ GetColByType()

Object SLabel::GetColByType ( SLabelCol  colType)

Get the indices of the columns with given column type.

Parameters
colType(SLabelCol) The column type
Return values
ret.IndexTbl(Array<number>) All the column indices with given type

◆ GetComment()

string SLabel::GetComment ( )

Get the comment associated to the label.

See also
SLabel.SetComment()
Returns
(string) The associated comment.

◆ GetLine()

Object SLabel::GetLine ( number  idxLine)

Get all the contents of the line with given index.

Parameters
idxLine(number) The line index (0 <= idxLine < Nb Line)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.ValueTbl(Array<number>) A table of all values associated to the line
ret.Header(number) The type of the line (see SLabelLine)

◆ GetLineByType()

Object SLabel::GetLineByType ( SLabelLine  lineType)

Get the index of the line with given line type.

Parameters
lineType(SLabelLine) The line type
Return values
ret.IndexTbl(Array<number>) All the line indices with given type

◆ New() [1/2]

static SLabel SLabel::New ( number  nbLine,
number  nbColumn 
)
static

Construct a SLabel with given number of lines and columns.

Parameters
nbLine(number) The number of lines
nbColumn(number) The number of columns
Returns
(SLabel) The new SLabel.

◆ New() [2/2]

static SLabel SLabel::New ( SLabel  other)
static

Construct a SLabel by copying the SLabel other.

Parameters
other(SLabel) The SLabel to copy
Returns
(SLabel) The new SLabel.

◆ SetBackgroundColor()

static SLabel::SetBackgroundColor ( number  red,
number  green,
number  blue,
number  transparency 
)
static

Define the SLabel background color.

Parameters
red(number) The red color (between 0 and 1)
green(number) The green color (between 0 and 1)
blue(number) The blue color (between 0 and 1)
transparency(number) The transparency (between 0 and 1)

◆ SetBackgroundType()

static SLabel::SetBackgroundType ( SLabelBackgroundType  backgroundType)
static

Define the background type.

See also
SLabel.SetBackgroundColor()
Parameters
backgroundType(SLabelBackgroundType) Type of background to apply

◆ SetCell()

Object SLabel::SetCell ( number  idxLine,
number  idxColumn,
number  value 
)

Set the content of a cell.

Parameters
idxLine(number) The line index (0 <= idxLine < Nb Line)
idxColumn(number) The column index (0 <= idxColumn < Nb Column)
value(number) The data to store in the cell
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetCol()

Object SLabel::SetCol ( number  idxColumn,
Array< number >  valueTbl 
)

Set the content of all the columns with given index.

Parameters
idxColumn(number) The column index (0 <= idxColumn < Nb Column)
valueTbl(Array<number>) A table of values
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetColType()

Object SLabel::SetColType ( Array< SLabelCol colType)

Set the type for all columns.

Parameters
colType(Array<SLabelCol>) The column types to set.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetComment()

SLabel::SetComment ( string  comment)

Set a comment to the label.

See also
SLabel.GetComment()
Parameters
comment(string) The comment to set

◆ SetDecimalNumber()

static SLabel::SetDecimalNumber ( number  nbDecimal)
static

Define number of decimals to display in the SLabel.

Parameters
nbDecimal(number) The number of decimals (between 0 and 5)

◆ SetLine()

Object SLabel::SetLine ( number  idxLine,
Array< number >  valueTbl 
)

Set the content of all the lines with given index.

Parameters
idxLine(number) The line index (0 <= idxLine < Nb Line)
valueTbl(Array<number>) A table of value
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetLineColor()

static SLabel::SetLineColor ( number  red,
number  green,
number  blue 
)
static

Define the color of line contour and text.

Parameters
red(number) The red color (between 0 and 1)
green(number) The green color (between 0 and 1)
blue(number) The blue color (between 0 and 1)

◆ SetLineType()

Object SLabel::SetLineType ( Array< SLabelLine lineType)

Set the type for all lines.

Parameters
lineType(Array<SLabelLine>) The line types
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetSizeType()

static SLabel::SetSizeType ( SLabelType  labelType)
static

Define how the SLabel is displayed.

Parameters
labelType(SLabelType) The type of label to use

◆ SetTolerance()

SLabel::SetTolerance ( number  lowerTol,
number  upperTol 
)

Set the default tolerance.

Parameters
lowerTol(number) The lower tolerance
upperTol(number) The upper tolerance

◆ SetVisibleColumn()

Object SLabel::SetVisibleColumn ( number  columnIndex,
boolean  isVisible 
)

Hide/show one column with a given index.

Parameters
columnIndex(number) The column index to hide/show.
isVisible(boolean) True if the column must be visible, else false
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ SetVisibleRow()

Object SLabel::SetVisibleRow ( number  rowIndex,
boolean  isVisible 
)

Hide/show one row with a given index.

Parameters
rowIndex(number) The row index to hide/show.
isVisible(boolean) True if the row must be visible, else false
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred

◆ ShowComment()

SLabel::ShowComment ( boolean  showComment)

Show or hide the comment.

Parameters
showComment(boolean) True to show the comment, false to hide.

◆ toString()

string SLabel::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ UseEngineeringNotation()

static SLabel::UseEngineeringNotation ( boolean  use)
static

Define if SLabel use engineering notation ( Xe+y )

Parameters
use(boolean) True to use engineering notation, else false

◆ ValuesToString()

string SLabel::ValuesToString ( )

Get a debug string representation of the label.

Returns
(string) A debug string representing the label