GO2cam Javascript API
GO2SDisplayPoint Class Reference

Shortcut of GO2SDisplayGeometry to display a cross marking a position, without creating a geometry first. More...

Inheritance diagram for GO2SDisplayPoint:
GO2SDisplayGeometry

Public Member Functions

 GO2SDisplayPoint ()
 
 GO2SDisplayPoint (GO2SXYZ position)
 
void SetPosition (GO2SXYZ position)
 
void SetSize (Number size)
 
- Public Member Functions inherited from GO2SDisplayGeometry
 GO2SDisplayGeometry ()
 
 GO2SDisplayGeometry (GO2SGeometry geom)
 
void SetColor (Number color)
 
Boolean SetGeometry (GO2SGeometry geom)
 
void SetLineType (GO2SEnum::GO2SLineType type)
 
void SetLineWidth (Number width)
 
void SetTransparency (Number transparency)
 
void SetVisible (Boolean visible)
 

Additional Inherited Members

- Protected Member Functions inherited from GO2SDisplayGeometry
void SetEntity (std::shared_ptr< CGoeElementInterface > entity)
 

Detailed Description

Shortcut of GO2SDisplayGeometry to display a cross marking a position, without creating a geometry first.

Nothing is created in the GO2cam database: the cross is only displayed while the script is running. Its size is given in pixels: it does not change with the zoom. Same settings as GO2SDisplayGeometry: color, line width, line type, show/hide.

var pos = new GO2SXYZ(0, 0, 0);
// preview of the point: only displayed, nothing is created in the database
var preview = new GO2SDisplayPoint(pos)
preview.SetColor(0x0000FF)
preview.SetSize(8)
// each pick moves the point, ESC validates the last one
var pick;
while ((pick = GO2SInteract.PickXYZ('Pick the position, ESC to validate')))
{
pos = pick;
preview.SetPosition(pos)
}
// create the final point
new GO2SPoint(pos);
Class to manage interactivity with GO2cam.
Definition GO2SInteract.hpp:10
static GO2SXYZ PickXYZ(String forcedMessage="", Boolean info=false)
Point object.
Definition GO2SPoint.hpp:12
Creation of a coordinate reference.
Definition GO2SXYZ.hpp:93
Remarks
coordinates are expressed in the current working plane
Version
2027

Constructor & Destructor Documentation

◆ GO2SDisplayPoint() [1/2]

GO2SDisplayPoint::GO2SDisplayPoint ( )

Default constructor, point at the origin

Version
2027

◆ GO2SDisplayPoint() [2/2]

GO2SDisplayPoint::GO2SDisplayPoint ( GO2SXYZ position)
explicit

Constructor, display a point at the given position

Version
2027
Parameters
[in]positionposition of the point

Member Function Documentation

◆ SetPosition()

void GO2SDisplayPoint::SetPosition ( GO2SXYZ position)

Move the point

Version
2027
Parameters
[in]positionnew position of the point

◆ SetSize()

void GO2SDisplayPoint::SetSize ( Number size)

Set the size of the cross

Version
2027
Parameters
[in]sizehalf size of the cross in pixels (default 5)