本文整理汇总了C++中idataarray::Pointer::deepCopy方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::deepCopy方法的具体用法?C++ Pointer::deepCopy怎么用?C++ Pointer::deepCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idataarray::Pointer
的用法示例。
在下文中一共展示了Pointer::deepCopy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: 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;
}