Katana Plug-in APIs 0.1

ScenegraphLocationDelegate.h

00001 // Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FNRENDER_SCENEGRAPHLOCATIONDELEGATE_H
00004 #define FNRENDER_SCENEGRAPHLOCATIONDELEGATE_H
00005 
00006 #include <vector>
00007 
00008 #include "FnPluginSystem/FnPlugin.h"
00009 
00010 #include "FnRender/FnRenderAPI.h"
00011 #include "FnRender/suite/FnScenegraphLocationDelegateSuite.h"
00012 
00013 #include "FnScenegraphIterator/FnScenegraphIterator.h"
00014 #include "FnScenegraphIterator/suite/FnScenegraphIteratorSuite.h"
00015 
00016 namespace Foundry
00017 {
00018 namespace Katana
00019 {
00020 namespace Render
00021 {
00048     class FNRENDER_API ScenegraphLocationDelegate
00049     {
00050     public:
00051         virtual ~ScenegraphLocationDelegate() {}
00052         void bootstrap(void* ptr) {};
00053 
00063         virtual void* process(FnScenegraphIterator sgIterator, void* optionalInput) = 0;
00064         virtual std::string getSupportedRenderer() const { return std::string(); };
00065         virtual void fillSupportedLocationList(std::vector<std::string>& supportedLocationList) const = 0;
00066 
00067         static FnScenegraphLocationDelegatePluginSuite_v1 createSuite(FnLocationHandle(*create)());
00068         static FnPlugStatus setHost(FnPluginHost* host);
00069         static FnLocationHandle newLocationHandle(ScenegraphLocationDelegate* location);
00070 
00071         static unsigned int _apiVersion;
00072         static const char* _apiName;
00073 
00074     private:
00075         static FnPluginHost * _host;
00076     };
00077 
00081 }
00082 }
00083 }
00084 
00085 namespace FnKat = Foundry::Katana;
00086 
00087 #define DEFINE_SCENEGRAPH_LOCATION_DELEGATE_PLUGIN(LOCATION_CLASS)            \
00088                                                                               \
00089     FnPlugin LOCATION_CLASS##_plugin;                                         \
00090                                                                               \
00091     FnLocationHandle LOCATION_CLASS##_create()                                \
00092     {                                                                         \
00093         return Foundry::Katana::Render::ScenegraphLocationDelegate::          \
00094                 newLocationHandle(LOCATION_CLASS::create());                  \
00095     }                                                                         \
00096                                                                               \
00097     FnScenegraphLocationDelegatePluginSuite_v1 LOCATION_CLASS##_suite =       \
00098             Foundry::Katana::Render::ScenegraphLocationDelegate::createSuite( \
00099                     LOCATION_CLASS##_create);                                 \
00100                                                                               \
00101     const void* LOCATION_CLASS##_getSuite()                                   \
00102     {                                                                         \
00103         return &LOCATION_CLASS##_suite;                                       \
00104     }
00105 
00106 #endif
 All Classes Functions Variables Typedefs Enumerations Enumerator