Introduction to the Maya C++ API. Tuesday, 17 April 12

Size: px
Start display at page:

Download "Introduction to the Maya C++ API. Tuesday, 17 April 12"

Transcription

1 Introduction to the Maya C++ API

2 API Basics Maya has both a python and a C++ API In most cases either can be used to accomplish tasks For this lecture we will look at the C++ API There are a series of headers and libraries shipped with maya which allow us to write plugins These come in many forms and will be discussed today

3 C++ API The maya api uses inheritance to extend the basic functionality of maya. There are a number of different class types we can work with and these will change depending upon the context

4 MFn function Sets Set of functions for creating, querying, and operating on a type of object MFnCamera MFnLight MFnFluid MFnPlugin MFnNurbsSurface MFnDagNode (DagNode has visible component in UI) MFnDependencyNode (dependency node has no visible component in UI) An object can be compatible with more than one type of function set... Example: a NURBS object is compatible with/can be operated on by MFnNurbsSurface, MFnDagNode, MFnDependencyNode etc.

5 Proxy MPx Base classes inherited to define new types of Maya objects Examples: MPxCommand define new commands MPxNode define new (generic) nodes MPxDeformerNode define deformer type MPxIkSolver define new IK solver MPxFileTranslator define file exporter Proxies understand Maya s internals; developer implement the new/unique features

6 Iterators MIt Used to traverse a category of objects Examples: MItKeyframe iterate over keyframes of anim curve MItSurfaceCV MItCurveCV MItDependencyGraph iterate over all nodes (in)directly connected to a given node MItDependencyNodes traverse all the nodes in Maya s Dependency Graph

7 Utility Classes MGlobal a static class. Members perform mostly UI-related tasks MStatus passes return status codes (always check) MString MVector MDagPath

8 MObject Is a handle/reference to a Maya internal object Valid use: determine object type and compatible function sets Maya controls the deletion of MObjects NEVER store an MObject use immediately MDagPaths can be stored

9 Getting Started Maya plugins are built as platform specific shared libraries, (.so,.dll,.bundle) Under mac/linux we must use the same version of the compiler as used to build maya to avoid linker problems with the standard libraries Linux: stdout is directed to shell (where gomaya was called in the case of the studio) Windows: stdout is directed to an output window General: stdout may not appear unless flushed

10 mayald mayald is a shell script shipped with maya to simplify the building of maya plugins / projects It contains commands / paths to use when building maya plugins It also links against all of the libraries required for every type of maya application we may wish to build It is found in /usr/autodesk/maya/bin in the current lab build

11 Qt Project To help aid with development I have created a basic qt.pro file which will allow for maya plugin development At present it works for both mac and linux and will select the correct versions of the compiler etc bases on the platform This gives the advantage of using the Qt IDE for our development.

12 LIBS=-L$MAYA_LOCATION/lib \ -lopenmayalib \ -lopenmaya \ -lanimslice \ -ldeformslice \ -lmodifiers \ -ldynslice \ -lkinslice \ -lmodelslice \ -lnurbsslice \ -lpolyslice \ -lprojectslice \ -limage \ -lshared \ -ltranslators \ -ldatamodel \ -lrendermodel \ -lnurbsengine \ -ldependengine \ -lcommandengine \ -lfoundation \ -limfbase \ -lm -ldl ;; mayald by default adds all these libs the Qt project will need them adding when required # These are the maya libs we need to link to, this will change depending # upon which maya framework we use, just add them to the end of # this list as required and they will be added to the build MAYALIBS=-lOpenMaya \ -lfoundation

13 A Simple Maya Command The following example will create and register a simple maya command We are going to use a macro supplied with the maya API which will create the correct class / code we require This is the simplest possible way and is good for quick command development

14 #include <maya/msimple.h> #include <maya/miostream.h> #include <maya/mglobal.h> // This is a macro to create a simple command // the compiler expands it to a bunch of code DeclareSimpleCommand( HelloMaya, "NCCA", "Maya 2011"); MStatus HelloMaya::doIt( const MArgList& ) std::cout<<"this should come from the shell\n"; MGlobal::displayInfo("Hello Maya in the maya command shell"); return MS::kSuccess; #define DeclareSimpleCommand( _classname, _vendor, _version ) \ name of command who wrote it maya version

15 Loading Plugin To load the plugin select Windows->Settings/Preferences->Plugin- Manager Click browse and find the plugin in your file system Click on the and you will see the info

16 running the command python import maya.cmds as cmds cmds.hellomaya() mel HelloMaya

17 MPxCommand The MPxCommand class is used to create our own command Each command is derived from this one, and must have a doit method optionally we can also implement an undoit and redoit method to allow us to hook into the maya undo / redo system

