H3D API Training Part 3.2: Fields; Event Handling.

Slides:



Advertisements
Similar presentations
Generalized Requests. The current definition They are defined in MPI 2 under the hood of the chapter 8 (External Interfaces) Page 166 line 16 The objective.
Advertisements

Based on LabVIEW 2011 Student Edition
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
Introduction to Programming Lesson 1. Objectives Skills/ConceptsMTA Exam Objectives Understanding Computer Programming Understand computer storage and.
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
Feature requests for Case Manager By Spar Nord Bank A/S IBM Insight 2014 Spar Nord Bank A/S1.
C++ Basics Prof. Shermane Austin. Learning Programming Language Basics Data Types – simple Expressions Relational and Logical Operators Conditional Statements.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Viewpoint { eventIn SFBool set_bind exposedField SFFloat fieldOfView # (0,  ) exposedField SFBool jump TRUE exposedField SFRotation orientation.
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
Adding Functionality To Web-Based VR Basic Concepts Client – server model Client-side static Client-side scripting Server-side scripting.
Repetition Statements repeat block of code until a condition is satisfied also called loops Java supports 3 kinds of loops: while statement – repeats a.
© De Montfort University, D Graphics and VRML Howell Istance and Chris Hand* De Montfort University * now at
A Standard Humanoid Representation on The Web: VRML/X3D Humanoid Animation Working Group (H-anim) Che-Jen Chen May/30/2003.
Cse591 Spring 981 VRML Basics The basic elements of VRML files are nodes. Every type of node has a set of fields associated with it. –Common single-valued.
Main Index Contents 11 Main Index Contents Container Types Container Types Sequence Containers Sequence Containers Associative Containers Associative Containers.
10 ThinkOfANumber program1July ThinkOfANumber program CE : Fundamental Programming Techniques.
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
Lecture 13LabVIEW and GPIB LabVIEW (National Instruments) –Graphical program language –Widely used in academia (lab) and industry (R&D) General Purpose.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
LabVIEW an Introduction
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Each VI has 2 Windows Front Panel User Interface (UI) –Controls = Inputs –Indicators = Outputs Block Diagram Graphical Code –Data travels on wires from.
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
Containers Overview and Class Vector
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
H3D API Training  Part 3.3: Python – H3D integration.
VRML Shapes and Geometry
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
1 Chapter 8 Scope, Lifetime, and More on Functions Dale/Weems/Headington.
FLTK Help Session By Richard Yu Gu CS 638 -Graphics Fall, 1999.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
C++ language first designed or implemented In 1980 by Bjarne Stroustrup, from Bell labs. that would receive formally this name at the end of 1983.
Additional Control Structures. Chapter 9 Topics Switch Statement for Multi-way Branching Do-While Statement for Looping For Statement for Looping Using.
Computer Graphics Group Script node Jiří Žára. Computer Graphics Group Contents 1.Script node 2.Motion generators 2Script node.
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Interactive Textures as Spatial User Interfaces in X3D Web3D 2010 Symposium Sabine Webel Y. Jung, M. Olbrich, T. Drevensek, T. Franke, M.Roth, D.Fellner,
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Chapter 13 – C++ String Class. String objects u Do not need to specify size of string object –C++ keeps track of size of text –C++ expands memory region.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
Intro to VRML Let’s build something! The source code examples in this tutorial WORK!
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Copyright © 2002 W. A. Tucker1 Chapter 9 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
Functions, Scope, and The Free Store Functions Functions must be declared by a function prototype before they are invoked, return_type Function_name(type,
1 For Loops l From Chapter 9 l A shorthand way of coding count loops.
1 Programming in C++ Dale/Weems/Headington Chapter 9 Additional Control Structures (Switch, Do..While, For statements)
1 Chapter 9 Scope, Lifetime, and More on Functions.
Introduction to Literate Programming in Matlab 2WN50 – Week programming-in-matlab.pptx?dl=0.
Mindstorm NXT-G Introduction Towson University Robotics.
Aggregator  Performs aggregate calculations  Components of the Aggregator Transformation Aggregate expression Group by port Sorted Input option Aggregate.
Compilation of XSLT into Dataflow Graphs for Web Service Composition Peter Kelly Paul Coddington Andrew Wendelborn.
// Increment i i += 1; // Restart timer this->start(Cycles::rdtsc() + clock->updateIntervalCycles); updater->start(0); // Start immediately. CS 190 Lecture.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
1 Chapter 8 Scope, Lifetime, and More on Functions CS185/09 - Introduction to Programming Caldwell College.
Introduction to Programming Lesson 1. Algorithms Algorithm refers to a method for solving problems. Common techniques for representing an algorithms:
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
Event Sources and Realtime Actions
ECE Application Programming
Loops in Java.
Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.
Logical Operations In Matlab.
Introduction to Programming
Review for Midterm 3.
Presentation transcript:

H3D API Training Part 3.2: Fields; Event Handling

H3D API  Fields: ◦ Field concept ◦ SF / MF Fields ◦ Mutator/Function fields  Event Handling: ◦ Field Routes (Behaviour Graph)

Fields  Fundamental building blocks of X3D and H3D API  Data storage  Data dependency  Data modification (functional)  Event handling  Ability to express behaviour in the system / applications

Routing  Dependencies between fields  Event propagation  Default behaviour: copy value

Fields - Example button my_func colour my_func() has type SFBool -> SFRGB my_func() returns red if button pressed is true, otherwise green

Fields - Functionality  Base Field ◦ route to field (express a dependency) ◦ unroute from field ◦ upToDate() (ensure field is up-to-date) ◦ event passing ◦ lazy evaluation  Data Field ◦ Single (SF) or Multiple (MF) data value ◦ Strongly typed ◦ Functional modification of data values (via update() function) ◦ getValue() and setValue()

Access types  initializeOnly  outputOnly  inputOnly  inputOutput

Event Handling  H3D API (and X3D) uses Fields for event handling  Fields trigger events immediately when modifying a field’s value (e.g. setValue())  Events propagate immediately when triggered  Events are not evaluated / acted upon until the field’s value is requested (e.g. getValue()) ◦ Lazy evaluation, by default ◦ Immediate evaluation when using the “AutoUpdate” template in C++

Fields - Example AB C DE A.setValue(1)

Fields - Example AB C DE E.getValue()D.getValue()B.getValue()A.getValue()

Fields - SF Fields  Contain a single data value of a specified type ◦ SFFloat, SFInt32, SFBool, SFString ◦ SFVec2f, SFVec3f ◦ SFNode  Can create own SF types in C++  Need to define the setValueFromString() function in C++ in order to be recognisable by the X3D parser

Fields - MF Fields  Contain an array of values of a specified type ◦ MFFloat, MFInt32, MFBool, MFString ◦ MFVec2f, MFVec3f ◦ MFNode  Can create own MF types in C++ as with SF  Can set/get entire array, or individual elements  Iterate (from C++)  MFNode (and SFNode) performs reference counting to automatically reference and unreference the nodes in the array.

Fields – Function fields  X3D concept - a field that executes code during its update check ◦ Can act as a function (in the mathematical sense), mapping an input value to an output value ◦ Can perform any action, e.g. file I/O, graphics rendering, etc ◦ Strongly typed: has an output type, and an input type ◦ Input type can be composite, e.g.  “greater_than” field:  output type: SFBool  input type: ( SFFloat, SFFloat )

TypedField  Adds type checking to field routes.  Allows specification of input route types and resulting type. class DotProduct: public TypedField< SFFloat, Types > { virtual void update() { const Vec3f &v1 = static_cast (routes_in[0]) ->getValue(); const Vec3f &v2 = static_cast (routes_in[1]) ->getValue(); value = v1 * v2; }

AutoUpdate  Updates its value when event received  Eager evaluation

PeriodicUpdate  Allows the field value to be polled at certain intervals( by default each scene-graph loop ).  Period can be specified in time or scene-graph loops.

Dependent fields  SF/MFNode types where the status of the field is dependent on a field in the node it contains.  Changes to the dependent field causes an event on the SF/MFNode. typedef DependentSFNode< X3DCoordinateNode FieldRef< X3DGeometricPropertyNode, Field, &X3DCoordinateNode::propertyChanged > > SFCoordinateNode;