当前位置: 首页>>代码示例>>C++>>正文


C++ MapModelChange::getFirstIndex方法代码示例

本文整理汇总了C++中MapModelChange::getFirstIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ MapModelChange::getFirstIndex方法的具体用法?C++ MapModelChange::getFirstIndex怎么用?C++ MapModelChange::getFirstIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapModelChange的用法示例。


在下文中一共展示了MapModelChange::getFirstIndex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void
MapCallback::onMapModelChanged( const MapModelChange& change )
{
    switch( change.getAction() )
    {
    case MapModelChange::ADD_ELEVATION_LAYER: 
        onElevationLayerAdded( change.getElevationLayer(), change.getFirstIndex() ); break;
    case MapModelChange::ADD_IMAGE_LAYER:
        onImageLayerAdded( change.getImageLayer(), change.getFirstIndex() ); break;
    case MapModelChange::ADD_MASK_LAYER:
        onMaskLayerAdded( change.getMaskLayer() ); break;
    case MapModelChange::ADD_MODEL_LAYER:
        onModelLayerAdded( change.getModelLayer(), change.getFirstIndex() ); break;
    case MapModelChange::REMOVE_ELEVATION_LAYER:
        onElevationLayerRemoved( change.getElevationLayer(), change.getFirstIndex() ); break;
    case MapModelChange::REMOVE_IMAGE_LAYER:
        onImageLayerRemoved( change.getImageLayer(), change.getFirstIndex() ); break;
    case MapModelChange::REMOVE_MASK_LAYER:
        onMaskLayerRemoved( change.getMaskLayer() ); break;
    case MapModelChange::REMOVE_MODEL_LAYER:
        onModelLayerRemoved( change.getModelLayer() ); break;
    case MapModelChange::MOVE_ELEVATION_LAYER:
        onElevationLayerMoved( change.getElevationLayer(), change.getFirstIndex(), change.getSecondIndex() ); break;
    case MapModelChange::MOVE_IMAGE_LAYER:
        onImageLayerMoved( change.getImageLayer(), change.getFirstIndex(), change.getSecondIndex() ); break;
    case MapModelChange::MOVE_MODEL_LAYER:
            onModelLayerMoved( change.getModelLayer(), change.getFirstIndex(), change.getSecondIndex() ); break;
    case MapModelChange::UNSPECIFIED: break;
    default: break;
    }
}
开发者ID:chuckshaw,项目名称:osgearth,代码行数:31,代码来源:Map.cpp

示例2: switch

void
OSGTerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
    _update_mapf->sync();

    // dispatch the change handler
    if ( change.getLayer() )
    {
        // first inform the texture compositor with the new model changes:
        if ( _texCompositor.valid() && change.getImageLayer() )
        {
            _texCompositor->applyMapModelChange( change );
        }

        // then apply the actual change:
        switch( change.getAction() )
        {
        case MapModelChange::ADD_IMAGE_LAYER:
            addImageLayer( change.getImageLayer() );
            break;
        case MapModelChange::REMOVE_IMAGE_LAYER:
            removeImageLayer( change.getImageLayer() );
            break;
        case MapModelChange::ADD_ELEVATION_LAYER:
            addElevationLayer( change.getElevationLayer() );
            break;
        case MapModelChange::REMOVE_ELEVATION_LAYER:
            removeElevationLayer( change.getElevationLayer() );
            break;
        case MapModelChange::MOVE_IMAGE_LAYER:
            moveImageLayer( change.getFirstIndex(), change.getSecondIndex() );
            break;
        case MapModelChange::MOVE_ELEVATION_LAYER:
            moveElevationLayer( change.getFirstIndex(), change.getSecondIndex() );
            break;
        case MapModelChange::ADD_MODEL_LAYER:
        case MapModelChange::REMOVE_MODEL_LAYER:
        case MapModelChange::MOVE_MODEL_LAYER:
        default: break;
        }
    }

    // update the terrain revision in threaded mode
    if ( _isStreaming )
    {
        //getTerrain()->incrementRevision();
        static_cast<StreamingTerrainNode*>(_terrain)->updateTaskServiceThreads( *_update_mapf );
    }
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:49,代码来源:OSGTerrainEngineNode.cpp