18 customcreatesphere This command will generate a number of random spheres based on a user argument

19 CustomSphere We will implement the following virtual methods from the MPxCommand CustomSphere - m_count : uint + ~CustomSphere + doit( _args : MArgList& ) : MStatus + redoit() : MStatus + undoit() : MStatus + isundoable() : bool + creator() : static void* MPxCommand class the main code for executing the command will be placed in the redoit and called from the doit method when constructed As we have no dynamic memory we don t actually use the dtor.

20 Utility macros simple macro to check status and return if error /// originally written by Sola Aino #define CHECK_STATUS_AND_RETURN_IF_FAIL( stat, message ) \ if(!status ) \ \ MString errorstring = status.errorstring() + MString( message); \ MGlobal::displayError( errorstring ); \ return MStatus::kFailure; \ \ This macro makes it easy to check for errors and will be replaced by the compiler every time we use it.

21 Basic Methods CustomSphere:: CustomSphere() // as we have no dynamic allocation // we don't need to do anything here bool CustomSphere::isUndoable() const return true; Note the creator method is called by maya and we use it to call our void* CustomSphere::creator() return new CustomSphere(); ctor

22 doit method the doit method will be passed any arguments passed when the command is invoked. It is the responsibility of the doit command to parse these and store in the class any values which may be required for do / undo. Arguments are processed by the MArgList class as shown in the following example

23 MStatus CustomSphere::doIt( const MArgList& _args ) MStatus status; // Verify argument count if ( _args.length()!= 1 ) MGlobal::displayError( "Command requires one argument" ); return MStatus::kFailure; // Check aurgument type m_count = _args.asint( 0, &status ); if(!status ) MGlobal::displayError( "argument is not an integer" ); return MStatus::kFailure; // Check argument range if( m_count <= 0 ) MGlobal::displayError( "argument must be greater than zero" ); return MStatus::kFailure; // now call the redoit method which actually does the work return redoit();

24 redoit method In this case the redoit method will do the creation of the spheres This will loop for the number of times specified on the command line, and execute a maya command to create a sphere with a random radius Next a move command will be executed to move the sphere to a random position For ease boost::format is used to form the format strings.

25 MStatus CustomSphere::redoIt() // loop for the number of arguments passed in and create some random spheres for( unsigned int i = 0; i < m_count; ++i ) // fist I'm going to create a maya command as follows // sphere -name "sphere[n]" where n is the value of i std::string cmd; float rad=randfloat(0.2,2.5); cmd=boost::str(boost::format("sphere -name \"sphere%d\" -r %f") %i %rad) ; // now execute the command MStatus status = MGlobal::executeCommand( cmd.c_str() ); // and check that is was succesfull CHECK_STATUS_AND_RETURN_IF_FAIL(status,"Unable to execute sphere command"); // now move to a random position first grab some positions float x=randfloat(-20,20); float y=randfloat(-20,20); float z=randfloat(-20,20); // build the command string // move x y z "sphere[n]" cmd=boost::str(boost::format("move %f %f %f \"sphere%d\"") %x %y %z %i) ; // execute status=mglobal::executecommand(cmd.c_str()); CHECK_STATUS_AND_RETURN_IF_FAIL(status,"unable to move object"); std::string mesg=boost::str(boost::format("%d Spheres created") %m_count) ; MGlobal::displayInfo( mesg.c_str() ); return MStatus::kSuccess;

26 MStatus CustomSphere::undoIt() // here we undo what was done in the re-do method, // this will be called when maya calles the undo method for( unsigned int i = 0; i < m_count; ++i ) std::string cmd; // delete the objects as created previously cmd=boost::str(boost::format("delete \"sphere%d\"") %i) ; MStatus status=mglobal::executecommand(cmd.c_str()); // check that is was ok CHECK_STATUS_AND_RETURN_IF_FAIL(status,"unable to delete objects in undo"); return MStatus::kSuccess; float randfloat(float _min, float _max) return ((_max-_min)*((float)rand()/rand_max))+_min;

27 plugin code to register our command we need to add some plugin code to allow the register / deregister of the plugin This is as follows MStatus initializeplugin( MObject obj ) MStatus status; MFnPlugin plugin( obj, "", "NCCA", "Any" ); status = plugin.registercommand( "customcreatesphere", CustomSphere::creator ); if (!status ) status.perror( "Unable to register command \"customcreatesphere\"" ); return status; return status;

28 MStatus uninitializeplugin( MObject obj ) MStatus status; MFnPlugin plugin( obj ); status = plugin.deregistercommand( "customcreatesphere" ); if (!status ) status.perror( "Unable to register command \"customcreatesphere\"" ); return status; return status; import maya.cmds as cmds cmds.customcreatesphere(300)

