本文整理汇总了C++中VectorOfFloatArray类的典型用法代码示例。如果您正苦于以下问题:C++ VectorOfFloatArray类的具体用法?C++ VectorOfFloatArray怎么用?C++ VectorOfFloatArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VectorOfFloatArray类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: readVectorOfArrays
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5PrimaryStatsDataDelegate::readMDFWeights(hid_t pid, PrimaryStatsData* data)
{
int err = 0;
FloatArrayType::Pointer angles = FloatArrayType::CreateArray(1, DREAM3D::HDF5::Angle);
FloatArrayType::Pointer axis = FloatArrayType::CreateArray(3, DREAM3D::HDF5::Axis);
axis->SetNumberOfComponents(3);
FloatArrayType::Pointer weight = FloatArrayType::CreateArray(1, DREAM3D::HDF5::Weight);
VectorOfFloatArray mdfWeights;
mdfWeights.push_back(angles);
mdfWeights.push_back(axis);
mdfWeights.push_back(weight);
hid_t groupId = H5Utilities::openHDF5Object(pid, DREAM3D::HDF5::MDFWeights);
if (groupId > 0)
{
err = readVectorOfArrays(groupId, mdfWeights);
if(err >= 0)
{
data->setMDF_Weights(mdfWeights);
}
}
err = H5Utilities::closeHDF5Object(groupId);
return err;
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:30,代码来源:H5PrimaryStatsDataDelegate.cpp
示例2: dims
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5PrimaryStatsDataDelegate::readMDFWeights(hid_t pid, PrimaryStatsData* data)
{
int err = 0;
QVector<size_t> dims(1, 1);
FloatArrayType::Pointer angles = FloatArrayType::CreateArray(1, dims, DREAM3D::StringConstants::Angle);
FloatArrayType::Pointer weight = FloatArrayType::CreateArray(1, DREAM3D::StringConstants::Weight);
dims[0] = 3;
FloatArrayType::Pointer axis = FloatArrayType::CreateArray(3, dims, DREAM3D::StringConstants::Axis);
VectorOfFloatArray mdfWeights;
mdfWeights.push_back(angles);
mdfWeights.push_back(axis);
mdfWeights.push_back(weight);
hid_t groupId = QH5Utilities::openHDF5Object(pid, DREAM3D::StringConstants::MDFWeights);
if (groupId > 0)
{
err = readVectorOfArrays(groupId, mdfWeights);
if(err >= 0)
{
data->setMDF_Weights(mdfWeights);
}
}
err = QH5Utilities::closeHDF5Object(groupId);
return err;
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:29,代码来源:H5PrimaryStatsDataDelegate.cpp
示例3: readVectorOfArrays
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5TransformationStatsDataDelegate::readODFWeights(hid_t pid, TransformationStatsData* data)
{
int err = 0;
FloatArrayType::Pointer euler1 = FloatArrayType::CreateArray(0, DREAM3D::StringConstants::Euler1);
FloatArrayType::Pointer euler2 = FloatArrayType::CreateArray(0, DREAM3D::StringConstants::Euler2);
FloatArrayType::Pointer euler3 = FloatArrayType::CreateArray(0, DREAM3D::StringConstants::Euler3);
FloatArrayType::Pointer weight = FloatArrayType::CreateArray(0, DREAM3D::StringConstants::Weight);
FloatArrayType::Pointer sigma = FloatArrayType::CreateArray(0, DREAM3D::StringConstants::Sigma);
VectorOfFloatArray odfWeights;
odfWeights.push_back(euler1);
odfWeights.push_back(euler2);
odfWeights.push_back(euler3);
odfWeights.push_back(weight);
odfWeights.push_back(sigma);
hid_t groupId = QH5Utilities::openHDF5Object(pid, DREAM3D::StringConstants::ODFWeights);
err = readVectorOfArrays(groupId, odfWeights);
if(err >= 0)
{
data->setODF_Weights(odfWeights);
}
err |= QH5Utilities::closeHDF5Object(groupId);
return err;
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:33,代码来源:H5TransformationStatsDataDelegate.cpp
示例4: extractStatsData
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGenODFWidget::extractStatsData(int index, StatsData* statsData, unsigned int phaseType)
{
VectorOfFloatArray arrays;
if(phaseType == DREAM3D::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
arrays = pp->getODF_Weights();
}
if(phaseType == DREAM3D::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
arrays = pp->getODF_Weights();
}
if(phaseType == DREAM3D::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
arrays = tp->getODF_Weights();
}
if (arrays.size() > 0)
{
QVector<float> e1(static_cast<int>(arrays[0]->getNumberOfTuples()));
::memcpy( e1.data(), arrays[0]->getVoidPointer(0), sizeof(float)*e1.size() );
QVector<float> e2(static_cast<int>(arrays[1]->getNumberOfTuples()));
::memcpy( e2.data(), arrays[1]->getVoidPointer(0), sizeof(float)*e2.size() );
QVector<float> e3(static_cast<int>(arrays[2]->getNumberOfTuples()));
::memcpy( e3.data(), arrays[2]->getVoidPointer(0), sizeof(float)*e3.size() );
QVector<float> weights(static_cast<int>(arrays[3]->getNumberOfTuples()));
::memcpy( weights.data(), arrays[3]->getVoidPointer(0), sizeof(float)*weights.size() );
QVector<float> sigmas(static_cast<int>(arrays[4]->getNumberOfTuples()));
::memcpy( sigmas.data(), arrays[4]->getVoidPointer(0), sizeof(float)*sigmas.size() );
// Convert from Radians to Degrees for the Euler Angles
for(int i = 0; i < e1.size(); ++i)
{
e1[i] = e1[i] * 180.0f / M_PI;
e2[i] = e2[i] * 180.0f / M_PI;
e3[i] = e3[i] * 180.0f / M_PI;
}
if(e1.size() > 0)
{
// Load the data into the table model
m_ODFTableModel->setTableData(e1, e2, e3, weights, sigmas);
}
}
// Write the MDF Data if we have that functionality enabled
if (m_MDFWidget != NULL)
{
m_MDFWidget->extractStatsData(index, statsData, phaseType);
}
updatePlots();
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:59,代码来源:StatsGenODFWidget.cpp
示例5: Q_UNUSED
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGenMDFWidget::extractStatsData(int index, StatsData* statsData, unsigned int phaseType)
{
Q_UNUSED(index)
VectorOfFloatArray arrays;
if(phaseType == SIMPL::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
arrays = pp->getMDF_Weights();
}
if(phaseType == SIMPL::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
arrays = pp->getMDF_Weights();
}
if(phaseType == SIMPL::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
arrays = tp->getMDF_Weights();
}
QVector<float> axis;
QVector<float> angle;
QVector<float> weights;
for (int i = 0; i < arrays.size(); i++)
{
if(arrays[i]->getName().compare(SIMPL::StringConstants::Axis) == 0)
{
axis = QVector<float>(static_cast<int>(arrays[i]->getSize())); // This one is 3xn in size
::memcpy( &(axis.front()), arrays[i]->getVoidPointer(0), sizeof(float)*axis.size() );
}
if(arrays[i]->getName().compare(SIMPL::StringConstants::Angle) == 0)
{
angle = QVector<float>(static_cast<int>(arrays[i]->getNumberOfTuples()));
::memcpy( &(angle.front()), arrays[i]->getVoidPointer(0), sizeof(float)*angle.size() );
}
if(arrays[i]->getName().compare(SIMPL::StringConstants::Weight) == 0)
{
weights = QVector<float>(static_cast<int>(arrays[i]->getNumberOfTuples()));
::memcpy( &(weights.front()), arrays[i]->getVoidPointer(0), sizeof(float)*weights.size() );
}
}
if (arrays.size() > 0)
{
// Load the data into the table model
m_MDFTableModel->setTableData(angle, axis, weights);
}
on_m_MDFUpdateBtn_clicked();
}
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:55,代码来源:StatsGenMDFWidget.cpp
示例6:
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5PrimaryStatsDataDelegate::readVectorOfArrays(hid_t pid, VectorOfFloatArray colData)
{
int err = 0;
for (VectorOfFloatArray::iterator iter = colData.begin(); iter != colData.end(); ++iter )
{
FloatArrayType::Pointer d = *iter;
err = d->readH5Data(pid);
if (err < 0) { return err; }
}
return err;
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:16,代码来源:H5PrimaryStatsDataDelegate.cpp
示例7: tDims
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5PrimaryStatsDataDelegate::writeVectorOfArrays(hid_t pid,
VectorOfFloatArray colData)
{
herr_t err = 0;
herr_t retErr = 0;
// Loop through all the column data and write each one to the HDF5 file
size_t numColumns = colData.size();
for (size_t c = 0; c < numColumns; ++c)
{
//qDebug() << "Writing Dataset:" << hdf5GroupName << "/" << columnHeaders[c] ;
err = -1;
if(NULL != colData[c].get() && colData[c]->getSize() > 0)
{
QVector<size_t> tDims(1, colData[c]->getNumberOfTuples());
err = colData[c]->writeH5Data(pid, tDims);
if(err < 0)
{
retErr = err;
break;
}
}
else
{
qDebug() << ":Null Data Column had no data. Did you create the data?" ;
qDebug() << " File: " << __FILE__ ;
qDebug() << " Line: " << __LINE__ ;
break;
}
}
return retErr;
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPL,代码行数:36,代码来源:H5PrimaryStatsDataDelegate.cpp
示例8: tr
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int StatsGenPlotWidget::extractStatsData(int index,
QVector<float>& binNumbers,
VectorOfFloatArray arrays)
{
int err = 0;
if (m_StatsType == DREAM3D::StatisticsType::UnknownStatisticsGroup)
{
QMessageBox::critical(this, tr("StatsGenerator"),
tr("This Plot has not been assigned a Statistics Group. This should be happening from within the program. Contact the developer."),
QMessageBox::Ok,
QMessageBox::Ok);
return -1;
}
if (m_DistributionType == DREAM3D::DistributionType::UnknownDistributionType)
{
QMessageBox::critical(this, tr("StatsGenerator"),
tr("The 'Distribution Type' was of an unknown type."),
QMessageBox::Ok,
QMessageBox::Ok);
return -1;
}
// Remove all the current rows in the table model
m_TableModel->removeRows(0, m_TableModel->rowCount());
// This will force a reset of the table model creating a new table model
setDistributionType(m_DistributionType); // This makes sure the combo box is set correctly
QVector<QString> colors;
qint32 count = binNumbers.count();
QStringList colorNames = QColor::colorNames();
qint32 colorOffset = 21;
for (qint32 i = 0; i < count; ++i)
{
colors.push_back(colorNames[colorOffset++]);
}
QVector<QVector<float> > data;
for(VectorOfFloatArray::size_type i = 0; i < arrays.size(); ++i)
{
QVector<float> col(static_cast<int>(arrays[i]->getNumberOfTuples()));
if (arrays[i]->getNumberOfTuples() > 0)
{
::memcpy( &(col.front()), arrays[i]->getVoidPointer(0), sizeof(float)*col.size() );
}
data.push_back(col);
}
m_TableModel->setTableData(binNumbers, data, colors);
m_TableView->resizeColumnsToContents();
m_TableView->scrollToBottom();
m_TableView->setFocus();
updatePlotCurves();
m_UserUpdatedData = true;
return err;
}
开发者ID:kglowins,项目名称:DREAM3D,代码行数:63,代码来源:StatsGenPlotWidget.cpp
示例9: writeVectorOfArrays
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int H5PrimaryStatsDataDelegate::writeWeightsData(hid_t pid, const std::string &hdf5GroupName,
VectorOfFloatArray colData)
{
herr_t err = 0;
if (colData.size() == 0) { return err; }
// Create the Group Folder
hid_t disId = H5Utilities::createGroup(pid, hdf5GroupName);
if (disId > 0)
{
err = writeVectorOfArrays(disId, colData);
}
// Close the HDF5 Group
err |= H5Gclose(disId);
return err;
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:18,代码来源:H5PrimaryStatsDataDelegate.cpp
示例10: getStatisticsData
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
VectorOfFloatArray StatsGenPlotWidget::getStatisticsData()
{
VectorOfFloatArray data;
if (m_StatsType == DREAM3D::StatisticsType::UnknownStatisticsGroup)
{
QMessageBox::critical(this, tr("StatsGenerator"),
tr("This Plot has not been assigned a Statistics Group. This should be happening from within the program. Contact the developer."),
QMessageBox::Ok,
QMessageBox::Ok);
return data;
}
if (m_DistributionType == DREAM3D::DistributionType::UnknownDistributionType)
{
QMessageBox::critical(this, tr("StatsGenerator"),
tr("This Plot has not been assigned a known Distribution Type. This should be happening from within the program. Contact the developer."),
QMessageBox::Ok,
QMessageBox::Ok);
return data;
}
FloatArrayType::Pointer col0;
FloatArrayType::Pointer col1;
FloatArrayType::Pointer col2;
QVector<float> v0;
QVector<float> v1;
QVector<float> v2;
Q_ASSERT(m_PhaseIndex >= 0);
// Create a new Table Model
switch(m_DistributionType)
{
case DREAM3D::DistributionType::Beta:
v0 = m_TableModel->getData(SGBetaTableModel::Alpha);
v1 = m_TableModel->getData(SGBetaTableModel::Beta);
col0 = FloatArrayType::FromQVector(v0, DREAM3D::StringConstants::Alpha);
col1 = FloatArrayType::FromQVector(v1, DREAM3D::StringConstants::Beta);
data.push_back(col0);
data.push_back(col1);
break;
case DREAM3D::DistributionType::LogNormal:
v0 = m_TableModel->getData(SGLogNormalTableModel::Average);
v1 = m_TableModel->getData(SGLogNormalTableModel::StdDev);
col0 = FloatArrayType::FromQVector(v0, DREAM3D::StringConstants::Average);
col1 = FloatArrayType::FromQVector(v1, DREAM3D::StringConstants::StandardDeviation);
data.push_back(col0);
data.push_back(col1);
break;
case DREAM3D::DistributionType::Power:
v0 = m_TableModel->getData(SGPowerLawTableModel::Alpha);
v1 = m_TableModel->getData(SGPowerLawTableModel::K);
v2 = m_TableModel->getData(SGPowerLawTableModel::Beta);
col0 = FloatArrayType::FromQVector(v0, DREAM3D::StringConstants::Alpha);
col1 = FloatArrayType::FromQVector(v1, DREAM3D::StringConstants::Exp_k);
col2 = FloatArrayType::FromQVector(v2, DREAM3D::StringConstants::Beta);
data.push_back(col0);
data.push_back(col1);
data.push_back(col2);
break;
default:
return data;
}
return data;
}
开发者ID:kglowins,项目名称:DREAM3D,代码行数:70,代码来源:StatsGenPlotWidget.cpp
示例11: GenerateAxisODFBinData
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGeneratorUtilities::GenerateAxisODFBinData(StatsData* statsData, unsigned int phaseType,
QVector<float> &e1s, QVector<float> &e2s,
QVector<float> &e3s, QVector<float> &weights,
QVector<float> &sigmas, bool computeAxisODF)
{
QVector<float> aodf;
size_t numEntries = e1s.size();
aodf.resize(OrthoRhombicOps::k_OdfSize);
if (computeAxisODF) { Texture::CalculateOrthoRhombicODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
aodf.data(), numEntries); }
if (aodf.size() > 0)
{
FloatArrayType::Pointer aodfData = FloatArrayType::FromQVector(aodf, SIMPL::StringConstants::AxisOrientation);
if (phaseType == SIMPL::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setAxisOrientation(aodfData);
}
if (phaseType == SIMPL::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setAxisOrientation(aodfData);
}
if (phaseType == SIMPL::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setAxisOrientation(aodfData);
}
if (e1s.size() > 0)
{
FloatArrayType::Pointer euler1 = FloatArrayType::FromQVector(e1s, SIMPL::StringConstants::Euler1);
FloatArrayType::Pointer euler2 = FloatArrayType::FromQVector(e2s, SIMPL::StringConstants::Euler2);
FloatArrayType::Pointer euler3 = FloatArrayType::FromQVector(e3s, SIMPL::StringConstants::Euler3);
FloatArrayType::Pointer sigma = FloatArrayType::FromQVector(sigmas, SIMPL::StringConstants::Sigma);
FloatArrayType::Pointer weight = FloatArrayType::FromQVector(weights, SIMPL::StringConstants::Weight);
VectorOfFloatArray aodfWeights;
aodfWeights.push_back(euler1);
aodfWeights.push_back(euler2);
aodfWeights.push_back(euler3);
aodfWeights.push_back(sigma);
aodfWeights.push_back(weight);
if (phaseType == SIMPL::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setAxisODF_Weights(aodfWeights);
}
if (phaseType == SIMPL::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setAxisODF_Weights(aodfWeights);
}
if (phaseType == SIMPL::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setAxisODF_Weights(aodfWeights);
}
}
}
}
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:66,代码来源:StatsGeneratorUtilities.cpp
示例12: if
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGeneratorUtilities::GenerateMisorientationBinData(StatsData* statsData,
unsigned int phaseType, unsigned int crystalStruct,
QVector<float> &odf,
QVector<float> &angles, QVector<float> &axes,
QVector<float> &weights, bool computeMDF)
{
QVector<float> x;
QVector<float> y;
QVector<float> mdf;
if (Ebsd::CrystalStructure::Cubic_High == crystalStruct)
{
mdf.resize(CubicOps::k_MdfSize);
if (computeMDF) { Texture::CalculateMDFData<float, CubicOps>(angles.data(), axes.data(), weights.data(), odf.data(), mdf.data(), angles.size()); }
//nElements = 18 * 18 * 18;
}
else if (Ebsd::CrystalStructure::Hexagonal_High == crystalStruct)
{
mdf.resize(HexagonalOps::k_MdfSize);
if (computeMDF) { Texture::CalculateMDFData<float, HexagonalOps>(angles.data(), axes.data(), weights.data(), odf.data(), mdf.data(), angles.size()); }
//nElements = 36 * 36 * 12;
}
if (mdf.size() > 0)
{
FloatArrayType::Pointer p = FloatArrayType::FromPointer(mdf.data(), mdf.size(), SIMPL::StringConstants::MisorientationBins);
if (phaseType == SIMPL::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setMisorientationBins(p);
}
if (phaseType == SIMPL::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setMisorientationBins(p);
}
if (phaseType == SIMPL::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setMisorientationBins(p);
}
if (angles.size() > 0)
{
FloatArrayType::Pointer anglesArray = FloatArrayType::FromPointer(angles.data(), angles.size(), SIMPL::StringConstants::Angle);
FloatArrayType::Pointer axisArray = FloatArrayType::FromPointer(axes.data(), axes.size(), SIMPL::StringConstants::Axis);
FloatArrayType::Pointer weightArray = FloatArrayType::FromPointer(weights.data(), weights.size(), SIMPL::StringConstants::Weight);
VectorOfFloatArray mdfWeights;
mdfWeights.push_back(anglesArray);
mdfWeights.push_back(axisArray);
mdfWeights.push_back(weightArray);
if (phaseType == SIMPL::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setMDF_Weights(mdfWeights);
}
if (phaseType == SIMPL::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setMDF_Weights(mdfWeights);
}
if (phaseType == SIMPL::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setMDF_Weights(mdfWeights);
}
}
}
}
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:72,代码来源:StatsGeneratorUtilities.cpp
示例13: if
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int StatsGenODFWidget::getOrientationData(StatsData* statsData, unsigned int phaseType)
{
int retErr = 0;
QVector<float> e1s;
QVector<float> e2s;
QVector<float> e3s;
QVector<float> weights;
QVector<float> sigmas;
QVector<float> odf;
// Initialize xMax and yMax....
e1s = m_ODFTableModel->getData(SGODFTableModel::Euler1);
e2s = m_ODFTableModel->getData(SGODFTableModel::Euler2);
e3s = m_ODFTableModel->getData(SGODFTableModel::Euler3);
weights = m_ODFTableModel->getData(SGODFTableModel::Weight);
sigmas = m_ODFTableModel->getData(SGODFTableModel::Sigma);
for (QVector<float>::size_type i = 0; i < e1s.size(); i++)
{
e1s[i] = e1s[i] * M_PI / 180.0;
e2s[i] = e2s[i] * M_PI / 180.0;
e3s[i] = e3s[i] * M_PI / 180.0;
}
size_t numEntries = e1s.size();
if ( Ebsd::CrystalStructure::Cubic_High == m_CrystalStructure)
{
odf.resize(CubicOps::k_OdfSize);
Texture::CalculateCubicODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
odf.data(), numEntries);
}
else if ( Ebsd::CrystalStructure::Hexagonal_High == m_CrystalStructure)
{
odf.resize(HexagonalOps::k_OdfSize);
Texture::CalculateHexODFData(e1s.data(), e2s.data(), e3s.data(),
weights.data(), sigmas.data(), true,
odf.data(), numEntries);
}
if (odf.size() > 0)
{
FloatArrayType::Pointer p = FloatArrayType::FromQVector(odf, DREAM3D::StringConstants::ODF);
if(phaseType == DREAM3D::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setODF(p);
}
if(phaseType == DREAM3D::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setODF(p);
}
if(phaseType == DREAM3D::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setODF(p);
}
if (e1s.size() > 0)
{
FloatArrayType::Pointer euler1 = FloatArrayType::FromQVector(e1s, DREAM3D::StringConstants::Euler1);
FloatArrayType::Pointer euler2 = FloatArrayType::FromQVector(e2s, DREAM3D::StringConstants::Euler2);
FloatArrayType::Pointer euler3 = FloatArrayType::FromQVector(e3s, DREAM3D::StringConstants::Euler3);
FloatArrayType::Pointer sigma = FloatArrayType::FromQVector(sigmas, DREAM3D::StringConstants::Sigma);
FloatArrayType::Pointer weight = FloatArrayType::FromQVector(weights, DREAM3D::StringConstants::Weight);
VectorOfFloatArray odfWeights;
odfWeights.push_back(euler1);
odfWeights.push_back(euler2);
odfWeights.push_back(euler3);
odfWeights.push_back(sigma);
odfWeights.push_back(weight);
if(phaseType == DREAM3D::PhaseType::PrimaryPhase)
{
PrimaryStatsData* pp = PrimaryStatsData::SafePointerDownCast(statsData);
pp->setODF_Weights(odfWeights);
}
if(phaseType == DREAM3D::PhaseType::PrecipitatePhase)
{
PrecipitateStatsData* pp = PrecipitateStatsData::SafePointerDownCast(statsData);
pp->setODF_Weights(odfWeights);
}
if(phaseType == DREAM3D::PhaseType::TransformationPhase)
{
TransformationStatsData* tp = TransformationStatsData::SafePointerDownCast(statsData);
tp->setODF_Weights(odfWeights);
}
}
}
// Write the MDF Data if we have that functionality enabled
if (m_MDFWidget != NULL)
{
m_MDFWidget->getMisorientationData(statsData, phaseType);
}
return retErr;
}
开发者ID:ravishivaraman,项目名称:DREAM3D,代码行数:99,代码来源:StatsGenODFWidget.cpp
注:本文中的VectorOfFloatArray类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论