示例3: if

void
TextureLayout::applyMapModelChange( const MapModelChange& change, bool reserveSeconarySlotIfNecessary )
{
    if ( change.getAction() == MapModelChange::ADD_IMAGE_LAYER )
    {
        assignPrimarySlot( change.getImageLayer(), change.getFirstIndex() );

        bool blendingOn = change.getImageLayer()->getImageLayerOptions().lodBlending() == true;
        _lodBlending[ change.getImageLayer()->getUID() ] = blendingOn;

        if ( blendingOn && reserveSeconarySlotIfNecessary )
        {
            assignSecondarySlot( change.getImageLayer() );
        }
    }

    else if ( change.getAction() == MapModelChange::REMOVE_IMAGE_LAYER )
    {
        for( int which = 0; which <= 1; ++which )
        {
            int slot = getSlot( change.getLayer()->getUID(), which );
            if ( slot < 0 )
                break;

            _slots[slot] = -1;

            if ( which == 0 ) // primary slot; remove from render order:
            {
                for( RenderOrderVector::iterator j = _order.begin(); j != _order.end(); )
                {
                    if ( *j == slot )
                        j = _order.erase( j );
                    else
                        ++j;
                }
            }
        }
    }

    else if ( change.getAction() == MapModelChange::MOVE_IMAGE_LAYER )
    {
        int fromIndex = getOrder( change.getLayer()->getUID() );
        int toIndex = change.getSecondIndex();

        if ( fromIndex != toIndex )
        {
            int slot = _order[fromIndex];
            _order.erase( _order.begin() + fromIndex );
            _order.insert( _order.begin() + toIndex, slot );
        }
    }

    //OE_INFO << LC << "Layout Slots: " << std::endl;
    //for( int i=0; i<_slots.size(); ++i )
    //    OE_INFO << LC << "  Slot " << i << ": uid=" << _slots[i] << ", order=" << getOrder(_slots[i]) << std::endl;
    //OE_INFO << LC << "Layout Order: " << std::endl;
    //for( int i=0; i<_order.size(); ++i )
    //    OE_INFO << LC << "  Ordr " << i << ": slot=" << _order[i] << std::endl;
}
开发者ID:dgraves,项目名称:osgearth,代码行数:59,代码来源:TextureCompositor.cpp

示例4: switch

void
MapCallback::onMapModelChanged( const MapModelChange& change )
{
    switch( change.getAction() )
    {
    case MapModelChange::ADD_LAYER: 
        onLayerAdded(change.getLayer(), change.getFirstIndex());
        break;

    case MapModelChange::REMOVE_LAYER:
        onLayerRemoved(change.getLayer(), change.getFirstIndex());
        break;

    case MapModelChange::MOVE_LAYER:
        onLayerMoved(change.getLayer(), change.getFirstIndex(), change.getSecondIndex());
        break;

    case MapModelChange::ENABLE_LAYER:
        onLayerEnabled(change.getLayer());
        break;

    case MapModelChange::DISABLE_LAYER:
        onLayerDisabled(change.getLayer());
        break;

    case MapModelChange::BEGIN_BATCH_UPDATE:
	onBeginUpdate();
	break;

    case MapModelChange::END_BATCH_UPDATE:
	onEndUpdate();
	break;

    default: 
        break;
    }
}
开发者ID:JD31,项目名称:osgearth,代码行数:37,代码来源:MapCallback.cpp

示例5: if