29 Exercise import maya.cmds as cmds cmds.customcreatesphere(n=300,mr=0.1,mm=2,x=2,y=5,z=20) Using the maya api documentation for MArgList modify the customcreatesphere plugin to take the following arguments -mr [double] the minimum radius must be >0 -mm [double] the max radius -x [double] the ±x extents -y [double] the ±y extents -z [double] the ±z extents -n [int] the number of spheres to create

30 Hint You will need to add class attributes for each of the new parameters, there is quite a lot of sample code in the MArgList class you can use. If you want a more advanced solution follow this tutorial RobTheBloke/www/maya/MSyntax.html Solution next week (mine is based on the above)

31 references Introduction to the Maya API Sola Aina NCCA 2011 Autodesk Maya 2011 help

Maya API White Paper January 2005

Maya API White Paper January 2005 Maya API White Paper January 2005 This white paper introduces Maya software and its architecture to programmers who may be unfamiliar with the Maya API. The goal of this document is to help programmers

More information

Maya API Overview Cyrille FauvelAutodesk Developer Network (ADN)

Maya API Overview Cyrille FauvelAutodesk Developer Network (ADN) We may make statements regarding planned or future development efforts for our existing or new products and services. These statements are not intended to be a promise or guarantee of future delivery of

More information

CONTENTS... 1 INTRODUCTION... 3 OVERVIEW OF THE MAYA API INTERNATIONALIZATION ARCHITECTURE...

CONTENTS... 1 INTRODUCTION... 3 OVERVIEW OF THE MAYA API INTERNATIONALIZATION ARCHITECTURE... AUTODESK MAYA PLUG-IN INTERNATIONALIZATION WHITE PAPER This white paper describes the internationalization and localization features available to programmers developing plug-ins for Autodesk Maya software.

More information

Maya Python. for Games and Film. and the Maya Python API. A Complete Reference for Maya Python. Ryan Trowbridge. Adam Mechtley ELSEVIER

Maya Python. for Games and Film. and the Maya Python API. A Complete Reference for Maya Python. Ryan Trowbridge. Adam Mechtley ELSEVIER Maya Python for Games and Film A Complete Reference for Maya Python and the Maya Python API Adam Mechtley Ryan Trowbridge AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO

More information

Week 03 MEL basic syntax II

Week 03 MEL basic syntax II Week 03 MEL basic syntax II The Basics of MEL syntax (part 3): if, function and imperative syntax Conditional execution The Basics of MEL syntax (part 3) When a MEL script must choose whether or not to

More information

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

7/21/10 MOTIVATION. Did you see Inception this weekend? COMP 10 EXPLORING COMPUTER SCIENCE. Lecture 6 Arrays

7/21/10 MOTIVATION. Did you see Inception this weekend? COMP 10 EXPLORING COMPUTER SCIENCE. Lecture 6 Arrays MOTIVATION Did you see Inception this weekend? COMP 10 EXPLORING COMPUTER SCIENCE Lecture 6 Arrays float movierating1 = 1.0;! float movierating2 = 3.5;! float movierating3 = 1.0;! float movierating4 =

More information

Python Programming Exercises 1

Python Programming Exercises 1 Python Programming Exercises 1 Notes: throughout these exercises >>> preceeds code that should be typed directly into the Python interpreter. To get the most out of these exercises, don t just follow them

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Dynamics in Maya. Gary Monheit Alias Wavefront PHYSICALLY BASED MODELING SH1 SIGGRAPH 97 COURSE NOTES

Dynamics in Maya. Gary Monheit Alias Wavefront PHYSICALLY BASED MODELING SH1 SIGGRAPH 97 COURSE NOTES Dynamics in Maya Gary Monheit Alias Wavefront SH1 Dynamics in Maya Overall Requirements Architecture and Features Animations SH2 Overall Requirements Why Dynamics? Problems with traditional animation techniques

More information

Advanced Systems Programming

Advanced Systems Programming Advanced Systems Programming Introduction to C++ Martin Küttler September 19, 2017 1 / 18 About this presentation This presentation is not about learning programming or every C++ feature. It is a short

More information

Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following:

Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following: If you are a beginner on Microsoft Visual Studio 2008 then you will at first find that this powerful program is not that easy to use for a beginner this is the aim of this tutorial. I hope that it helps

More information

Instantiation of Template class

Instantiation of Template class Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double

More information

Embedding Python in Your C Programs

Embedding Python in Your C Programs 1 of 7 6/18/2006 9:05 PM Embedding Python in Your C Programs William Nagel Abstract C, meet Python. Python, this is C. With surprisingly little effort, the Python interpreter can be integrated into your

More information

