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


C++ Filename::getFullPathAndName方法代码示例

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


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

示例1: execute

bool DeriveProduct::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
   StepResource pStep("Execute Wizard Item", "app", "58FE5CAB-E941-4E60-BA55-B29D70715FC4");
   pStep->addProperty("Item", getName());
   mpStep = pStep.get();

   if (!extractInputArgs(pInArgList))
   {
      reportError("Unable to extract input arguments.", "5E158F48-6089-4A88-ABD0-55C717BD13E2");
      return false;
   }
   View* pView = pInArgList->getPlugInArgValue<View>("View");
   if (pView == NULL)
   {
      std::vector<Window*> windows;
      Service<DesktopServices>()->getWindows(SPATIAL_DATA_WINDOW, windows);
      if (!windows.empty())
      {
         pView = static_cast<SpatialDataWindow*>(windows.front())->getSpatialDataView();
      }
   }
   if (pView == NULL)
   {
      reportError("No view provided.", "852F585B-D239-4C0A-B993-70EE68EC8DEE");
      return false;
   }

   ProductWindow* pProductWindow = Service<DesktopServices>()->deriveProduct(pView);
   if (pProductWindow == NULL)
   {
      reportError("Unable to derive product", "E24BB5A5-A675-4897-9C48-A4E4109379DF");
      return false;
   }

   // Load a template if one is specified
   Filename* pTemplate = pInArgList->getPlugInArgValue<Filename>("Template");
   if (pTemplate != NULL)
   {
      if (!pProductWindow->getProductView()->loadTemplate(pTemplate->getFullPathAndName()))
      {
         reportError("Could not load the requested template!", "C99CE97E-3F0F-4CBB-8460-28D96D55596B");
         return false;
      }
   }

   // Set the output values
   if (!pOutArgList->setPlugInArgValue("Window", pProductWindow) ||
      !pOutArgList->setPlugInArgValue("View", pProductWindow->getProductView()))
   {
      reportError("Could not set the data set output value!", "3C53EDAE-DC70-4141-9759-ECD3EB9BE186");
      return false;
   }

   reportComplete();
   pStep->finalize(Message::Success);
   return true;
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:57,代码来源:DeriveProduct.cpp

示例2: extractInputArgs

bool WavelengthExporter::extractInputArgs(PlugInArgList* pArgList)
{
   VERIFY(pArgList != NULL);

   mpProgress = pArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());

   mpWavelengths = pArgList->getPlugInArgValue<Wavelengths>(Wavelengths::WavelengthsArg());
   if (mpWavelengths == NULL)
   {
      string message = "The " + Wavelengths::WavelengthsArg() + " input value is invalid.";
      if (mpProgress != NULL)
      {
         mpProgress->updateProgress(message, 0, ERRORS);
      }

      mpStep->finalize(Message::Failure, message);
      return false;
   }

   Filename* pFilename = pArgList->getPlugInArgValue<Filename>(Wavelengths::WavelengthFileArg());
   if (pFilename == NULL)
   {
      string message = "The " + Wavelengths::WavelengthFileArg() + " input value is not present.";
      if (mpProgress != NULL)
      {
         mpProgress->updateProgress(message, 0, ERRORS);
      }

      mpStep->finalize(Message::Failure, message);
      return false;
   }

   mFilename = pFilename->getFullPathAndName();
   if (mFilename.empty() == true)
   {
      string message = "The " + Wavelengths::WavelengthFileArg() + " input value is invalid.";
      if (mpProgress != NULL)
      {
         mpProgress->updateProgress(message, 0, ERRORS);
      }

      mpStep->finalize(Message::Failure, message);
      return false;
   }

   return true;
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:47,代码来源:WavelengthExporter.cpp

示例3: execute

