I’ve struggled with one mesh topology modification problem for a long time. My question is simple: modify an existing ON_Mesh object instead of replacing old mesh object with new mesh.
My persudo code is listed as following:
CRhinoMeshObject* pMeshObj;
m_pMesh = const_cast<ON_Mesh*>(pMeshObj->Mesh());
m_Topology = new ON_MeshTopology(m_pMesh->Topology());
My question is about the third line( it can’t pass compiling). I’ve searched opennurbs_mesh.h and found the copy construction and operator = overload functions are decleared as private.
In fact, I want to modify the mesh’s topology, so I need the raw topology firstly and also need add or remove some items in the topology to modify ON_Mesh (dynamically searching topology of ON_Mesh and modify ON_Mesh by the modified topology). But I can’t find a simple way to copy the mesh’s raw topology.
Any suggestion is welcome.
Thanks.
Jacky
Thank you for your reply.
In fact, I want to borrow the ON_MeshTopology from existing mesh( or copied mesh) and modify the ON_MeshTopology object and the copied mesh both. But the point is that ON_MeshTopology’s copy construction and operator = overload functions are decleared as private. So my question is how to copy a ON_MeshTopology object from a existing ON_MeshTopology object.
Thanks.
Thanks again for your reply. My mesh engine is based on pure triangle mesh but ON_Mesh supports mixed triangle and quad mesh. So If I convert ON_Mesh to my mesh, some information(color, texture, quad to triangle) may lost. Now, I have transfered some algorithm from my mesh to ON_Mesh, and I just want to use ON_MeshTopology as input but also make some modification during algorithm applying. After that, I will call ON_Mesh’s DestroyTopology to regenerate a new topology for the new ON_Mesh object.
Since you’ve told me that door is closed to me, and I will try to find some other solutions. Really, really, thank you for your patience and your help.
Thanks.