02.05.2014 Views

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basics<br />

Intersection – This method gets the intersection of the given two extent<br />

objects.<br />

Extent2 ext = new Extent2(new Index2 (1, 1), new Index2(2, 3));<br />

//ext is [1 : 1 : 2, 1 : 1 : 3]<br />

Extent2 ext1 = new Extent2(new Index2 (1, 1), new Index2(3, 4));<br />

//ext1 is [1 : 1 : 3, 1 : 1 : 4]<br />

Extent2 ext2 = ext1.Intersection(ext);<br />

//ext2 is [1 : 1 : 2, 1 : 1 : 3]<br />

Reverse – This method returns the reverse of the extent.<br />

Extent2 ext = new Extent2(new Index2 (1, 1), new Index2(2, 3));<br />

//ext is [1 : 1 : 2, 1 : 1 : 3]<br />

Extent2 reverseExt = ext.Reverse();<br />

//reverseExt is [2 : -1 : 1, 3 : -1 : 1]<br />

NearestIndex – This method finds the nearest index in the extent corresponding<br />

to given values in the Index2 input parameter. If the input values are off the end of<br />

the extent, the last index is returned. -1 is returned if the extent is empty. Indexes<br />

into the extent are zero-based.<br />

Extent2 ext = new Extent2(new Index2 (1, 3), new Index2(4, 5));<br />

//ext is [1 : 1 : 4, 3 : 1 : 7]<br />

Index2 nearest = ext.NearestIndex(new Index2(3, 8));<br />

// result is (2, 4)<br />

Here the Extent2 has two arrays {1, 2, 3, 4} and {3, 4, 5, 6, 7}. In the first array,<br />

you are looking for the value 3 and find it at index position 2. In the second array,<br />

you are looking for the value 8, but it is not there. It is beyond the end of the array,<br />

so the index position returned is the last index position or 4. The result is (2, 4).<br />

SnapValue – This method returns the nearest value in each Extent2 that falls on<br />

an extent increment closest to the input values. The returned values can be outside<br />

the range of the Extent2 objects.<br />

Index2 begin = new Index2(3, 5);<br />

Index2 size = new Index2(10, 10);<br />

Index2 inc = new Index2(3, 5);<br />

Extent2 ext = new Extent2(begin, size, inc);<br />

//ext is [3 : 3 : 30, 5 : 5 : 50]<br />

Index2 snap = ext.SnapValue(new Index2(13, 22));<br />

//snap is (12, 10).<br />

In this example, the output Index2 value has elements of 12 and 20. The value 13<br />

falls closest to the value 12 that is an even increment of the starting value of 3 and<br />

<strong>Schlumberger</strong> Private - Customer Use<br />

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

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

Saved successfully!

Ooh no, something went wrong!