v3.0
Allows you to navigate through the samples of the associated geometry. This method returns one Sample for each corresponding component in the collection. For example, if you have a SampleCollection containing 5 members and you call this method with the direction set to siLastComponent, the returned collection will contain 5 instances of the last sample in the original SampleCollection.
SampleCollection SampleCollection.Navigate( siNavigateComponentType in_siNavigate ); |
oReturn = SampleCollection.Navigate( Navigation ); |
| Parameter | Type | Description |
|---|---|---|
| Navigation | siNavigateComponentType | Select the direction of navigation. |
var obj = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" );
var samplelist = obj.ActivePrimitive.Geometry.Facets(2).Samples;
var results = "";
var fs = new Enumerator( samplelist.Navigate(siFirstComponent) );
for ( ; ! fs.atEnd(); fs.moveNext() ) {
var firstsample = fs.item();
results += firstsample.Index + " ";
}
LogMessage( "The associated first samples are " + results );
results = "";
var ls = new Enumerator( samplelist.Navigate(siLastComponent) );
for ( ; ! ls.atEnd(); ls.moveNext() ) {
var lastsample = ls.item();
results += lastsample.Index + " ";
}
LogMessage( "The associated last samples are " + results );
results = "";
var ns = new Enumerator( samplelist.Navigate(siNextComponent) );
for ( ; ! ns.atEnd(); ns.moveNext() ) {
var nextsample = ns.item();
results += nextsample.Index + " ";
}
LogMessage( "The associated next samples are " + results );
results = "";
var ps = new Enumerator( samplelist.Navigate(siPreviousComponent) );
for ( ; ! ps.atEnd(); ps.moveNext() ) {
var prevsample = ps.item();
results += prevsample.Index + " ";
}
LogMessage( "The associated previous samples are " + results );
// Expected results:
//INFO : The associated first samples are 0 0 0 0
//INFO : The associated last samples are 23 23 23 23
//INFO : The associated next samples are 9 10 11 12
//INFO : The associated previous samples are 7 8 9 10
|