11 #ifndef __GA_IntrinsicManager__
12 #define __GA_IntrinsicManager__
53 {
return myAttributes.entries(); }
64 return isValidHandle(lhandle)
65 ? myAttributes(lhandle)->getGlobalId()
73 return isValidHandle(handle)
74 ? myAttributes(handle)->getName()
81 {
return getStorage(getLocalHandle(name)); }
84 return isValidHandle(handle)
85 ? myAttributes(handle)->getStorage()
93 {
return getStorage(getLocalHandle(name)); }
96 return isValidHandle(handle)
97 ? myAttributes(handle)->getReadOnly()
105 {
return getUserId(getLocalHandle(name)); }
108 return isValidHandle(handle)
109 ? myAttributes(handle)->getUserId()
117 {
return getOptions(getLocalHandle(name)); }
120 return isValidHandle(handle)
121 ? &myAttributes(handle)->getOptions()
150 : myManager(r.myManager)
162 myManager = r.myManager;
172 myOk = myManager->startDefinition(def);
189 h = myManager->addAttribute(store,
190 name, user_id, read_only,
192 if (!GAisValidGlobalIntrinsic(h))
206 myOk = myManager->endDefinition(*myDef);
244 myManager = src.myManager;
245 myCurrent = src.myCurrent;
246 myEntries = src.myEntries;
257 return !myManager || myCurrent >= myEntries;
264 {
return myManager->getName(myCurrent); }
266 {
return myCurrent; }
269 {
return myCurrent; }
273 : myManager(manager),
275 myEntries(manager->getLocalEntries())
291 {
return h >= 0 && h < myAttributes.entries(); }
294 class ga_IntrinsicAttribute
306 , myGlobalId(global_id)
307 , myLocalId(local_id)
310 , myReadOnly(read_only)
313 myOptions = *options;
315 ~ga_IntrinsicAttribute() {}
319 const UT_Options &getOptions()
const {
return myOptions; }
320 int getGlobalId()
const {
return myGlobalId; }
321 int getLocalId()
const {
return myLocalId; }
322 int getUserId()
const {
return myUserId; }
323 bool getReadOnly()
const {
return myReadOnly; }
357 int user_id,
bool read_only,
GA_GlobalIntrinsic getGlobalHandle(GA_LocalIntrinsic lhandle) const
bool getOk() const
Return status of the operation.
const UT_StringHolder & getToken() const
Get the current attribute token.
int getLocalEntries() const
Return the number of local handles defined in the manager.
Manager to keep track of global handle to name mappings.
Stores information about intrinsic attributes for classes.
GLuint const GLchar * name
iterator(const iterator &src)
Copy constructor.
static const UT_StringHolder theEmptyString
const UT_Options * getOptions(GA_LocalIntrinsic handle) const
void advance()
Advance to the next iteration.
GLuint const GLuint * names
const UT_Options * getOptions(const UT_StringRef &name) const
bool getReadOnly(GA_LocalIntrinsic handle) const
GA_GlobalIntrinsic addAttribute(GA_StorageClass store, const UT_StringRef &name, int user_id, bool read_only, const UT_Options *options=NULL)
const iterator & operator=(const iterator &src)
Assignment operator.
int getUserId(GA_LocalIntrinsic handle) const
GA_StorageClass getStorage(const UT_StringRef &name) const
GLfloat GLfloat GLfloat GLfloat h
A map of string to various well defined value types.
Registrar & operator=(const Registrar &r)
Assignment operator.
iterator & operator++()
Increment operator.
bool start(GA_IntrinsicDef &def)
Start defining attributes for the given intrinsic definition.
Registrar(const Registrar &r)
Copy constructor.
bool getReadOnly(const UT_StringRef &name) const
const UT_StringHolder & getName(GA_LocalIntrinsic handle) const
Look up an attribute name from the given handle.
int getIndex() const
Get the current attribute handle (global id)
Container class for all geometry.
bool atEnd() const
Test to see if the iteration is complete.
iterator()
Simple default constructor.
Definition of a geometric primitive.
GA_LocalIntrinsic getLocalHandle() const
iterator begin() const
Start traversal of intrinsic attributes names.
int getUserId(const UT_StringRef &name) const
GA_StorageClass getStorage(GA_LocalIntrinsic handle) const
#define GA_INVALID_INTRINSIC_HANDLE