本文整理汇总了C++中MapModelChange类的典型用法代码示例。如果您正苦于以下问题:C++ MapModelChange类的具体用法?C++ MapModelChange怎么用?C++ MapModelChange使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MapModelChange类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
}
示例2: 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;
}
}
}
}
示例3: 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;
}
}