00001 
00002 #ifndef __matter_context_hpp__
00003 #define __matter_context_hpp__
00004 
00005 #include <crbn/matter/minterface.hpp>
00006 
00007 #include "mcache.hpp"
00008 #include "mcreator.hpp"
00009 
00010 
00011 
00012 
00013 
00014 class MatterContext: public MatterInterface
00015 {
00016  public:
00017 
00018   
00019   MatterContext();
00020 
00021   
00022   virtual ~MatterContext();
00023 
00024   
00025   uint32 memory();
00026 
00027   
00028   bool realize();
00029 
00030   
00031   float eval( uint32 index, intersection& inter, ray& r );
00032 
00033   
00034   uint32 create( char* matter_type, paramlist& pl );
00035 
00036   inline mCache* mcache_get() { return &_mcache; }
00037  protected:
00038   mCache _mcache;
00039   mCreator _mcreator;
00040 };
00041 
00042 #endif // __matter_context_hpp__