DzVertexMesh->addVertex
Alessandro Mastronardi
Posts: 2,621
Any particular reason why the following code is crashing?
I'm trying to store some vertices into a DzVertexMesh...
DzVertexMesh *vMesh;
vMesh->beginEdit(false);
vMesh->addVertex(0.0, 0.0, 0.0);
vMesh->addVertex(0.0, 1.0, 0.0);
vMesh->addVertex(1.0, 1.0, 0.0);
vMesh->addVertex(1.0, 0.0, 0.0);
vMesh->finishEdit();
Post edited by Alessandro Mastronardi on
Comments
At a glance, it would appear that you have declared a DzVertexMesh pointer, but you haven't defined it (i.e. = new DzVertexMesh).
-Rob
Using:
actually gives a "allocating an object of abstract class 'DzVertexMesh'.
Shouldn't there be parentheses at the end?
@Alessandro: Yeah, sorry... I was on my tablet, on the way out the door to take my wife to dinner. I didn't have anything other than your post in front of me at the time and the use of a declared but undefined pointer was an obvious issue that didn't require me to look at headers/definitions for more context. That is why I started my response with "At a glance". Now that I've had a chance to look at this when I'm not being rushed out the door... rather than DzVertexMesh, which you are correct is an abstract base class, use DzFacetMesh. You will obviously still need to define the pointer before you attempt to do anything with it, or you will cause a crash.
@Richard: Take a look at this. It may even answer some questions you didn't even know you had.
-Rob
Yep, thank you very much Rob, will use the DzFacetMesh
Thanks Rob, an interesting site.