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


C++ SpatialDataView::deleteLayer方法代码示例

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


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

示例1: destroyLayer

 void destroyLayer(Layer* pLayer)
 {
    SpatialDataView* pSdv = (pLayer == NULL) ? NULL : dynamic_cast<SpatialDataView*>(pLayer->getView());
    if (pSdv != NULL)
    {
       pSdv->deleteLayer(pLayer);
    }
 }
开发者ID:Siddharthk,项目名称:opticks,代码行数:8,代码来源:SimpleViews.cpp

示例2: createChipView

SpatialDataView* ChippingWindow::createChipView() const
{
   if (mpView == NULL)
   {
      return NULL;
   }

   SpatialDataView* pChipView = dynamic_cast<SpatialDataView*>(mpView->copy());
   if (pChipView != NULL)
   {
      vector<std::pair<View*, LinkType> > linkedViews;
      pChipView->getLinkedViews(linkedViews);
      for (unsigned int i = 0; i < linkedViews.size(); ++i)
      {
         if (linkedViews[i].second == NO_LINK)
         {
            continue;
         }

         pChipView->unlinkView(linkedViews[i].first);
      }

      LayerList* pLayerList = pChipView->getLayerList();
      if (pLayerList != NULL)
      {
         vector<Layer*> layers;
         pLayerList->getLayers(layers);
         for (unsigned int i = 0; i < layers.size(); i++)
         {
            Layer* pLayer = layers.at(i);
            if (dynamic_cast<RasterLayer*>(pLayer) == NULL)
            {
               pChipView->deleteLayer(pLayer);
            }
         }
      }
   }

   return pChipView;
}
开发者ID:wzssyqa,项目名称:opticks-cmake,代码行数:40,代码来源:ChippingWindow.cpp

示例3: displayPseudocolorResults