RenderMonkey SDK Version 1.71

RenderMonkey SDK Version 1.71 RenderMonkey SDK Version 1.71 OVERVIEW... 3 RENDERMONKEY PLUG-IN ARCHITECTURE PHILOSOPHY... 3 IMPORTANT CHANGES WHEN PORTING EXISTING PLUG-INS... 3 GENERAL... 4 GENERATING A RENDERMONKEY PLUG-IN FRAMEWORK...

More information

COSC 2P91. Introduction Part Deux. Week 1b. Brock University. Brock University (Week 1b) Introduction Part Deux 1 / 14

COSC 2P91. Introduction Part Deux. Week 1b. Brock University. Brock University (Week 1b) Introduction Part Deux 1 / 14 COSC 2P91 Introduction Part Deux Week 1b Brock University Brock University (Week 1b) Introduction Part Deux 1 / 14 Source Files Like most other compiled languages, we ll be dealing with a few different

More information

Lecture 3. Functions & Modules

Lecture 3. Functions & Modules Lecture 3 Functions & Modules Labs this Week Lab 1 is due at the beginning of your lab If it is not yet by then, you cannot get credit Only exception is for students who added late (Those students should

More information

Lecture 2: C Programming Basic

Lecture 2: C Programming Basic ECE342 Introduction to Embedded Systems Lecture 2: C Programming Basic Ying Tang Electrical and Computer Engineering Rowan University 1 Facts about C C was developed in 1972 in order to write the UNIX

More information

Developing with the CityEngine SDK. Matthias Specht, Gert van Maren Esri R&D Center Zurich

Developing with the CityEngine SDK. Matthias Specht, Gert van Maren Esri R&D Center Zurich Developing with the CityEngine SDK Matthias Specht, Gert van Maren Esri R&D Center Zurich Agenda Examples (5 min) Introduction SDK (5 min) SDK architecture, code samples (10 min) Creating Apps!!! (30 min)

More information

Arizona s First University. More ways to show off--controlling your Creation: IP and OO ECE 373

Arizona s First University. More ways to show off--controlling your Creation: IP and OO ECE 373 Arizona s First University. More ways to show off--controlling your Creation: IP and OO ECE 373 Overview Object Creation Control Distribution Possibilities Impact of design decisions on IP control 2 Good

More information

CS 11 java track: lecture 1

CS 11 java track: lecture 1 CS 11 java track: lecture 1 Administrivia need a CS cluster account http://www.cs.caltech.edu/ cgi-bin/sysadmin/account_request.cgi need to know UNIX www.its.caltech.edu/its/facilities/labsclusters/ unix/unixtutorial.shtml

More information

Computer Science II Lecture 1 Introduction and Background

Computer Science II Lecture 1 Introduction and Background Computer Science II Lecture 1 Introduction and Background Discussion of Syllabus Instructor, TAs, office hours Course web site, http://www.cs.rpi.edu/courses/fall04/cs2, will be up soon Course emphasis,

More information

Functions in C C Programming and Software Tools. N.C. State Department of Computer Science

Functions in C C Programming and Software Tools. N.C. State Department of Computer Science Functions in C C Programming and Software Tools N.C. State Department of Computer Science Functions in C Functions are also called subroutines or procedures One part of a program calls (or invokes the

More information

Introduction to C++ with content from

Introduction to C++ with content from Introduction to C++ with content from www.cplusplus.com 2 Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup

More information

de facto standard C library Contains a bunch of header files and APIs to do various tasks

de facto standard C library Contains a bunch of header files and APIs to do various tasks CSE333 SECTION 6 GNU C Library de facto standard C library Contains a bunch of header files and APIs to do various tasks Don t need to memorize everything Do need to know what if there s an API that can

More information

Programming in Java Prof. Debasis Samanta Department of Computer Science Engineering Indian Institute of Technology, Kharagpur

Programming in Java Prof. Debasis Samanta Department of Computer Science Engineering Indian Institute of Technology, Kharagpur Programming in Java Prof. Debasis Samanta Department of Computer Science Engineering Indian Institute of Technology, Kharagpur Lecture 04 Demonstration 1 So, we have learned about how to run Java programs

More information

Page 1. Agenda. Programming Languages. C Compilation Process

Page 1. Agenda. Programming Languages. C Compilation Process EE 472 Embedded Systems Dr. Shwetak Patel Assistant Professor Computer Science & Engineering Electrical Engineering Agenda Announcements C programming intro + pointers Shwetak N. Patel - EE 472 2 Programming

More information

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models

Page 1. Human-computer interaction. Lecture 1b: Design & Implementation. Building user interfaces. Mental & implementation models Human-computer interaction Lecture 1b: Design & Implementation Human-computer interaction is a discipline concerned with the design, implementation, and evaluation of interactive systems for human use

More information

CS3157: Advanced Programming. Outline

CS3157: Advanced Programming. Outline CS3157: Advanced Programming Lecture #12 Apr 3 Shlomo Hershkop shlomo@cs.columbia.edu 1 Outline Intro CPP Boring stuff: Language basics: identifiers, data types, operators, type conversions, branching

More information

C++ for Java Programmers

C++ for Java Programmers Basics all Finished! Everything we have covered so far: Lecture 5 Operators Variables Arrays Null Terminated Strings Structs Functions 1 2 45 mins of pure fun Introduction Today: Pointers Pointers Even

More information

CMPE-013/L. Introduction to C Programming

CMPE-013/L. Introduction to C Programming CMPE-013/L Introduction to C Programming Bryant Wenborg Mairs Spring 2014 What we will cover in 13/L Embedded C on a microcontroller Specific issues with microcontrollers Peripheral usage Reading documentation

More information

the gamedesigninitiative at cornell university Lecture 7 C++ Overview

the gamedesigninitiative at cornell university Lecture 7 C++ Overview Lecture 7 Lecture 7 So You Think You Know C++ Most of you are experienced Java programmers Both in 2110 and several upper-level courses If you saw C++, was likely in a systems course Java was based on

More information

SE350: Operating Systems

SE350: Operating Systems SE350: Operating Systems Tutorial: The Programming Interface Main Points Creating and managing processes fork, exec, wait Example: implementing a shell Shell A shell is a job control system Allows programmer

More information

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3 Hello, World! in C Johann Myrkraverk Oskarsson October 23, 2018 Contents 1 The Quintessential Example Program 1 I Printing Text 2 II The Main Function 3 III The Header Files 4 IV Compiling and Running

More information

MA400: Financial Mathematics

MA400: Financial Mathematics MA400: Financial Mathematics Introductory Course Lecture 1: Overview of the course Preliminaries A brief introduction Beginning to program Some example programs Aims of this course Students should have

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types Computer Languages A computer language is a language that is used to communicate with a machine. Like all languages, computer languages have syntax (form) and semantics

More information

The following program computes a Calculus value, the "trapezoidal approximation of

The following program computes a Calculus value, the trapezoidal approximation of Multicore machines and shared memory Multicore CPUs have more than one core processor that can execute instructions at the same time. The cores share main memory. In the next few activities, we will learn

More information

Creating animation rigs that solve problems, are fun to use, and don t cause nervous breakdowns.

Creating animation rigs that solve problems, are fun to use, and don t cause nervous breakdowns. Animator Friendly Rigging Creating animation rigs that solve problems, are fun to use, and don t cause nervous breakdowns. - 1- CONTENTS Finishing The Rig... 6 Matching Controls... 7 Matching the position

More information

CCReflect has a few interesting features that are quite desirable for DigiPen game projects:

CCReflect has a few interesting features that are quite desirable for DigiPen game projects: CCReflect v1.0 User Manual Contents Introduction... 2 Features... 2 Dependencies... 2 Compiler Dependencies... 2 Glossary... 2 Type Registration... 3 POD Registration... 3 Non-Pod Registration... 3 External

More information

Lecture 3. Functions & Modules

Lecture 3. Functions & Modules Lecture 3 Functions & Modules Labs this Week Lab 1 is due at the beginning of your lab If it is not yet by then, you cannot get credit Only exception is for students who added late (Those students should

More information

Patterns for object creation

Patterns for object creation Persistence Patterns for object creation class Thing public: static Thing* create(const char* afile); ~Thing(); private: } Thing(); bool init(const char* afile); Patterns for object creation Thing* Thing::create(const

More information

Week 7. Statically-typed OO languages: C++ Closer look at subtyping

Week 7. Statically-typed OO languages: C++ Closer look at subtyping C++ & Subtyping Week 7 Statically-typed OO languages: C++ Closer look at subtyping Why talk about C++? C++ is an OO extension of C Efficiency and flexibility from C OO program organization from Simula

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

COMP 250 Winter 2011 Reading: Java background January 5, 2011

COMP 250 Winter 2011 Reading: Java background January 5, 2011 Almost all of you have taken COMP 202 or equivalent, so I am assuming that you are familiar with the basic techniques and definitions of Java covered in that course. Those of you who have not taken a COMP

More information

Exercise 6.2 A generic container class

Exercise 6.2 A generic container class Exercise 6.2 A generic container class The goal of this exercise is to write a class Array that mimics the behavior of a C++ array, but provides more intelligent memory management a) Start with the input

More information

Memory and C/C++ modules

Memory and C/C++ modules Memory and C/C++ modules From Reading #5 and mostly #6 More OOP topics (templates; libraries) as time permits later Program building l Have: source code human readable instructions l Need: machine language

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

Introduction: The Unix shell and C programming

Introduction: The Unix shell and C programming Introduction: The Unix shell and C programming 1DT048: Programming for Beginners Uppsala University June 11, 2014 You ll be working with the assignments in the Unix labs. If you are new to Unix or working

More information

Armide Documentation. Release Kyle Mayes

Armide Documentation. Release Kyle Mayes Armide Documentation Release 0.3.1 Kyle Mayes December 19, 2014 Contents 1 Introduction 1 1.1 Features.................................................. 1 1.2 License..................................................

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Week 9: GUI Part II. User Interface, UI Layouts Controls (All examples can be found in Z:\Public\gui_II.mel) User Interface UI

Week 9: GUI Part II. User Interface, UI Layouts Controls (All examples can be found in Z:\Public\gui_II.mel) User Interface UI Week 9: GUI Part II User Interface, UI Layouts Controls (All examples can be found in Z:\Public\gui_II.mel) User Interface UI We started to create dialogs using MEL script last week. It is very easy in

More information

Reviewing gcc, make, gdb, and Linux Editors 1

Reviewing gcc, make, gdb, and Linux Editors 1 Reviewing gcc, make, gdb, and Linux Editors 1 Colin Gordon csgordon@cs.washington.edu University of Washington CSE333 Section 1, 3/31/11 1 Lots of material borrowed from 351/303 slides Colin Gordon (University

More information

Outline. Review of Last Week II. Review of Last Week. Computer Memory. Review Variables and Memory. February 7, Data Types

Outline. Review of Last Week II. Review of Last Week. Computer Memory. Review Variables and Memory. February 7, Data Types Data Types Declarations and Initializations Larry Caretto Computer Science 16 Computing in Engineering and Science February 7, 25 Outline Review last week Meaning of data types Integer data types have

More information

CptS 360 (System Programming) Unit 1: Introduction to System Programming

CptS 360 (System Programming) Unit 1: Introduction to System Programming CptS 360 (System Programming) Unit 1: Introduction to System Programming Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2018 Motivation (for the whole course)

More information

Using the GeoX Framework

Using the GeoX Framework Using the GeoX Framework Michael Wand February 3rd, 2014 1. Introduction GeoX is a collection of C++ libraries for experimenting with geometric modeling techniques (GeoX = geometry experiments). It consists

More information

TDDE18 & 726G77. Functions

TDDE18 & 726G77. Functions TDDE18 & 726G77 Functions Labs update No more one time password. We will note who have demonstrated during the lab and register this in webreg. Use the terminal to send in your lab! Dont use Visual studio

More information

CSI Lab 02. Tuesday, January 21st

CSI Lab 02. Tuesday, January 21st CSI Lab 02 Tuesday, January 21st Objectives: Explore some basic functionality of python Introduction Last week we talked about the fact that a computer is, among other things, a tool to perform high speed

More information

Plotting package evaluation

Plotting package evaluation Plotting package evaluation Introduction We would like to evaluate several graphics packages for possible use in the GLAST Standard Analysis Environment. It is hoped that this testing will lead to a recommendation

More information

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009 CMPT 117: Tutorial 1 Craig Thompson 12 January 2009 Administrivia Coding habits OOP Header Files Function Overloading Class info Tutorials Review of course material additional examples Q&A Labs Work on

More information

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year Object Oriented Programming Assistant Lecture Omar Al Khayat 2 nd Year Syllabus Overview of C++ Program Principles of object oriented programming including classes Introduction to Object-Oriented Paradigm:Structures

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed Process Management CS 537 Lecture 3: Processes Michael Swift This lecture begins a series of topics on processes, threads, and synchronization Today: processes and process management what are the OS units

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

Reminder: compiling & linking

Reminder: compiling & linking Reminder: compiling & linking source file 1 object file 1 source file 2 compilation object file 2 library object file 1 linking (relocation + linking) load file source file N object file N library object

More information

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup starting in 1979 based on C Introduction to C++ also

More information

bioplux C++ API v. 2

bioplux C++ API v. 2 bioplux C++ API v. 2 Programming Interface Reference Document Version 1d 1/12 Change Log Version Date Changes 1d 17 Mar 2015 Include VS2013 in Introduction. 1c 23 Nov 2012 Removed the GetFrames (no arguments)

More information

QUIZ Lesson 4. Exercise 4: Write an if statement that assigns the value of x to the variable y if x is in between 1 and 20, otherwise y is unchanged.

QUIZ Lesson 4. Exercise 4: Write an if statement that assigns the value of x to the variable y if x is in between 1 and 20, otherwise y is unchanged. QUIZ Lesson 4 Exercise 4: Write an if statement that assigns the value of x to the variable y if x is in between 1 and 20, otherwise y is unchanged. QUIZ Lesson 4 Exercise 4: Write an if statement that

More information

Day One Export Documentation

Day One Export Documentation Day One Export Documentation Release 1.0.0 Nathan Grigg May 09, 2018 Contents 1 Use the command line tool 3 1.1 Basic Usage............................................... 3 1.2 Use a custom template..........................................

More information

Code architecture and organisation

Code architecture and organisation RenderDoc Code architecture and organisation This document covers RenderDoc at a high level, giving you an idea of how the UI is separated from the rest of the code and generally how the capture & replay

More information

Initializing and Finalizing Objects

Initializing and Finalizing Objects 4 Initializing and Finalizing Objects 147 Content Initializing and Finalizing Objects 4 Constructors Default Constructor Copy Constructor Destructor 148 Initializing Objects: Constructors Initializing

More information

COMS Spring Homework 3

COMS Spring Homework 3 COMS 1003-1 Spring 2011 Homework 3 The main goal of the first homework is to make you familiarize with advanced data types and pointers. There are 6 exercises in this assignment, for a total of 100 points.

More information

Direct Memory Access. Lecture 2 Pointer Revision Command Line Arguments. What happens when we use pointers. Same again with pictures

Direct Memory Access. Lecture 2 Pointer Revision Command Line Arguments. What happens when we use pointers. Same again with pictures Lecture 2 Pointer Revision Command Line Arguments Direct Memory Access C/C++ allows the programmer to obtain the value of the memory address where a variable lives. To do this we need to use a special

More information

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005 CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005 The process of creating a project with Microsoft Visual Studio 2005.Net is similar to the process in Visual

More information

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa Music 3SI: Introduction to Audio/Multimedia App. Programming IDE (briefly) VST Plug-in Assignment 1 hints Last Week... Week #5-5/5/2006 CCRMA, Department of Music Stanford University 1 2 Today... Cocoa

More information

Distributed Real-Time Control Systems. Lecture 17 C++ Programming Intro to C++ Objects and Classes

Distributed Real-Time Control Systems. Lecture 17 C++ Programming Intro to C++ Objects and Classes Distributed Real-Time Control Systems Lecture 17 C++ Programming Intro to C++ Objects and Classes 1 Bibliography Classical References Covers C++ 11 2 What is C++? A computer language with object oriented

More information

1 The Python API. 1.1 Current Status

1 The Python API. 1.1 Current Status 1 The Python API Blender provides a Python 1 API (Application Programming Interface) for developers. At Not A Number s home page you find a special section called Python & Plugins at the Discussion Server

More information

Frequency tables Create a new Frequency Table

Frequency tables Create a new Frequency Table Frequency tables Create a new Frequency Table Contents FREQUENCY TABLES CREATE A NEW FREQUENCY TABLE... 1 Results Table... 2 Calculate Descriptive Statistics for Frequency Tables... 6 Transfer Results

More information

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) First Name: Last Name: NetID:

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28)   First Name: Last Name: NetID: CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) http://www.cs.cornell.edu/courses/cs1110/2016sp/labs/lab01/lab01.pdf First Name: Last Name: NetID: Goals. Learning a computer language is a lot like learning

