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 />

Max – This property returns the maximum corner of the box. This is defined as the<br />

Point3, which is furthest from the origin along all three axes.<br />

Box3 bx1 = new Box3(new Point3 (1, 20, 3), new Point3(10, 11, 12));<br />

Point3 pt1 = bx1.Max;<br />

//result is pt1(10, 20, 12)<br />

This example illustrates a box created from a pair of points that are at corners that are<br />

close to the Y axis and X axis respectively. Consequently the max point for the box is a<br />

point that uses the X location from one of the input corners and the Y location from the<br />

other.<br />

Min - This property returns the minimum corner of the box. This is defined as the Point3<br />

which is closest to the origin along all three axes.<br />

Box3 bx1 = new Box3(new Point3 (1, 20, 3), new Point3(10, 11, 12));<br />

Point3 pt1 = bx1.Min;<br />

//result is pt1(1, 11, 3)<br />

This example, like the one above for Max, finds the minimum corner of the box from<br />

different parts of the two input points.<br />

IsDegenerate - This property returns true if this box is degenerated into a plane or<br />

point. A box degenerates to a plane when the value for one axis is the same for both<br />

corner points.<br />

Box3 bt = new Box3(new Point3 (1, 20, 30), new Point3(10, 11, 30));<br />

bool result = bt.IsDegenerate;<br />

//result is true<br />

Box3 bt2 = new Box3(new Point3 (1, 20, 30), new Point3(10, 11, 40));<br />

result = bt2.IsDegenerate;<br />

//result is false<br />

The first box is degenerated into a horizontal plane because the Z value for the input<br />

points is the same. The second box does not degenerate to a plane since none of the X, Y,<br />

or Z values of the input points match.<br />

The public fields for the Box class are:<br />

Null – This method defines a null box instance.<br />

Box3 nullBox = new Box3(Point3.Null, Point3.Null);<br />

Box3 defines two public operators:<br />

4-158 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!