VTK Graphs Cmake & Git. Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
Intro to Microsoft PowerPoint 2010 Public Computer Center, Moore Memorial Library, Greene, NY.
LINUX-WINDOWS INTERACTION. One software allowing interaction between Linux and Windows is WINE. Wine allows Linux users to load Windows programs while.
Software Configuration Management Donna Albino LIS489, December 3, 2014.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
How to install CGAL Yuanzhen Wang. What is CGAL Computational Geometry Algorithms Library “Provide easy access to efficient and reliable geometric algorithms.
SubVersioN – the new Central Service at DESY by Marian Gawron.
GIT is for people who like SVN September 18 th 2012 Vladimir Kerkez and BK.
Android Application Development 2013 PClassic Chris Murphy 1.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Servlets Environment Setup. Agenda:  Setting up Java Development Kit  Setting up Web Server: Tomcat  Setting up CLASSPATH.
CS413: Java Programming language Applications Applets
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
CCS APPS CODE COVERAGE. CCS APPS Code Coverage Definition: –The amount of code within a program that is exercised Uses: –Important for discovering code.
Introduction Purpose This course describes the process of installing the KPIT GNU toolchain on your PC. Objective Learn how easy it is to get information.
Software Engineering in Robotics Packaging and Deployment of Systems Henrik I. Christensen –
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
Version control Using Git Version control, using Git1.
Drexel University Software Engineering Research Group Git for SE101 1.
Visual C++ Programming: Concepts and Projects
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Installing CompuCell3D from source Maciej Swat Biocomplexity Institute, Indiana University.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Installing CompuCell3D from source. Why you might want to install from source? 1.There are no binaries for your platform (e.g. gentoo linux) 2.You want.
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Intoduction to Andriod studio Environment With a hello world program.
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
NALINI S. NAUTIYAL SYSTEM SOFTWARE DIVISION Subversion.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
CMake: Experience in ALICE P. Hristov 19/06/12. History I Recursive makefiles (F.Carminati): – Problems in dependencies – Slow "Recursive Makefiles.
1 Creative Innovation – Customer Satisfaction – Continual Quality Improvement Accessing and Building Asterisk SCF.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Version Control Systems
Version control and issue tracking options for IHE PCD
CS5220 Advanced Topics in Web Programming Version Control with Git
Build and Test system for FairRoot
Development Environment
Source Control Systems
ALICE-Juniors Meeting
Version Control Systems
Cmake Primer.
Software Installation
Overview Unit testing Building Version control.
CSCE 206 Lab Structured Programming in C
Presentation transcript:

VTK Graphs Cmake & Git

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Collision detection: Is it easy to do? Is it necessary?

Do you like VTK’s automatic camera placement? What else does make easy?

Hierarchy of Transformation? Any VTK Tips/Tricks?

Visualization for Debugging: Would this help you study & debug a maze solving algorithm?

How did performance scale with this much geometry?

How do you do textures? What was most challenging technical detail?

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Readings for This Week: "Eenie, Meenie, Minie, Moe: Selecting the Right Graph for Your Message" Stephen Few, 2004

Readings for This Week: "Automating the design of graphical presentations of relational information" Jock Mackinlay, 1986

Readings for This Week: "Designing Effective Step-By-Step Assembly Instructions" Agrawala et al., 2003

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Readings for Next Week: "Graph drawing by force-directed placement", Fruchterman & Reingold, 1991

Readings for Next Week: "Heapviz: Interactive Heap Visualization for Program Understanding and Debugging” Aftandilian, Kelley, Gramazio, Ricci, Su, & Guyer, 2010

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Introduction to VTK: Graphs

Graph Theory 101 A graph consists of: o Edges – the “points” o Vertices – the “lines”

Types of Graphs Directed o One vertex “points” to another Undirected o Two vertices are connected (they both point to each other)

Graphs in VTK

Constructing Graphs VisualizeGraph VisualizeGraph Use these to construct graphs o vtkMutableUndirectedGraph o vtkMutableDirectedGraph vtkSmartPointer g = vtkSmartPointer ::New(); vtkIdType v1 = g->AddVertex(); vtkIdType v2 = g->AddVertex(); g->AddEdge ( v1, v2 );

Graph Data VertexData o You can store data for every vertex o Colors, ids, names, etc o graph->GetVertexData()->AddArray(yourFavoriteArray); EdgeData o You can store data for every edge o Edge weights, colors, etc o graph->GetEdgeData()->AddArray(yourFavoriteArray); o