More information

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003 CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003 The process of creating a project with Microsoft Visual Studio 2003.Net is to some extend similar to the process

More information

Functions in C C Programming and Software Tools

Functions in C C Programming and Software Tools Functions in C C Programming and Software Tools N.C. State Department of Computer Science Functions in C Functions are also called subroutines or procedures One part of a program calls (or invokes the

More information

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins)

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins) CSE 374 Programming Concepts & Tools Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins) Hacker tool of the week (tags) Problem: I want to find the definition of a function or

More information

Hierarchical Data Format query language (HDFql)

Hierarchical Data Format query language (HDFql) Hierarchical Data Format query language (HDFql) Reference Manual Version 1.5.0 December 2017 Copyright (C) 2016-2017 This document is part of the Hierarchical Data Format query language (HDFql). For more

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file?

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file? QUIZ on Ch.5 Why is it sometimes not a good idea to place the private part of the interface in a header file? Example projects where we don t want the implementation visible to the client programmer: The

More information

Custom Component Development Using RenderMonkey SDK. Natalya Tatarchuk 3D Application Research Group ATI Research, Inc

Custom Component Development Using RenderMonkey SDK. Natalya Tatarchuk 3D Application Research Group ATI Research, Inc Custom Component Development Using RenderMonkey SDK Natalya Tatarchuk 3D Application Research Group ATI Research, Inc Overview Motivation Introduction to the SDK SDK Functionality Overview Conclusion 2

