/** * Returns a pointer to the CCopasiDataModel the element belongs to. * If there is no instance of CCopasiDataModel in the ancestor tree, NULL * is returned. */ CCopasiDataModel* CCopasiObject::getObjectDataModel() { CCopasiObject * pObject = this; while (pObject != NULL) { if (pObject->isDataModel()) return static_cast<CCopasiDataModel *>(pObject); pObject = pObject->getObjectParent(); } return NULL; }