Root for iPad

Hi,
I’m trying to develop an App using root 5,34.11. I’m using OSX 10.8.5 and clang 5.0, xcode 5.0 or xcode 4.6.3.

I have experienced some problems during the compilation of the test/ios/Tutorials.

First of all, I have to add …/…/…/graf2d/ios/inc in the include paths of the xcode project.

In any case I get the following errors:

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/HintView.mm:40:135: Cannot initialize a parameter of type ‘NSLineBreakMode’ with an rvalue of type ‘UILineBreakMode’

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/HintView.mm:40:169: Cannot initialize a parameter of type ‘NSTextAlignment’ with an rvalue of type ‘UITextAlignment’

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/Tutorials/DetailViewController.mm:114:14: Allocating an object of abstract class type ‘ROOT::iOS::Pad’

Note also the during the installation procedure (make install) the graf2d/ios/inc are not copied in the installation directory.

Thanks for your help
Cheers
Andrea

[quote=“bulgarelli”]Hi,
I’m trying to develop an App using root 5,34.11. I’m using OSX 10.8.5 and clang 5.0, xcode 5.0 or xcode 4.6.3.

I have experienced some problems during the compilation of the test/ios/Tutorials.

First of all, I have to add …/…/…/graf2d/ios/inc in the include paths of the xcode project.

In any case I get the following errors:

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/HintView.mm:40:135: Cannot initialize a parameter of type ‘NSLineBreakMode’ with an rvalue of type ‘UILineBreakMode’

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/HintView.mm:40:169: Cannot initialize a parameter of type ‘NSTextAlignment’ with an rvalue of type ‘UITextAlignment’

Error: /usr/local_gtb/root-v5-34/test/ios/Tutorials/Tutorials/DetailViewController.mm:114:14: Allocating an object of abstract class type ‘ROOT::iOS::Pad’

Note also the during the installation procedure (make install) the graf2d/ios/inc are not copied in the installation directory.

Thanks for your help
Cheers
Andrea[/quote]

Hello, I’ll have a look and fix the problems you’ve mentioned, thanks for reporting.

Hi.

I’ve updated graf2d/ios module. Also I’ve updated both ios apps in test/ios. Both of them now require iOS 7 SDK to build. I can successfully build/install them on my iPad using XCode 5 on Mac OS 10.9 (should be also possible with 10.8 ). You are not supposed to do ‘make install’ with ROOT built for iOS; both apps (xcode projects) use the directory structure you have after configure/make (but not make install).

The new code is in v5-34-00-patches.

Hi,
I have tried with my new configuration: osx 10.9, xcode 5.1.1, iOS SDK 7.1
Compiler:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0

I have performed the following commands:

git clone -b v5-34-00-patches root.cern.ch/git/root.git root-v5-34
cd root-v5-34
./configure ios
make

export LOCAL=<…>/root-v5-34
export ROOTSYS=$LOCAL
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

cd test/ios/Tutorials
open Tutorials.xcodeproj

I’ll try to compile. I get the following error:

test/ios/Tutorials/Tutorials/DetailViewController.mm:125:17: Allocating an object of abstract class type ‘ROOT::iOS::Pad’

Please, let me known were I have made a mistake.

Thanks for your help
Cheers,
Andrea

Hi, thanks for reporting. Fixed in v5-34-00-patches.

Many thanks!

Now it compile, but I have changed from

./configure ios

to

./configure iossim

(what is the difference? With the first I’ll get linker errors during the compilation of the xcode projects)

xcode compile, the iPad emulator starts but during the startup of the App I get the following error message from the xcode console:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fwrite$UNIX2003 called from function G__exec_text in image RootBrowser.
(lldb)

with both xcode projects and the startup is stopped with a SIGABORT.

Thanks for your help.

Cheers,
Andrea

Oh!

‘./configure ios’ builds ROOT as static library to work on a real device, while iossim - for simulator.
I haven’t worked with iossim version for 2 years already (I was updating the app using a real device).
I’ll have a look (or probably Fons can have a look).

Many thanks, now everything work with “ios” target.
A very interesting work for these two Apps.

