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


C++ Pointer::get方法代码示例

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


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

示例1: InstantiateFilter

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
AbstractFilter::Pointer InstantiateFilter(QString filtName)
{
  // Now instantiate the PhWriter Filter from the FilterManager
  FilterManager* fm = FilterManager::Instance();
  IFilterFactory::Pointer filterFactory = fm->getFactoryForFilter(filtName);
  if (NULL == filterFactory.get() )
  {
    std::stringstream ss;
    ss << "The OrientationTransformTest Requires the use of the " << filtName.toStdString() << " filter. Did the plugins load?";
    DREAM3D_TEST_THROW_EXCEPTION(ss.str())
  }
开发者ID:kglowins,项目名称:DREAM3D,代码行数:14,代码来源:OrientationTransformsTest.cpp

示例2: TestFilterAvailability

 // -----------------------------------------------------------------------------
 //
 // -----------------------------------------------------------------------------
 int TestFilterAvailability()
 {
   // Now instantiate the PhWriter Filter from the FilterManager
   QString filtName = "PhWriter";
   FilterManager* fm = FilterManager::Instance();
   IFilterFactory::Pointer filterFactory = fm->getFactoryForFilter(filtName);
   if (NULL == filterFactory.get() )
   {
     std::stringstream ss;
     ss << "The PhIOTest Requires the use of the " << filtName.toStdString() << " filter which is found in the IO Plugin";
     DREAM3D_TEST_THROW_EXCEPTION(ss.str())
   }
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:15,代码来源:PhIOTest.cpp

示例3: TestFilterAvailability

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int TestFilterAvailability()
{
  // Now instantiate the ReadCtfData Filter from the FilterManager
  QString filtName = "ReadCtfData";
  FilterManager* fm = FilterManager::Instance();
  IFilterFactory::Pointer filterFactory = fm->getFactoryForFilter(filtName);
  if (NULL == filterFactory.get())
  {
    std::stringstream ss;
    ss << "The CtfCachingTest requires the use of the " << filtName.toStdString() << " filter which is found in the OrientationAnalysis Plugin";
    DREAM3D_TEST_THROW_EXCEPTION(ss.str())
  }
开发者ID:kglowins,项目名称:DREAM3D,代码行数:15,代码来源:CtfCachingTest.cpp

示例4: instantiateFilter

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void PipelineViewEntry::instantiateFilter(const QString& filterClassName)
{
  FilterManager::Pointer fm = FilterManager::Instance();
  if(NULL == fm.get() ) { return; }
  IFilterFactory::Pointer ff = fm->getFactoryForFilter(filterClassName);
  if (NULL == ff.get()) { return; }

  // Create an instance of the filter. Since we are dealing with the AbstractFilter interface we can not
  // actually use the actual filter class. We are going to have to rely on QProperties or Signals/Slots
  // to communicate changes back to the filter.
  m_Filter = ff->create();
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:15,代码来源:PipelineViewEntry.cpp

示例5: readExistingPipelineFromFile

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int DataContainerReader::readExistingPipelineFromFile(hid_t fileId)
{
  herr_t err = 0;
  m_PipelineFromFile->clear();

  H5FilterParametersReader::Pointer reader = H5FilterParametersReader::New();

  // HDF5: Open the "Pipeline" Group
  hid_t pipelineGroupId = H5Gopen(fileId, DREAM3D::StringConstants::PipelineGroupName.toLatin1().data(), H5P_DEFAULT);
  reader->setPipelineGroupId(pipelineGroupId);

  // Use QH5Lite to ask how many "groups" are in the "Pipeline Group"
  QList<QString> groupList;
  err = QH5Utilities::getGroupObjects(pipelineGroupId, H5Utilities::H5Support_GROUP, groupList);

  // Loop over the items getting the "ClassName" attribute from each group
  QString classNameStr = "";
  for (int32_t i = 0; i < groupList.size(); i++)
  {
    QString ss = QString::number(i, 10);

    err = QH5Lite::readStringAttribute(pipelineGroupId, ss, "ClassName", classNameStr);
    if (err < 0)
    {
      qDebug() << "Filter Index = " << i;
    }
    // Instantiate a new filter using the FilterFactory based on the value of the className attribute
    FilterManager* fm = FilterManager::Instance();
    IFilterFactory::Pointer ff = fm->getFactoryForFilter(classNameStr);
    if (NULL != ff.get())
    {
      AbstractFilter::Pointer filter = ff->create();
      if (NULL != filter.get())
      {
        // Read the parameters
        filter->readFilterParameters( reader.get(), i);

        // Add filter to m_PipelineFromFile
        m_PipelineFromFile->pushBack(filter);
      }
    }
  }
  err = H5Gclose(pipelineGroupId);
  return err;
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:48,代码来源:DataContainerReader.cpp

示例6: ReadPipelineFromFile

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
FilterPipeline::Pointer JsonFilterParametersReader::ReadPipelineFromFile(QString filePath, IObserver* obs)
{
    QFileInfo fInfo(filePath);

    if (filePath.isEmpty() == true)
    {
        return FilterPipeline::NullPointer();
    }
    QFileInfo fi(filePath);
    if (fi.exists() == false)
    {
        return FilterPipeline::NullPointer();
    }

    FilterManager* filtManager = FilterManager::Instance();
    FilterFactory<EmptyFilter>::Pointer emptyFilterFactory = FilterFactory<EmptyFilter>::New();
    filtManager->addFilterFactory("EmptyFilter", emptyFilterFactory);

    JsonFilterParametersReader::Pointer reader = JsonFilterParametersReader::New();
    int err = reader->openFile(filePath);

    if (err < 0)
    {
        if (NULL != obs)
        {
            PipelineMessage pm(JsonFilterParametersReader::ClassName(), "File '" + fInfo.fileName() + "' could not be opened for reading.", -1, PipelineMessage::Error);
            obs->processPipelineMessage(pm);
        }
        return FilterPipeline::NullPointer();
    }

    reader->openGroup(DREAM3D::Settings::PipelineBuilderGroup);
    int filterCount = reader->readValue(DREAM3D::Settings::NumFilters, 0);
    reader->closeGroup();

    FilterPipeline::Pointer pipeline = FilterPipeline::New();

    for (int i = 0; i < filterCount; ++i)
    {
        // Open the group to get the name of the filter then close again.
        reader->openFilterGroup(NULL, i);
        QString filterName = reader->readString(DREAM3D::Settings::FilterName, "");
        reader->closeFilterGroup();
        //qDebug() << "Group: " << gName << " FilterName: " << filterName;
        if (filterName.isEmpty() == false)
        {
            IFilterFactory::Pointer factory = filtManager->getFactoryForFilter(filterName);
            if (factory.get() != NULL)
            {
                AbstractFilter::Pointer filter = factory->create();

                if (NULL != filter.get())
                {
                    filter->readFilterParameters(reader.get(), i);
                    pipeline->pushBack(filter);
                }
            }
            else // Could not find the filter because the specific name has not been registered. This could
                // be due to a name change for the filter.
            {
                EmptyFilter::Pointer filter = EmptyFilter::New();
                QString humanLabel = QString("UNKNOWN FILTER: ") + filterName;
                filter->setHumanLabel(humanLabel);
                filter->setOriginalFilterName(filterName);
                pipeline->pushBack(filter);

                if (NULL != obs)
                {
                    QString ss = QObject::tr("An implementation for filter '%1' could not be located. Possible reasons include a name change of the filter, plugin not loading or a simple spelling mistake? A blank filter has been inserted in its place.").arg(filterName);
                    PipelineMessage pm(filterName, ss, -66066, PipelineMessage::Error);
                    pm.setPrefix("JsonFilterParametersReader::ReadPipelineFromFile()");
                    obs->processPipelineMessage(pm);
                }
            }
        }
        else
        {
            EmptyFilter::Pointer filter = EmptyFilter::New();
            QString humanLabel = QString("MISSING FILTER: ") + filterName;
            filter->setHumanLabel(humanLabel);
            filter->setOriginalFilterName(filterName);
            pipeline->pushBack(filter);

            if (NULL != obs)
            {
                QString gName = QString::number(i);
                QString ss = QObject::tr("A filter for index '%1' is missing in the file. Is the numbering of the filters correct in the pipeline file?").arg(gName);
                PipelineMessage pm(filterName, ss, -66067, PipelineMessage::Error);
                pm.setPrefix("JsonFilterParametersReader::ReadPipelineFromFile()");
                obs->processPipelineMessage(pm);
            }
        }
    }
    return pipeline;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:98,代码来源:JsonFilterParametersReader.cpp


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