8 #ifndef __GOP_GroupParse_h__
9 #define __GOP_GroupParse_h__
36 class gop_PendingParse;
44 friend class gopAddData;
53 : myNumericTokensFlag(false),
54 myAttributeTokensFlag(false),
55 myNameTokensFlag(false),
56 myAccumulateAttributes(false)
62 {
return myNumericTokensFlag || myAttributeTokensFlag; }
65 { myNameTokensFlag =
value; }
67 { myNumericTokensFlag =
value; }
69 { myAttributeTokensFlag =
value; }
73 {
if( myAccumulateAttributes) myAttributeTokens.append(s); }
75 {
return myAttributeTokens; }
78 bool myNumericTokensFlag;
79 bool myAttributeTokensFlag;
80 bool myNameTokensFlag;
81 bool myAccumulateAttributes;
96 : myConstDetail(detail)
97 , myNonConstDetail(NULL)
100 : myConstDetail(detail)
101 , myNonConstDetail(detached ? NULL : detail)
108 template <
typename ElemGroup>
112 createGroup(type).release()));
118 return *myConstDetail;
135 static void buildPrimGroupToken(
const GEO_Detail *gdp,
140 static void buildPointGroupToken(
const GEO_Detail *gdp,
148 static void buildPrimElementToken(
const GEO_Detail *gdp,
152 static void buildPointElementToken(
const GEO_Detail *gdp,
159 static int parseVectorAttributeComponent(
174 numok,
true, ordered, strict,
offset, info));
186 numok,
true, ordered, strict,
offset, info));
190 const GroupCreator &creator,
194 ParseInfo *info = NULL);
209 numok,
false, ordered, strict,
offset));
221 numok,
false, ordered, strict,
offset));
225 const GroupCreator &creator,
229 ParseInfo *info = 0);
231 void expandGroupMask(
const char *
pattern,
247 static bool isGroupNumeric(
const char*
pattern);
249 static void matchGroups(
255 {
return (::strchr(pattern,
'@') !=
nullptr); }
262 const GroupCreator &creator,
264 bool allow_reference,
268 ParseInfo *info = NULL);
269 GA_Group *constCastParseGroups(
const char *inpattern,
271 const GroupCreator &creator,
273 bool allow_reference,
277 ParseInfo *info = NULL)
279 const GA_Group *group = parseGroups(
280 inpattern, type, creator, allow_numeric,
281 allow_reference, ordered, strict, offset, info);
283 "This group must be a newly-created, ad-hoc group!");
295 char *parseNumericBlock(
char *
pattern,
bool is_prim,
296 const GroupCreator &creator,
300 gop_PendingParse *pending_parse);
306 char *parseAttributeGroup(
GA_Group *group,
309 bool ordered, ParseInfo *info = NULL);
311 GA_Group *createAdhocGroup(
const GroupCreator &creator,
313 void appendAdhocGroup(
GA_Group *group,
bool ismetheowner);
314 void destroyAdhocGroup(
const GA_Group *group);
316 friend class gop_PendingNamePatternParse;
Definition of a geometry attribute.
const UT_StringArray & getAttributeTokens() const
void setParsedNumericToken(bool value=true)
GA_PointGroup * parsePointGroupsCopy(const char *pat, const GroupCreator &creator, bool numok, bool ordered, bool strict, GA_Index offset=GA_Index(0))
GLsizei const GLfloat * value
GroupCreator(GEO_Detail *detail, bool detached)
void setParsedNameToken(bool value=true)
void setParsedAttributeToken(bool value=true)
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
const GEO_Detail * myConstDetail
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
#define UT_ASSERT_MSG_P(ZZ,...)
const GA_PrimitiveGroup * parsePrimitiveGroups(const char *pat, const GroupCreator &creator, bool numok, bool ordered, bool strict, GA_Index offset=GA_Index(0), ParseInfo *info=NULL)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
void addAttributeToken(const UT_StringHolder &s)
const GA_PointGroup * parsePointGroups(const char *pat, const GroupCreator &creator, bool numok, bool ordered, bool strict, GA_Index offset=GA_Index(0), ParseInfo *info=NULL)
GOP_GroupParse(GOP_Manager *manager)
GA_PrimitiveGroup * parsePrimitiveGroupsCopy(const char *pat, const GroupCreator &creator, bool numok, bool ordered, bool strict, GA_Index offset=GA_Index(0))
static bool hasAttributePattern(const char *pattern)
GroupCreator(const GEO_Detail *detail)
GEO_Detail * myNonConstDetail
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
bool getParsedAdhocTokens() const
void setAccumulateAttributes()
UT_UniquePtr< GA_Group > GA_GroupUPtr
const GEO_Detail & getDetail() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
bool getParsedNameTokens() const
Container class for all geometry.
UT_UniquePtr< ElemGroup > createElemGroup(GA_GroupType type) const