00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __GOP_Manager_h__
00017 #define __GOP_Manager_h__
00018
00019 #include "GOP_API.h"
00020 #include <UT/UT_PtrArray.h>
00021 #include "GOP_AdhocGroup.h"
00022 #include "GOP_GroupParse.h"
00023
00024
00025 class GB_BreakpointGroup;
00026 class GB_EdgeGroup;
00027 class GB_PointGroup;
00028 class GB_PrimitiveGroup;
00029 class GB_VertexGroup;
00030 class GU_Detail;
00031 class OP_Node;
00032
00033 class GOP_API GOP_Manager
00034 {
00035
00036 public:
00037 GOP_Manager (void) {};
00038 virtual ~GOP_Manager (void);
00039
00040 const GB_PrimitiveGroup *parsePrimitiveGroups(const char *pat,
00041 GU_Detail *pgdp = 0,
00042 int numok = 1,
00043 int ordered = 1,
00044 bool strict = false,
00045 int prim_offset = 0);
00046
00047 const GB_PointGroup *parsePointGroups(const char *pat,
00048 GU_Detail *pgdp = 0,
00049 int numok = 1,
00050 int ordered = 1,
00051 bool strict = false,
00052 int point_offset = 0);
00053
00054 const GB_EdgeGroup *parseEdgeGroups(const char *pat,
00055 GU_Detail *pgdp,
00056 bool strict = true,
00057 int prim_offset = 0,
00058 int point_offset = 0);
00059
00060 const GB_BreakpointGroup *parseBreakpointGroups(const char *pat,
00061 GU_Detail *pgdp,
00062 bool strict = true,
00063 int prim_offset = 0);
00064
00065 const GB_VertexGroup *parseVertexGroups(const char *pat,
00066 GU_Detail *pgdp,
00067 bool strict = true,
00068 int prim_offset = 0);
00069
00070
00071
00072
00073
00074 GB_PrimitiveGroup *parsePrimitiveGroupsCopy(const char *pat,
00075 GU_Detail *pgdp = 0,
00076 int numok = 1,
00077 int ordered = 1,
00078 bool strict = false);
00079
00080 GB_PointGroup *parsePointGroupsCopy(const char *pat,
00081 GU_Detail *pgdp = 0,
00082 int numok = 1,
00083 int ordered = 1,
00084 bool strict = false);
00085
00086 GB_EdgeGroup *parseEdgeGroupsCopy(const char *pat,
00087 GU_Detail *pgdp);
00088
00089 GB_BreakpointGroup *parseBreakpointGroupsCopy(const char *pat,
00090 GU_Detail *pgdp);
00091
00092 GB_VertexGroup *parseVertexGroupsCopy(const char *pat,
00093 GU_Detail *pgdp);
00094
00095
00096 int parseEachGroup(const char *inpattern,
00097 GroupOperation operation,
00098 void *data, int isPrim,OP_Node *opThis,
00099 GU_Detail *pgdp=0,
00100 int ordered = 1,
00101 bool strict = false,
00102 bool allow_adhoc = true);
00103
00104
00105
00106 void subdividePrimitiveGroup(GroupOperation operation,
00107 const GB_PrimitiveGroup *g,
00108 void *data, int optype,
00109 int opstep,
00110 const char *oplabel,
00111 OP_Node *opThis,
00112 GU_Detail *gdp=0);
00113
00114 void subdivideMixPrimitiveGroup(GroupOperation operation,
00115 const GB_PrimitiveGroup *g,
00116 void *data, int optype,
00117 int opstep,
00118 const char *oplabel,
00119 OP_Node *opThis,
00120 GU_Detail *gdp=0);
00121
00122 void subdividePointGroup(GroupOperation operation,
00123 const GB_PointGroup *group,
00124 void *data, int optype,
00125 int opstep, const char *oplabel,
00126 OP_Node *opThis,
00127 GU_Detail *gdp=0);
00128
00129 void expandGroupNames(const char *pattern,
00130 UT_String &outNames,
00131 int isPrim, GU_Detail *gdp=0);
00132
00133
00134 GB_PrimitiveGroup *createPrimitiveGroup(GU_Detail &gdp,
00135 const char *name = "adhoc");
00136 GB_PointGroup *createPointGroup (GU_Detail &gdp,
00137 const char *name = "adhoc");
00138 GB_EdgeGroup *createEdgeGroup (GU_Detail &gdp,
00139 const char *name = "adhoc");
00140 GB_BreakpointGroup *createBreakpointGroup(GU_Detail &gdp,
00141 const char *name = "adhoc");
00142 GB_VertexGroup *createVertexGroup (GU_Detail &gdp,
00143 const char *name = "adhoc");
00144
00145
00146 int destroyAdhocGroup (const GB_BaseGroup *group);
00147 void destroyAdhocGroups(void);
00148
00149
00150 void destroyAdhocGroups(const GU_Detail *gdp);
00151
00152
00153
00154 int removeAdhocGroup (const GB_BaseGroup *group);
00155 void removeAdhocGroups(void);
00156
00157
00158
00159
00160 void appendEdgeAdhocGroup(GU_Detail *gdp,
00161 GB_BaseGroup *group, int isowner);
00162 void appendBreakpointAdhocGroup(GU_Detail *gdp,
00163 GB_BaseGroup *group, int isowner);
00164 void appendVertexAdhocGroup(GU_Detail *gdp,
00165 GB_BaseGroup *group, int isowner);
00166 void appendRegularAdhocGroup(GU_Detail *gdp,
00167 GB_BaseGroup *group, int isowner);
00168
00169
00170 static const char *getUniqueGroupName(const char *base);
00171
00172 private:
00173 void appendAdhocGroup(GOP_AdhocGroup *);
00174
00175 UT_PtrArray<GOP_AdhocGroup *> myGroupList;
00176
00177 };
00178
00179 #endif