00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __GOP_GroupParse_h__
00016 #define __GOP_GroupParse_h__
00017
00018 #include "GOP_API.h"
00019
00020 #include "GOP_AdhocGroup.h"
00021
00022 class UT_String;
00023 class GB_Group;
00024
00025 class OP_Node;
00026 typedef void (OP_Node::*GroupOperation)(const GB_Group *, void *);
00027
00028
00029
00030 class gopAddData;
00031 class GU_Detail;
00032 class GB_PrimitiveGroup;
00033 class GB_PointGroup;
00034 class GOP_Manager;
00035
00036 class GOP_API GOP_GroupParse
00037 {
00038 friend class gopAddData;
00039
00040 public:
00041 GOP_GroupParse (GOP_Manager *manager)
00042 {
00043 myManager = manager;
00044 };
00045 virtual ~GOP_GroupParse (void) {};
00046
00047
00048
00049
00050 static void buildPrimGroupToken(const GU_Detail *gdp,
00051 const GB_PrimitiveGroup *primgrp,
00052 UT_String &token,
00053 int offset = 0);
00054 static void buildPointGroupToken(const GU_Detail *gdp,
00055 const GB_PointGroup *ptgrp,
00056 UT_String &token,
00057 int offset = 0);
00058
00059 const GB_PrimitiveGroup *parsePrimitiveGroups(const char *pat,
00060 GU_Detail *pgdp = 0,
00061 int numok = 1,
00062 int ordered = 1,
00063 bool strict = false,
00064 int offset = 0)
00065 {
00066 return (const GB_PrimitiveGroup *)parseGroups(pat, 1, pgdp, numok, 1,
00067 ordered, strict, offset);
00068 }
00069 const GB_PointGroup *parsePointGroups(const char *pat,
00070 GU_Detail *pgdp = 0,
00071 int numok = 1,
00072 int ordered = 1,
00073 bool strict = false,
00074 int offset = 0)
00075 {
00076 return (const GB_PointGroup *)parseGroups(pat, 0, pgdp, numok, 1,
00077 ordered, strict, offset);
00078 }
00079
00080
00081
00082
00083
00084 GB_PrimitiveGroup *parsePrimitiveGroupsCopy(const char *pat,
00085 GU_Detail *pgdp = 0,
00086 int numok = 1,
00087 int ordered = 1,
00088 bool strict = false,
00089 int offset = 0)
00090 {
00091 return (GB_PrimitiveGroup *)parseGroups(pat, 1, pgdp, numok, 0,
00092 ordered, strict, offset);
00093 }
00094
00095 GB_PointGroup *parsePointGroupsCopy(const char *pat,
00096 GU_Detail *pgdp = 0,
00097 int numok = 1,
00098 int ordered = 1,
00099 bool strict = false,
00100 int offset = 0)
00101 {
00102 return (GB_PointGroup *)parseGroups(pat, 0, pgdp, numok, 0,
00103 ordered, strict, offset);
00104 }
00105
00106
00107
00108
00109 int parseEachGroup(const char *inpattern,
00110 GroupOperation operation,
00111 void *data, int isPrim,OP_Node *opThis,
00112 GU_Detail *pgdp=0,
00113 int ordered = 1,
00114 bool strict = false,
00115 int offset = 0,
00116 bool allow_adhoc = true);
00117
00118 void expandGroupNames(const char *pattern,
00119 UT_String &outNames,
00120 int isPrim, GU_Detail *gdp=0);
00121 private:
00122
00123 GOP_Manager *myManager;
00124
00125 const GB_Group *parseGroups(const char *inpattern, int isPrim,
00126 GU_Detail *pgdp,
00127 int allow_numeric = 1,
00128 int allow_reference = 1,
00129 int ordered = 1,
00130 bool strict = false,
00131 int offset = 0);
00132
00133
00134 GB_Group *extractNumeric(char *pattern, int isPrim,
00135 GU_Detail *pgdp, int &all_numeric,
00136 int ordered, int offset = 0);
00137
00138
00139
00140
00141 GB_Group *extractAttributeGroup(char *pattern, bool isPrim,
00142 GU_Detail *pgdp, bool onlyone,
00143 bool ordered);
00144
00145 void parseAttributeGroup(GB_Group *group,
00146 char *pattern, bool isPrim,
00147 GU_Detail *pgdp, bool negate, bool ordered);
00148
00149 void appendAdhocGroup(GU_Detail *gdp, GB_BaseGroup *group,
00150 int isowner);
00151
00152 };
00153
00154 #endif