Code Search for Developers
 
 
  

SRenderPluginManager.h from osgDesigner at Krugle


Show SRenderPluginManager.h syntax highlighted

#ifndef __SRENDERPLUGINMANAGER_H__
#define __SRENDERPLUGINMANAGER_H__ 1



#include <gen_prog/plugin/plugin_manager.h>


#include <osgDesigner/plugins/IRenderPluginDescABC.h>
#include <osgDesigner/core/SConfigManager.h>

#include <osgDesigner/plugins/CModulePrefixSuffix.h>
#include <osgDesigner/plugins/SRenderPluginRegistry.h>

namespace osgDesigner
{
    class CRenderPluginIdentifier
    {
        public:
            
            typedef boost::filesystem::path                     path_type;
            typedef std::vector<path_type>                      path_list;
            
            typedef std::string                                 dynamic_library_key_type;
            typedef std::string                                 module_key_type;
            
            void getDirectoryList(path_list & pathList) const
            {
                boost::filesystem::path userPluginDirectory(SConfigManager::instance()->getPluginDirectory(), boost::filesystem::native);
                
                if (boost::filesystem::exists(userPluginDirectory))
                    pathList.push_back(userPluginDirectory / "render");
                else
                {
                    pathList.push_back("./lib/osgDesignerPlugins/render");
                 
                    pathList.push_back("/usr/local/lib/osgDesignerPlugins/render");
                    pathList.push_back("/usr/lib/osgDesignerPlugins/render");
                }
            }
            
            bool isValidModuleKey(const module_key_type & moduleKey) const
            { return (moduleKey.empty() == false); }
            
            module_key_type toModuleKey(const dynamic_library_key_type & dlKey) const
            { 
                if (dlKey.empty()) return ("");
                
                module_key_type moduleKey;
                
                std::string prefix(getPrefix());
                std::string suffix(getSuffix());
                
                if ((dlKey.find(prefix) == 0) && (dlKey.rfind(suffix) == dlKey.size() - suffix.size()))
                {
                    moduleKey = dlKey;
                    moduleKey.erase(moduleKey.size() - suffix.size(), suffix.size());
                    moduleKey.erase(0, prefix.size());
                }
                
                return (moduleKey); 
            }
            
            dynamic_library_key_type toDynamicLibraryKey(const module_key_type & moduleKey) const
            { 
                return (getPrefix() + moduleKey + getSuffix()); 
            }
            
            
        private :
        
            const char * getSuffix() const
            {
                return ("");
            }
            
            const char * getPrefix() const
            {
                return ("Render_");
            }
    };
    
 
    
    typedef gen_prog::plugin::detail::dynamic_library_identifier_helper< CModulePrefixSuffix >          CRenderDynamicLibraryIdentifier;
    
    typedef gen_prog::plugin::dynamic_library_manager< CRenderDynamicLibraryIdentifier >                CRenderDynamicLibraryManager;

    // ** define a manager for IRenderPluginDescABC
    typedef gen_prog::plugin::plugin_manager< SRenderPluginRegistry, 
                                              CRenderPluginIdentifier, 
                                              CRenderDynamicLibraryManager >                            CRenderPluginManager;
    
    typedef gen_prog::plugin::detail::singleton< CRenderPluginManager >                                 SRenderPluginManager;
    
}

#endif // ** __SRENDERPLUGINMANAGER_H__ **//




See more files for this project here

osgDesigner

osgDesigner is a graphical tool used to modify an OpenSceneGraph (OSG) scene using the osgIntrospection framework. OpenSceneGraph developpers will be able to extend osgDesigner at need using (editor | render | osgIntrospection wrapper) plugin system.

Project homepage: http://sourceforge.net/projects/osgdesigner
Programming language(s): C++,Shell Script
License: other

  CModulePrefixSuffix.h
  DynamicLibrary.h
  IEditorPluginABC.h
  IEditorPluginDescABC.h
  IEditorPluginWidgetABC.h
  IPluginDescABC.h
  IRenderPluginABC.h
  IRenderPluginDescABC.h
  SEditorPluginManager.h
  SEditorPluginRegistry.h
  SRenderPluginManager.h
  SRenderPluginRegistry.h
  TPluginManagerProxy.h