Esempio n. 1
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
StatsDataArray::Pointer StatsDataArray::CreateArray(size_t numTuples, int rank, size_t* dims, const QString& name, bool allocate)
{
  if (name.isEmpty() == true)
  {
    return NullPointer();
  }
  StatsDataArray::Pointer ptr = StatsDataArray::New();
  ptr->setName(name);
  std::vector<unsigned int> phase_types(numTuples, DREAM3D::PhaseType::UnknownPhaseType);
  if(allocate) { ptr->fillArrayWithNewStatsData(numTuples, &(phase_types.front()) ); }
  return ptr;
}
Esempio n. 2
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
StatsDataArray::Pointer StatsDataArray::CreateArray(QVector<size_t> tDims, QVector<size_t> cDims, const QString& name, bool allocate)
{
  if (name.isEmpty() == true)
  {
    return NullPointer();
  }
  size_t numTuples = tDims[0];
  qint32 size = tDims.size();
  for(qint32 iter = 1; iter < size; iter++)
  {
    numTuples *= tDims[iter];
  }
  StatsDataArray::Pointer ptr = StatsDataArray::New();
  ptr->setName(name);
  std::vector<unsigned int> phase_types(numTuples, DREAM3D::PhaseType::UnknownPhaseType);
  if(allocate) { ptr->fillArrayWithNewStatsData(numTuples, &(phase_types.front()) ); }
  return ptr;
}