00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __SOP_FacePointParser_h__
00021 #define __SOP_FacePointParser_h__
00022
00023 #include "SOP_API.h"
00024 #include <GOP/GOP_Parser.h>
00025 #include <UT/UT_Math.h>
00026 #include "SOP_Curve.h"
00027
00028
00029
00030 #define CHAR_POINT 'p'
00031 #define CHAR_POINTCOPY 'P'
00032 #define CHAR_RELATIVE '@'
00033 #define CHAR_BREAKPOINT 'b'
00034 #define CHAR_BRACKETOPEN '['
00035 #define CHAR_BRACKETCLOSE ']'
00036 #define CHAR_XYZW_DELIM ','
00037 #define CHAR_UV_DELIM ','
00038
00039
00040 class SOP_API SOP_FacePointParser : public GOP_Parser
00041 {
00042 public:
00043 SOP_FacePointParser(const GU_Detail *gdp, UT_String &str);
00044
00045 virtual ~SOP_FacePointParser() {}
00046
00047 protected:
00048 virtual void handleError();
00049
00050
00051
00052
00053
00054 int myErrorIndex;
00055
00056 const GU_Detail *myRefGdp;
00057
00058 private:
00059
00060 virtual void init();
00061 virtual void finish();
00062 virtual bool dispatch(char c);
00063
00064
00065 virtual void handleStart();
00066 void handleCollectX();
00067 void handleCollectY();
00068 void handleCollectZ();
00069 void handleCollectW();
00070 void handleCollectP();
00071 void handleCollectBU();
00072 void handleCollectBV();
00073
00074
00075
00076 virtual void resetPointList() = 0;
00077 virtual void addPoint(UT_Vector4 &v, bool relative,
00078 bool use_w, const UT_Vector4 &last,
00079 int reftype = -1, int pid = -1) = 0;
00080 virtual void referencePoint(const GEO_Point *point) = 0;
00081
00082
00083
00084
00085 bool getPosFromBreakpoint(int u, int v, int primidx,
00086 UT_Vector4 &pos);
00087
00088 UT_Vector4 myLastPos;
00089 UT_Vector4 myCurrPos;
00090
00091 bool myRelative;
00092 bool myCopyPoint;
00093 bool myAllSpaces;
00094 bool myFirstBracket;
00095 bool myOpenBracket;
00096 bool myZDone;
00097 int myIndex;
00098 int myU, myV;
00099 };
00100
00101 #endif