|
From: <sar...@us...> - 2014-09-22 12:00:23
|
Revision: 21149
http://sourceforge.net/p/sbml/code/21149
Author: sarahkeating
Date: 2014-09-22 12:00:20 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
propagating a transformer needs to be on the submodel instantiate function
Modified Paths:
--------------
trunk/libsbml/src/sbml/packages/comp/extension/CompModelPlugin.cpp
trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
Modified: trunk/libsbml/src/sbml/packages/comp/extension/CompModelPlugin.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/extension/CompModelPlugin.cpp 2014-09-22 09:29:04 UTC (rev 21148)
+++ trunk/libsbml/src/sbml/packages/comp/extension/CompModelPlugin.cpp 2014-09-22 12:00:20 UTC (rev 21149)
@@ -693,14 +693,17 @@
return LIBSBML_OPERATION_FAILED;
}
- // if we have a transformer specified, then we need to propagate it, so it can
- // be used
- if (isSetTransformer())
- {
- CompModelPlugin* other = dynamic_cast<CompModelPlugin*>(submodinst->getPlugin("comp"));
- if (other != NULL)
- other->setTransformer(getTransformer());
- }
+ //// if we have a transformer specified, then we need to propagate it, so it can
+ //// be used
+
+ // this needs to happen in Submodel:instantiate
+
+ //if (isSetTransformer())
+ //{
+ // CompModelPlugin* other = dynamic_cast<CompModelPlugin*>(submodinst->getPlugin("comp"));
+ // if (other != NULL)
+ // other->setTransformer(getTransformer());
+ //}
}
// Next, recursively find all the targets of SBaseRef elements
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-22 09:29:04 UTC (rev 21148)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-22 12:00:20 UTC (rev 21149)
@@ -932,9 +932,20 @@
// plugin->getPrefix(), true);
//}
+ CompModelPlugin* origmodplug =
+ static_cast<CompModelPlugin*>(rootdoc->getModel()->getPlugin(getPrefix()));
+
CompModelPlugin* instmodplug =
static_cast<CompModelPlugin*>(mInstantiatedModel->getPlugin(getPrefix()));
+ // if we have a transformer specified, then we need to propagate it, so it can
+ // be used
+ if (origmodplug->isSetTransformer())
+ {
+ if (instmodplug != NULL)
+ instmodplug->setTransformer(origmodplug->getTransformer());
+ }
+
for (unsigned int sub=0; sub<instmodplug->getNumSubmodels(); sub++)
{
Submodel* instsub = instmodplug->getSubmodel(sub);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|