02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Geometry<br />

The Polyline2 and Polyline3 classes provide the same constructors, properties, and<br />

methods. They vary only in the dimensions available. Polyline2 objects are constructed<br />

from Point2 objects and Polyline3 objects are constructed from Point3 objects. The<br />

following section details the constructors, properties, and methods available using the<br />

Polyline3 for the examples.<br />

Each Polyline type has multiple constructors. Using Polyline3, for example, here is the<br />

constructor that takes a set of points:<br />

Point3 [] points = ...;<br />

Polyline3 polyline = new Polyline3(points);<br />

This example creates a Polyline3 from a collection of points and specifies if the polyline<br />

is closed or not.<br />

bool isClosed = true;<br />

Point3 [] points = ...;<br />

Polyline3 polyline = new Polyline3(points, isClosed);<br />

The public properties for Polyline include:<br />

IsClosed - This property returns true if the polyline is closed.<br />

IList points = new List();<br />

points.Add(new Point3 (0, 0, 0));<br />

points.Add(new Point3 (1, 1, 1));<br />

points.Add(new Point3 (2, 2, 2));<br />

Polyline3 poly1 = new Polyline3(points);<br />

Polyline3 poly2 = new Polyline3(points,true);<br />

bool result = poly1.IsClosed;<br />

//result is false;<br />

result = poly2.IsClosed;<br />

//result is true;<br />

The Polyline class defines the public field:<br />

Empty – This method defines an empty polyline (with no points).<br />

Polyline3 poly4 = Polyline3.Empty;<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Services 4-183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!