Katana Plug-in APIs 0.1

FnLookFile.h

00001 // Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FnGeolibServicesLookFile_H
00004 #define FnGeolibServicesLookFile_H
00005 
00006 #include <string>
00007 #include <stdint.h>
00008 #include <memory>
00009 
00010 #include <FnAttribute/FnAttribute.h>
00011 
00012 #include <FnGeolibServices/FnGeolibServicesAPI.h>
00013 #include <FnGeolibServices/ns.h>
00014 #include <FnGeolibServices/suite/FnLookFileSuite.h>
00015 
00016 
00017 #include <FnPluginSystem/FnPluginSystem.h>
00018 
00019 FNGEOLIBSERVICES_NAMESPACE_ENTER
00020 {
00025     class FNGEOLIBSERVICES_API FnLookFile
00026     {
00027     public:
00028         typedef std::shared_ptr<FnLookFile> Ptr;
00029 
00030         class FNGEOLIBSERVICES_API AttrMap
00031         {
00032         public:
00033             typedef std::shared_ptr<AttrMap> Ptr;
00034 
00035             FnAttribute::Attribute get(const std::string & key) const;
00036             FnAttribute::StringAttribute getKeys() const;
00037 
00038             ~AttrMap();
00039 
00040         private:
00041             friend class FnLookFile; // only FnLookFile can create these
00042             AttrMap(FnLookFileAttrMapHandle handle);
00043 
00044             FnLookFileAttrMapHandle _handle;
00045         };
00046 
00047         ~FnLookFile();
00048 
00049         static Ptr getLookFile(const std::string & filePath,
00050                 const std::string & passName=std::string());
00051 
00052         AttrMap::Ptr getMaterials() const;
00053         std::string getMaterialType(const std::string & materialName) const;
00054         FnAttribute::Attribute getMaterial(const std::string & name,
00055                 bool global=true) const;
00056 
00057         FnAttribute::StringAttribute getRootIdNames() const;
00058         std::string getRootIdType(const std::string & rootId) const;
00059         FnAttribute::StringAttribute getPathsWithOverrides(
00060                 const std::string & rootId=std::string()) const;
00061         AttrMap::Ptr getAttrs(const std::string & locationName,
00062                 const std::string & rootId=std::string()) const;
00063         AttrMap::Ptr getRootOverrides() const;
00064 
00065         static FnAttribute::StringAttribute getPassNamesForLookFileAsset(
00066                 const std::string & asset);
00067 
00068         static FnAttribute::StringAttribute getSafePath(
00069                 const std::string & asset, bool includeVersion);
00070 
00071         static void flushCache();
00072 
00073     private:
00074         FnLookFile(FnLookFileHandle handle);
00075 
00076         static const FnLookFileHostSuite_v2 * _getSuite();
00077 
00078         FnLookFileHandle _handle;
00079     };
00080 
00082 }
00083 FNGEOLIBSERVICES_NAMESPACE_EXIT
00084 
00085 
00086 
00087 
00088 #endif // FnGeolibServicesLookFile_H
 All Classes Functions Variables Typedefs Enumerations Enumerator