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


C++ ref_ptr::addParent方法代码示例

本文整理汇总了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;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:59,代码来源:ossimPlanetTextureLayerGroup.cpp

示例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;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:25,代码来源:ossimPlanetTextureLayerGroup.cpp

示例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;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:28,代码来源:ossimPlanetTextureLayerGroup.cpp

示例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;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:28,代码来源:ossimPlanetTextureLayerGroup.cpp

示例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;
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:30,代码来源:ossimPlanetTextureLayerGroup.cpp


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