root’s graphics on ios. root’s graphics (general scheme):

16
ROOT’s graphics on iOS

Upload: trevor-dorsey

Post on 05-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

ROOT’s graphics on iOS

Page 2: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

ROOT’s graphics (general scheme):

Page 3: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

iOS features: Typical application has one window (takes the full device’s

screen), uses views (views are not windows) to arrange its contents.

No X11, so no full TVirtualX implementation possible, no ROOT’s GUI.

Rich set of libraries and frameworks: CoreGraphics, CoreFoundations, CoreText, CoreAnimation, UIKit, GLES, etc.

Very specific GUI, different from Windows/X11/MacOS X. Touches instead of mouse event (this affects how user can

interact with ROOT’s objects). Objective-C/Objective-C++ to create native GUI.

Page 4: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

1. Non-gui graphics’ portNon-GUI graphics is mainly based on TVirtualPad interface (works via gPad). TPad/TCanvas internally calls TVirtualPadPainter methods (which has X11/Win32 GDI/OpenGL implementations). Implemented: IOSPad (I had to add iOS-specific extentions to

standard TPad). IOSPainter to do actual painting.

Page 5: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

Non-GUI graphics: implementation details 2D graphics (lines, polygons, fill patterns, etc.) – done by

CoreGraphics (Quartz 2D API): • rich 2D API (paths, strokes, blending, gradients,

etc.)• advanced text rendering• anti-aliasing• the same code can draw to a window, to a bitmap,

to a PDF file.• Etc.

Text is done by CoreText framework (ROOT needs font metrics, and Quartz 2D does not support them).

CoreFoundation (different data structures used both by Quartz and CoreText).

Page 6: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

ROOT’s graphics on iPad (screenshots from device):

Page 7: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

GUI on iOS

1. ROOT’s GUI classes can not be ported on iOS – no X11 or similar window management system.

2. To develop GUI for iOS you have to use UIKit - object oriented framework, written in Objective-C, which can be used from Objective-C or Objective-C++. UIKit strongly relies on MVC pattern.

3. You can use InterfaceBuilder to create user interface (Apple's analogue for QT-builder or ROOT's GUI builder) or create UI programmatically.

Page 8: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

Native iOS application consists of: Run loop (done by UIKit) Main window One or more controller objects Views, managed by controllers (views are

rectangular areas, roughly speaking similar to TPad, but they contain not TObjects, but other views - widgets or sub-views).

Page 9: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

2. ROOT’s apps for iOS: “Tutorials” – small application, demonstrates how to use

IOSPad and UIKit, simplified version of $ROOTSYS/tutorials/demos.C

“RootBrowser” – mixture of simplified TBrowser and TCanvas, to browser ROOT files’ content and visualize objects like histograms (similar to Photos application, but works with ROOT’s objects, not pictures).

Page 10: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

ROOT’s applications for iOS - “Tutorals” app:

Page 11: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

"Tutorials": Split-view based application. Has several demos. Supports zooming and scrolling (pinch gesture, taps, pan) Supports picking (initial version). Has TCanvas editor prototype - in a popover window. 3D objects can be rotated with a pan gesture. Has different animations.

Mainly was a testbed for different features.

Page 12: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

“RootBrowser” application:

Based on navigation controller and view hierarchy: top view to open/close/select ROOT files (using TFile and

TWebFile) view with file contents (with thumbnails for objects,

contained in a file) detailed object view with IOSPad to draw object, selected

from file; editor (“object inspector”) to modify object’s properties.

Page 13: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

Top level view:

Page 14: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

File contents:

Page 15: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

Detailed view with editor:

Page 16: ROOT’s graphics on iOS. ROOT’s graphics (general scheme):

3. OpenGL to OpenGLES (plans) Port GL-based 3D plots (TGLHistPainter) Simplified version of EVE (“EVE for iPad”).