00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GU_SopResolver__
00020 #define __GU_SopResolver__
00021
00022 #include "GU_API.h"
00023 #include <SYS/SYS_Types.h>
00024 #include "GU_DetailHandle.h"
00025
00026
00027 class GU_API GU_SopQuery {
00028 public:
00029 GU_SopQuery()
00030 {
00031 myOpId = -1;
00032 myFrameSpecified = false;
00033 myTimeSpecified = false;
00034 }
00035
00036
00037 ~GU_SopQuery() { clear(); }
00038
00039 void clear();
00040 void clearButLeaveTime();
00041
00042 void setDetail(const GU_DetailHandle &handle)
00043 { myDetail = handle;
00044 myDetail.addPreserveRequest();
00045 }
00046
00047 GU_DetailHandle &getDetail(const char *fullpath, int relative_to=-1);
00048 int getOpId() const { return myOpId; }
00049 int getSourceId() const { return mySourceOpId; }
00050 bool getFrame(fpreal &frame) const
00051 {
00052 if (myFrameSpecified)
00053 frame = myFrame;
00054 return myFrameSpecified;
00055 }
00056
00057 void setFrame(fpreal frame)
00058 {
00059 myFrameSpecified = true;
00060 myFrame = frame;
00061 }
00062
00063 bool getTime(fpreal &frame) const
00064 {
00065 if (myTimeSpecified)
00066 frame = myTime;
00067 return myTimeSpecified;
00068 }
00069
00070 void setTime(fpreal frame)
00071 {
00072 myTimeSpecified = true;
00073 myTime = frame;
00074 }
00075
00076 private:
00077 GU_DetailHandle myDetail;
00078 int myOpId;
00079 int mySourceOpId;
00080 bool myFrameSpecified;
00081 fpreal myFrame;
00082 bool myTimeSpecified;
00083 fpreal myTime;
00084 friend class GU_SopResolver;
00085 };
00086
00087
00088
00089
00090
00091 class GU_API GU_SopResolver {
00092 public:
00093 GU_SopResolver();
00094 virtual ~GU_SopResolver();
00095
00096 static void setResolver(GU_SopResolver *resolver);
00097 static GU_SopResolver *getResolver();
00098
00099
00100 static bool lookup(const char *fullpath, GU_SopQuery &q);
00101
00102
00103
00104
00105
00106
00107 virtual int resolveId(const char *fullpath,
00108 int relative_to) = 0;
00109
00110
00111
00112 virtual bool resolveDetail(GU_SopQuery &q) = 0;
00113 };
00114
00115 #endif
00116