GO2cam Javascript API
GO2SDisplayPolyline Class Reference

Shortcut of GO2SDisplayGeometry to display lines going through points, without creating a geometry first. More...

Inheritance diagram for GO2SDisplayPolyline:
GO2SDisplayGeometry

Public Member Functions

 GO2SDisplayPolyline ()
 
 GO2SDisplayPolyline (Array< GO2SXYZ > points)
 
void SetPoints (Array< GO2SXYZ > points)
 
- 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 lines going through points, without creating a geometry first.

Nothing is created in the GO2cam database: the lines are only displayed while the script is running. Same settings as GO2SDisplayGeometry: color, line width, line type, show/hide.

var org = new GO2SXYZ(0, 0, 0);
var end = new GO2SXYZ(10, 0, 0);
// preview of the segment: only displayed, nothing is created in the database
var preview = new GO2SDisplayPolyline([org, end])
preview.SetColor(0x0000FF)
preview.SetLineWidth(3)
preview.SetLineType(GO2SLineType.Dotted)
// each pick moves the end point, ESC validates the last one
var pos;
while ((pos = GO2SInteract.PickXYZ('Pick the end point, ESC to validate')))
{
end = pos;
preview.SetPoints([org, end])
}
// create the final segment
new GO2SSegment(org, end);
Class to manage interactivity with GO2cam.
Definition GO2SInteract.hpp:10
static GO2SXYZ PickXYZ(String forcedMessage="", Boolean info=false)
Segment object.
Definition GO2SSegment.hpp:8
Creation of a coordinate reference.
Definition GO2SXYZ.hpp:93
Remarks
coordinates are expressed in the current working plane
Version
2027

Constructor & Destructor Documentation

◆ GO2SDisplayPolyline() [1/2]

GO2SDisplayPolyline::GO2SDisplayPolyline ( )

Default constructor, empty polyline

Version
2027

◆ GO2SDisplayPolyline() [2/2]

GO2SDisplayPolyline::GO2SDisplayPolyline ( Array< GO2SXYZ > points)
explicit

Constructor, display a polyline going through the given points

Version
2027
Parameters
[in]pointspoints of the polyline

Member Function Documentation

◆ SetPoints()

void GO2SDisplayPolyline::SetPoints ( Array< GO2SXYZ > points)

Replace the points of the polyline

Version
2027
Parameters
[in]pointspoints of the polyline