Graph Data: Example … Create a graph with 3 vertices and 3 edges … // Create the edge weight array vtkSmartPointer weights = vtkSmartPointer ::New(); weights->SetNumberOfComponents(1); weights->SetName("Weights"); // Set the edge weights weights->InsertNextValue(1.0); weights->InsertNextValue(2.0); // Create the vertex id array vtkSmartPointer vertexIDs = vtkSmartPointer ::New(); vertexIDs->SetNumberOfComponents(1); vertexIDs->SetName("VertexIDs"); // Set the vertex ids vertexIDs->InsertNextValue(0); vertexIDs->InsertNextValue(1); vertexIDs->InsertNextValue(2); // Add the edge weight array to the graph g->GetEdgeData()->AddArray(weights); g->GetVertexData()->AddArray(vertexIDs);

Displaying Graphs VisualizeGraph VisualizeGraph vtkSmartPointer graphLayoutView = vtkSmartPointer ::New(); graphLayoutView->AddRepresentationFromInput(g); graphLayoutView->ResetCamera(); graphLayoutView->Render(); graphLayoutView->GetInteractor()->Start();

Displaying Vertex and Edge Labels graphLayoutView->SetVertexLabelVisibility(true); graphLayoutView->SetEdgeLabelVisibility(true); graphLayoutView->SetEdgeLabelArrayName("Weights"); graphLayoutView->SetVertexLabelArrayName("VertexIDs");

Layout Strategies graphLayoutView->SetLayoutStrategy(“Strategy Name"); o "Random“ - Randomly places vertices in a box o "Force Directed“ - Simulating forces (springs) on edges o "Simple 2D“ - A simple 2D force directed layout o "Clustering 2D“ - Just like simple 2D but uses some techniques to cluster better o "Fast 2D“ - A linear-time 2D layout. o "Circular"

Vertex Coodinates You can also specify the “Pass Through” layout strategy This allows you to set the coordinates of the vertices manually: vtkSmartPointer points = vtkSmartPointer ::New(); points->InsertNextPoint(0.0, 0.0, 0.0); points->InsertNextPoint(1.0, 0.0, 0.0); points->InsertNextPoint(0.0, 1.0, 0.0); g->SetPoints(points);

Neighboring Vertices vtkAdjacentVertexIterator vtkSmartPointer iterator = vtkSmartPointer ::New(); g->GetAdjacentVertices(0, iterator); while(iterator->HasNext()) { vtkIdType nextVertex = iterator->Next(); std::cout << "Next vertex: " << nextVertex << std::endl; }

Lookup Tables Automatic map from a range to all colors: Manually specify colors in the table: vtkLookupTable* lookupTable = vtkLookupTable::New(); lookupTable->SetTableRange(0.0, 10.0); lookupTable->Build(); vtkSmartPointer lookupTable = vtkSmartPointer ::New(); lookupTable->SetNumberOfTableValues(2); lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red lookupTable->SetTableValue(1, 0.0, 1.0, 0.0); // green lookupTable->Build();

Color Vertices // Create the color array vtkIntArray* vertexColors = vtkIntArray::New(); vertexColors->SetName(“VertexColors”); vertexColors->SetNumberOfComponents(1); vertexColors->InsertNextValue(1); vertexColors->InsertNextValue(2); … … Create a lookup table … // Add the color array to the graph graph->GetVertexData()->AddArray(vertexColors); vtkViewTheme* theme = vtkViewTheme::New(); theme->SetPointLookupTable(lookupTable); graphLayoutView->ApplyViewTheme(theme); graphLayoutView->SetVertexColorArrayName(“VertexColors"); graphLayoutView->ColorVerticesOn();

Color Edges // Create the color array vtkIntArray* edgeColors = vtkIntArray::New(); edgeColors->SetName(“EdgeColors”); edgeColors->SetNumberOfComponents(1); edgeColors->InsertNextValue(1); edgeColors->InsertNextValue(2); … … Create a lookup table … // Add the color array to the graph graph->GetEdgeData()->AddArray(edgeColors); vtkViewTheme* theme = vtkViewTheme::New(); theme->SetCellLookupTable(lookupTable); graphLayoutView->ApplyViewTheme(theme); graphLayoutView->SetVertexColorArrayName(“EdgeColors"); graphLayoutView->ColorEdgesOn();

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Introduction to VTK: CMake

What is CMake? Cross platform Make Allows the same source code to be compiled on many different operating systems and IDEs (Integrated Development Environment) o Visual Studio o Code Blocks o KDevelop o Eclipse o Traditional Unix Makefile o Etc.

The Idea Software used to ship with a Makefile The settings for library paths, which options you wanted to use for the compilation and installation were hard coded into the Makefile Autoconf and similar packages attempted to make this a little easier CMake makes it VERY easy

Single Person Project The Code The Compiler/IDE

Collaborative (“Real”) Project The Code Person A’s Compiler/IDE Person N’s Compiler/IDE YIKES!!

Collaborative (“Real”) Project The Code Person A’s Compiler/IDE Person N’s Compiler/IDE CMake

The Magic File – CMakeLists.txt PROJECT(YourExampleProject) FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) ADD_EXECUTABLE(ExampleExecutable ExampleCode.cxx) TARGET_LINK_LIBRARIES(ExampleExecutable vtkHybrid)

