From: Oliver O. <fr...@us...> - 2007-05-08 03:27:22
|
Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23932 Modified Files: Tag: projectx materialserver_c.cpp Log Message: - Added facilities to export registered materials. - the (protected) method ExportMaterial(material) exports one material via all registered exporters - exporters can be created and registered via InitMaterialExporter(name) - ExportAllMaterial() exports all materials (when it's called). Materials can't just be exported automatically, as one possible method to register materials is to just put them in the tree below the MaterialServer. So ExportAllMaterial has to be called manually after Materials have been installed (can also be called from Ruby). Index: materialserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** materialserver_c.cpp 5 Dec 2005 21:38:22 -0000 1.1 --- materialserver_c.cpp 8 May 2007 03:27:18 -0000 1.1.4.1 *************** *** 25,32 **** using namespace boost; using namespace kerosin; ! using namespace zeitgeist; ! void CLASS(MaterialServer)::DefineClass() { ! DEFINE_BASECLASS(zeitgeist/Node); } --- 25,63 ---- using namespace boost; using namespace kerosin; ! using namespace std; ! FUNCTION(MaterialServer,initMaterialExporter) { ! string inExporterName; ! ! if ( ! (in.GetSize() != 1) || ! (! in.GetValue(in.begin(),inExporterName)) ! ) ! { ! return false; ! } ! ! return obj->InitMaterialExporter(inExporterName); ! } ! ! FUNCTION(MaterialServer,exportAllMaterial) ! { ! if ( ! (in.GetSize() != 0) ! ) ! { ! return false; ! } ! ! obj->ExportAllMaterial(); ! return true; ! } ! ! void ! CLASS(MaterialServer)::DefineClass() ! { ! DEFINE_BASECLASS(zeitgeist/Node); ! DEFINE_FUNCTION(initMaterialExporter); ! DEFINE_FUNCTION(exportAllMaterial); } |