00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __VEX_VexResolver__
00022 #define __VEX_VexResolver__
00023
00024 #include "VEX_API.h"
00025 #include <iostream.h>
00026 #include <UT/UT_String.h>
00027 #include <UT/UT_PtrArray.h>
00028
00029 class VEX_VexResolver;
00030
00031 typedef UT_PtrArray<VEX_VexResolver *> VEX_VexResolverArray;
00032
00033 class VEX_API VEX_VexResolver
00034 {
00035 public:
00036 static bool needsVexResolver(const char *shader);
00037 static bool needsVexResolverForMantraOutput(const char *shader);
00038 static bool getVflCode(const char *shader, ostream &os,
00039 const char *shadername = 0);
00040 static bool getVexCode(const char *shader, ostream &os,
00041 const char *shadername = 0);
00042 static bool getVexContext(const char *shader, UT_String &ctx);
00043
00044
00045
00046
00047
00048
00049
00050 static bool convertToCanonicalPath(const char *shader,
00051 UT_String &canonical_shader);
00052
00053 protected:
00054 VEX_VexResolver();
00055 virtual ~VEX_VexResolver();
00056
00057 virtual bool canResolveCode(const char *shader) = 0;
00058 virtual bool supportedByMantra() = 0;
00059 virtual bool resolveVflCode(const char *shader,
00060 ostream &os,
00061 const char *shadername) = 0;
00062 virtual bool resolveVexCode(const char *shader,
00063 ostream &os,
00064 const char *shadername) = 0;
00065 virtual bool resolveVexContext(const char *shader,
00066 UT_String &ctx) = 0;
00067 virtual bool resolveCanonicalPath(const char *shader,
00068 UT_String &canonical_shader) = 0;
00069
00070 private:
00071 static void addVexResolver(VEX_VexResolver *resolver);
00072 static void removeVexResolver(VEX_VexResolver *resolver);
00073 static VEX_VexResolverArray &getVexResolvers();
00074 };
00075
00076 #endif
00077