本文整理汇总了C++中CFunction::getMiriamAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C++ CFunction::getMiriamAnnotation方法的具体用法?C++ CFunction::getMiriamAnnotation怎么用?C++ CFunction::getMiriamAnnotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunction
的用法示例。
在下文中一共展示了CFunction::getMiriamAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enterProtected
bool CQRDFTreeView::enterProtected()
{
clear();
CCopasiObject *pObject = dynamic_cast< CCopasiObject * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
if (pObject != NULL)
{
CModelEntity * pEntity = NULL;
CEvent * pEvent = NULL;
CReaction * pReaction = NULL;
CFunction * pFunction = NULL;
const std::string * pMiriamAnnotation = NULL;
if ((pEntity = dynamic_cast< CModelEntity * >(pObject)) != NULL)
pMiriamAnnotation = &pEntity->getMiriamAnnotation();
else if ((pEvent = dynamic_cast< CEvent * >(pObject)) != NULL)
pMiriamAnnotation = &pEvent->getMiriamAnnotation();
else if ((pReaction = dynamic_cast< CReaction * >(pObject)) != NULL)
pMiriamAnnotation = &pReaction->getMiriamAnnotation();
else if ((pFunction = dynamic_cast< CFunction * >(pObject)) != NULL)
pMiriamAnnotation = &pFunction->getMiriamAnnotation();
if (pMiriamAnnotation && *pMiriamAnnotation != "")
mpGraph = CRDFParser::graphFromXml(*pMiriamAnnotation);
}
CCopasiMessage::clearDeque();
if (CCopasiMessage::size() != 0)
{
QString Message = FROM_UTF8(CCopasiMessage::getAllMessageText());
CQMessageBox::warning(this, QString("RDF Warning"), Message,
QMessageBox::Ok, QMessageBox::Ok);
}
if (mpGraph == NULL)
mpGraph = new CRDFGraph;
// We make sure that we always have an about node.
mpGraph->createAboutNode(mKey);
// We iterate of all triplets
std::set< CRDFTriplet >::const_iterator it = mpGraph->getTriplets().begin();
std::set< CRDFTriplet >::const_iterator end = mpGraph->getTriplets().end();
for (; it != end; ++it)
{
CQRDFTreeViewItem * pSubjectItem = find(it->pSubject);
if (pSubjectItem == NULL)
{
pSubjectItem = new CQRDFTreeViewItem(mpTreeWidget, NULL);
insert(it->pSubject, pSubjectItem);
// Display the subject information
const CRDFSubject & Subject = it->pSubject->getSubject();
switch (Subject.getType())
{
case CRDFSubject::RESOURCE:
pSubjectItem->setText(COL_SUBJECT, FROM_UTF8(Subject.getResource()));
break;
case CRDFSubject::BLANK_NODE:
pSubjectItem->setText(COL_SUBJECT, FROM_UTF8(Subject.getBlankNodeID()));
break;
}
}
CQRDFTreeViewItem * pObjectItem = NULL;
if (it->Predicate.getURI() == "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject")
{
pObjectItem = new CQRDFTreeViewItem(pSubjectItem, NULL);
insert(it->pObject, pObjectItem);
}
else
pObjectItem = find(it->pObject);
if (pObjectItem == NULL)
{
pObjectItem = new CQRDFTreeViewItem(pSubjectItem, NULL);
insert(it->pObject, pObjectItem);
}
else
{
QTreeWidgetItem * pParent = pObjectItem->parent();
if (pParent == NULL)
{
mpTreeWidget->invisibleRootItem()->removeChild(pObjectItem);
pSubjectItem->addChild(pObjectItem);
}
else
{
pParent->removeChild(pObjectItem);
pSubjectItem->addChild(pObjectItem);
}
}
//.........这里部分代码省略.........