So Delete now works, along with Move, Add Vertex and face creation, so it is finally possible to construct some very rudimentary models now. All the new features are integrated properly into the Undo/Redo system as per last post (cheers for the feature, by the way Drew) and seems to be working okay.
Delete involved a bit of a rewrite of the model storage code. Previously I was referencing faces to vertices and vice versa using indices, but this proved highly problematic when trying to implement undo/redo for deletion of vertices or triangles.
Now, each vertex is assigned a ID that is unique for the duration of the program running. Faces store a list of IDs as well as indices and when vertices are removed (or added by Redo), the faces are stitched to the vertices via IDs. There is then a method that is run when required that gathers the current index of the vertex by ID and caches it in the triangle to avoid having to keep looking up by ID every frame.
This has vastly simplified the code, at the cost of an unsigned member in the vertex structure and three unsigned members in the triangle structure, which is more than acceptable.
Obviously still miles and miles to go before this starts being a useful program. I need to get Rotate, Scale and Extrude working next, then finish off the Add Primitive tool to support triangles, planes, cubes, spheres etc. At that point, I'll probably start thinking about the skeleton system rather than leave it too late in the project and push forward with the animation system. Might be worth getting grouping working first.
At that point, we are not far off MilkShape-level of functionality at which point anything I can implement that improves on MilkShape is a bonus. Plus, of course, I'll release this project for free which is an automatic bonus over MilkShape. Not that MilkShape's licence is unfairly priced but frankly MilkShape's UI is quite basic and bodged in my opinion and the world deserves a prettier low-poly editor.
Just finished working on this little control. It's for manually entering values for moving, and also allows you to lock axes for mouse-drag movement.
It's all one control as I'm going to want almost identical controls for the Rotate and Scale tools, so it has been written in isolation. There is just a function that returns a HWND to the AxisControl and you can control the text on the button, send it messages to retrieve the axis filter and the values, and its parent control gets a WM_COMMAND with a BN_CLICKED when the button is pressed.
Looks quite professional I think. But then I am biased.
Starving. Must eat.