More information

Link native libraries from a.net application

Link native libraries from a.net application Link native libraries from a.net application Walter Hoolwerf (Radboud University, The Netherlands walto@vaag.cx) Mark Jans (Radboud University, The Netherlands mjans@home.nl) Abstract: To be written. Key

More information

OGSI.NET UVa Grid Computing Group. OGSI.NET Developer Tutorial

OGSI.NET UVa Grid Computing Group. OGSI.NET Developer Tutorial OGSI.NET UVa Grid Computing Group OGSI.NET Developer Tutorial Table of Contents Table of Contents...2 Introduction...3 Writing a Simple Service...4 Simple Math Port Type...4 Simple Math Service and Bindings...7

More information

Lecture 3. Variables. Variables

Lecture 3. Variables. Variables Lecture 3 Variables Variables Data processed by programs are input from keyboard by user, are read from the storage medium or are obtained by evaluating expressions. For this purpose it is necessary to

More information

Object Oriented Programming in C#

Object Oriented Programming in C# Introduction to Object Oriented Programming in C# Class and Object 1 You will be able to: Objectives 1. Write a simple class definition in C#. 2. Control access to the methods and data in a class. 3. Create

More information

Using DPDK with Go. Takanari Hayama Technology Consulting Company IGEL Co.,Ltd.

