I’m trying to update my code from openNURBS 5.0 to openNURBS 6.0, and it’s requiring a huge number of changes. One problem seems to be that the various “table” arrays for things in the ONX_Model have gone away.
I was just trying to replace
onx_model->m_object_table [index]
with
onx_model->ModelGeometryFromUnsignedIndex (index)
My immediate problem with this is that ModelGeometryFromUnsignedIndex isn’t declared const, which is tripping up my code. But when I tried to look at the implementation and see whether its un-const-ness was required, I discovered there is no implementation?! If I do
When moving from openNURBS 5 to 6, it’s best to convert your for loops that iterated the old tables, found on ONX_Model, to model component iterators. For example, to iterate the model geometry you can do this:
That doesn’t really help, as I am actually trying to do random access lookup via the index here rather than iterating through everything.
I’m not seeing any obvious reason I cannot just store an ON_Object pointer instead of the index here, which I guess should be a reasonable workaround for what I need.
Index wasn’t working for me at all, but I changed things to use the iterator to go over the entire file and then used the UUID as a random access pointer, and that seems to be working for me.