Assignment 2

Download the assignment archive, and unzip the compressed file. You should have a directory named DGP2016-A1 containing a README.txt file and several subdirectories. Follow these instructions. You should upload your completed assignment through Canvas. If you don't follow the instructions, particularly about naming files, I will return your assignment without grading. Your submission may have bugs, but it has to compile and the application has to run. Otherwise I will not grade your assignment.

In this assignment you will implement the core/HalfEdges class and the core/PolygonMesh class. For this you have to edit the following two files


You should copy your implementation of the classes core/Faces, io/SaveStl, and io/LoadStl from Assignment 1 into the Assignment 2 src directory.

The following classes are already implemented: core/Edges, core/Graph, and core/Partition.

Note that the design of these classes is slightly different from what we discused in class, and from the description in the web pages. The web pages will be updated soon. Use the description of the public interfaces contained in the header files as the definition of these classes.

In particular, a new core/Edges class is defined, which corresponds to a read-only core/Graph class. The core/Graph class is now defined as a subclass of the core/Edges class, where the methods reset(nV) and insertEdge(iV0,iV1) are made public.

In addition, since the constructor of the core/HalfEdges class requires the construction of the primal graph of the mesh, and preserving the graph provides additional functionality, we have decided to make the core/HalfEdges class a subclass of the core/Edges class as well.

Furthermore, we have made the core/PolygonMesh class a subclass of the class core/HalfEdges

We have also implemented the class core/PolygonMeshTest, which only comprises a constructor. When the constructor is instantiated, an instance of the core/PolygonMesh class is created from the current application scene graph, and some information is printed to the standard output. A new push button has been added to the user interface. When this pushbutton is pressed, the core/PolygonMeshTest constructor is instantiated.

A number of simple test files have been added to the assets directory. Since the polygon meshes described in these files are small, they can be used to debug your implementation. Some of these files contain scene graphs with multiple IndexedFaceSet nodes, some contain regular polygon meshes, and some contain singular polygon meshes. Some meshes have boundaries and others do not. The constructor for the class core/PolygonMeshTest traverses the scene graph, and for each IndexedFaceSet node that it finds, it creates an instantance of the core/PolygonMesh class and prints detailed information resulting from the classification of vertices and edges.

More details to be provided soon. The Core Mesh web pages will also be updated to math the assignment files. But you can start working on this assignment based on your class notes and the information contained in the header files.