void AlgorithmPattern::displayPseudocolorResults(RasterElement* pRasterElement, std::vector<std::string>& sigNames,
                                                 Opticks::PixelOffset offset)
{
   REQUIRE(pRasterElement != NULL);

   SpatialDataView* pView = NULL;

   vector<Window*> windows;
   mpDesktopServices->getWindows(SPATIAL_DATA_WINDOW, windows);
   for (unsigned int j = 0; j < windows.size() && pView == NULL; j++)
   {
      SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(windows[j]);
      if (pWindow != NULL)
      {
         SpatialDataView* pCurrentView = pWindow->getSpatialDataView();
         if (pCurrentView != NULL)
         {
            LayerList* pLList = pCurrentView->getLayerList();
            REQUIRE(pLList != NULL);
            vector<Layer*> layers;
            pLList->getLayers(RASTER, layers);
            for (vector<Layer*>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
            {
               if (*layer != NULL && static_cast<RasterElement*>((*layer)->getDataElement()) == getRasterElement())
               {
                  pView = pCurrentView;
                  break;
               }
            }
         }
      }
   }

   REQUIRE(pView != NULL);

   PseudocolorLayer* pLayer = NULL;

   // Get or create a valid pseudocolor layer
   LayerList* pLayerList = pView->getLayerList();
   if (pLayerList != NULL)
   {
      pLayer = static_cast<PseudocolorLayer*>(pLayerList->getLayer(PSEUDOCOLOR, pRasterElement));
      if (pLayer == NULL)
      {
         pLayer = static_cast<PseudocolorLayer*>(pView->createLayer(PSEUDOCOLOR, pRasterElement));
      }

      // Remove existing layers of other types
      if (pLayer != NULL)
      {
         Layer* pThresholdLayer = pLayerList->getLayer(THRESHOLD, pRasterElement);
         if (pThresholdLayer != NULL)
         {
            pView->deleteLayer(pThresholdLayer);
         }

         Layer* pRasterLayer = pLayerList->getLayer(RASTER, pRasterElement);
         if (pRasterLayer != NULL)
         {
            pView->deleteLayer(pRasterLayer);
         }
      }
   }

   INVARIANT(pLayer != NULL);

   UndoLock lock(pView);

   int iSignatureCount = sigNames.size();

   vector<ColorType> layerColors;
   vector<ColorType> excludeColors;
   excludeColors.push_back(ColorType(0, 0, 0));
   excludeColors.push_back(ColorType(255, 255, 255));
   // 1 for each sig + no sigs + multiple sigs
   ColorType::getUniqueColors(iSignatureCount + 2, layerColors, excludeColors);

   pLayer->clear();

   for (int i = 0; i < iSignatureCount; i++)
   {
      pLayer->addInitializedClass(sigNames[i], i + 1, layerColors[i], true);
   }

   pLayer->addInitializedClass(std::string("Indeterminate"), -1, layerColors[iSignatureCount], true);
   pLayer->addInitializedClass(std::string("No match"), 0, layerColors[iSignatureCount + 1], false);
   pLayer->setXOffset(offset.mX);
   pLayer->setYOffset(offset.mY);
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:89,代码来源:AlgorithmPattern.cpp

示例4: displayThresholdResults

void AlgorithmPattern::displayThresholdResults(RasterElement* pRasterElement, ColorType color, PassArea passArea,
                                               double firstThreshold, double secondThreshold,
                                               Opticks::PixelOffset offset)
{
   REQUIRE(pRasterElement != NULL);

   SpatialDataView* pView = NULL;

   vector<Window*> windows;
   mpDesktopServices->getWindows(SPATIAL_DATA_WINDOW, windows);
   for (unsigned int i = 0; i < windows.size() && pView == NULL; i++)
   {
      SpatialDataWindow* pWindow = static_cast<SpatialDataWindow*>(windows[i]);
      if (pWindow != NULL)
      {
         SpatialDataView* pCurrentView = pWindow->getSpatialDataView();
         if (pCurrentView != NULL)
         {
            LayerList* pLList = pCurrentView->getLayerList();
            REQUIRE(pLList != NULL);
            vector<Layer*> layers;
            pLList->getLayers(RASTER, layers);
            for (vector<Layer*>::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
            {
               if (*layer != NULL && static_cast<RasterElement*>((*layer)->getDataElement()) == getRasterElement())
               {
                  pView = pCurrentView;
                  break;
               }
            }
         }
      }
   }

   REQUIRE(pView != NULL);

   ThresholdLayer* pLayer = NULL;

   // Get or create a valid threshold layer
   LayerList* pLayerList = pView->getLayerList();
   if (pLayerList != NULL)
   {
      pLayer = static_cast<ThresholdLayer*>(pLayerList->getLayer(THRESHOLD, pRasterElement));
      if (pLayer == NULL)
      {
         pLayer = static_cast<ThresholdLayer*>(pView->createLayer(THRESHOLD, pRasterElement));
      }

      // Remove existing layers of other types
      if (pLayer != NULL)
      {
         Layer* pRasterLayer = pLayerList->getLayer(RASTER, pRasterElement);
         if (pRasterLayer != NULL)
         {
            pView->deleteLayer(pRasterLayer);
         }

         Layer* pPseudocolorLayer = pLayerList->getLayer(PSEUDOCOLOR, pRasterElement);
         if (pPseudocolorLayer != NULL)
         {
            pView->deleteLayer(pPseudocolorLayer);
         }
      }
   }

   INVARIANT(pLayer != NULL);

   UndoLock lock(pView);

   if (color.isValid())
   {
      pLayer->setColor(color);
   }

   pLayer->setRegionUnits(RAW_VALUE);
   pLayer->setPassArea(passArea);
   pLayer->setFirstThreshold(firstThreshold);
   pLayer->setSecondThreshold(secondThreshold);
   pLayer->setXOffset(offset.mX);
   pLayer->setYOffset(offset.mY);
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:81,代码来源:AlgorithmPattern.cpp


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