80 likes | 262 Views
DrawGraph. CSC 385 – Project - Jason Creighton. DrawGraph. 3 Menu Options:. 1. Draw a Complete Graph You tell it how many sides and DrawGraph takes care of the rest. 2. Input a Graph Via Keyboard Simply enter a sequence of ‘1’s’ and ‘0’s’ to draw a graph via an
E N D
DrawGraph CSC 385 – Project - Jason Creighton
DrawGraph 3 Menu Options: 1. Draw a Complete Graph You tell it how many sides and DrawGraph takes care of the rest. 2. Input a Graph Via Keyboard Simply enter a sequence of ‘1’s’ and ‘0’s’ to draw a graph via an adjacency matrix. 3. Input a Graph Via File Import a saved graph from a previous session.
DrawGraph Code Overview: • Uses OpenGL • Written in C++ • Created with Visual Studio To the right is the DrawGraph.h file A DrawGraph object consists of a vector of Points and Vertices. Other methods were Implemented in order to configure these vectors to work together.
DrawGraph Code Overview: The setVerticesComplete() method takes the number of points (pts.size()) and loops through all the points, drawing each other point to itself. The set points() method takes the total amount of points and gives and x, y coordinates to evenly space these points on the radius of a circle.
DrawGraph Code Overview: These two methods simply draw all of the points and vertices in the DrawGraph object. The DrawGraph object is named graph in this example.
DrawGraph Code Overview: These methods work together to draw the numbers along the side of the graph.Line 73 you’ll notice that we have set an offset and an enlarge parameter in order to draw the numbers outside the circle.
DrawGraph • Simply run the .exe file in order to run the program. • All saved files are saved in the root directory (where the .exe file is) as a .gph file • .gph files can be edited in notepad and reimported without issue • Attached to this presentation is all of the code as well as the .exe file.
DrawGraph CSC 385 – Project - Jason Creighton