stkeg Posted August 15, 2013 Share Posted August 15, 2013 i'm trying to add new points and primitives to an existing geometry in a DOP with the HDK. this is what I'm doing: //from the SIM_Object i find the object i want SIM_Object *sim_obj = objects.findObjectById(obj_id); const SIM_Geometry* sim_geo = sim_obj->getGeometry(); GU_DetailHandleAutoReadLock gdl(sim_geo->getGeometry()); const GU_Detail *gdp = gdl.getGdp(); gdp->appendPointOffset(); i can't add anything to the gdp. i get errors like this whenever i try (in this example, appendPointOffset): error: passing ‘const GU_Detail’ as ‘this’ argument of ‘GA_Offset GEO_Detail::appendPointOffset()’ discards qualifiers i think it might be because i should be using GU_DetailHandleAutoWriteLock instead of the GU_DetailHandleAutoReadLock, but I can't use the Write version. I get an error like this: error: no matching function for call to ‘GU_DetailHandleAutoWriteLock::GU_DetailHandleAutoWriteLock(GU_ConstDetailHandle)’ any clues as to how i can do this? thanks. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted August 15, 2013 Share Posted August 15, 2013 (edited) const GU_Detail* mean it's locked for modification and you trying to use non cost function on it. All I can say for now without the code. What you are passing to GU_DetailHandleAutoWriteLock ? Maybe you need to cast it before? It requires const GU_DetailHandle and it looks that you are trying to pass GU_ConstDetailHandle And it's not exactly the same. EDIT: There is a public GU_ConstDetailHandle::castAwayConst() method that returns GU_DetailHandle Maybe you can cast it later to const and pass to GU_DetailHandleAutoWriteLock ? But I'm sure you can get it before without so many casts. EDIT2: You can find example of how to use GU_DetailHandleAutoWriteLock in those three examples in HDK help: http://www.sidefx.co..._c-example.html http://www.sidefx.co..._c-example.html http://www.sidefx.co..._c-example.html Edited August 15, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.