本文整理汇总了C++中MapModelChange::getAction方法的典型用法代码示例。如果您正苦于以下问题:C++ MapModelChange::getAction方法的具体用法?C++ MapModelChange::getAction怎么用?C++ MapModelChange::getAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapModelChange
的用法示例。
在下文中一共展示了MapModelChange::getAction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
TerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
if ( _initStage == INIT_POSTINIT_COMPLETE )
{
if ( change.getAction() == MapModelChange::ADD_IMAGE_LAYER )
{
change.getImageLayer()->addCallback( _imageLayerController.get() );
}
else if ( change.getAction() == MapModelChange::REMOVE_IMAGE_LAYER )
{
change.getImageLayer()->removeCallback( _imageLayerController.get() );
}
if (change.getAction() == MapModelChange::ADD_IMAGE_LAYER ||
change.getAction() == MapModelChange::REMOVE_IMAGE_LAYER ||
change.getAction() == MapModelChange::MOVE_IMAGE_LAYER )
{
updateImageUniforms();
}
}
// if post-initialization has not yet happened, we need to make sure the
// compositor is up to date with the map model. (After post-initialization,
// this happens in the subclass...something that probably needs to change
// since this is unclear)
else if ( _texCompositor.valid() && change.getImageLayer() )
{
_texCompositor->applyMapModelChange( change );
}
// notify that a redraw is required.
dirty();
}
示例2: 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;
}
示例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;
}
}
示例4: if
void
TerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
if (change.getAction() == MapModelChange::ADD_LAYER &&
change.getImageLayer() != 0L)
{
change.getImageLayer()->addCallback( _imageLayerController.get() );
}
else if (change.getAction() == MapModelChange::REMOVE_LAYER &&
change.getImageLayer() != 0L)
{
change.getImageLayer()->removeCallback( _imageLayerController.get() );
}
// notify that a redraw is required.
requestRedraw();
}
示例5: if
void
TerrainEngineNode::onMapModelChanged( const MapModelChange& change )
{
if ( _initStage == INIT_POSTINIT_COMPLETE )
{
if ( change.getAction() == MapModelChange::ADD_IMAGE_LAYER )
{
change.getImageLayer()->addCallback( _imageLayerController.get() );
}
else if ( change.getAction() == MapModelChange::REMOVE_IMAGE_LAYER )
{
change.getImageLayer()->removeCallback( _imageLayerController.get() );
}
}
// notify that a redraw is required.
requestRedraw();
}
示例6: 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 );
}
}
示例7: 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;
}
}
示例8: 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;
}
}
}
}
示例9: 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;
}
}
}
}
示例10: onMapModelChanged
void onMapModelChanged( const MapModelChange& change ) {
s_updateRequired = true;
s_changeAction = change.getAction();
}