Line-by-line PROJECT(YourExampleProject) Tell CMake you are starting a new project

Line-by-line FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) Tell CMake you want to use VTK in your new project If you have the environment variable VTK_BIN set, CMake will find VTK automatically If not, when you configure your project using CMake it will ask you where you have VTK installed

Line-by-line ADD_EXECUTABLE(ExampleExecutable ExampleCode.cxx) Tell CMake you want to create an executable called ExampleExecutable from ExampleCode.cxx TARGET_LINK_LIBRARIES(ExampleExecutable vtkHybrid) Tell CMake that ExampleCode.cxx uses functions defined in the library vtkHybrid. You can list as many libraries as you need. TARGET_LINK_LIBRARIES(ExampleExecutable vtkHybrid vtkInfovis OtherLibrary)

Windows Interface Download from here: html html You will use a GUI interface

Windows Process Run CMake Point it to your source directory Point it the build directory of your choice Set an options that you would like Click “configure” (you may have to do this twice (until the “generate” button is not greyed out) ) Choose your generator (which IDE you are going to use to build the project) Click “Generate”

Linux Should already have CMake installed Test by typing ‘cmake’ in a terminal If you don’t get “command not found”, you’re in good shape If you do, most distributions have a CMake package o sudo yum install cmake o sudo apt-get install cmake o Or equivalent

Linux Interface ccmake – Curses Cmake ( _library) ) _library) Allows you to set many options before generating a project

Linux Process Linux - Makefile o Create a build directory (wherever you want) o From the build directory, run ‘ccmake’ on the source directory o Example: Your source code is in ~/src/VTK Create a build directory: mkdir ~/bin/VTK cd ~/bin/VTK ccmake ~/src/VTK o Set any options you would like o Hit ‘c’ for ‘configure’. You may have to do this twice o Hit ‘g’ for generate

Linux Process Linux – Other IDE o ccmake ~/src/VTK –G YourGenerator o More info at mation mation o Generators include Eclipse KDevelop3 CodeBlocks NMake

First Time VTK Programming Step 1 – Download the VTK source code Step 2 – Use CMake to create a project for the IDE you want to use to compile VTK Step 3 – Use the IDE you selected in Step 2 to build VTK Step 4 – Obtain an example program and associated CMakeLists.txt file from the Examples Wiki Step 5 – Use CMake to create a project for the IDE you want to use to compile the example program Step 6 – Use the IDE you selected in Step 5 to build the example program

Today’s Class Highlights from HW #1 This Week’s Readings Next Week’s Readings VTK Graphs Intro to Cmake Intro to Git

Introduction to VTK: Git

What is Git? The latest and greatest version control system Makes large projects easier to manage Written by Linus Torvalds (the Linux guy) to help with the massive Linux project

Version Control Systems – A Brief History Patches CVS/SVN Git

The Olden Days In the “olden days”, people would send patches back and forth to each other via This was terribly inefficient The patch would only work with the exact file that it was created for No version control

CVS/SVN CVS: Concurrent Versions System SVN: Subversion – a re-write of CVS Users can “publish” code to a central repository Users can get the code from the central repository

CVS/SVN Central Repository User AUser B

Git There is no “central repository” to speak of Typically one computer is designated as the “official” computer, but it is no different than any other user

Git “Central Repository” New link! User B User A

Branches Work on different “projects” without affecting other “projects” in the works Submit a branch for easy code review Github.com gitorious.com, etc.