bool ResamplerPlugIn::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
   VERIFY(pInArgList != NULL && pOutArgList != NULL);
   ProgressTracker progress(pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg()),
      "Executing Spectral Resampler.", "spectral", "{88CD3E49-A522-431A-AE2A-96A6B2EB4012}");

   Service<DesktopServices> pDesktop;

   const DataElement* pElement(NULL);
   std::string waveFilename;

   // get default resampling options from user config
   std::string resampleMethod = ResamplerOptions::getSettingResamplerMethod();
   double dropOutWindow = ResamplerOptions::getSettingDropOutWindow();
   double fwhm = ResamplerOptions::getSettingFullWidthHalfMax();
   bool useFillValue = ResamplerOptions::getSettingUseFillValue();
   double fillValue = ResamplerOptions::getSettingSignatureFillValue();

   std::vector<Signature*> originalSignatures;
   std::auto_ptr<std::vector<Signature*> > pResampledSignatures(new std::vector<Signature*>);
   std::string errorMsg;

   if (isBatch())
   {
      VERIFY(pInArgList->getPlugInArgValue("Signatures to resample", originalSignatures));
      if (originalSignatures.empty())
      {
         Signature* pSignature = pInArgList->getPlugInArgValue<Signature>("Signature to resample");
         if (pSignature != NULL)
         {
            originalSignatures.push_back(pSignature);
         }
      }
      if (originalSignatures.empty())
      {
         progress.report("No signatures are available to be resampled.", 0, ERRORS, true);
         return false;
      }
      pElement = pInArgList->getPlugInArgValue<DataElement>("Data element wavelength source");
      Filename* pWaveFilename = pInArgList->getPlugInArgValue<Filename>("Wavelengths Filename");
      if (pWaveFilename != NULL)
      {
         waveFilename = pWaveFilename->getFullPathAndName();
      }
      VERIFY(pInArgList->getPlugInArgValue("Resampling Method", resampleMethod));
      VERIFY(pInArgList->getPlugInArgValue("Drop out window", dropOutWindow));
      VERIFY(pInArgList->getPlugInArgValue("FWHM", fwhm));
      VERIFY(pInArgList->getPlugInArgValue("Use fill value", useFillValue));
      VERIFY(pInArgList->getPlugInArgValue("Fill value", fillValue));
   }
   else
   {
      ResamplerPlugInDlg dlg(pDesktop->getMainWidget());
      if (dlg.exec() == QDialog::Rejected)
      {
         progress.report("User canceled resampling.", 0, ABORT, true);
         progress.upALevel();
         return false;
      }
      originalSignatures = dlg.getSignaturesToResample();
      resampleMethod = dlg.getResamplingMethod();
      dropOutWindow = dlg.getDropOutWindow();
      fwhm = dlg.getFWHM();
      useFillValue = dlg.getUseFillValue();
      fillValue = dlg.getFillValue();
      pElement = dlg.getWavelengthsElement();
      waveFilename = dlg.getWavelengthsFilename();
   }

   std::string resampledTo;
   FactoryResource<Wavelengths> pWavelengths;
   if (pElement != NULL)  // try loading wavelengths from user specified data element
   {
      if (getWavelengthsFromElement(pElement, pWavelengths.get(), errorMsg) == false)
      {
         progress.report(errorMsg, 0, ERRORS, true);
         return false;
      }
      resampledTo = pElement->getName();
   }
   else if (waveFilename.empty() == false)  // if no user provided raster, look for a wavelengths file
   {
      if (QFile::exists(QString::fromStdString(waveFilename)))
      {
         if (getWavelengthsFromFile(waveFilename, pWavelengths.get(), errorMsg) == false)
         {
            progress.report(errorMsg, 0, ERRORS, true);
            return false;
         }
      }
      else
      {
         errorMsg = "The wavelengths file \"" + waveFilename + "\" could not be found.";
         progress.report(errorMsg, 0, ERRORS, true);
         return false;
      }
      resampledTo = waveFilename;
   }
   else  // if no wavelength source provided, look for raster in current active spatial data view
   {
//.........这里部分代码省略.........
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:101,代码来源:ResamplerPlugIn.cpp

示例4: execute

bool WavelengthExporter::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
   if (pInArgList == NULL)
   {
      return false;
   }

   StepResource pStep(string("Execute ") + getName(), "Spectral", "B6112093-AE6A-4319-85D8-B7A4C1E3DC5E");

   // Extract the input args
   Progress* pProgress = pInArgList->getPlugInArgValue<Progress>(Executable::ProgressArg());

   DynamicObject* pWavelengthData = pInArgList->getPlugInArgValue<DynamicObject>(Wavelengths::WavelengthsArg());
   if (pWavelengthData == NULL)
   {
      string message = "The " + Wavelengths::WavelengthsArg() + " input value is invalid.";
      if (pProgress != NULL)
      {
         pProgress->updateProgress(message, 0, ERRORS);
      }

      pStep->finalize(Message::Failure, message);
      return false;
   }

   Filename* pFilename = pInArgList->getPlugInArgValue<Filename>(Wavelengths::WavelengthFileArg());
   if (pFilename == NULL)
   {
      string message = "The " + Wavelengths::WavelengthFileArg() + " input value is not present.";
      if (pProgress != NULL)
      {
         pProgress->updateProgress(message, 0, ERRORS);
      }

      pStep->finalize(Message::Failure, message);
      return false;
   }

   mFilename = pFilename->getFullPathAndName();
   if (mFilename.empty() == true)
   {
      string message = "The " + Wavelengths::WavelengthFileArg() + " input value is invalid.";
      if (pProgress != NULL)
      {
         pProgress->updateProgress(message, 0, ERRORS);
      }

      pStep->finalize(Message::Failure, message);
      return false;
   }

   // Save the wavelength values
   Wavelengths wavelengths(pWavelengthData);

   bool bSuccess = saveWavelengths(wavelengths);
   if (bSuccess == false)
   {
      string message = "Could not save the wavelengths to the file.";
      if (pProgress != NULL)
      {
         pProgress->updateProgress(message, 0, ERRORS);
      }

      pStep->finalize(Message::Failure, message);
      return false;
   }

   if (pProgress != NULL)
   {
      pProgress->updateProgress("Wavelength export completed successfully.", 100, NORMAL);
   }

   pStep->finalize(Message::Success);
   return true;
}
开发者ID:yuguess,项目名称:GSoC,代码行数:75,代码来源:WavelengthExporter.cpp

