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


C++ attributematrix::Pointer类代码示例

本文整理汇总了C++中attributematrix::Pointer的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: renameAttributeMatrix

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
bool DataContainer::renameAttributeMatrix(const QString& oldname, const QString& newname, bool overwrite)
{
  QMap<QString, AttributeMatrix::Pointer>::iterator it;
  it =  m_AttributeMatrices.find(oldname);
  if ( it == m_AttributeMatrices.end() )
  {
    return false;
  }
  AttributeMatrix::Pointer p = it.value();
  p->setName(newname);
  removeAttributeMatrix(oldname);

  // Now check to make sure there isn't one with the same name
  it =  m_AttributeMatrices.find(newname);
  if ( it == m_AttributeMatrices.end() ) // Didn't find another AttributeMatrix with the new name
  {
    addAttributeMatrix(newname, p);
  }
  else if(overwrite == true) // We are here because we found another attribute matrix with the new name
  {
    AttributeMatrix::Pointer removedAttributeMatrix = removeAttributeMatrix(newname); // Remove the existing one
    addAttributeMatrix(newname, p);
  }
  else
  {
    return false;
  }
  return true;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:32,代码来源:DataContainer.cpp

示例2: dataCheck

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void EstablishShapeTypes::dataCheck()
{
  setErrorCondition(0);
  DataArrayPath tempPath;

  DataContainerArray::Pointer dca = getDataContainerArray();

  QVector<size_t> cDims(1, 1);
  m_PhaseTypesPtr = dca->getPrereqArrayFromPath<DataArray<uint32_t>, AbstractFilter>(this, getInputPhaseTypesArrayPath(), cDims);
  if( NULL != m_PhaseTypesPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
  { m_PhaseTypes = m_PhaseTypesPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */

  // Get the DataContainer first - same as phase types
  DataContainer::Pointer m = dca->getPrereqDataContainer<AbstractFilter>(this, getInputPhaseTypesArrayPath().getDataContainerName());
  if(getErrorCondition() < 0) { return; }

  // Now get the AttributeMatrix that the user wants to use to store the ShapeTypes array - same as phase types
  AttributeMatrix::Pointer cellEnsembleAttrMat = m->getPrereqAttributeMatrix<AbstractFilter>(this, getInputPhaseTypesArrayPath().getAttributeMatrixName(), -990);
  if(getErrorCondition() < 0 || NULL == cellEnsembleAttrMat.get()) { return; }
  // Now create the output Shape Types Array
  tempPath.update(getInputPhaseTypesArrayPath().getDataContainerName(), getInputPhaseTypesArrayPath().getAttributeMatrixName(), getShapeTypesArrayName() );
  m_ShapeTypesPtr = getDataContainerArray()->createNonPrereqArrayFromPath<UInt32ArrayType, AbstractFilter>(this, tempPath, true, cDims); /* Assigns the shared_ptr<>(this, tempPath, true, dims); Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
  if( NULL != m_ShapeTypesPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
  { m_ShapeTypes = m_ShapeTypesPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
开发者ID:ricortiz,项目名称:DREAM3D,代码行数:28,代码来源:EstablishShapeTypes.cpp

示例3: gatherStatsData

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int BoundaryPhaseWidget::gatherStatsData(AttributeMatrix::Pointer attrMat)
{
  if (m_PhaseIndex < 1)
  {
    QMessageBox::critical(this, tr("StatsGenerator"),
                          tr("The Phase Index is Less than 1. This is not allowed."),
                          QMessageBox::Default);
    return -1;
  }
  int retErr = 0;
  float calcPhaseFraction = m_PhaseFraction / m_TotalPhaseFraction;

  //size_t ensembles = attrMat->getNumTuples();

  // Get pointers
  IDataArray::Pointer iDataArray = attrMat->getAttributeArray(DREAM3D::EnsembleData::CrystalStructures);
  unsigned int* crystalStructures = boost::dynamic_pointer_cast< UInt32ArrayType >(iDataArray)->getPointer(0);
  iDataArray = attrMat->getAttributeArray(DREAM3D::EnsembleData::PhaseTypes);
  unsigned int* phaseTypes = boost::dynamic_pointer_cast< UInt32ArrayType >(iDataArray)->getPointer(0);

  crystalStructures[m_PhaseIndex] = m_CrystalStructure;
  phaseTypes[m_PhaseIndex] = m_PhaseType;

  StatsDataArray* statsDataArray = StatsDataArray::SafeObjectDownCast<IDataArray*, StatsDataArray*>(attrMat->getAttributeArray(DREAM3D::EnsembleData::Statistics).get());
  if (NULL != statsDataArray)
  {
    StatsData::Pointer statsData = statsDataArray->getStatsData(m_PhaseIndex);
    BoundaryStatsData* boundaryStatsData = BoundaryStatsData::SafePointerDownCast(statsData.get());

    boundaryStatsData->setPhaseFraction(calcPhaseFraction);
  }
  return retErr;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:36,代码来源:BoundaryPhaseWidget.cpp

示例4: extractStatsData

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void BoundaryPhaseWidget::extractStatsData(AttributeMatrix::Pointer attrMat, int index)
{

  setPhaseIndex(index);

  IDataArray::Pointer iDataArray = attrMat->getAttributeArray(DREAM3D::EnsembleData::CrystalStructures);
  unsigned int* attributeArray = boost::dynamic_pointer_cast< UInt32ArrayType >(iDataArray)->getPointer(0);
  m_CrystalStructure = attributeArray[index];

  iDataArray = attrMat->getAttributeArray(DREAM3D::EnsembleData::PhaseTypes);
  attributeArray = boost::dynamic_pointer_cast< UInt32ArrayType >(iDataArray)->getPointer(0);
  m_PhaseType = attributeArray[index];

  iDataArray = attrMat->getAttributeArray(DREAM3D::EnsembleData::Statistics);
  StatsDataArray* statsDataArray = StatsDataArray::SafeObjectDownCast<IDataArray*, StatsDataArray*>(iDataArray.get());
  if (statsDataArray == NULL)
  {
    return;
  }
  StatsData::Pointer statsData = statsDataArray->getStatsData(index);
  BoundaryStatsData* boundaryStatsData = BoundaryStatsData::SafePointerDownCast(statsData.get());

  m_PhaseFraction = boundaryStatsData->getPhaseFraction();

}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:28,代码来源:BoundaryPhaseWidget.cpp

示例5: dataCheck

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RegularGridSampleSurfaceMesh::dataCheck()
{
  setErrorCondition(0);
  DataArrayPath tempPath;

  DataContainer::Pointer m = getDataContainerArray()->createNonPrereqDataContainer<AbstractFilter>(this, getDataContainerName());
  if (getErrorCondition() < 0) { return; }

  ImageGeom::Pointer image = ImageGeom::CreateGeometry(DREAM3D::Geometry::ImageGeometry);
  m->setGeometry(image);

  // Set the Dimensions, Resolution and Origin of the output data container
  m->getGeometryAs<ImageGeom>()->setDimensions(m_XPoints, m_YPoints, m_ZPoints);
  m->getGeometryAs<ImageGeom>()->setResolution(m_Resolution.x, m_Resolution.y, m_Resolution.z);
  m->getGeometryAs<ImageGeom>()->setOrigin(m_Origin.x, m_Origin.y, m_Origin.z);

  QVector<size_t> tDims(3, 0);
  tDims[0] = m_XPoints;
  tDims[1] = m_YPoints;
  tDims[2] = m_ZPoints;
  AttributeMatrix::Pointer cellAttrMat = m->createNonPrereqAttributeMatrix<AbstractFilter>(this, getCellAttributeMatrixName(), tDims, DREAM3D::AttributeMatrixType::Cell);
  if (getErrorCondition() < 0 || NULL == cellAttrMat.get()) { return; }

  QVector<size_t> cDims(1, 1);
  tempPath.update(getDataContainerName(), getCellAttributeMatrixName(), getFeatureIdsArrayName() );
  m_FeatureIdsPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter, int32_t>(this, tempPath, 0, cDims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
  if( NULL != m_FeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
  { m_FeatureIds = m_FeatureIdsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
开发者ID:ricortiz,项目名称:DREAM3D,代码行数:32,代码来源:RegularGridSampleSurfaceMesh.cpp

示例6: dataCheck

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void CopyAttributeArray::dataCheck()
{
  setErrorCondition(0);

  if(m_NewArrayName.isEmpty() == true)
  {
    setErrorCondition(-11009);
    QString ss = QObject::tr("The new Attribute Array name must be set");
    notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
    return;
  }

  QString daName = getSelectedArrayPath().getDataArrayName();

  IDataArray::Pointer dataArray = getDataContainerArray()->getPrereqIDataArrayFromPath<IDataArray, AbstractFilter>(this, getSelectedArrayPath());
  if(getErrorCondition() < 0) { return; }

  DataArrayPath path(getSelectedArrayPath().getDataContainerName(), getSelectedArrayPath().getAttributeMatrixName(), "");
  AttributeMatrix::Pointer attrMat = getDataContainerArray()->getAttributeMatrix(path);

  IDataArray::Pointer pNew = dataArray->deepCopy();
  pNew->setName(m_NewArrayName); // Set the name of the array
  int32_t err = attrMat->addAttributeArray(m_NewArrayName, pNew);

  if (0 != err)
  {
    setErrorCondition(err);
    QString ss = QObject::tr("Attempt to copy Attribute Array '%1' to '%2' failed").arg(daName).arg(m_NewArrayName);
    notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
  }
}
开发者ID:dream3d,项目名称:UCSBUtilities,代码行数:34,代码来源:CopyAttributeArray.cpp

示例7: PopulateAttributeMatrixComboBox

    static void PopulateAttributeMatrixComboBox(AbstractFilter* filter, FilterParameter* filterParameter,
                                            QComboBox* dcCombo, QComboBox* amCombo,
                                            DataContainerArrayProxy& dcaProxy)
    {
      FilterParameterType* fp = dynamic_cast<FilterParameterType*>(filterParameter);
      assert(fp != NULL);
      DataContainerArray::Pointer dca = filter->getDataContainerArray();
      if (NULL == dca.get()) { return; }

      QString dcName = dcCombo->currentText();

      // Clear the AttributeMatrix List
      bool alreadyBlocked = false;
      if(amCombo->signalsBlocked()) { alreadyBlocked = true; }
      amCombo->blockSignals(true);
      amCombo->clear();

      // Loop over the data containers until we find the proper data container
      QList<DataContainerProxy> containers = dcaProxy.dataContainers.values();
      QListIterator<DataContainerProxy> containerIter(containers);
      QVector<unsigned int> defVec = fp->getDefaultAttributeMatrixTypes();
      while(containerIter.hasNext())
      {
        DataContainerProxy dc = containerIter.next();

        if(dc.name.compare(dcName) == 0 )
        {
          // We found the proper Data Container, now populate the AttributeMatrix List
          QMap<QString, AttributeMatrixProxy> attrMats = dc.attributeMatricies;
          QMapIterator<QString, AttributeMatrixProxy> attrMatsIter(attrMats);
          while(attrMatsIter.hasNext() )
          {
            attrMatsIter.next();
            QString amName = attrMatsIter.key();
            AttributeMatrix::Pointer am = dca->getAttributeMatrix(DataArrayPath(dc.name, amName, ""));
            amCombo->addItem(amName);

            if (NULL != am.get() && defVec.isEmpty() == false && defVec.contains(am->getType()) == false)
            {
              QStandardItemModel* model = qobject_cast<QStandardItemModel*>(amCombo->model());
              if (NULL != model)
              {
                QStandardItem* item = model->item(amCombo->findText(amName));
                if (NULL != item)
                {
                  item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
                }
              }
            }
          }
        }
      }

      if(!alreadyBlocked) { // Only unblock if this function blocked the signals.
        amCombo->blockSignals(false);
      }
    }
开发者ID:BlueQuartzSoftware,项目名称:SIMPLView,代码行数:57,代码来源:FilterParameterWidgetUtils.hpp

示例8: preflight

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ChangeResolution::preflight()
{
  setInPreflight(true);
  emit preflightAboutToExecute();
  emit updateFilterParameters(this);
  dataCheck();

  if (getErrorCondition() < 0)
  {
    emit preflightExecuted();
    setInPreflight(false);
    return;
  }

  DataContainer::Pointer m;
  if (m_SaveAsNewDataContainer == false)
  {
    m = getDataContainerArray()->getDataContainer(getCellAttributeMatrixPath().getDataContainerName());
  }
  else
  {
    m = getDataContainerArray()->getDataContainer(getNewDataContainerName());
  }

  size_t dims[3] = { 0, 0, 0 };
  m->getGeometryAs<ImageGeom>()->getDimensions(dims);

  float sizex = (dims[0]) * m->getGeometryAs<ImageGeom>()->getXRes();
  float sizey = (dims[1]) * m->getGeometryAs<ImageGeom>()->getYRes();
  float sizez = (dims[2]) * m->getGeometryAs<ImageGeom>()->getZRes();
  size_t m_XP = size_t(sizex / m_Resolution.x);
  size_t m_YP = size_t(sizey / m_Resolution.y);
  size_t m_ZP = size_t(sizez / m_Resolution.z);
  if (m_XP == 0) { m_XP = 1; }
  if (m_YP == 0) { m_YP = 1; }
  if (m_ZP == 0) { m_ZP = 1; }

  m->getGeometryAs<ImageGeom>()->setDimensions(m_XP, m_YP, m_ZP);
  m->getGeometryAs<ImageGeom>()->setResolution(m_Resolution.x, m_Resolution.y, m_Resolution.z);

  QVector<size_t> tDims(3, 0);
  tDims[0] = m_XP;
  tDims[1] = m_YP;
  tDims[2] = m_ZP;
  m->getAttributeMatrix(getCellAttributeMatrixPath().getAttributeMatrixName())->setTupleDimensions(tDims);

  if (m_RenumberFeatures == true)
  {
    AttributeMatrix::Pointer cellFeatureAttrMat = m->getAttributeMatrix(getCellFeatureAttributeMatrixPath().getAttributeMatrixName());
    QVector<bool> activeObjects(cellFeatureAttrMat->getNumTuples(), true);
    cellFeatureAttrMat->removeInactiveObjects(activeObjects, m_FeatureIdsPtr.lock());
  }
  emit preflightExecuted();
  setInPreflight(false);
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:58,代码来源:ChangeResolution.cpp

示例9: addAttributeMatrix

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void DataContainer::addAttributeMatrix(const QString& name, AttributeMatrix::Pointer data)
{
  if (data->getName().compare(name) != 0)
  {
    qDebug() << "Adding Attribute Matrix with different array name than key name";
    qDebug() << "Key name: " << name;
    qDebug() << "Array Name: " << data->getName();
    qDebug() << "This action is NOT typical of DREAM3D Usage. Are you sure you want to be doing this? We are forcing the name of the AttributeMatrix to be the same as the key";
    data->setName(name);
  }
  m_AttributeMatrices[name] = data;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:15,代码来源:DataContainer.cpp

示例10: execute

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void CombineAttributeMatrices::execute()
{
  setErrorCondition(0);
  dataCheck();
  if (getErrorCondition() < 0) { return; }

  DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getFirstAttributeMatrixPath().getDataContainerName());
  AttributeMatrix::Pointer firstAttrMat = m->getAttributeMatrix(getFirstAttributeMatrixPath().getAttributeMatrixName());
  AttributeMatrix::Pointer secondAttrMat = m->getAttributeMatrix(getSecondAttributeMatrixPath().getAttributeMatrixName());
  AttributeMatrix::Pointer combinedAttrMat = m->getAttributeMatrix(getCombinedAttributeMatrixName());
  size_t firstAttrMatNumTuples = firstAttrMat->getNumTuples();

  size_t totalTuples1 = m_SecondIndexPtr.lock()->getNumberOfTuples();
  size_t totalTuples2 = m_SecondIndexPtr.lock()->getNumberOfTuples();
  for (size_t i = 0; i < totalTuples1; i++)
  {
    if (m_FirstIndex > 0) { m_NewIndex[i] = m_FirstIndex[i]; }
  }
  for (size_t i = 0; i < totalTuples2; i++)
  {
    //subtract 1 from the index plus numTuples because the second index should be shifted to account for the zeroth tuple (all AMs above element start at tuple 1)
    if (m_SecondIndex[i] > 0 && m_NewIndex[i] == 0) m_NewIndex[i] = m_SecondIndex[i] + firstAttrMatNumTuples - 1;
    else if (m_SecondIndex[i] > 0 && m_NewIndex[i] != 0)
    {
      QString ss = QObject::tr("When copying the indices, the indices of the two attribute matrices overlapped.  The index of the first attribute matrix was kept.");
      notifyWarningMessage(getHumanLabel(), ss, -111);
    }
  }

  QList<QString> arrayNames = firstAttrMat->getAttributeArrayNames();
  size_t location = 0;
  for (QList<QString>::iterator iter = arrayNames.begin(); iter != arrayNames.end(); ++iter)
  {
    IDataArray::Pointer fromDataArray = firstAttrMat->getAttributeArray(*iter);
    IDataArray::Pointer toDataArray = combinedAttrMat->getAttributeArray(*iter);
    EXECUTE_FUNCTION_TEMPLATE(this, copyData, fromDataArray, fromDataArray, toDataArray, location);
  }

  arrayNames.clear();
  arrayNames = secondAttrMat->getAttributeArrayNames();
  location = firstAttrMatNumTuples;
  for (QList<QString>::iterator iter = arrayNames.begin(); iter != arrayNames.end(); ++iter)
  {
    IDataArray::Pointer fromDataArray = secondAttrMat->getAttributeArray(*iter);
    IDataArray::Pointer toDataArray = combinedAttrMat->getAttributeArray(*iter);
    EXECUTE_FUNCTION_TEMPLATE(this, copyData, fromDataArray, fromDataArray, toDataArray, location);
  }

  notifyStatusMessage(getHumanLabel(), "Complete");
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:53,代码来源:CombineAttributeMatrices.cpp

示例11: dataCheck

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RegularizeZSpacing::dataCheck()
{
    setErrorCondition(0);

    if (getNewZRes() <= 0)
    {
        QString ss = QObject::tr("The new Z resolution Y (%1) must be positive").arg(getNewZRes());
        setErrorCondition(-5555);
        notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
    }

    std::ifstream inFile;
    inFile.open(m_InputFile.toLatin1().data());

    if (!inFile.good())
    {
        QString ss = QObject::tr("Unable to open input file with name '%1'").arg(getInputFile());
        setErrorCondition(-5556);
        notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
        return;
    }

    ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, getCellAttributeMatrixPath().getDataContainerName());
    AttributeMatrix::Pointer cellAttrMat = getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, getCellAttributeMatrixPath(), -301);
    if(getErrorCondition() < 0) {
        return;
    }

    float zval = 0.0f;
    for (size_t iter = 0; iter < image->getZPoints() + 1; iter++)
    {
        inFile >> zval;
    }
    size_t zP = static_cast<size_t>(zval / getNewZRes());
    if(zP == 0) {
        zP = 1;
    }

    if (getInPreflight())
    {
        image->setDimensions(image->getXPoints(), image->getYPoints(), zP);
        QVector<size_t> tDims(3, 0);
        tDims[0] = image->getXPoints();
        tDims[1] = image->getYPoints();
        tDims[2] = zP;
        cellAttrMat->resizeAttributeArrays(tDims);
    }

    inFile.close();
}
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:53,代码来源:RegularizeZSpacing.cpp

示例12: dataCheck

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void MoveData::dataCheck()
{
  setErrorCondition(0);
  DataArrayPath amSrcPath = getAttributeMatrixSource();
  DataArrayPath amDestPath = getAttributeMatrixDestination();
  DataArrayPath daSrcPath = getDataArraySource();

  if (getWhatToMove() == k_MoveAttributeMatrix)
  {
    DataContainer::Pointer amDestDataContainer = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getDataContainerDestination());
    DataContainer::Pointer amSrcDataContainer = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, amSrcPath.getDataContainerName());
    AttributeMatrix::Pointer amSrcAttributeMatrix = getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, amSrcPath, -301);

    if(getErrorCondition() < 0) { return; }

    if (amSrcDataContainer->getName() == amDestDataContainer->getName())
    {
      QString ss = QObject::tr("The source and destination Data Container are the same.  Is this what you meant to do?");
      notifyWarningMessage(getHumanLabel(), ss, getErrorCondition());
      return;
    }

    amDestDataContainer->addAttributeMatrix(amSrcAttributeMatrix->getName(), amSrcAttributeMatrix);
    amSrcDataContainer->removeAttributeMatrix(amSrcAttributeMatrix->getName());
  }
  else if (getWhatToMove() == k_MoveDataArray )
  {
    AttributeMatrix::Pointer daSrcAttributeMatrix = getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, daSrcPath, -301);
    AttributeMatrix::Pointer daDestAttributeMatrix = getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, amDestPath, -301);
    IDataArray::Pointer daSrcDataArray = getDataContainerArray()->getPrereqIDataArrayFromPath<IDataArray, AbstractFilter>(this, daSrcPath);

    if(getErrorCondition() < 0) { return; }

    if (daDestAttributeMatrix->getNumTuples() != daSrcDataArray->getNumberOfTuples())
    {
      setErrorCondition(-11019);
      QString ss = QObject::tr("The number of tuples of source Attribute Array (%1) and destination Attribute Matrix (%2) do not match").arg(daSrcDataArray->getNumberOfTuples()).arg(daDestAttributeMatrix->getNumTuples());
      notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
      return;
    }
    else if (amSrcPath == amDestPath)
    {
      QString ss = QObject::tr("The source and destination Attribute Matrix are the same.  Is this what you meant to do?");
      notifyWarningMessage(getHumanLabel(), ss, getErrorCondition());
      return;
    }

    daDestAttributeMatrix->addAttributeArray(daSrcPath.getDataArrayName(), daSrcDataArray);
    daSrcAttributeMatrix->removeAttributeArray(daSrcPath.getDataArrayName());
  }
  else
  {
    setErrorCondition(-11020);
    QString ss = QObject::tr("Neither an Attribute Matrix nor an Attribute Array was selected to be moved");
    notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
    return;
  }
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:61,代码来源:MoveData.cpp

示例13: dap

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QVector<DataArrayPath> DataContainer::getAllDataArrayPaths()
{

  QVector<DataArrayPath> paths;
  for(QMap<QString, AttributeMatrix::Pointer>::iterator iter = m_AttributeMatrices.begin(); iter != m_AttributeMatrices.end(); ++iter)
  {
    AttributeMatrix::Pointer am = iter.value();
    QString amName = am->getName();
    QList<QString> aaNames = am->getAttributeArrayNames();

    foreach(QString aaName, aaNames)
    {
      DataArrayPath dap(getName(), amName, aaName);
      paths.push_back(dap);
    }
  }
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:19,代码来源:DataContainer.cpp

示例14: addAttributeMatrix

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void VertexGeom::addAttributeMatrix(const QString& name, AttributeMatrix::Pointer data)
{
  if (data->getType() != 0)
  {
    // VertexGeom can only accept vertex Attribute Matrices
    return;
  }
  if (data->getNumTuples() != getNumberOfElements())
  {
    return;
  }
  if (data->getName().compare(name) != 0)
  {
    data->setName(name);
  }
  m_AttributeMatrices[name] = data;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:20,代码来源:VertexGeom.cpp

示例15: deepCopy

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
AttributeMatrix::Pointer AttributeMatrix::deepCopy()
{
    AttributeMatrix::Pointer newAttrMat = AttributeMatrix::New(getTupleDimensions(), getName(), getType());

    for(QMap<QString, IDataArray::Pointer>::iterator iter = m_AttributeArrays.begin(); iter != m_AttributeArrays.end(); ++iter)
    {
        IDataArray::Pointer d = iter.value();
        IDataArray::Pointer new_d = d->deepCopy();
        if (new_d.get() == NULL)
        {
            return AttributeMatrix::NullPointer();
        }
        newAttrMat->addAttributeArray(new_d->getName(), new_d);
    }

    return newAttrMat;
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:20,代码来源:AttributeMatrix.cpp


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