本文整理汇总了C++中int32arraytype::Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeXdmf
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int VertexGeom::writeXdmf(QTextStream& out, QString dcName, QString hdfFileName)
{
herr_t err = 0;
// Always start the grid
out << " <!-- *************** START OF " << dcName << " *************** -->" << "\n";
out << " <Grid Name=\"" << dcName << "\" GridType=\"Uniform\">" << "\n";
#if 0
DataArrayPath dap = getTemporalDataPath();
if(dap.isValid())
{
IDataArray::Pointer timeValues = getAttributeMatrix(dap.getAttributeMatrixName())->getAttributeArray(dap.getDataArrayName());
Int32ArrayType::Pointer timeValuePtr = boost::dynamic_pointer_cast<Int32ArrayType>(timeValues);
out << " <Time TimeType=\"Single\" Value=\"" << timeValuePtr->getValue(0) << "\"/>\n";
}
#endif
out << " <Topology TopologyType=\"Polyvertex\" NumberOfElements=\"" << getNumberOfVertices() << "\">" << "\n";
out << " <DataItem Format=\"HDF\" NumberType=\"Int\" Dimensions=\"" << getNumberOfVertices() << "\">" << "\n";
out << " " << hdfFileName << ":/DataContainers/" << dcName << "/" << DREAM3D::Geometry::Geometry << "/" << "Verts" << "\n";
out << " </DataItem>" << "\n";
out << " </Topology>" << "\n";
out << " <Geometry Type=\"XYZ\">" << "\n";
out << " <DataItem Format=\"HDF\" Dimensions=\"" << getNumberOfVertices() << " 3\" NumberType=\"Float\" Precision=\"4\">" << "\n";
out << " " << hdfFileName << ":/DataContainers/" << dcName << "/" << DREAM3D::Geometry::Geometry << "/" << DREAM3D::Geometry::SharedVertexList << "\n";
out << " </DataItem>" << "\n";
out << " </Geometry>" << "\n";
out << "" << "\n";
return err;
}
示例2: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void AbaqusSurfaceMeshWriter::execute()
{
int err = 0;
std::stringstream ss;
SurfaceMeshDataContainer* sm = getSurfaceMeshDataContainer();
dataCheck(false, 1, 1, 1);
if(getErrorCondition() < 0)
{
return;
}
// Make sure any directory path is also available as the user may have just typed
// in a path without actually creating the full path
std::string parentPath = MXAFileInfo::parentPath(getOutputFile());
if(!MXADir::mkdir(parentPath, true))
{
std::stringstream ss;
ss << "Error creating parent path '" << parentPath << "'";
notifyErrorMessage(ss.str(), -1);
setErrorCondition(-1);
return;
}
DREAM3D::SurfaceMesh::VertListPointer_t nodesPtr = sm->getVertices();
DREAM3D::SurfaceMesh::FaceListPointer_t trianglePtr = sm->getFaces();
// Get the Labels(GrainIds or Region Ids) for the triangles
Int32ArrayType::Pointer faceLabelsPtr = boost::dynamic_pointer_cast<Int32ArrayType>(sm->getFaceData(DREAM3D::FaceData::SurfaceMeshFaceLabels));
int32_t* faceLabels = faceLabelsPtr->GetPointer(0);
// Store all the unique Spins
std::set<int> uniqueSpins;
for (int i = 0; i < trianglePtr->GetNumberOfTuples(); i++)
{
uniqueSpins.insert(faceLabels[i*2]);
uniqueSpins.insert(faceLabels[i*2+1]);
}
FILE* f = fopen(m_OutputFile.c_str(), "wb");
ScopedFileMonitor fileMonitor(f);
err = writeHeader(f, nodesPtr->GetNumberOfTuples(), trianglePtr->GetNumberOfTuples(), uniqueSpins.size()-1);
err = writeNodes(f);
err = writeTriangles(f);
err = writeGrains(f);
setErrorCondition(0);
notifyStatusMessage("Complete");
return;
}
示例3: 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);
}
}
示例4: assign_points
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RegularGridSampleSurfaceMesh::assign_points(Int32ArrayType::Pointer iArray)
{
int32_t* ids = iArray->getPointer(0);
for (int64_t i = 0; i < (m_XPoints * m_YPoints * m_ZPoints); i++)
{
m_FeatureIds[i] = ids[i];
}
}
示例5: TestDataArray
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void TestDataArray()
{
int32_t* ptr = NULL;
{
Int32ArrayType::Pointer d = Int32ArrayType::CreateArray(0, "Test7");
DREAM3D_REQUIRE_EQUAL(0, d->getSize());
DREAM3D_REQUIRE_EQUAL(0, d->getNumberOfTuples());
ptr = d->getPointer(0);
DREAM3D_REQUIRE_EQUAL(ptr, 0);
DREAM3D_REQUIRE_EQUAL(d->isAllocated(), false);
}
{
QVector<size_t> dims(1, NUM_COMPONENTS);
Int32ArrayType::Pointer int32Array = Int32ArrayType::CreateArray(NUM_ELEMENTS, dims, "Test8");
ptr = int32Array->getPointer(0);
DREAM3D_REQUIRE_EQUAL(int32Array->isAllocated(), true);
DREAM3D_REQUIRE_EQUAL(NUM_ELEMENTS, int32Array->getNumberOfTuples());
DREAM3D_REQUIRE_EQUAL(NUM_ELEMENTS * NUM_COMPONENTS, int32Array->getSize());
for (int i = 0; i < NUM_TUPLES; ++i)
{
for (int c = 0; c < NUM_COMPONENTS; ++c)
{
int32Array->setComponent(i, c, i + c);
}
}
// Resize Larger
int32Array->resize(NUM_TUPLES_2);
DREAM3D_REQUIRE_EQUAL(NUM_TUPLES_2, int32Array->getNumberOfTuples());
DREAM3D_REQUIRE_EQUAL(NUM_ELEMENTS_2, int32Array->getSize());
DREAM3D_REQUIRE_EQUAL(int32Array->isAllocated(), true);
// This should have saved our data so lets look at the data and compare it
for (int i = 0; i < NUM_TUPLES; ++i)
{
for (int c = 0; c < NUM_COMPONENTS; ++c)
{
DREAM3D_REQUIRE_EQUAL( (int32Array->getComponent(i, c)), (i + c))
}
}
// Resize Smaller - Which should have still saved some of our data
int32Array->resize(NUM_TUPLES_3);
DREAM3D_REQUIRE_EQUAL(NUM_TUPLES_3, int32Array->getNumberOfTuples());
DREAM3D_REQUIRE_EQUAL(NUM_ELEMENTS_3, int32Array->getSize());
DREAM3D_REQUIRE_EQUAL(int32Array->isAllocated(), true);
// This should have saved our data so lets look at the data and compare it
for (int i = 0; i < NUM_TUPLES; ++i)
{
for (int c = 0; c < NUM_COMPONENTS; ++c)
{
DREAM3D_REQUIRE_EQUAL( (int32Array->getComponent(i, c)), (i + c))
}
}
// Change number of components
// dims[0] = NUM_COMPONENTS_4;
// int32Array->setDims(dims);
// DREAM3D_REQUIRE_EQUAL(NUM_TUPLES_4, int32Array->getNumberOfTuples());
// DREAM3D_REQUIRE_EQUAL(NUM_ELEMENTS_4, int32Array->getSize());
double temp = 9999;
int32Array->initializeTuple(0, temp );
for (int c = 0; c < NUM_COMPONENTS; ++c)
{
DREAM3D_REQUIRE_EQUAL( (int32Array->getComponent(0, c)), (9999))
}
ptr = int32Array->getPointer(0);
}
}
示例6: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void VisualizeGBCDPoleFigure::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
// Make sure any directory path is also available as the user may have just typed
// in a path without actually creating the full path
QFileInfo fi(getOutputFile());
QDir dir(fi.path());
if(!dir.mkpath("."))
{
QString ss;
ss = QObject::tr("Error creating parent path '%1'").arg(dir.path());
setErrorCondition(-1);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
QFile file(getOutputFile());
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QString ss = QObject::tr("Error opening output file '%1'").arg(getOutputFile());
setErrorCondition(-100);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
FloatArrayType::Pointer gbcdDeltasArray = FloatArrayType::CreateArray(5, "GBCDDeltas");
gbcdDeltasArray->initializeWithZeros();
FloatArrayType::Pointer gbcdLimitsArray = FloatArrayType::CreateArray(10, "GBCDLimits");
gbcdLimitsArray->initializeWithZeros();
Int32ArrayType::Pointer gbcdSizesArray = Int32ArrayType::CreateArray(5, "GBCDSizes");
gbcdSizesArray->initializeWithZeros();
float* gbcdDeltas = gbcdDeltasArray->getPointer(0);
int* gbcdSizes = gbcdSizesArray->getPointer(0);
float* gbcdLimits = gbcdLimitsArray->getPointer(0);
// Original Ranges from Dave R.
//m_GBCDlimits[0] = 0.0f;
//m_GBCDlimits[1] = cosf(1.0f*m_pi);
//m_GBCDlimits[2] = 0.0f;
//m_GBCDlimits[3] = 0.0f;
//m_GBCDlimits[4] = cosf(1.0f*m_pi);
//m_GBCDlimits[5] = 2.0f*m_pi;
//m_GBCDlimits[6] = cosf(0.0f);
//m_GBCDlimits[7] = 2.0f*m_pi;
//m_GBCDlimits[8] = 2.0f*m_pi;
//m_GBCDlimits[9] = cosf(0.0f);
// Greg R. Ranges
gbcdLimits[0] = 0.0f;
gbcdLimits[1] = 0.0f;
gbcdLimits[2] = 0.0f;
gbcdLimits[3] = 0.0f;
gbcdLimits[4] = 0.0f;
gbcdLimits[5] = SIMPLib::Constants::k_PiOver2;
gbcdLimits[6] = 1.0f;
gbcdLimits[7] = SIMPLib::Constants::k_PiOver2;
gbcdLimits[8] = 1.0f;
gbcdLimits[9] = SIMPLib::Constants::k_2Pi;
// reset the 3rd and 4th dimensions using the square grid approach
gbcdLimits[3] = -sqrtf(SIMPLib::Constants::k_PiOver2);
gbcdLimits[4] = -sqrtf(SIMPLib::Constants::k_PiOver2);
gbcdLimits[8] = sqrtf(SIMPLib::Constants::k_PiOver2);
gbcdLimits[9] = sqrtf(SIMPLib::Constants::k_PiOver2);
// get num components of GBCD
QVector<size_t> cDims = m_GBCDPtr.lock()->getComponentDimensions();
gbcdSizes[0] = cDims[0];
gbcdSizes[1] = cDims[1];
gbcdSizes[2] = cDims[2];
gbcdSizes[3] = cDims[3];
gbcdSizes[4] = cDims[4];
gbcdDeltas[0] = (gbcdLimits[5] - gbcdLimits[0]) / float(gbcdSizes[0]);
gbcdDeltas[1] = (gbcdLimits[6] - gbcdLimits[1]) / float(gbcdSizes[1]);
gbcdDeltas[2] = (gbcdLimits[7] - gbcdLimits[2]) / float(gbcdSizes[2]);
gbcdDeltas[3] = (gbcdLimits[8] - gbcdLimits[3]) / float(gbcdSizes[3]);
gbcdDeltas[4] = (gbcdLimits[9] - gbcdLimits[4]) / float(gbcdSizes[4]);
float vec[3] = { 0.0f, 0.0f, 0.0f };
float vec2[3] = { 0.0f, 0.0f, 0.0f };
float rotNormal[3] = { 0.0f, 0.0f, 0.0f };
float rotNormal2[3] = { 0.0f, 0.0f, 0.0f };
float sqCoord[2] = { 0.0f, 0.0f };
float dg[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dgt[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dg1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dg2[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float sym1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
//.........这里部分代码省略.........
示例7: generate
void generate(size_t start, size_t end) const
{
// We want to work with the raw pointers for speed so get those pointers.
float* m_GBCDdeltas = m_GbcdDeltasArray->getPointer(0);
float* m_GBCDlimits = m_GbcdLimitsArray->getPointer(0);
int* m_GBCDsizes = m_GbcdSizesArray->getPointer(0);
int32_t* m_Bins = m_GbcdBinsArray->getPointer(0);
bool* m_HemiCheck = m_GbcdHemiCheckArray->getPointer(0);
int32_t* m_Labels = m_LabelsArray->getPointer(0);
double* m_Normals = m_NormalsArray->getPointer(0);
int32_t* m_Phases = m_PhasesArray->getPointer(0);
float* m_Eulers = m_EulersArray->getPointer(0);
uint32_t* m_CrystalStructures = m_CrystalStructuresArray->getPointer(0);
int32_t j = 0;//, j4;
int32_t k = 0;//, k4;
int32_t m = 0;
int32_t temp = 0;
//bool gbcd_indices_good;
int32_t feature1 = 0, feature2 = 0;
int32_t inversion = 1;
float g1ea[3] = { 0.0f, 0.0f, 0.0f }, g2ea[3] = { 0.0f, 0.0f, 0.0f };
float g1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, g2[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float g1s[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, g2s[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float sym1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, sym2[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float g2t[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, dg[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float euler_mis[3] = { 0.0f, 0.0f, 0.0f };
float normal[3] = { 0.0f, 0.0f, 0.0f };
float xstl1_norm1[3] = { 0.0f, 0.0f, 0.0f };
int32_t gbcd_index = 0;
float sqCoord[2] = { 0.0f, 0.0f }, sqCoordInv[2] = { 0.0f, 0.0f };
bool nhCheck = false, nhCheckInv = true;
int32_t SYMcounter = 0;
int64_t TRIcounter = static_cast<int64_t>(start - startOffset);
int64_t TRIcounterShift = 0;
for (size_t i = start; i < end; i++)
{
SYMcounter = 0;
feature1 = m_Labels[2 * i];
feature2 = m_Labels[2 * i + 1];
normal[0] = m_Normals[3 * i];
normal[1] = m_Normals[3 * i + 1];
normal[2] = m_Normals[3 * i + 2];
if (feature1 < 0 || feature2 < 0) { continue; }
if (m_Phases[feature1] == m_Phases[feature2] && m_Phases[feature1] > 0)
{
TRIcounterShift = (TRIcounter * numEntriesPerTri);
uint32_t cryst = m_CrystalStructures[m_Phases[feature1]];
for (int32_t q = 0; q < 2; q++)
{
if (q == 1)
{
temp = feature1;
feature1 = feature2;
feature2 = temp;
normal[0] = -normal[0];
normal[1] = -normal[1];
normal[2] = -normal[2];
}
for (m = 0; m < 3; m++)
{
g1ea[m] = m_Eulers[3 * feature1 + m];
g2ea[m] = m_Eulers[3 * feature2 + m];
}
FOrientArrayType om(9, 0.0f);
FOrientTransformsType::eu2om(FOrientArrayType(g1ea, 3), om);
om.toGMatrix(g1);
FOrientTransformsType::eu2om(FOrientArrayType(g2ea, 3), om);
om.toGMatrix(g2);
int32_t nsym = m_OrientationOps[cryst]->getNumSymOps();
for (j = 0; j < nsym; j++)
{
// rotate g1 by symOp
m_OrientationOps[cryst]->getMatSymOp(j, sym1);
MatrixMath::Multiply3x3with3x3(sym1, g1, g1s);
// get the crystal directions along the triangle normals
MatrixMath::Multiply3x3with3x1(g1s, normal, xstl1_norm1);
// get coordinates in square projection of crystal normal parallel to boundary normal
nhCheck = getSquareCoord(xstl1_norm1, sqCoord);
if (inversion == 1)
{
sqCoordInv[0] = -sqCoord[0];
sqCoordInv[1] = -sqCoord[1];
if (nhCheck == false) { nhCheckInv = true; }
else { nhCheckInv = false; }
}
for (k = 0; k < nsym; k++)
{
// calculate the symmetric misorienation
m_OrientationOps[cryst]->getMatSymOp(k, sym2);
//.........这里部分代码省略.........
示例8: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ErodeDilateBadData::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getFeatureIdsArrayPath().getDataContainerName());
size_t totalPoints = m_FeatureIdsPtr.lock()->getNumberOfTuples();
Int32ArrayType::Pointer neighborsPtr = Int32ArrayType::CreateArray(totalPoints, "_INTERNAL_USE_ONLY_Neighbors");
m_Neighbors = neighborsPtr->getPointer(0);
neighborsPtr->initializeWithValue(-1);
size_t udims[3] = {0, 0, 0};
m->getGeometryAs<ImageGeom>()->getDimensions(udims);
#if (CMP_SIZEOF_SIZE_T == 4)
typedef int32_t DimType;
#else
typedef int64_t DimType;
#endif
DimType dims[3] =
{
static_cast<DimType>(udims[0]),
static_cast<DimType>(udims[1]),
static_cast<DimType>(udims[2]),
};
int32_t good = 1;
int64_t count = 0;
int64_t kstride = 0, jstride = 0;
int32_t featurename = 0, feature = 0;
int32_t current = 0;
int32_t most = 0;
int64_t neighpoint = 0;
size_t numfeatures = 0;
for (size_t i = 0; i < totalPoints; i++)
{
featurename = m_FeatureIds[i];
if (featurename > numfeatures) { numfeatures = featurename; }
}
DimType neighpoints[6] = { 0, 0, 0, 0, 0, 0 };
neighpoints[0] = -dims[0] * dims[1];
neighpoints[1] = -dims[0];
neighpoints[2] = -1;
neighpoints[3] = 1;
neighpoints[4] = dims[0];
neighpoints[5] = dims[0] * dims[1];
QVector<int32_t> n(numfeatures + 1, 0);
for (int32_t iteration = 0; iteration < m_NumIterations; iteration++)
{
for (DimType k = 0; k < dims[2]; k++)
{
kstride = dims[0] * dims[1] * k;
for (DimType j = 0; j < dims[1]; j++)
{
jstride = dims[0] * j;
for (DimType i = 0; i < dims[0]; i++)
{
count = kstride + jstride + i;
featurename = m_FeatureIds[count];
if (featurename == 0)
{
current = 0;
most = 0;
for (int32_t l = 0; l < 6; l++)
{
good = 1;
neighpoint = count + neighpoints[l];
if (l == 0 && (k == 0 || m_ZDirOn == false)) { good = 0; }
else if (l == 5 && (k == (dims[2] - 1) || m_ZDirOn == false)) { good = 0; }
else if (l == 1 && (j == 0 || m_YDirOn == false)) { good = 0; }
else if (l == 4 && (j == (dims[1] - 1) || m_YDirOn == false)) { good = 0; }
else if (l == 2 && (i == 0 || m_XDirOn == false)) { good = 0; }
else if (l == 3 && (i == (dims[0] - 1) || m_XDirOn == false)) { good = 0; }
if (good == 1)
{
feature = m_FeatureIds[neighpoint];
if (m_Direction == 0 && feature > 0)
{
m_Neighbors[neighpoint] = count;
}
if (feature > 0 && m_Direction == 1)
{
n[feature]++;
current = n[feature];
if (current > most)
{
most = current;
m_Neighbors[count] = neighpoint;
}
}
}
}
//.........这里部分代码省略.........
示例9: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void VisualizeGBCDGMT::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer sm = getDataContainerArray()->getDataContainer(getGBCDArrayPath().getDataContainerName());
// Make sure any directory path is also available as the user may have just typed
// in a path without actually creating the full path
QFileInfo fi(getOutputFile());
QDir dir(fi.path());
if (!dir.mkpath("."))
{
QString ss;
ss = QObject::tr("Error creating parent path '%1'").arg(dir.path());
setErrorCondition(-1);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
QFile file(getOutputFile());
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QString ss = QObject::tr("Error opening output file '%1'").arg(getOutputFile());
setErrorCondition(-100);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
FloatArrayType::Pointer gbcdDeltasArray = FloatArrayType::CreateArray(5, "GBCDDeltas");
gbcdDeltasArray->initializeWithZeros();
FloatArrayType::Pointer gbcdLimitsArray = FloatArrayType::CreateArray(10, "GBCDLimits");
gbcdLimitsArray->initializeWithZeros();
Int32ArrayType::Pointer gbcdSizesArray = Int32ArrayType::CreateArray(5, "GBCDSizes");
gbcdSizesArray->initializeWithZeros();
float* gbcdDeltas = gbcdDeltasArray->getPointer(0);
int32_t* gbcdSizes = gbcdSizesArray->getPointer(0);
float* gbcdLimits = gbcdLimitsArray->getPointer(0);
// Original Ranges from Dave R.
//m_GBCDlimits[0] = 0.0f;
//m_GBCDlimits[1] = cosf(1.0f*m_pi);
//m_GBCDlimits[2] = 0.0f;
//m_GBCDlimits[3] = 0.0f;
//m_GBCDlimits[4] = cosf(1.0f*m_pi);
//m_GBCDlimits[5] = 2.0f*m_pi;
//m_GBCDlimits[6] = cosf(0.0f);
//m_GBCDlimits[7] = 2.0f*m_pi;
//m_GBCDlimits[8] = 2.0f*m_pi;
//m_GBCDlimits[9] = cosf(0.0f);
// Greg R. Ranges
gbcdLimits[0] = 0.0f;
gbcdLimits[1] = 0.0f;
gbcdLimits[2] = 0.0f;
gbcdLimits[3] = -sqrtf(SIMPLib::Constants::k_Pi / 2.0f);
gbcdLimits[4] = -sqrtf(SIMPLib::Constants::k_Pi / 2.0f);
gbcdLimits[5] = SIMPLib::Constants::k_Pi / 2.0f;
gbcdLimits[6] = 1.0f;
gbcdLimits[7] = SIMPLib::Constants::k_Pi / 2.0f;
gbcdLimits[8] = sqrtf(SIMPLib::Constants::k_Pi / 2.0f);
gbcdLimits[9] = sqrtf(SIMPLib::Constants::k_Pi / 2.0f);
// get num components of GBCD
QVector<size_t> cDims = m_GBCDPtr.lock()->getComponentDimensions();
gbcdSizes[0] = cDims[0];
gbcdSizes[1] = cDims[1];
gbcdSizes[2] = cDims[2];
gbcdSizes[3] = cDims[3];
gbcdSizes[4] = cDims[4];
gbcdDeltas[0] = (gbcdLimits[5] - gbcdLimits[0]) / float(gbcdSizes[0]);
gbcdDeltas[1] = (gbcdLimits[6] - gbcdLimits[1]) / float(gbcdSizes[1]);
gbcdDeltas[2] = (gbcdLimits[7] - gbcdLimits[2]) / float(gbcdSizes[2]);
gbcdDeltas[3] = (gbcdLimits[8] - gbcdLimits[3]) / float(gbcdSizes[3]);
gbcdDeltas[4] = (gbcdLimits[9] - gbcdLimits[4]) / float(gbcdSizes[4]);
float vec[3] = { 0.0f, 0.0f, 0.0f };
float vec2[3] = { 0.0f, 0.0f, 0.0f };
float rotNormal[3] = { 0.0f, 0.0f, 0.0f };
float rotNormal2[3] = { 0.0f, 0.0f, 0.0f };
float sqCoord[2] = { 0.0f, 0.0f };
float dg[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dgt[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dg1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float dg2[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float sym1[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float sym2[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float sym2t[3][3] = { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
float mis_euler1[3] = { 0.0f, 0.0f, 0.0f };
//.........这里部分代码省略.........
示例10: ConvertData
/**
* @brief ConvertData Templated function that converts an IDataArray to a given primitive type
* @param ptr IDataArray instance pointer
* @param dims Component dimensions
* @param m DataContainer instance pointer
* @param scalarType Primitive type to convert to
* @param attributeMatrixName Name of target AttributeMatrix
* @param name Name of converted array
*/
void ConvertData(T* ptr, QVector<size_t> dims, DataContainer::Pointer m, int32_t scalarType, const QString attributeMatrixName, const QString& name)
{
int voxels = ptr->getNumberOfTuples();
size_t size = ptr->getSize();
if (scalarType == Detail::Int8)
{
Int8ArrayType::Pointer p = Int8ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::UInt8)
{
UInt8ArrayType::Pointer p = UInt8ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::Int16)
{
Int16ArrayType::Pointer p = Int16ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::UInt16)
{
UInt16ArrayType::Pointer p = UInt16ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::Int32)
{
Int32ArrayType::Pointer p = Int32ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::UInt32)
{
UInt32ArrayType::Pointer p = UInt32ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::Int64)
{
Int64ArrayType::Pointer p = Int64ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::UInt64)
{
UInt64ArrayType::Pointer p = UInt64ArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::Float)
{
FloatArrayType::Pointer p = FloatArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
{
p->setValue(v, ptr->getValue(v) );
}
}
else if (scalarType == Detail::Double)
{
DoubleArrayType::Pointer p = DoubleArrayType::CreateArray(voxels, dims, name);
m->getAttributeMatrix(attributeMatrixName)->addAttributeArray(p->getName(), p);
for(size_t v = 0; v < size; ++v)
//.........这里部分代码省略.........
示例11: in
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ImportR3DStack::execute()
{
int err = 0;
setErrorCondition(err);
dataCheck(false,1,1,1);
if (getErrorCondition() < 0) { notifyErrorMessage("There is a problem with the data check", getErrorCondition()); }
VoxelDataContainer* m = getVoxelDataContainer();
if(NULL == m)
{
setErrorCondition(-999);
notifyErrorMessage("The DataContainer Object was NULL", -999);
return;
}
setErrorCondition(0);
std::stringstream ss;
m->setResolution(m_Resolution.x, m_Resolution.y, m_Resolution.z);
m->setOrigin(m_Origin.x, m_Origin.y, m_Origin.z);
int x = 0;
int y = 0;
readXYSize(x, y);
if (x < 1 || y < 1)
{
setErrorCondition(-1000);
notifyErrorMessage("At least one dimension is less than 1", getErrorCondition());
}
size_t numSlices = m_ZEndIndex - m_ZStartIndex + 1;
size_t totalVoxels = numSlices * x * y;
// Create a new array, eventually substituting this into the DataContainer later on.
Int32ArrayType::Pointer grainIdsPtr = Int32ArrayType::CreateArray(totalVoxels, 1, DREAM3D::CellData::GrainIds);
grainIdsPtr->initializeWithZeros();
m_GrainIds = grainIdsPtr->GetPointer(0); // Get the pointer to the front of the array
int32_t* currentPositionPtr = m_GrainIds;
bool ok = false;
int pixelBytes = 0;
int totalPixels = 0;
int height = 0;
int width = 0;
size_t index = 0;
int64_t z = m_ZStartIndex;
m->setDimensions(x,y,numSlices);
for (std::vector<std::string>::iterator filepath = m_R3DFileList.begin(); filepath != m_R3DFileList.end(); ++filepath)
{
QString R3DFName = QString::fromStdString(*filepath);
ss.str("");
ss << "Importing file " << R3DFName.toStdString();
notifyStatusMessage(ss.str());
QByteArray buf;
QFile in(R3DFName);
if (!in.open(QIODevice::ReadOnly | QIODevice::Text))
{
QString msg = QString("R3D file could not be opened: ") + R3DFName;
setErrorCondition(-14000);
notifyErrorMessage(msg.toStdString(), getErrorCondition());
}
buf = in.readLine(); // Read first line which is the x and y sizes
QList<QByteArray> tokens = buf.split(',');
width = tokens.at(0).toInt();
height = tokens.at(1).toInt();
int32_t value = 0;
for(qint32 i = 0; i < height; ++i)
{
buf = in.readLine();
tokens = buf.split(',');
if (tokens.size() != width+2)
{
notifyStatusMessage("A file did not have the correct width partilcuar line");
break;
}
for(int j = 1; j < width+1; j++)
{
currentPositionPtr[index] = tokens[j].toInt(&ok, 10);
++index;
if (!ok)
{
setErrorCondition(-2004);
notifyErrorMessage("Width dimension entry was not an integer", getErrorCondition());
break;
}
}
if (in.atEnd() == true && i < height - 2)
//.........这里部分代码省略.........
示例12: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SampleSurfaceMesh::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer sm = getDataContainerArray()->getDataContainer(m_SurfaceMeshFaceLabelsArrayPath.getDataContainerName());
SIMPL_RANDOMNG_NEW()
#ifdef SIMPLib_USE_PARALLEL_ALGORITHMS
tbb::task_scheduler_init init;
bool doParallel = true;
#endif
TriangleGeom::Pointer triangleGeom = sm->getGeometryAs<TriangleGeom>();
// pull down faces
int64_t numFaces = m_SurfaceMeshFaceLabelsPtr.lock()->getNumberOfTuples();
// create array to hold bounding vertices for each face
FloatArrayType::Pointer llPtr = FloatArrayType::CreateArray(3, "_INTERNAL_USE_ONLY_Lower_Left");
FloatArrayType::Pointer urPtr = FloatArrayType::CreateArray(3, "_INTERNAL_USE_ONLY_Upper_Right");
float* ll = llPtr->getPointer(0);
float* ur = urPtr->getPointer(0);
VertexGeom::Pointer faceBBs = VertexGeom::CreateGeometry(2 * numFaces, "_INTERNAL_USE_ONLY_faceBBs");
// walk through faces to see how many features there are
int32_t g1 = 0, g2 = 0;
int32_t maxFeatureId = 0;
for (int64_t i = 0; i < numFaces; i++)
{
g1 = m_SurfaceMeshFaceLabels[2 * i];
g2 = m_SurfaceMeshFaceLabels[2 * i + 1];
if (g1 > maxFeatureId) { maxFeatureId = g1; }
if (g2 > maxFeatureId) { maxFeatureId = g2; }
}
// add one to account for feature 0
int32_t numFeatures = maxFeatureId + 1;
// create a dynamic list array to hold face lists
Int32Int32DynamicListArray::Pointer faceLists = Int32Int32DynamicListArray::New();
std::vector<int32_t> linkCount(numFeatures, 0);
// fill out lists with number of references to cells
typedef boost::shared_array<int32_t> SharedInt32Array_t;
SharedInt32Array_t linkLocPtr(new int32_t[numFaces]);
int32_t* linkLoc = linkLocPtr.get();
::memset(linkLoc, 0, numFaces * sizeof(int32_t));
// traverse data to determine number of faces belonging to each feature
for (int64_t i = 0; i < numFaces; i++)
{
g1 = m_SurfaceMeshFaceLabels[2 * i];
g2 = m_SurfaceMeshFaceLabels[2 * i + 1];
if (g1 > 0) { linkCount[g1]++; }
if (g2 > 0) { linkCount[g2]++; }
}
// now allocate storage for the faces
faceLists->allocateLists(linkCount);
// traverse data again to get the faces belonging to each feature
for (int64_t i = 0; i < numFaces; i++)
{
g1 = m_SurfaceMeshFaceLabels[2 * i];
g2 = m_SurfaceMeshFaceLabels[2 * i + 1];
if (g1 > 0) { faceLists->insertCellReference(g1, (linkLoc[g1])++, i); }
if (g2 > 0) { faceLists->insertCellReference(g2, (linkLoc[g2])++, i); }
// find bounding box for each face
GeometryMath::FindBoundingBoxOfFace(triangleGeom, i, ll, ur);
faceBBs->setCoords(2 * i, ll);
faceBBs->setCoords(2 * i + 1, ur);
}
// generate the list of sampling points from subclass
VertexGeom::Pointer points = generate_points();
if(getErrorCondition() < 0 || NULL == points.get()) { return; }
int64_t numPoints = points->getNumberOfVertices();
// create array to hold which polyhedron (feature) each point falls in
Int32ArrayType::Pointer iArray = Int32ArrayType::NullPointer();
iArray = Int32ArrayType::CreateArray(numPoints, "_INTERNAL_USE_ONLY_polyhedronIds");
iArray->initializeWithZeros();
int32_t* polyIds = iArray->getPointer(0);
#ifdef SIMPLib_USE_PARALLEL_ALGORITHMS
if (doParallel == true)
{
tbb::parallel_for(tbb::blocked_range<size_t>(0, numFeatures),
SampleSurfaceMeshImpl(triangleGeom, faceLists, faceBBs, points, polyIds), tbb::auto_partitioner());
}
else
#endif
{
SampleSurfaceMeshImpl serial(triangleGeom, faceLists, faceBBs, points, polyIds);
serial.checkPoints(0, numFeatures);
//.........这里部分代码省略.........
示例13: writeGrains
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int AbaqusSurfaceMeshWriter::writeGrains(FILE* f)
{
//*Elset, elset=Grain1
//1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
int err = 0;
std::stringstream ss;
SurfaceMeshDataContainer* sm = getSurfaceMeshDataContainer();
DREAM3D::SurfaceMesh::VertListPointer_t nodesPtr = sm->getVertices();
DREAM3D::SurfaceMesh::FaceListPointer_t trianglePtr = sm->getFaces();
// Get the Labels(GrainIds or Region Ids) for the triangles
Int32ArrayType::Pointer faceLabelsPtr = boost::dynamic_pointer_cast<Int32ArrayType>(sm->getFaceData(DREAM3D::FaceData::SurfaceMeshFaceLabels));
int32_t* faceLabels = faceLabelsPtr->GetPointer(0);
int nTriangles = trianglePtr->GetNumberOfTuples();
// Store all the unique Spins
std::set<int> uniqueSpins;
for (int i = 0; i < nTriangles; i++)
{
uniqueSpins.insert(faceLabels[i*2]);
uniqueSpins.insert(faceLabels[i*2+1]);
}
int spin = 0;
//Loop over the unique Spins
for (std::set<int>::iterator spinIter = uniqueSpins.begin(); spinIter != uniqueSpins.end(); ++spinIter )
{
spin = *spinIter;
if(spin < 0) { continue; }
fprintf(f, "*ELSET, ELSET=Grain%d\n", spin);
ss.str("");
ss << "Writing ELSET for Grain Id " << spin;
notifyStatusMessage(ss.str());
// Loop over all the triangles for this spin
int lineCount = 0;
for(int t = 0; t < nTriangles; ++t)
{
if (faceLabels[t*2] != spin && faceLabels[t*2+1] != spin)
{
continue; // We do not match either spin so move to the next triangle
}
// Only print 15 Triangles per line
if (lineCount == 15)
{
fprintf(f, ", %d\n", t);
lineCount = 0;
}
else if(lineCount == 0) // First value on the line
{
fprintf(f,"%d", t);
lineCount++;
}
else
{
fprintf(f,", %d", t);
lineCount++;
}
}
// Make sure we have a new line at the end of the section
if (lineCount != 0)
{
fprintf(f, "\n");
}
}
return err;
}
示例14: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ErodeDilateCoordinationNumber::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getFeatureIdsArrayPath().getDataContainerName());
size_t totalPoints = m_FeatureIdsPtr.lock()->getNumberOfTuples();
Int32ArrayType::Pointer neighborsPtr = Int32ArrayType::CreateArray(totalPoints, "Neighbors");
m_Neighbors = neighborsPtr->getPointer(0);
neighborsPtr->initializeWithValue(-1);
size_t udims[3] = {0, 0, 0};
m->getGeometryAs<ImageGeom>()->getDimensions(udims);
int64_t dims[3] =
{
static_cast<int64_t>(udims[0]),
static_cast<int64_t>(udims[1]),
static_cast<int64_t>(udims[2]),
};
int32_t good = 1;
int64_t point = 0;
int64_t kstride = 0, jstride = 0;
int32_t featurename = 0, feature = 0;
int32_t coordination = 0;
int32_t current = 0;
int32_t most = 0;
int64_t neighpoint = 0;
size_t numfeatures = 0;
for(size_t i = 0; i < totalPoints; i++)
{
featurename = m_FeatureIds[i];
if (featurename > numfeatures) { numfeatures = featurename; }
}
int64_t neighpoints[6] = { 0, 0, 0, 0, 0, 0 };
neighpoints[0] = -dims[0] * dims[1];
neighpoints[1] = -dims[0];
neighpoints[2] = -1;
neighpoints[3] = 1;
neighpoints[4] = dims[0];
neighpoints[5] = dims[0] * dims[1];
QString attrMatName = m_FeatureIdsArrayPath.getAttributeMatrixName();
QList<QString> voxelArrayNames = m->getAttributeMatrix(attrMatName)->getAttributeArrayNames();
QVector<int32_t> n(numfeatures + 1, 0);
QVector<int32_t> coordinationNumber(totalPoints, 0);
bool keepgoing = true;
int32_t counter = 1;
while (counter > 0 && keepgoing == true)
{
counter = 0;
if (m_Loop == false) { keepgoing = false; }
for (int64_t k = 0; k < dims[2]; k++)
{
kstride = dims[0] * dims[1] * k;
for (int64_t j = 0; j < dims[1]; j++)
{
jstride = dims[0] * j;
for (int64_t i = 0; i < dims[0]; i++)
{
point = kstride + jstride + i;
featurename = m_FeatureIds[point];
coordination = 0;
current = 0;
most = 0;
for (int32_t l = 0; l < 6; l++)
{
good = 1;
neighpoint = point + neighpoints[l];
if (l == 0 && k == 0) { good = 0; }
if (l == 5 && k == (dims[2] - 1)) { good = 0; }
if (l == 1 && j == 0) { good = 0; }
if (l == 4 && j == (dims[1] - 1)) { good = 0; }
if (l == 2 && i == 0) { good = 0; }
if (l == 3 && i == (dims[0] - 1)) { good = 0; }
if (good == 1)
{
feature = m_FeatureIds[neighpoint];
if ((featurename > 0 && feature == 0) || (featurename == 0 && feature > 0))
{
coordination = coordination + 1;
n[feature]++;
current = n[feature];
if (current > most)
{
most = current;
m_Neighbors[point] = neighpoint;
}
}
//.........这里部分代码省略.........
示例15: removeInactiveObjects
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
bool AttributeMatrix::removeInactiveObjects(QVector<bool> activeObjects, Int32ArrayType::Pointer Ids)
{
bool acceptableMatrix = false;
//Only valid for feature or ensemble type matrices
if(m_Type == DREAM3D::AttributeMatrixType::VertexFeature || m_Type == DREAM3D::AttributeMatrixType::VertexEnsemble ||
m_Type == DREAM3D::AttributeMatrixType::EdgeFeature || m_Type == DREAM3D::AttributeMatrixType::EdgeEnsemble ||
m_Type == DREAM3D::AttributeMatrixType::FaceFeature || m_Type == DREAM3D::AttributeMatrixType::FaceEnsemble ||
m_Type == DREAM3D::AttributeMatrixType::CellFeature || m_Type == DREAM3D::AttributeMatrixType::CellEnsemble)
{
acceptableMatrix = true;
}
size_t totalTuples = getNumTuples();
if( static_cast<size_t>(activeObjects.size()) == totalTuples && acceptableMatrix == true)
{
size_t goodcount = 1;
QVector<size_t> NewNames(totalTuples, 0);
QVector<size_t> RemoveList;
for(qint32 i = 1; i < activeObjects.size(); i++)
{
if(activeObjects[i] == false)
{
RemoveList.push_back(i);
NewNames[i] = 0;
}
else
{
NewNames[i] = goodcount;
goodcount++;
}
}
if(RemoveList.size() > 0)
{
QList<QString> headers = getAttributeArrayNames();
for (QList<QString>::iterator iter = headers.begin(); iter != headers.end(); ++iter)
{
IDataArray::Pointer p = getAttributeArray(*iter);
QString type = p->getTypeAsString();
if(type.compare("NeighborList<T>") == 0)
{
removeAttributeArray(*iter);
}
else
{
p->eraseTuples(RemoveList);
}
}
QVector<size_t> tDims(1, (totalTuples - RemoveList.size()));
setTupleDimensions(tDims);
// Loop over all the points and correct all the feature names
size_t totalPoints = Ids->getNumberOfTuples();
int32_t* id = Ids->getPointer(0);
for (size_t i = 0; i < totalPoints; i++)
{
if(id[i] >= 0 && id[i] < NewNames.size())
{
id[i] = static_cast<int32_t>( NewNames[id[i]] );
}
}
}
}
else
{
return false;
}
return true;
}