There are some basic questions:

  1. in the RootBrowser App you says that “Using pan gesture along the selected axis, you can change the axis range - “zoom”.”. I’m sorry, but I do not understand how to perform this task.
  2. in the Tutorial App there is the possibility to rotate a Lego plot. This possibility is absent in the RootBrowser App. Have you planned to add also the rotation?
  3. In RootBrowser it is possible to select and change attributes but not to move the objects into a pad. Have you planned to add this possibility?
  4. Have you planned to implement the “Fit” procedure?
  5. a canvas with more then one pad is supported?

Thanks for your work
Andrea

  1. in the RootBrowser App you says that “Using pan gesture along the selected axis,
    you can change the axis range - “zoom”.”.
    I’m sorry, but I do not understand how to perform this task.

You first have to select an axis by a single tap gesture (an axis will be ‘highlighted’).

  1. in the Tutorial App there is the possibility to rotate a Lego plot.
    This possibility is absent in the RootBrowser App.
    Have you planned to add also the rotation?

No, actually, in RootBrowser a pad view (edit mode) already handles too many similar gestures making
it hard to use - pan to zoom axis, pan to scroll, pinch gesture. So I decided to ignore this rotation feature.

  1. In RootBrowser it is possible to select and change
    attributes but not to move the objects into a pad.
    Have you planned to add this possibility?

I do not remember exactly, in principle, I remember I had a test version but at some
point I decided not to implement this - probably, with same reason as 2) but I’m
not sure why exactly.

  1. Have you planned to implement the “Fit” procedure?

Yes, and that’s quite easy to do I think.

  1. a canvas with more then one pad is supported?

No, since an iPad’s screen is quite small, I decided not to do this.

[quote=“tpochep”]>>1) in the RootBrowser App you says that "Using pan gesture along the selected axis,

you can change the axis range - “zoom”.".
I’m sorry, but I do not understand how to perform this task.

You first have to select an axis by a single tap gesture (an axis will be ‘highlighted’).

Ok, thanks, it works

  1. in the Tutorial App there is the possibility to rotate a Lego plot.
    This possibility is absent in the RootBrowser App.
    Have you planned to add also the rotation?

No, actually, in RootBrowser a pad view (edit mode) already handles too many similar gestures making
it hard to use - pan to zoom axis, pan to scroll, pinch gesture. So I decided to ignore this rotation feature.

  1. In RootBrowser it is possible to select and change
    attributes but not to move the objects into a pad.
    Have you planned to add this possibility?

I do not remember exactly, in principle, I remember I had a test version but at some
point I decided not to implement this - probably, with same reason as 2) but I’m
not sure why exactly.

  1. Have you planned to implement the “Fit” procedure?

Yes, and that’s quite easy to do I think.

Great!

  1. a canvas with more then one pad is supported?

No, since an iPad’s screen is quite small, I decided not to do this.

Ok, this should be a problem for me. I have a lot of root files where I have saved the canvases (TCanvas) of the AGILE satellite payload monitoring system. Each canvas has a set of pads.

It should be nice to display these canvases on iPad using your root browser (the files are accessible via http).

Could I convert the canvas into TPads (in fact, a TCanvas is a TPad)? Or do you think that implement the display of a TCanvas in the ipad root browser is feasible?

For the first option, this is the content of the file:

root [1] .ls
TFile** Canvas_1_n2.root
TFile* Canvas_1_n2.root
KEY: TCanvas Canvas_1_n2;1 0_3201 AC Ratemeters

Canvas_1_n2->Draw()
TPad* pad = Canvas_1_n2->cd()
pad->SaveAs(“test.root”)

but when I open the test.root I see a TCanvas.

I’m trying to

  1. store in a root file the TPad object already divided in many TPad(s)

OR

  1. convert each pad (with canvas->cd(M) ) and save each pad into a root file (maybe in different directories)

Let me know

Thanks for your help,
Andrea

[/quote]

Hi,
I have tried to convert my canvases into pads to use them with the ipad version of the root, but without success.
Do you have some suggestions?
Cheers,
Andrea