本文整理汇总了C++中CCopasiObject::getObjectDisplayName方法的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiObject::getObjectDisplayName方法的具体用法?C++ CCopasiObject::getObjectDisplayName怎么用?C++ CCopasiObject::getObjectDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCopasiObject
的用法示例。
在下文中一共展示了CCopasiObject::getObjectDisplayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getXPathAndName
std::string
SEDMLUtils::getXPathForObject(const CCopasiObject& object)
{
const std::string& type = object.getObjectName();
const CCopasiDataModel* dm = object.getObjectDataModel();
std::string yAxis = object.getObjectDisplayName();
std::string targetXPathString = getXPathAndName(yAxis, type,
dm->getModel(), *dm);
return targetXPathString;
}
示例2: createDataGenerators
/**
* Creates the data generators for SEDML.
*/
void CSEDMLExporter::createDataGenerators(CCopasiDataModel & dataModel,
std::string & taskId,
CCopasiTask* task)
{
const CModel* pModel = dataModel.getModel();
std::vector<std::string> stringsContainer; //split string container
if (pModel == NULL)
CCopasiMessage(CCopasiMessage::ERROR, "SED-ML: No model for this SED-ML document. An SBML model must exist for every SED-ML document.");
SedPlot2D* pPSedPlot;
SedCurve* pCurve; // = pPSedPlot->createCurve();
//create generator for special varibale time
const CCopasiObject* pTime = static_cast<const CCopasiObject *>(dataModel.getModel()->getObject(CCopasiObjectName("Reference=Time")));
SedDataGenerator *pTimeDGenp = this->mpSEDMLDocument->createDataGenerator();
pTimeDGenp->setId("time");
pTimeDGenp->setName(pTime->getObjectName());
SedVariable *pTimeVar = pTimeDGenp->createVariable();
pTimeVar->setId("var_time");
pTimeVar->setTaskReference(taskId);
pTimeVar->setSymbol(SEDML_TIME_URN);
pTimeDGenp->setMath(SBML_parseFormula(pTimeVar->getId().c_str()));
size_t i, imax = dataModel.getPlotDefinitionList()->size();
SedDataGenerator *pPDGen;
if (imax == 0 && (task == NULL || task->getReport().getTarget().empty()))
CCopasiMessage(CCopasiMessage::ERROR, "SED-ML: No plot/report definition for this SED-ML document.");
// export report
if (task != NULL && !task->getReport().getTarget().empty())
{
CReportDefinition* def = task->getReport().getReportDefinition();
if (def != NULL)
{
SedReport* pReport = mpSEDMLDocument->createReport();
std::string name = def->getObjectName();
SEDMLUtils::removeCharactersFromString(name, "[]");
//
pReport->setId(SEDMLUtils::getNextId("report", mpSEDMLDocument->getNumOutputs()));
pReport->setName(name);
std::vector<CRegisteredObjectName> header = *def->getHeaderAddr();
std::vector<CRegisteredObjectName> body =
def->isTable() ? *def->getTableAddr() :
*def->getBodyAddr();
int dsCount = 0;
for (size_t i = 0; i < body.size(); ++i)
{
CRegisteredObjectName& current = body[i];
if (current == def->getSeparator().getCN()) continue;
CCopasiObject *object = dataModel.getDataObject(current);
if (object == NULL) continue;
const std::string& typeX = object->getObjectName();
std::string xAxis = object->getObjectDisplayName();
std::string targetXPathStringX = SEDMLUtils::getXPathAndName(xAxis, typeX,
pModel, dataModel);
if (object->getCN() == pTime->getCN())
pPDGen = pTimeDGenp;
else
pPDGen = createDataGenerator(
this->mpSEDMLDocument,
xAxis,
targetXPathStringX,
taskId,
i,
0
);
SedDataSet* pDS = pReport->createDataSet();
pDS->setId(SEDMLUtils::getNextId("ds", ++dsCount));
if (def->isTable())
{
CCopasiObject *headerObj = NULL;
if (header.size() > i)
headerObj = dataModel.getDataObject(header[i]);
else
headerObj = dataModel.getDataObject(body[i]);
if (headerObj != NULL)
pDS->setLabel(headerObj->getObjectDisplayName());
else
pDS->setLabel(xAxis);
}
else
//.........这里部分代码省略.........
示例3: createParameterMapping
void CMMLOutput::createParameterMapping(const CReaction* pReac,
std::vector<std::vector<std::string> > & params,
bool numbers)
{
assert(pReac);
assert(pReac->getFunction());
const CFunctionParameters & functionParams = pReac->getFunctionParameters();
size_t j, jmax;
size_t i, imax = functionParams.size();
params.resize(imax);
for (i = 0; i < imax; ++i)
{
params[i].resize(1);
std::string name;
//std::ostringstream number;
switch (functionParams[i]->getUsage())
{
case CFunctionParameter::SUBSTRATE:
case CFunctionParameter::PRODUCT:
case CFunctionParameter::MODIFIER:
if (functionParams[i]->getType() == CFunctionParameter::FLOAT64)
{
CCopasiObject * pObject = CCopasiRootContainer::getKeyFactory()->get(pReac->getParameterMappings()[i][0]);
if (pObject != NULL)
{
name = pObject->getObjectDisplayName();
}
else
{
name = "unknown";
}
//params[i][0] = "<mi>"+ CMathMl::fixName(name)+"</mi>";
params[i][0] = "<mi>[" + CMathMl::fixName(name) + "]</mi>";
}
else if (functionParams[i]->getType() == CFunctionParameter::VFLOAT64)
{
jmax = pReac->getParameterMappings()[i].size();
params[i].resize(jmax);
for (j = 0; j < jmax; ++j)
{
name = CCopasiRootContainer::getKeyFactory()->get(pReac->getParameterMappings()[i][j])->getObjectDisplayName();
//params[i][j] = "<mi>"+ CMathMl::fixName(name)+"</mi>";
params[i][j] = "<mi>[" + CMathMl::fixName(name) + "]</mi>";
}
}
else assert(false);
break;
case CFunctionParameter::PARAMETER:
if (pReac->isLocalParameter(i))
{
if (numbers)
{
std::ostringstream number;
number << pReac->getParameterValue(functionParams[i]->getObjectName());
params[i][0] = "<mn>" + number.str() + "</mn>";
}
else
{
name = CCopasiRootContainer::getKeyFactory()->get(pReac->getParameterMappings()[i][0])->getObjectName();
//params[i][0] = "<mi>" + CMathMl::fixName(name) + "</mi>";
params[i][0] = "<msub><mi>" + CMathMl::fixName(name) + "</mi><mi>("
+ CMathMl::fixName(pReac->getObjectName()) + ")</mi></msub>";
}
}
else
{
name = CCopasiRootContainer::getKeyFactory()->get(pReac->getParameterMappings()[i][0])->getObjectName();
params[i][0] = "<mi>" + CMathMl::fixName(name) + "</mi>";
//params[i][0] = "<mi>ggg</mi>";
}
break;
case CFunctionParameter::VOLUME:
name = CCopasiRootContainer::getKeyFactory()->get(pReac->getParameterMappings()[i][0])->getObjectName();
params[i][0] = "<msub><mi>V</mi><mi>" + CMathMl::fixName(name)
+ "</mi></msub>";
break;
case CFunctionParameter::TIME:
params[i][0] = "<mi>time</mi>";
break;
default:
break;
}
}
}