示例5: extractInputArgs

bool ElmBatch::extractInputArgs(PlugInArgList* pInputArgList)
{
   if (ElmCore::extractInputArgs(pInputArgList) == false)
   {
      return false;
   }

   StepResource pStep("Extract Batch Input Args", "app", "32A136BE-8531-42ca-8B22-086293B5A925");
   VERIFY(pStep.get() != NULL);

   // Get the Use Gains/Offsets Flag.
   if (pInputArgList->getPlugInArgValue<bool>(UseGainsOffsetsArg(), mUseGainsOffsets) == false)
   {
      pStep->finalize(Message::Failure, "The \"" + UseGainsOffsetsArg() + "\" input arg is invalid.");
      if (mpProgress != NULL)
      {
         mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
      }

      return false;
   }

   if (mUseGainsOffsets == true)
   {
      // If the Use Gains/Offsets Flag is set to true, get the Gains/Offsets Filename.
      Filename* pFilename = pInputArgList->getPlugInArgValue<Filename>(GainsOffsetsFilenameArg());
      if (pFilename == NULL || pFilename->getFullPathAndName().empty() == true)
      {
         // If the Gains/Offsets Filename is not set, use the default.
         mGainsOffsetsFilename = getDefaultGainsOffsetsFilename();
      }
      else if (pFilename->isDirectory() == true)
      {
         pStep->finalize(Message::Failure, "The \"" + GainsOffsetsFilenameArg() + "\" cannot be a directory.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }
      else
      {
         mGainsOffsetsFilename = pFilename->getFullPathAndName();
      }
   }
   else
   {
      // If the Use Gains/Offsets Flag is set to false, get the Signature Filenames and AOI Filenames.
      vector<Filename*> pSignatureFilenames;
      if (pInputArgList->getPlugInArgValue<vector<Filename*> >
         (SignatureFilenamesArg(), pSignatureFilenames) == false)
      {
         pStep->finalize(Message::Failure, "The \"" + SignatureFilenamesArg() + "\" input arg is invalid.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }

      for (vector<Filename*>::iterator iter = pSignatureFilenames.begin(); iter != pSignatureFilenames.end(); ++iter)
      {
         bool previouslyLoaded;
         Signature* pSignature = dynamic_cast<Signature*>
            (getElement(*iter, "Signature", NULL, previouslyLoaded));
         if (pSignature == NULL)
         {
            pStep->finalize(Message::Failure, "The \"" + SignatureFilenamesArg() +
               "\" input arg contains an invalid value.");
            if (mpProgress != NULL)
            {
               mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
            }

            return false;
         }

         mpSignatures.push_back(pSignature);
         if (previouslyLoaded == false)
         {
            mpSignaturesToDestroy.push_back(pSignature);
         }
      }

      // Get the AOI names.
      vector<Filename*> pAoiFilenames;
      if (pInputArgList->getPlugInArgValue<vector<Filename*> >(AoiFilenamesArg(), pAoiFilenames) == false)
      {
         pStep->finalize(Message::Failure, "The \"" + AoiFilenamesArg() + "\" input arg is invalid.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }

      for (vector<Filename*>::iterator iter = pAoiFilenames.begin(); iter != pAoiFilenames.end(); ++iter)
//.........这里部分代码省略.........
开发者ID:yuguess,项目名称:GSoC,代码行数:101,代码来源:ElmBatch.cpp


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