void SetZLayerSettings( const Handle_V3d_Viewer& theViewer3d, int theLayerId, bool theIsOrdered )
{
- if ( theViewer3d.IsNull() || theLayerId < 0 ) {
+ if ( theViewer3d.IsNull() /*|| theLayerId < 0*/ )
+ {
return;
}
theViewer->GetAllZLayers( anExistingZLayers );
int n = anExistingZLayers.Length();
- myZLayers.resize( n );
- for( int i=1; i<=n; i++ )
- myZLayers[i-1] = anExistingZLayers( i );
+ for( int i=1; i<=n; i++ ) {
+ int aLayerId = anExistingZLayers( i );
+ if ( aLayerId >= 0 ) {
+ myZLayers.push_back( aLayerId );
+ }
+ }
myIndex = 0;
}