Katana Plug-in APIs 0.1

FnGeolibCookInterfaceUtilsService.h

00001 // Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FnGeolibCookInterfaceUtilsService_H
00004 #define FnGeolibCookInterfaceUtilsService_H
00005 
00006 #include <stdint.h>
00007 #include <string>
00008 
00009 #include "FnAttribute/FnAttribute.h"
00010 #include "FnGeolib/op/FnGeolibCookInterface.h"
00011 #include "FnPlatform/StringView.h"
00012 #include "FnPlatform/internal/Portability.h"
00013 #include "FnPluginSystem/FnPluginSystem.h"
00014 
00015 #include "FnGeolibServices/FnGeolibServicesAPI.h"
00016 #include "FnGeolibServices/ns.h"
00017 #include "FnGeolibServices/suite/FnGeolibCookInterfaceUtilsSuite.h"
00018 
00019 FNGEOLIBSERVICES_NAMESPACE_ENTER
00020 {
00027     class BaseGlobalAttributeProvider;
00028     class BaseGlobalAttributeProviderLegacy;
00029 
00033     class FNGEOLIBSERVICES_API FnGeolibCookInterfaceUtils
00034     {
00035     public:
00036         struct MatchesCELInfo
00037         {
00038             bool matches;
00039             bool canMatchChildren;
00040         };
00041 
00057         static void matchesCEL(MatchesCELInfo & matchesCELInfo,
00058                 const FNGEOLIBOP_NAMESPACE::GeolibCookInterface & interface,
00059                 const FnAttribute::StringAttribute & cel,
00060                 const std::string & inputLocationPath=std::string(),
00061                 int inputIndex=kFnKatGeolibDefaultInput);
00062 
00081         static FnAttribute::GroupAttribute cookDaps(
00082                 const FNGEOLIBOP_NAMESPACE::GeolibCookInterface & interface,
00083                 const std::string & attrRoot,
00084                 const std::string & inputLocationPath=std::string(),
00085                 int inputIndex=kFnKatGeolibDefaultInput,
00086                 const FnAttribute::Attribute & cookOrderAttr=FnAttribute::Attribute());
00087 
00088         struct BuildLocalsAndGlobalsInfo
00089         {
00090             FnAttribute::GroupAttribute locals;
00091             FnAttribute::GroupAttribute globals;
00092         };
00093 
00094         static BuildLocalsAndGlobalsInfo buildLocalsAndGlobals(
00095                 const FNGEOLIBOP_NAMESPACE::GeolibCookInterface & interface,
00096                 const std::string & attrRoot);
00097 
00098         static FnAttribute::Attribute getDefaultDapCookOrder();
00099 
00100         static FnAttribute::GroupAttribute resolveFileNamesWithinGroup(
00101                 const FNGEOLIBOP_NAMESPACE::GeolibCookInterface & interface,
00102                 const FnAttribute::GroupAttribute & inputGroup,
00103                 const FnAttribute::StringAttribute & celAttr,
00104                 int frameNumber);
00105 
00106         static FnAttribute::StringAttribute resolveFileNameInString(
00107                 const FNGEOLIBOP_NAMESPACE::GeolibCookInterface & interface,
00108                 const FnAttribute::StringAttribute & inputString,
00109                 int frameNumber);
00110 
00111         static FnAttribute::Attribute getGlobalAttrGeneric(
00112             BaseGlobalAttributeProvider& provider,
00113             FnPlatform::StringView name,
00114             FnPlatform::StringView locationPath,
00115             bool* didAbortPtr = NULL);
00116 
00125         static FNKAT_DEPRECATED FnAttribute::Attribute getGlobalAttrGeneric(
00126             BaseGlobalAttributeProviderLegacy& provider,
00127             const std::string& name,
00128             const std::string& locationPath,
00129             bool* didAbortPtr = NULL);
00130 
00131     private:
00132         FnGeolibCookInterfaceUtils();
00133 
00134         static const FnGeolibCookInterfaceUtilsHostSuite_v2 * _getSuite();
00135     };
00136 
00143     class FNGEOLIBSERVICES_API BaseGlobalAttributeProvider
00144     {
00145     public:
00146         virtual ~BaseGlobalAttributeProvider() {}
00147 
00148         virtual FnGeolibGlobalAttributeProviderStatus getAttr(
00149             FnPlatform::StringView attrPath,
00150             FnAttribute::Attribute* attributeOut) = 0;
00151     };
00152 
00159     class FNGEOLIBSERVICES_API BaseGlobalAttributeProviderLegacy
00160     {
00161     public:
00162         virtual ~BaseGlobalAttributeProviderLegacy() {}
00163 
00164         FNKAT_DEPRECATED virtual FnGeolibGlobalAttributeProviderStatus
00165         provideAttribute(const std::string& attrPath,
00166                          const std::string& leafLocationPath,
00167                          int32_t relativeDepth,
00168                          FnAttribute::Attribute* attributeOut) = 0;
00169     };
00171 }
00172 FNGEOLIBSERVICES_NAMESPACE_EXIT
00173 
00174 #endif // FnGeolibServicesCookInterfaceUtilsService_H
 All Classes Functions Variables Typedefs Enumerations Enumerator