1 / 8

DrawGraph

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

london
Download Presentation

DrawGraph

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DrawGraph CSC 385 – Project - Jason Creighton

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. DrawGraph CSC 385 – Project - Jason Creighton

More Related