本文整理汇总了C++中int32arraytype::Pointer::SetNumberOfComponents方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::SetNumberOfComponents方法的具体用法?C++ Pointer::SetNumberOfComponents怎么用?C++ Pointer::SetNumberOfComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类int32arraytype::Pointer
的用法示例。
在下文中一共展示了Pointer::SetNumberOfComponents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getVoxelDataContainer
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ReadH5Ebsd::copyHEDMArrays(H5EbsdVolumeReader* ebsdReader)
{
float* f1 = NULL;
float* f2 = NULL;
float* f3 = NULL;
int* phasePtr = NULL;
FloatArrayType::Pointer fArray = FloatArrayType::NullPointer();
Int32ArrayType::Pointer iArray = Int32ArrayType::NullPointer();
VoxelDataContainer* m = getVoxelDataContainer();
int64_t totalPoints = m->getTotalPoints();
if (m_SelectedVoxelCellArrays.find(m_CellEulerAnglesArrayName) != m_SelectedVoxelCellArrays.end() )
{
// radianconversion = M_PI / 180.0;
f1 = reinterpret_cast<float*>(ebsdReader->getPointerByName(Ebsd::Mic::Euler1));
f2 = reinterpret_cast<float*>(ebsdReader->getPointerByName(Ebsd::Mic::Euler2));
f3 = reinterpret_cast<float*>(ebsdReader->getPointerByName(Ebsd::Mic::Euler3));
fArray = FloatArrayType::CreateArray(totalPoints * 3, DREAM3D::CellData::EulerAngles);
fArray->SetNumberOfComponents(3);
float* cellEulerAngles = fArray->GetPointer(0);
for (int64_t i = 0; i < totalPoints; i++)
{
cellEulerAngles[3 * i] = f1[i];
cellEulerAngles[3 * i + 1] = f2[i];
cellEulerAngles[3 * i + 2] = f3[i];
}
m->addCellData(DREAM3D::CellData::EulerAngles, fArray);
}
if (m_SelectedVoxelCellArrays.find(m_CellPhasesArrayName) != m_SelectedVoxelCellArrays.end() )
{
phasePtr = reinterpret_cast<int*>(ebsdReader->getPointerByName(Ebsd::Mic::Phase));
iArray = Int32ArrayType::CreateArray(totalPoints, DREAM3D::CellData::Phases);
iArray->SetNumberOfComponents(1);
::memcpy(iArray->GetPointer(0), phasePtr, sizeof(int32_t) * totalPoints);
m->addCellData(DREAM3D::CellData::Phases, iArray);
}
if (m_SelectedVoxelCellArrays.find(Ebsd::Mic::Confidence) != m_SelectedVoxelCellArrays.end() )
{
f1 = reinterpret_cast<float*>(ebsdReader->getPointerByName(Ebsd::Mic::Confidence));
fArray = FloatArrayType::CreateArray(totalPoints, Ebsd::Mic::Confidence);
fArray->SetNumberOfComponents(1);
::memcpy(fArray->GetPointer(0), f1, sizeof(float) * totalPoints);
m->addCellData(Ebsd::Mic::Confidence, fArray);
}
}