Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22398
Modified Files:
Tag: projectx
materialserver.h
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.h
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialserver.h,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** materialserver.h 19 Feb 2006 11:10:11 -0000 1.2
--- materialserver.h 8 May 2007 03:23:33 -0000 1.2.4.1
***************
*** 49,54 ****
--- 49,70 ----
boost::shared_ptr<Material> GetMaterial(const std::string &name);
+ /** Create an instance of a material exporter and register it to the MaterialServer.
+ A MaterialExporter is a class that takes care to additionally register/export
+ materials registered at the MaterialServer at another class (potentially
+ external to spark). This has to be done only when spark/kerosin
+ rendering alone is not enough.
+ \param name name of the MaterialExporter class name
+ \returns true if successful
+ */
+ bool InitMaterialExporter(const std::string& name);
+
+ //! export all registered materials via all registered exporters
+ void ExportAllMaterial();
+
protected:
virtual void OnLink();
+
+ //! export a single material to all registered exporters
+ void ExportMaterial(boost::shared_ptr<Material> material);
};
|