void
MPTerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
    if ( change.getAction() == MapModelChange::BEGIN_BATCH_UPDATE )
    {
        _batchUpdateInProgress = true;
    }

    else if ( change.getAction() == MapModelChange::END_BATCH_UPDATE )
    {
        _batchUpdateInProgress = false;

        if ( _refreshRequired )
            refresh();

        if ( _stateUpdateRequired )
            updateState();
    }

    else
    {
        // update the thread-safe map model copy:
        if ( _update_mapf->sync() )
        {
            _liveTiles->setMapRevision( _update_mapf->getRevision() );
        }

        // dispatch the change handler
        if ( change.getLayer() )
        {
            // then apply the actual change:
            switch( change.getAction() )
            {
            case MapModelChange::ADD_IMAGE_LAYER:
                addImageLayer( change.getImageLayer() );
                break;
            case MapModelChange::REMOVE_IMAGE_LAYER:
                removeImageLayer( change.getImageLayer() );
                break;
            case MapModelChange::ADD_ELEVATION_LAYER:
                addElevationLayer( change.getElevationLayer() );
                break;
            case MapModelChange::REMOVE_ELEVATION_LAYER:
                removeElevationLayer( change.getElevationLayer() );
                break;
            case MapModelChange::MOVE_IMAGE_LAYER:
                moveImageLayer( change.getFirstIndex(), change.getSecondIndex() );
                break;
            case MapModelChange::MOVE_ELEVATION_LAYER:
                moveElevationLayer( change.getFirstIndex(), change.getSecondIndex() );
                break;
            case MapModelChange::TOGGLE_ELEVATION_LAYER:
                toggleElevationLayer( change.getElevationLayer() );
                break;
            case MapModelChange::ADD_MODEL_LAYER:
            case MapModelChange::REMOVE_MODEL_LAYER:
            case MapModelChange::MOVE_MODEL_LAYER:
            default: 
                break;
            }
        }
    }
}
开发者ID:Displacer,项目名称:osgearth,代码行数:63,代码来源:MPTerrainEngineNode.cpp

示例6: if

void
MPTerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
    if ( change.getAction() == MapModelChange::BEGIN_BATCH_UPDATE )
    {
        _batchUpdateInProgress = true;
    }

    else if ( change.getAction() == MapModelChange::END_BATCH_UPDATE )
    {
        _batchUpdateInProgress = false;

        if ( _refreshRequired )
            refresh();

        if ( _shaderUpdateRequired )
            updateShaders();
    }

    else
    {
        // update the thread-safe map model copy:
        _update_mapf->sync();

        // dispatch the change handler
        if ( change.getLayer() )
        {
            // first inform the texture compositor with the new model changes:
            if ( _texCompositor.valid() && change.getImageLayer() )
            {
                _texCompositor->applyMapModelChange( change );
            }

            // then apply the actual change:
            switch( change.getAction() )
            {
            case MapModelChange::ADD_IMAGE_LAYER:
                addImageLayer( change.getImageLayer() );
                break;
            case MapModelChange::REMOVE_IMAGE_LAYER:
                removeImageLayer( change.getImageLayer() );
                break;
            case MapModelChange::ADD_ELEVATION_LAYER:
                addElevationLayer( change.getElevationLayer() );
                break;
            case MapModelChange::REMOVE_ELEVATION_LAYER:
                removeElevationLayer( change.getElevationLayer() );
                break;
            case MapModelChange::MOVE_IMAGE_LAYER:
                moveImageLayer( change.getFirstIndex(), change.getSecondIndex() );
                break;
            case MapModelChange::MOVE_ELEVATION_LAYER:
                moveElevationLayer( change.getFirstIndex(), change.getSecondIndex() );
                break;
            case MapModelChange::ADD_MODEL_LAYER:
            case MapModelChange::REMOVE_MODEL_LAYER:
            case MapModelChange::MOVE_MODEL_LAYER:
            default: 
                break;
            }
        }
    }
}
开发者ID:InterAtlas-ML,项目名称:osgearth,代码行数:63,代码来源:MPTerrainEngineNode.cpp


注:本文中的MapModelChange::getFirstIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。