|
From: <mor...@us...> - 2011-02-18 05:14:15
|
Revision: 3897
http://ecell.svn.sourceforge.net/ecell/?rev=3897&view=rev
Author: moriyoshi
Date: 2011-02-18 05:14:08 +0000 (Fri, 18 Feb 2011)
Log Message:
-----------
* Expose simulator object to the expressions in PythonProcess.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/Model.hpp
ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp
Modified: ecell3/trunk/ecell/libecs/Model.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/Model.hpp 2011-02-10 04:23:12 UTC (rev 3896)
+++ ecell3/trunk/ecell/libecs/Model.hpp 2011-02-18 05:14:08 UTC (rev 3897)
@@ -73,7 +73,7 @@
void setup();
- ~Model();
+ virtual ~Model();
/**
Initialize the whole model.
Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp
===================================================================
--- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-02-10 04:23:12 UTC (rev 3896)
+++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-02-18 05:14:08 UTC (rev 3897)
@@ -2817,6 +2817,11 @@
};
};
+AbstractSimulator* Entity_getModel(Entity const& entity)
+{
+ return dynamic_cast<AbstractSimulator*>(entity.getModel());
+}
+
BOOST_PYTHON_MODULE( _ecs )
{
DataPointVectorWrapper< DataPoint >::__class_init__();
@@ -2970,6 +2975,12 @@
py::class_< Entity, py::bases<>, Entity, boost::noncopyable >
( "Entity", py::no_init )
// properties
+ .add_property( "model",
+ py::make_function( &Entity_getModel,
+ return_existing_object() ) )
+ .add_property( "simulator",
+ py::make_function( &Entity_getModel,
+ return_existing_object() ) )
.add_property( "superSystem",
py::make_function( &Entity::getSuperSystem,
return_existing_object() ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|