Using DPDK with Go. Takanari Hayama Technology Consulting Company IGEL Co.,Ltd. Using DPDK with Go Technology Consulting Company Research, Development & Global Standard Takanari Hayama taki@igel.co.jp Technology Consulting Company IGEL Co.,Ltd. 1 BACKGROUND 2017/9/26,27 DPDK Summit

More information

Swift. Introducing swift. Thomas Woodfin

Swift. Introducing swift. Thomas Woodfin Swift Introducing swift Thomas Woodfin Content Swift benefits Programming language Development Guidelines Swift benefits What is Swift Benefits What is Swift New programming language for ios and OS X Development

More information

Week 8: Operator overloading

Week 8: Operator overloading Due to various disruptions, we did not get through all the material in the slides below. CS319: Scientific Computing (with C++) Week 8: Operator overloading 1 The copy constructor 2 Operator Overloading

More information

Lab 1: First Steps in C++ - Eclipse

Lab 1: First Steps in C++ - Eclipse Lab 1: First Steps in C++ - Eclipse Step Zero: Select workspace 1. Upon launching eclipse, we are ask to chose a workspace: 2. We select a new workspace directory (e.g., C:\Courses ): 3. We accept the

More information

In I t n er t a er c a t c i t v i e v C+ C + + Com C pilat a ion on (RE ( PL RE ) PL : ) Th T e h L e ean L ean W a W y a by Viktor Kirilov 1

