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

!= Operator - This operation compares two direction objects for inequality. Returns true<br />

if the instances are not equal. The objects are defined as not equal if any of their X, Y, Z,<br />

or NormalizedVector properties does not match the same property of the other.<br />

Direction3 dir1 = new Direction3(10, 20, 30);<br />

Direction3 dir2 = new Direction3(10, 20, 30);<br />

bool result = (dir1 == dir2);<br />

//result is true<br />

Vector Operator (Direction2 or Direction3) – The Vector operator will explicitly<br />

cast a Direction2 or Direction3 to a Vector2 or Vector3 object (based on the<br />

argument type passed). The values in the vector would be that of the normalized vector.<br />

Direction3 dir1 = new Direction3(10 , 20 , 30 );<br />

Vector3 vt3 = (Vector3)dir1 ;<br />

Direction2 or Direction3 Operator – This operator will implicitly cast a Vector2 or<br />

Vector3 to a Direction2 or Direction3 object (based on the argument type<br />

passed).<br />

Vector3 vt3 = new Vector3(10, 20, 30);<br />

Direction3 dir1 = vt3;<br />

Direction2 and Direction3 classes provide the following public methods:<br />

Equals - This method compares this instance with another object reference for equality.<br />

Returns true if this instance is the same as the other object reference.<br />

Direction3 dir1 = new Direction3(10, 20, 30);<br />

Direction3 dir2 = new Direction3(10, 20, 30);<br />

bool result = dir1.Equals(dir2);<br />

// result is true<br />

GetHashCode - This method gets the hash code for this instance.<br />

4-154 <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!