Getting Started with Milestone 2. From Lat Lon, to Cartesian, and back again
|
|
- Bryce Brooks
- 5 years ago
- Views:
Transcription
1 Getting Started with Milestone 2 From Lat Lon, to Cartesian, and back again
2 Initial Steps 1. Download m2 handout 2. Follow the walkthrough in Section 4 3. Read the EZGL QuickStart Guide 4. Modify main.cpp 5. Begin implementing the draw_map function
3 Modifying Your Main Function #include "m1.h" #include "m2.h Don t forget to include m2.h int main(int argc, char** argv) { //Other code goes here You only need to add one line in the function. Make sure you call draw_map after you call load_map. Make sure you call draw_map before you call close_map. //Load the map and related data structures bool load_success = load_map(map_path); if(!load_success) { std::cerr << "Failed to load map ' << map_path << "'\n"; return 2; draw_map(); close_map(); return 0;
4 Goal #1: Creating an Empty Window
5 Goal #1: An Empty Window
6 Implementing draw_map Make sure to include m2.h #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp void draw_map () { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas"; ezgl::application application(settings); application.run(nullptr, nullptr, nullptr, nullptr);
7 Implementing draw_map Include EZGL headers Read these headers in detail, they describe all the features of EZGL #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp void draw_map () { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas"; ezgl::application application(settings); application.run(nullptr, nullptr, nullptr, nullptr);
8 Implementing draw_map Setup EZGL Configuration main.ui file defines window layout #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp void draw_map () { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas"; ezgl::application application(settings); application.run(nullptr, nullptr, nullptr, nullptr);
9 Implementing draw_map Create the EZGL application #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp void draw_map () { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas"; ezgl::application application(settings); application.run(nullptr, nullptr, nullptr, nullptr);
10 Implementing draw_map Finally we run the application Passes control to EZGL Graphics window will open Will not return until graphics closed #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp void draw_map () { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas"; ezgl::application application(settings); application.run(nullptr, nullptr, nullptr, nullptr);
11 Our Newly Created Window Pan Buttons Zoom buttons Close window and continue
12 Drawing on a Canvas #include "m2.h #include "ezgl/application.hpp #include "ezgl/graphics.hpp Need to define a Canvas (area to draw upon), requires: Named location in main.ui ( MainCanvas ) Co-ordinate system (initial_world) Drawing callback function (draw_main_canvas) application.run() will call draw_main_canvas() void draw_main_canvas (ezgl::renderer &g); void draw_map_blank_canvas() { ezgl::application::settings settings; settings.main_ui_resource = "libstreetmap/resources/main.ui"; settings.window_identifier = "MainWindow"; settings.canvas_identifier = "MainCanvas; ezgl::application application(settings); ezgl::rectangle initial_world({0, 0, {1000, 1000); application.add_canvas("maincanvas", draw_main_canvas, initial_world); application.run(nullptr, nullptr, nullptr, nullptr);
13 Draw Callback Called by application.run() to paint the canvas The renderer object supports many drawing operations (shapes, text): See ezgl/graphics.hpp void draw_main_canvas (ezgl::renderer &g) { g.draw_rectangle({0, 0, {1000, 1000); ; For now, we just draw a rectangle around the world coordinates draw_rectangle takes two arguments: Bottom-left corner Top-right corner
14 Our Window s Coordinate System Top-Right Corner (1000.0, ) Bottom-Left Corner (0.0, 0.0)
15 Goal #2: Drawing Intersections
16 Loading Intersection Data struct intersection_data { LatLon position; std::string name; ; std::vector<intersection_data> intersections; void draw_map () { intersections.resize(getnumintersections()); for (int id = 0; id < getnumintersections(); ++id) { intersections[id].position = getintersectionposition(id); intersections[id].name = getintersectionname(id); Write your code to initialize intersections //Other setup code not shown... application.run(nullptr, nullptr, nullptr, nullptr);
17 Use fill_rectangle to draw all the intersections struct intersection_data { LatLon position; std::string name; ; void draw_main_canvas(ezgl::renderer &g) { g.draw_rectangle({0, 0, {1000, 1000); std::vector<intersection_data> intersections; for (size_t i = 0; i < intersections.size(); ++i) { float x = intersections[i].position.lon(); float y = intersections[i].position.lat(); Write your code to draw each intersection float width = 10; float height = width; g.fill_rectangle({x, y, {x + width, y + height);
18 Attempt #1 at Drawing Intersections
19 Are x and y correct? What are the possible values of the longitude and latitude? void draw_main_canvas(ezgl::renderer &g) { g.draw_rectangle({0, 0, {1000, 1000); for (size_t i = 0; i < intersections.size(); ++i) { float x = intersections[i].position.lon(); float y = intersections[i].position.lat(); What coordinate system did we setup as initial_world? float width = 10; float height = width; g.fill_rectangle({x, y, {x + width, y + height);
20 Finding Map bounds double max_lat = getintersectionposition(0).lat(); double min_lat = max_lat; double max_lon = getintersectionposition(0).lon(); Write your code here double min_lon = max_lon; intersections.resize(getnumintersections()); for (int id = 0; id < getnumintersections(); ++id) { intersections[id].position = getintersectionposition(id); intersections[id].name = getintersectionname(id); max_lat = std::max(max_lat, intersections[id].position.lat()); min_lat = std::min(min_lat, Write your intersections[id].position.lat()); code here max_lon = std::max(max_lon, intersections[id].position.lon()); min_lon = std::min(min_lon, intersections[id].position.lon());
21 Updating World Coordinates ezgl::rectangle initial_world({min_lon, min_lat, {max_lon, max_lat); application.add_canvas("maincanvas", draw_main_canvas_xy_fixed_world, initial_world); application.run(nullptr, nullptr, nullptr, nullptr);
22 Attempt #3 A corrected visible world
23 Modifying the draw size Intersection width and height were set to big! I played around and got it right with Should the width and height change based on the zoom level?
24 Attempt #4 Eureka! Is this correct?
25 Converting Lat/Lon to Cartesian X/Y Should project Lat/Lon to Cartesian X/Y See M1 handout for details Need average latitude of map Should use functions to do the conversion: float x_from_lon(float lon); float y_from_lat(float lat); Inverse also useful: float lon_from_x(float x); float lat_from_y(float y);
26 Convert x and y into Cartesian Coordinates void draw_main_canvas(ezgl::renderer &g) { for (size_t i = 0; i < intersections.size(); ++i) { float x = x_from_lon(intersections[i].position.lon()); float y = y_from_lat(intersections[i].position.lat()); float width = 0.001; float height = width; g.fill_rectangle({x, y, {x + width, y + height);
27 Attempt #5 Corrected Projection
28 Projection Comparison
29 Reacting to Mouse Clicks
30 Reacting to Mouse Clicks application.run(nullptr, act_on_mouse_click, nullptr, nullptr); void act_on_mouse_click(ezgl::application* app, GdkEventButton* event, double x, double y) { std::cout << "Mouse clicked at (" << x << "," << y << ")\n"; Find the closest intersection to (x, y) LatLon pos = LatLon(lat_from_y(y), lon_from_x(x)); int id = find_closest_intersection(pos); Write your code to find the closest intersection to (x, y) std::cout << "Closest Intersection: << intersections[id].name << "\n";
31 Stateful Graphics
32 Highlighting Closest Intersection How can we draw the closest intersection differently? void act_on_mouse_click(ezgl::application* app, GdkEventButton* event, double x, double y) { std::cout << "Mouse clicked at (" << x << "," << y << ")\n"; Find the closest intersection to (x, y) LatLon pos = LatLon(lat_from_y(y), lon_from_x(x)); int id = find_closest_intersection(pos); std::cout << "Closest Intersection: << intersections[id].name << "\n";
33 Storing & Modifying State Set state based on mouse click struct intersection_data { LatLon position; std::string name; bool highlight = false; ; void act_on_mouse_click(ezgl::application* app, GdkEventButton* event, double x, double y) { std::cout << "Mouse clicked at (" << x << "," << y << ")\n"; Find the closest intersection to (x, y) LatLon pos = LatLon(lat_from_y(y), lon_from_x(x)); int id = find_closest_intersection(pos); std::cout << "Closest Intersection: << intersections[id].name << "\n"; intersections[id].highlight = true;
34 Drawing State Draw based on state struct intersection_data { LatLon position; std::string name; bool highlight = false; ; void draw_main_canvas(ezgl::renderer &g) { for (size_t i = 0; i < intersections.size(); ++i) { float x = x_from_lon(intersections[i].position.lon()); float y = y_from_lat(intersections[i].position.lat()); float width = 0.001; float height = width; if (intersections[i].highlight) { g.set_color(ezgl::red); else { g.set_color(ezgl::grey_55); g.fill_rectangle({x, y, {x + width, y + height);
35 Forcing a Redraw When state changes graphics will not update Can force a refresh void act_on_mouse_click(ezgl::application* app, GdkEventButton* event, double x, double y) { std::cout << "Mouse clicked at (" << x << "," << y << ")\n"; LatLon pos = LatLon(lat_from_y(y), lon_from_x(x)); int id = find_closest_intersection(pos); std::cout << "Closest Intersection: << intersections[id].name << "\n"; intersections[id].highlight = true; app->refresh_drawing();
36 Modifying GUI
37 Modifying GUI The GUI window layout is specified in: libstreetmap/resources/main.ui You can modify the GUI by editing this file Easiest way is to use the glade GUI editor tool: $ glade libstreetmap/resources/main.ui Can re-name components Move positions Add new components (text boxes etc.)
2IS45 Programming
Course Website Assignment Goals 2IS45 Programming http://www.win.tue.nl/~wsinswan/programmeren_2is45/ Rectangles Learn to use existing Abstract Data Types based on their contract (class Rectangle in Rectangle.
More informationECE297 Milestone 2 Drawing Maps. 1 Objectives. 2 Problem Statement
ECE297 Milestone 2 Drawing Maps The real voyage of discovery consists not in seeking new landscapes, but in having new eyes." Marcel Proust Assigned on Monday, Feb. 6 In-lab demo = 12/13 Due on Monday
More informationComputer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio)
Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Screen Coordinate System
More informationExceptions. CS162: Introduction to Computer Science II. Exceptions. Exceptions. Exceptions. Exceptions. Exceptions
CS162: Introduction to Computer Science II A typical way to handle error conditions is through the return value. For example, suppose we create a loadfile() function that returns true if it loaded the
More informationCommon Misunderstandings from Exam 1 Material
Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself
More informationCS 223: Data Structures and Programming Techniques. Exam 2
CS 223: Data Structures and Programming Techniques. Exam 2 Instructor: Jim Aspnes Work alone. Do not use any notes or books. You have approximately 75 minutes to complete this exam. Please write your answers
More informationDrawing and Coordinate Systems
Drawing and Coordinate Systems Coordinate Systems Screen Coordinate system World Coordinate system World window Viewport Window to viewport mapping Screen Coordinate System Glut OpenGL (0,0) Screen Coordinate
More informationPainting your window
The Paint event "Painting your window" means to make its appearance correct: it should reflect the current data associated with that window, and any text or images or controls it contains should appear
More informationInstallation and Configuration Manual
Installation and Configuration Manual IMPORTANT YOU MUST READ AND AGREE TO THE TERMS AND CONDITIONS OF THE LICENSE BEFORE CONTINUING WITH THIS PROGRAM INSTALL. CIRRUS SOFT LTD End-User License Agreement
More informationCISC 1600, Lab 3.1: Processing
CISC 1600, Lab 3.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1. Go to https://www.openprocessing.org/class/57767/
More informationPl_Editor. August 24, 2017
Pl_Editor Pl_Editor ii August 24, 2017 Pl_Editor iii Contents 1 Introduction to Pl_Editor 2 2 Pl_Editor files 2 2.1 Input file and default title block........................................ 2 2.2 Output
More informationCISC 1600, Lab 2.1: Processing
CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc
More informationBC Spatial Member Map Viewer. Version 2.0. User Guide. May 2015
BC Spatial Member Map Viewer Version 2.0 User Guide May 2015 1 P a g e Revised: 16 June 2015 Contents Contents... 2 Introduction... 4 System Requirements... 5 BC Spatial Map Viewer... 6 I. Navigation Tools...
More informationDice in Google SketchUp
A die (the singular of dice) looks so simple. But if you want the holes placed exactly and consistently, you need to create some extra geometry to use as guides. Plus, using components for the holes is
More informationDrawing and Coordinate Systems
Drawing and Coordinate Systems Coordinate Systems World Coordinate system World window Screen Coordinate system Viewport Window to viewport mapping Screen Coordinate System Glut OpenGL (0,0) 0) Screen
More informationC-String Library Functions
Strings Class 34 C-String Library Functions there are several useful functions in the cstring library strlen: the number of characters before the \0 strncat: concatenate two strings together strncpy: overwrite
More informationPointers and scanf() Steven R. Bagley
Pointers and scanf() Steven R. Bagley Recap Programs are a series of statements Defined in functions Can call functions to alter program flow if statement can determine whether code gets run Loops can
More informationCreating a Graphical LED cluster bean IBM Visual Age for Java - Creating Custom Beans
This tutorial will show you how create a visual Java Bean that represents an integer value as a row of 16 LED s Just follow each step in turn... Go to the Workbench Page 1 Add a Project using the menu
More informationCSE 333 Midterm Exam Sample Solution 7/28/14
Question 1. (20 points) C programming. For this question implement a C function contains that returns 1 (true) if a given C string appears as a substring of another C string starting at a given position.
More informationQt Essentials - Graphics View Module
Qt Essentials - Module Training Course Visit us at http://qt.digia.com Produced by Digia Plc. Material based on Qt 5.0, created on September 27, 2012 Digia Plc. Using GraphicsView Classes Coordinate Systems
More informationDrawing Primitives. OpenGL basics
CSC 706 Computer Graphics / Dr. N. Gueorguieva 1 OpenGL Libraries Drawing Primitives OpenGL basics OpenGL core library OpenGL32 on Windows GL on most unix/linux systems (libgl.a) OpenGL Utility Library
More informationIntermediate Programming, Spring 2017*
600.120 Intermediate Programming, Spring 2017* Misha Kazhdan *Much of the code in these examples is not commented because it would otherwise not fit on the slides. This is bad coding practice in general
More informationCombining Solr and Elasticsearch to Improve Autosuggestion on Mobile Local Search. Toan Vinh Luu, PhD Senior Search Engineer local.
Combining Solr and Elasticsearch to Improve Autosuggestion on Mobile Local Search Toan Vinh Luu, PhD Senior Search Engineer local.ch AG In this talk Autosuggestion feature Autosuggestion architecture Evaluation
More informationProgramming: You will have 6 files all need to be located in the dir. named PA4:
PROGRAMMING ASSIGNMENT 4: Read Savitch: Chapter 7 and class notes Programming: You will have 6 files all need to be located in the dir. named PA4: PA4.java ShapeP4.java PointP4.java CircleP4.java RectangleP4.java
More informationPackage rmapzen. October 7, 2018
Package rmapzen October 7, 2018 Type Package Title Client for 'Mapzen' and Related Map APIs Version 0.4.1 Maintainer Tarak Shah Provides an interface to 'Mapzen'-based APIs (including
More informationMap Direct Lite. Contents. Quick Start Guide: Map Navigation 8/17/2015
Map Direct Lite Quick Start Guide: Map Navigation 8/17/2015 Contents Quick Start Guide: Map Navigation... 1 Map Navigation in Map Direct Lite.... 2 Pan the Map by Dragging It.... 3 Zoom the Map In by Dragging
More informationThe javabook Package
A The javabook Package We document the javabook classes in this appendix. You can get information on the standard Java packages from a number of sources. If you use commercial Java compilers from Borland,
More informationLinked List using a Sentinel
Linked List using a Sentinel Linked List.h / Linked List.h Using a sentinel for search Created by Enoch Hwang on 2/1/10. Copyright 2010 La Sierra University. All rights reserved. / #include
More information+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.
+ Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create
More informationCreate a Scrolling Effect in PowerPoint 2007
Create a Scrolling Effect in PowerPoint 2007 You have a large image, document, etc. that you d like to show in your presentation and you d like to be able to scroll through it with the ability to control
More informationGUI Basics and Windowing Systems
GUI Basics and Windowing Systems Using X Windows as a case study 1 2 Evolution of GUIs Xero Star (1981) Developed at Xerox PARC Not commercially successful. Apple Macintosh (1984) Inspired by Xerox PARC
More informationTutorial on text transformation with pure::variants
Table of Contents 1. Overview... 1 2. About this tutorial... 1 3. Setting up the project... 2 3.1. Source Files... 4 3.2. Documentation Files... 5 3.3. Build Files... 6 4. Setting up the feature model...
More informationHow to use the DuPage County Parcel Viewer Interactive Web Mapping Application.
How to use the DuPage County Parcel Viewer Interactive Web Mapping Application. Parcel Viewer URL: URL: http://gis.dupageco.org/parcelviewer/ Initial View (And frequently asked questions) Parcel Search
More informationPhotoscenery for Realistic Scene Generation and Visualization in Flightgear: A Tutorial
Photoscenery for Realistic Scene Generation and Visualization in Flightgear: A Tutorial Srikanth A 1, Indhu B 2, L Krishnamurthy 1, VPS Naidu 3 Dept. of Mechanical Engineering, NIE, Mysore, India 1 Dept.
More informationHow to do a Property Search
How to do a Property Search A Self-Tutorial GIS Services 1401 Marina Way South Richmond, CA 94804 Tel: (510) 621-1298 Fax: (510) 307-8116 1. Navigate to the GIS Mapping Services page. 2. The mapping services
More informationAbstract Data Types. Lecture 05 Summary. Abstract Data Types Structures in C 1/26/2009. Slides by Mark Hancock (adapted from notes by Craig Schock)
Abstract Data Types 1 Lecture 05 Summary Abstract Data Types Structures in C 2 1 By the end of this lecture, you will be able to describe the main components of an abstract data type. You will also be
More informationAbstraction and Encapsulation. Benefits of Abstraction & Encapsulation. Concrete Types. Using Typedefs to streamline classes.
Classes II: Type Conversion,, For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Abstraction and Encapsulation Abstraction: Separation of interface from
More informationPhotoshop Introduction to The Shape Tool nigelbuckner This handout is an introduction to get you started using the Shape tool.
Photoshop Introduction to The Shape Tool nigelbuckner 2008 This handout is an introduction to get you started using the Shape tool. What is a shape in Photoshop? The Shape tool makes it possible to draw
More information- It computes the Standard Deviation by calculating the difference of each channel (R,G,B and A) of a pixel.
Standard Deviation: It is common to find comparison of two bitmaps in Image Processing Development. Comparison of two bitmaps means how each pixel of image1 is different from corresponding pixel of image2
More informationCSCI-1200 Data Structures Fall 2017 Test 1 Solutions
CSCI-1200 Data Structures Fall 2017 Test 1 Solutions 1 Searching for Symbols in ASCII Art [ /24] In this problem we will search a large ASCII Art canvas for matches to a target pattern. For example, given
More informationChapter 38 Map-Reduce Meets GIS
Chapter 38 Map-Reduce Meets GIS Part I. Preliminaries Part II. Tightly Coupled Multicore Part III. Loosely Coupled Cluster Part IV. GPU Acceleration Part V. Big Data Chapter 35. Basic Map-Reduce Chapter
More informationGUI Basics and Windowing Systems. Using X Windows as a case study
GUI Basics and Windowing Systems Using X Windows as a case study 2 CS 349 - Syllabus Evolution of GUIs Xero Star (1981) Developed at Xerox PARC Not commercially successful. Apple Macintosh (1984) Inspired
More informationPixelSurface a dynamic world of pixels for Unity
PixelSurface a dynamic world of pixels for Unity Oct 19, 2015 Joe Strout joe@luminaryapps.com Overview PixelSurface is a small class library for Unity that lets you manipulate 2D graphics on the level
More informationCISC 1600, Lab 2.2: Interactivity in Processing
CISC 1600, Lab 2.2: Interactivity in Processing Prof Michael Mandel 1 Getting set up For this lab, we will again be using Sketchpad, a site for building processing sketches online using processing.js.
More informationIntermediate C++ 1/83
Intermediate C++ 1/83 Sections I. Memory Management Basics II. The C++ Standard Library III. Casting IV. Resource Management: RAII 2/83 I. Memory Management Basics 1. Checking for memory leaks 2. Pass
More informationRAPIDMAP Geocortex HTML5 Viewer Manual
RAPIDMAP Geocortex HTML5 Viewer Manual This site was developed using the evolving HTML5 web standard and should work in most modern browsers including IE, Safari, Chrome and Firefox. Even though it was
More informationCS-211 Fall 2017 Test 1 Version Practice For Test on Oct. 2, Name:
CS-211 Fall 2017 Test 1 Version Practice For Test on Oct. 2, 2017 True/False Questions... Name: 1. (10 points) For the following, Check T if the statement is true, the F if the statement is false. (a)
More informationSBGN-ML. Milestone 1
SBGN-ML Milestone 1 Generalities SBGN-ML is XML based cf. schema SBGN.xsd SBGN-ML files represent SBGN maps PD (Process Description) only in milestone 1 Basic geometry and labels COMMON TYPES AND ELEMENTS
More informationIn order to follow this set of directions you will need the following
How to Create Maps & Figures in ArcView 9x In order to follow this set of directions you will need the following 1) the Jenny s Louisiana GIS Instructional CD 2) a computer with ArcGIS on it (version 9.0
More informationSpreadsheet View and Basic Statistics Concepts
Spreadsheet View and Basic Statistics Concepts GeoGebra 3.2 Workshop Handout 9 Judith and Markus Hohenwarter www.geogebra.org Table of Contents 1. Introduction to GeoGebra s Spreadsheet View 2 2. Record
More informationTeacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using
Teacher Assistant : Tamir Grossinger email: tamirgr@gmail.com Reception hours: by email - Building 37 / office -102 Assignments: 4 programing using C++ 1 theoretical You can find everything you need in
More informationStarting the QGIS Program. Exercise 1: Exploring QGIS
Exercise 1: Exploring QGIS In this exercise you will learn how to open maps, manipulate layers, add spatial data, change symbols, and navigate within QGIS. You will also learn to repair broken data links.
More informationBinghamton University. CS-211 Fall Functions. The Basis of C
Functions The Basis of C 1 What is a function? Have you ever needed to convert from C to F? Demo: http://www.pronk.com/samples/projects/021$function_machine/fu nction_machine.html 2 Function in C float
More informationMy First Command-Line Program
1. Tutorial Overview My First Command-Line Program In this tutorial, you re going to create a very simple command-line application that runs in a window. Unlike a graphical user interface application where
More informationAssignment 3: Inheritance
Assignment 3: Inheritance Due Wednesday March 21 st, 2012 by 11:59 pm. Submit deliverables via CourSys: https://courses.cs.sfu.ca/ Late penalty is 10% per calendar day (each 0 to 24 hour period past due).
More informationCS-211 Fall 2017 Test 1 Version A Oct. 2, Name:
CS-211 Fall 2017 Test 1 Version A Oct. 2, 2017 True/False Questions... Name: 1. (10 points) For the following, Check T if the statement is true, the F if the statement is false. (a) T F : If I code a C
More informationWhy C++ is much more fun than C (C++ FAQ)?
From C to C++ Why C++ is much more fun than C (C++ FAQ)? 1. Classes & methods - OO design 2. Generic programming - Templates allow for code reuse 3. Stricter type system (e.g. function args) 4. Some run-time
More informationProgramming Language. Functions. Eng. Anis Nazer First Semester
Programming Language Functions Eng. Anis Nazer First Semester 2016-2017 Definitions Function : a set of statements that are written once, and can be executed upon request Functions are separate entities
More informationCSCI-1200 Data Structures Spring 2018 Exam 1 Solutions
CSCI-1200 Data Structures Spring 2018 Exam 1 Solutions 1 Parcel Delivery [ / 35] In the following problem you will finish the implementation of a program that is designed to keep track of several delivery
More informationREVIT ARCHITECTURE 2016
Page 1 of 6 REVIT ARCHITECTURE 2016 Revit Architecture 2016: CREATE A CHAMFERED COLUMN COMPONENT About creating a chamfered column family typical to the Victorian cottage style. Add the column to your
More informationOpenGL Introduction Computer Graphics and Visualization
Fall 2009 2 OpenGL OpenGL System Interaction Portable Consistent visual display regardless of hardware, OS and windowing system Callable from Ada, C, C++, Fortran, Python, Perl and Java Runs on all major
More informationC++ Lab 03 - C++ Functions
C++ Lab 03 - C++ Functions 2.680 Unmanned Marine Vehicle Autonomy, Sensing and Communications Spring 2018 Michael Benjamin, mikerb@mit.edu Department of Mechanical Engineering Computer Science and Artificial
More informationEEN118 LAB TWO. 1. A Five-Pointed Star.
EEN118 LAB TWO The purpose of this lab is to get practice with defining and using your own functions. The essence of good structured programming is to split large problems into smaller and smaller sub-problems.
More informationint fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4
RP-VL-UTIL-V1 Developer s Guide [ Contents ] 1. Introduction... 1 2. Building Environment... 1 3. Operating Environment... 1 4. Function Explanation... 2 4.1. Common API for Transmitting and Receiving...
More informationCS 376b Computer Vision
CS 376b Computer Vision 09 / 25 / 2014 Instructor: Michael Eckmann Today s Topics Questions? / Comments? Enhancing images / masks Cross correlation Convolution C++ Cross-correlation Cross-correlation involves
More information3D computer graphics: geometric modeling of objects in the computer and rendering them
SE313: Computer Graphics and Visual Programming Computer Graphics Notes Gazihan Alankus, Spring 2012 Computer Graphics 3D computer graphics: geometric modeling of objects in the computer and rendering
More informationOpenGL and Qt Creator: a Gentle Introduction
OpenGL and Qt Creator: a Gentle Introduction Comp175: Introduction to Computer Graphics Fall 201 September 9th, 2011 1 Introduction In this lab 1 you will take your first steps into the world of OpenGL
More informationFast Introduction to Object Oriented Programming and C++
Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming
More informationCOMP Summer 2015 (A01) Jim (James) Young jimyoung.ca
COMP 1010- Summer 2015 (A01) Jim (James) Young young@cs.umanitoba.ca jimyoung.ca final float MAX_SPEED = 10; final float BALL_SIZE = 5; void setup() { size(500, 500); void draw() { stroke(255); fill(255);
More information20. Inheritance and Polymorphism
(Expression) Trees 20. Inheritance and Polymorphism Expression Trees, Inheritance, Code-Reuse, Virtual Functions, Polymorphism, Concepts of Object Oriented Programming bend fork 3 -(3-(4-5))*(3+4*5)/6
More informationTutorial for Lane County Mapping Applications
Tutorial for Lane County Mapping Applications Contents Overview... 2 Tools... 2 Navigation Tools... 3 Display Tools... 5 Information Tools... 6 Sharing Tools... 7 Common Tasks... 9 Identify or Show Data
More informationGuide to WB Annotations
Guide to WB Annotations 04 May 2016 Annotations are a powerful new feature added to Workbench v1.2.0 (Released May 2016) for placing text and symbols within wb_view tabs and windows. They enable generation
More informationCOS340A Assignment 1 I Pillemer Student# March 25 th 2007 p1/15
COS340A Assignment 1 I Pillemer Student# 3257 495 9 March 25 th 2007 p1/15 Assignment 1 I Pillemer Student#: 3257 495 9 COS340A Date submitted: March 25, 2007 Question 1... p2 3 Question 2... p4 Question
More informationC++ Tutorial AM 225. Dan Fortunato
C++ Tutorial AM 225 Dan Fortunato Anatomy of a C++ program A program begins execution in the main() function, which is called automatically when the program is run. Code from external libraries can be
More informationCS242: Object-Oriented Design and Programming
CS242: Object-Oriented Design and Programming Program Assignment 5 Part 1 (Linked List Timer Queue) Due Tuesday, March 18 th ; 1997 Part 2 (Heap Timer Queue) Due Tuesday, April 1 st ; 1997) A Timer Queue
More informationAdobe illustrator Introduction
Adobe illustrator Introduction This document was prepared by Luke Easterbrook 2013 1 Summary This document is an introduction to using adobe illustrator for scientific illustration. The document is a filleable
More informationLecture 7 A First Graphic Program And Data Structures & Drawing
Lecture 7 A First Graphic Program And Data Structures & Drawing Objective The objective is that you will understand: How to program the generation of 2D and 3D images. How to manipulate those images through
More informationHow to lay out a web page with CSS
How to lay out a web page with CSS A CSS page layout uses the Cascading Style Sheets format, rather than traditional HTML tables or frames, to organize the content on a web page. The basic building block
More informationQuick Tips to Using I-DEAS. Learn about:
Learn about: Quick Tips to Using I-DEAS I-DEAS Tutorials: Fundamental Skills windows mouse buttons applications and tasks menus icons part modeling viewing selecting data management using the online tutorials
More informationDOING MORE WITH WORD: MICROSOFT OFFICE 2010
DOING MORE WITH WORD: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT WORD PAGE 03 Viewing Toolbars Adding and Removing Buttons MORE TASKS IN MICROSOFT WORD
More informationQStringView. everywhere. Marc Mutz, Senior Software Engineer at KDAB
QStringView QStringView everywhere Marc Mutz, Senior Software Engineer at KDAB Intro About me p.2 Intro (cont'd) Author of QStringView p.3 Overview QStringView Using QStringView API Patterns For QStringView
More informationCFU RASTER FORMAT SPECIFICATION
Name: "MyNav CFU format" Version: 1 MyNav compatibility: v6.3.0.0 and above Date of publishing: November 18 th, 2010 Introduction CFU RASTER FORMAT SPECIFICATION The MyNav raster format is compatible with
More informationChapter 24. Graphical Objects The GraphicalObject Class
290 Chapter 24 Graphical Objects The simple graphics we saw earlier created screen artifacts. A screen artifact is simply an image drawn on the screen (viewport), just as a picture can be drawn on a whiteboard.
More informationPDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK.
EMF2PDF SDK Pilot Structures struct pdf_document { PDFDocument4 *pdfdoc; }; PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK. typedef enum { conone
More informationFind nearest dealer. Users guide
Find nearest dealer Users guide January 2017 Digital Media, Group Marketing 1 Table of contents 1. Access to backend... 3 2 Front page... 4 2.1 Left navigation... 5 3 Stockists... 6 3.1 Overview... 6 3.2
More information1 Getting started with Processing
cis3.5, spring 2009, lab II.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For
More informationStructuur van Computerprogramma s 2
Structuur van Computerprogramma s 2 dr. Dirk Deridder Dirk.Deridder@vub.ac.be http://soft.vub.ac.be/ Vrije Universiteit Brussel - Faculty of Science and Bio-Engineering Sciences - Computer Science Department
More informationThis document contains the questions and solutions to the CS107 midterm given in Winter 2018 by instructor Chris Gregg. This was a 120-minute exam.
This document contains the questions and solutions to the CS107 midterm given in Winter 2018 by instructor Chris Gregg. This was a 120-minute exam. Midterm questions Problem 1: Bits, bytes, and numbers
More informationC programming for beginners
C programming for beginners Lesson 2 December 10, 2008 (Medical Physics Group, UNED) C basics Lesson 2 1 / 11 Main task What are the values of c that hold bounded? x n+1 = x n2 + c (x ; c C) (Medical Physics
More informationLearning Recursion. Recursion [ Why is it important?] ~7 easy marks in Exam Paper. Step 1. Understand Code. Step 2. Understand Execution
Recursion [ Why is it important?] ~7 easy marks in Exam Paper Seemingly Different Coding Approach In Fact: Strengthen Top-down Thinking Get Mature in - Setting parameters - Function calls - return + work
More informationResponding to the Mouse
Responding to the Mouse The mouse has two buttons: left and right. Each button can be depressed and can be released. Here, for reference are the definitions of three common terms for actions performed
More informationJava Applets. Last Time. Java Applets. Java Applets. First Java Applet. Java Applets. v We created our first Java application
Last Time v We created our first Java application v What are the components of a basic Java application? v What GUI component did we use in the examples? v How do we write to the standard output? v An
More information1 Getting started with Processing
cisc3665, fall 2011, lab I.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For
More informationCSCI-1200 Data Structures Fall 2017 Lecture 2 STL Strings & Vectors
Announcements CSCI-1200 Data Structures Fall 2017 Lecture 2 STL Strings & Vectors HW 1 is available on-line through the website (on the Calendar ). Be sure to read through this information as you start
More information[ the academy_of_code] Senior Beginners
[ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell
More informationLAB 2 CREATING A COMBINED PROPOSAL
LAB 2 CREATING A COMBINED PROPOSAL OBJECTIVE Walk through the main steps of creating a single report that contains the contents of a number of reports (Contract, Proposal, Scope of Work, and Project Contact
More informationFlair Geometry Editor Part I. Beginners FLUKA Course
Flair Geometry Editor Part I Beginners FLUKA Course Starting the Geometry Editor Click on icon or from Menu View Geometry Editor or with [F4] shortcut Either start flair with option -g 2 Geometry editor
More informationBob s Concise Introduction to Doxygen
Bob s Concise Introduction to Doxygen by Robert S Laramee Visual and Interactive Computing Group Department of Computer Science Swansea University Swansea, Wales, UK 1 Comment Standard February 14, 2011
More informationCS107, Lecture 9 C Generics Function Pointers
CS107, Lecture 9 C Generics Function Pointers Reading: K&R 5.11 This document is copyright (C) Stanford Computer Science and Nick Troccoli, licensed under Creative Commons Attribution 2.5 License. All
More informationOpenCL in Action. Ofer Rosenberg
pencl in Action fer Rosenberg Working with pencl API pencl Boot Platform Devices Context Queue Platform Query int GetPlatform (cl_platform_id &platform, char* requestedplatformname) { cl_uint numplatforms;
More information