00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GOP_VertexGroupParser_h__
00021 #define __GOP_VertexGroupParser_h__
00022
00023 #include "GOP_API.h"
00024
00025
00026 #include "GOP_Parser.h"
00027 #include "GOP_EdgeAdhocGroup.h"
00028
00029 class GU_Detail;
00030 class GOP_Manager;
00031 class GEO_Primitive;
00032
00033 class GOP_API GOP_VertexGroupParser : public GOP_Parser
00034 {
00035 public:
00036 GOP_VertexGroupParser(GOP_Manager *manager, const GU_Detail &gdp,
00037 const UT_String &str, bool strict = true,
00038 int prim_offset = 0);
00039
00040
00041
00042
00043 static void buildGroupToken(const GU_Detail *gdp,
00044 const GB_VertexGroup *vtxgrp,
00045 UT_String &token, int offset = 0);
00046
00047 private:
00048
00049 virtual void init();
00050 virtual void finish();
00051 virtual bool dispatch(char c);
00052
00053
00054 virtual void handleStart();
00055 virtual void handleError();
00056
00057 void handleCollectPrim();
00058 void handleCollectPrim1();
00059 void handleCollectName();
00060 void handleCollectVertex0();
00061 void handleCollectVertex1();
00062
00063
00064 int myPrimIndex;
00065 int myPrim1;
00066 int myVertex0;
00067 int myVertex1;
00068
00069
00070 bool addVertex();
00071 bool addAllPrimVertices(GEO_Primitive *prim = 0);
00072 bool addVertexRange(int u0, int u1);
00073 bool addPrimGroup(const char *name);
00074
00075
00076 bool addPrimRange(int u0, int u1);
00077
00078
00079 GEO_Primitive *getPrim();
00080
00081
00082 const GU_Detail &myGdp;
00083 GB_VertexGroup *myGroup;
00084 GOP_Manager *myManager;
00085 bool myStrictFlag;
00086 int myPrimOffset;
00087 };
00088
00089
00090 #endif