本文整理汇总了C++中osg::ref_ptr::addParent方法的典型用法代码示例。如果您正苦于以下问题:C++ ref_ptr::addParent方法的具体用法?C++ ref_ptr::addParent怎么用?C++ ref_ptr::addParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::ref_ptr
的用法示例。
在下文中一共展示了ref_ptr::addParent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addAfterIdx
bool ossimPlanetTextureLayerGroup::addAfterIdx(ossim_int32 idx,
osg::ref_ptr<ossimPlanetTextureLayer> layer,
bool notifyFlag)
{
bool result = false;
theChildrenListMutex.lock();
if(containsLayerNoMutex(layer))
{
return result;
}
if(idx == -1)
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenList.insert(theChildrenList.begin(), layer);
theChildrenListMutex.unlock();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
else if(idx < theChildrenList.size())
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenList.insert(theChildrenList.begin()+idx+1, layer);
theChildrenListMutex.unlock();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
else if(idx == theChildrenList.size())
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenList.push_back(layer.get());
theChildrenListMutex.unlock();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
else
{
theChildrenListMutex.unlock();
}
return result;
}
示例2: addBottom
bool ossimPlanetTextureLayerGroup::addBottom(osg::ref_ptr<ossimPlanetTextureLayer> layer,
bool notifyFlag)
{
bool result = false;
if(layer.valid())
{
if(!containsLayerNoMutex(layer))
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenListMutex.lock();
theChildrenList.push_back(layer);
theChildrenListMutex.unlock();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
}
return result;
}
示例3: addTop
bool ossimPlanetTextureLayerGroup::addTop(osg::ref_ptr<ossimPlanetTextureLayer> layer,
bool notifyFlag)
{
if(layer.get() == this) return false;
// OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theChildrenListMutex);
bool result = false;
if(layer.valid())
{
if(!containsLayer(layer))
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenListMutex.lock();
theChildrenList.insert(theChildrenList.begin(), layer);
theChildrenListMutex.unlock();
dirtyExtents(); // notify parent layers
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
}
return result;
}
示例4: addBeforeIdx
bool ossimPlanetTextureLayerGroup::addBeforeIdx(ossim_uint32 idx,
osg::ref_ptr<ossimPlanetTextureLayer> layer,
bool notifyFlag)
{
bool result = false;
theChildrenListMutex.lock();
if((idx < theChildrenList.size())&&(!containsLayerNoMutex(layer)))
{
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenList.insert(theChildrenList.begin()+idx, layer);
theChildrenListMutex.unlock();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
else
{
theChildrenListMutex.unlock();
}
return result;
}
示例5: replaceLayer
bool ossimPlanetTextureLayerGroup::replaceLayer(ossim_uint32 idx,
osg::ref_ptr<ossimPlanetTextureLayer> layer,
bool notifyFlag)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theChildrenListMutex);
bool result = false;
if(layer.valid()&&idx < theChildrenList.size())
{
if(!containsLayerNoMutex(layer))
{
if(theChildrenList[idx].valid())
{
theChildrenList[idx]->removeCallback(theChildListener);
theChildrenList[idx]->removeParent(this);
}
layer->addParent(this);
layer->addCallback(theChildListener);
theChildrenList[idx] = layer.get();
dirtyExtents();
dirtyStats();
result = true;
if(notifyFlag)
{
notifyLayerAdded(layer);
}
}
}
return result;
}