In I t n er t a er c a t c i t v i e v C+ C + + Com C pilat a ion on (RE ( PL RE ) PL : ) Th T e h L e ean L ean W a W y a by Viktor Kirilov 1 Interactive C++ Compilation (REPL): The Lean Way by Viktor Kirilov 1 About me my name is Viktor Kirilov - from Bulgaria 4 years of professional C++ in the games / VFX industries working on personal projects

More information

Introduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy

Introduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy Introduction to Unreal Engine Blueprints for Beginners By Chaven R Yenketswamy Introduction My first two tutorials covered creating and painting 3D objects for inclusion in your Unreal Project. In this

More information

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005 Lecture 8 Classes and Objects Part 2 MIT AITI June 15th, 2005 1 What is an object? A building (Strathmore university) A desk A laptop A car Data packets through the internet 2 What is an object? Objects

More information

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below: QUIZ 1. Explain the meaning of the angle brackets in the declaration of v below: This is a template, used for generic programming! QUIZ 2. Why is the vector class called a container? 3. Explain how the

More information

Week 08 MEL for procedural modeling

Week 08 MEL for procedural modeling Week 08 MEL for procedural modeling Turtle geometry as procedural modeling tool. Generation of Tree and Plant like structure. Turtle Geometry Turtle and its operations Figure 1 A procedural tree. We had

More information

galileo Design Document Solomon Boulos

galileo Design Document Solomon Boulos galileo Design Document Solomon Boulos 1 Contents 1 Introduction 3 2 Overview 3 3 Code Organization 4 3.1 Core.................................................. 4 3.1.1 API..............................................

More information

VANET-Skeleton for ns2

VANET-Skeleton for ns2 VANET-Skeleton for ns2 Daniel Jungels Laboratory for computer Communications and Applications (LCA) EPFL December 23, 2005 This document quickly describes how to install ns2, and how to implement a VANET

More information