本文整理汇总了C++中datacontainerarray::Pointer::getAttributeMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::getAttributeMatrix方法的具体用法?C++ Pointer::getAttributeMatrix怎么用?C++ Pointer::getAttributeMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datacontainerarray::Pointer
的用法示例。
在下文中一共展示了Pointer::getAttributeMatrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPhaseCount
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int EstablishShapeTypes::getPhaseCount()
{
DataContainerArray::Pointer dca = getDataContainerArray();
AttributeMatrix::Pointer inputAttrMat = dca->getAttributeMatrix(getInputPhaseTypesArrayPath());
if (NULL == inputAttrMat.get() ) { return 0; }
if (__SHOW_DEBUG_MSG__)
{
qDebug() << " data->getNumberOfTuples(): " << inputAttrMat->getTupleDimensions();
qDebug() << "Name" << inputAttrMat->getName();
}
if (inputAttrMat->getType() < DREAM3D::AttributeMatrixType::VertexEnsemble
|| inputAttrMat->getType() > DREAM3D::AttributeMatrixType::CellEnsemble )
{
return 0;
}
QVector<size_t> tupleDims = inputAttrMat->getTupleDimensions();
size_t phaseCount = 1;
for (int32_t i = 0; i < tupleDims.size(); i++)
{
phaseCount = phaseCount * tupleDims[i];
}
return phaseCount;
}
示例2: PopulateAttributeMatrixComboBox
static void PopulateAttributeMatrixComboBox(AbstractFilter* filter, FilterParameter* filterParameter,
QComboBox* dcCombo, QComboBox* amCombo,
DataContainerArrayProxy& dcaProxy)
{
FilterParameterType* fp = dynamic_cast<FilterParameterType*>(filterParameter);
assert(fp != NULL);
DataContainerArray::Pointer dca = filter->getDataContainerArray();
if (NULL == dca.get()) { return; }
QString dcName = dcCombo->currentText();
// Clear the AttributeMatrix List
bool alreadyBlocked = false;
if(amCombo->signalsBlocked()) { alreadyBlocked = true; }
amCombo->blockSignals(true);
amCombo->clear();
// Loop over the data containers until we find the proper data container
QList<DataContainerProxy> containers = dcaProxy.dataContainers.values();
QListIterator<DataContainerProxy> containerIter(containers);
QVector<unsigned int> defVec = fp->getDefaultAttributeMatrixTypes();
while(containerIter.hasNext())
{
DataContainerProxy dc = containerIter.next();
if(dc.name.compare(dcName) == 0 )
{
// We found the proper Data Container, now populate the AttributeMatrix List
QMap<QString, AttributeMatrixProxy> attrMats = dc.attributeMatricies;
QMapIterator<QString, AttributeMatrixProxy> attrMatsIter(attrMats);
while(attrMatsIter.hasNext() )
{
attrMatsIter.next();
QString amName = attrMatsIter.key();
AttributeMatrix::Pointer am = dca->getAttributeMatrix(DataArrayPath(dc.name, amName, ""));
amCombo->addItem(amName);
if (NULL != am.get() && defVec.isEmpty() == false && defVec.contains(am->getType()) == false)
{
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(amCombo->model());
if (NULL != model)
{
QStandardItem* item = model->item(amCombo->findText(amName));
if (NULL != item)
{
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
}
}
}
}
}
}
if(!alreadyBlocked) { // Only unblock if this function blocked the signals.
amCombo->blockSignals(false);
}
}