diff --git a/contrib/mobile/iOS/Onelab/AppDelegate.h b/contrib/mobile/iOS/Onelab/AppDelegate.h index 60182856ba2ea8cb325a03f97f66731c2d198a41..e3292f2be7b2f147000ce23f079168e10f1ac8cd 100644 --- a/contrib/mobile/iOS/Onelab/AppDelegate.h +++ b/contrib/mobile/iOS/Onelab/AppDelegate.h @@ -16,7 +16,7 @@ @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UITableViewController *modelListController; -@property (strong, nonatomic) SplitViewController *splitViewController; +@property (strong, nonatomic) SplitViewController *splitViewController; // iPad @end diff --git a/contrib/mobile/iOS/Onelab/AppDelegate.mm b/contrib/mobile/iOS/Onelab/AppDelegate.mm index d984b6497034220f294bf00e65553bca874354f3..e7dce443139e728250f7c9f0f0253227f7c2e812 100644 --- a/contrib/mobile/iOS/Onelab/AppDelegate.mm +++ b/contrib/mobile/iOS/Onelab/AppDelegate.mm @@ -14,11 +14,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPadStoryboard" bundle:nil]; self.modelListController = (ModelListController *)self.window.rootViewController; - if([[UIDevice currentDevice].model isEqualToString:@"iPad"] || [[UIDevice currentDevice].model isEqualToString:@"iPad Simulator"]){ - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPadStoryboard" bundle:nil]; + if([[UIDevice currentDevice].model isEqualToString:@"iPad"] || [[UIDevice currentDevice].model isEqualToString:@"iPad Simulator"]) self.splitViewController = [storyboard instantiateViewControllerWithIdentifier:@"SplitViewController"]; - } return YES; } diff --git a/contrib/mobile/iOS/Onelab/DetailViewController.mm b/contrib/mobile/iOS/Onelab/DetailViewController.mm index 87eeef27224cf1d2c4813953049b87df76d0df03..de42265e17250c5a82bbfb1e9ae0f9f51e3336f3 100644 --- a/contrib/mobile/iOS/Onelab/DetailViewController.mm +++ b/contrib/mobile/iOS/Onelab/DetailViewController.mm @@ -58,12 +58,12 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestRender) name:@"requestRender" object:nil]; if(![[UIDevice currentDevice].model isEqualToString:@"iPad"] && ![[UIDevice currentDevice].model isEqualToString:@"iPad Simulator"]){ UIBarButtonItem *settings = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(showSettings)]; - UIBarButtonItem *postpro = [[UIBarButtonItem alloc] initWithTitle:@"Post processing" style:UIBarButtonItemStyleBordered target:self action:@selector(showPostpro)]; + UIBarButtonItem *postpro = [[UIBarButtonItem alloc] initWithTitle:@"Post-pro" style:UIBarButtonItemStyleBordered target:self action:@selector(showPostpro)]; UIBarButtonItem *more = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(showMore:)]; - UIBarButtonItem *model = [[UIBarButtonItem alloc] initWithTitle:@"Load model" style:UIBarButtonItemStyleBordered target:self action:@selector(showModelsList)]; + UIBarButtonItem *model = [[UIBarButtonItem alloc] initWithTitle:@"Models" style:UIBarButtonItemStyleBordered target:self action:@selector(showModelsList)]; NSArray *btns = [[NSArray alloc] initWithObjects:settings, postpro, more, nil]; - [self.navigationItem setLeftBarButtonItems:btns]; - [self.navigationItem setRightBarButtonItem:model]; + [self.navigationItem setLeftBarButtonItem:model]; + [self.navigationItem setRightBarButtonItems:btns]; } else { UIBarButtonItem *model = [[UIBarButtonItem alloc] initWithTitle:@"Models list" style:UIBarButtonItemStyleBordered target:self action:@selector(showModelsList)]; @@ -138,8 +138,7 @@ - (void) showSettings { - MasterViewController *masterViewController = [[MasterViewController alloc] init]; - [self.navigationController pushViewController:masterViewController animated:true]; + [self performSegueWithIdentifier:@"showSettingsSegue" sender:self]; } - (void) showPostpro diff --git a/contrib/mobile/iOS/Onelab/EAGLView.h b/contrib/mobile/iOS/Onelab/EAGLView.h index 1abbfe9bbc1070ea9f54d01284e2aecf079a0bf9..8d91d25cd5f8b925e6ac7d2cbb3f1e7229b8ef68 100644 --- a/contrib/mobile/iOS/Onelab/EAGLView.h +++ b/contrib/mobile/iOS/Onelab/EAGLView.h @@ -24,8 +24,7 @@ /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ GLuint depthRenderbuffer; - - NSString *docPath; + BOOL rendering; @public /* our GModel drawing class */ diff --git a/contrib/mobile/iOS/Onelab/EAGLView.mm b/contrib/mobile/iOS/Onelab/EAGLView.mm index 40856b830cb5fe07b8bb93f0af4a18165213e368..6f0fcc8e7f3c4f6efec553c91f1a09a68075cf67 100644 --- a/contrib/mobile/iOS/Onelab/EAGLView.mm +++ b/contrib/mobile/iOS/Onelab/EAGLView.mm @@ -55,7 +55,6 @@ [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); - glViewport(0, 0, backingWidth, backingHeight); // need this ...?? mContext->initView(backingWidth, backingHeight); mContext->drawView(); @@ -66,8 +65,8 @@ - (void)load:(NSString*) file { mContext->load(*new std::string([file fileSystemRepresentation])); + [[NSNotificationCenter defaultCenter] postNotificationName:@"resetParameters" object:nil]; [self drawView]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshParameters" object:nil]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { diff --git a/contrib/mobile/iOS/Onelab/MasterViewController.mm b/contrib/mobile/iOS/Onelab/MasterViewController.mm index 6f60b34f3c3f045c1df95b9230d8b1aff88f66fa..3b2b5dac98c24c5dc0c652517d1174540d8ae46f 100644 --- a/contrib/mobile/iOS/Onelab/MasterViewController.mm +++ b/contrib/mobile/iOS/Onelab/MasterViewController.mm @@ -86,7 +86,10 @@ { NSMutableArray *section = [_sections objectAtIndex:j]; for(int k=0; k<[section count];k++) - if([[(parameter*)[section objectAtIndex: k] getName] isEqualToString:name]){found = true; break;} + if([[[section objectAtIndex: k] getName] isEqualToString:name]) { + found = true; + break; + } if(!found) [self addParameterNumber:number[i] inSection:section]; found = true; @@ -117,7 +120,10 @@ { NSMutableArray *section = [_sections objectAtIndex:j]; for(int k=0; k<[section count];k++) - if([[(parameter*)[section objectAtIndex: k] getName] isEqualToString:name]){found = true; break;} // the parameters is already in the section + if([[(parameter*)[section objectAtIndex: k] getName] isEqualToString:name]) { + found = true; + break; + } // the parameters is already in the section if(!found) [self addParameterString:string[i] inSection:section]; found = true; diff --git a/contrib/mobile/iOS/Onelab/ModelListController.h b/contrib/mobile/iOS/Onelab/ModelListController.h index b7732fc9fc26275a5168d3715d2a9fc9c6f275bd..a1af92967c993e833b9a43589a9172f29e3c3bfd 100644 --- a/contrib/mobile/iOS/Onelab/ModelListController.h +++ b/contrib/mobile/iOS/Onelab/ModelListController.h @@ -16,6 +16,7 @@ NSMutableArray *models, *modelsName, *modelsDescription; NSString *currentElement; NSMutableString *currentElementValue; + NSString *selectedModel; } @property (nonatomic, retain) EAGLView *glView; @end diff --git a/contrib/mobile/iOS/Onelab/ModelListController.mm b/contrib/mobile/iOS/Onelab/ModelListController.mm index 25cb9d247d195819069ba5588854a6ce272dea6c..16768f92c273b374499decf16d1ea5c9183c630e 100644 --- a/contrib/mobile/iOS/Onelab/ModelListController.mm +++ b/contrib/mobile/iOS/Onelab/ModelListController.mm @@ -11,11 +11,6 @@ #import "Utils.h" -@interface ModelListController () { - -} -@end - @implementation ModelListController -(void)viewDidLoad { @@ -75,9 +70,10 @@ } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; + selectedModel = [NSString stringWithFormat:@"%@/%@/%@.geo",[Utils getApplicationDocumentsDirectory],[models objectAtIndex:indexPath.row], [models objectAtIndex:indexPath.row]]; if([[UIDevice currentDevice].model isEqualToString:@"iPad"] || [[UIDevice currentDevice].model isEqualToString:@"iPad Simulator"]){ - AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - appDelegate.splitViewController.initialModel = [NSString stringWithFormat:@"%@/%@/%@.geo",[Utils getApplicationDocumentsDirectory],[models objectAtIndex:indexPath.row], [models objectAtIndex:indexPath.row]]; + appDelegate.splitViewController.initialModel = selectedModel; [UIView transitionWithView:appDelegate.window duration:0.5 options:UIViewAnimationOptionTransitionFlipFromLeft @@ -86,9 +82,7 @@ } else { - DetailViewController *detailVIewController = [[DetailViewController alloc] init]; - [detailVIewController.glView load:[NSString stringWithFormat:@"%@/%@/%@.geo",[Utils getApplicationDocumentsDirectory],[modelsName objectAtIndex:indexPath.row], [modelsName objectAtIndex:indexPath.row]]]; - [self.navigationController pushViewController:detailVIewController animated:YES]; + [self performSegueWithIdentifier:@"showModelSegue" sender:self]; } } - (BOOL) parseInfosFile:(NSString *)file @@ -123,4 +117,12 @@ //[currentElementValue release]; currentElementValue = nil; } +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([[segue identifier] isEqualToString:@"showModelSegue"]) + { + DetailViewController *detailViewControler = [segue destinationViewController]; + detailViewControler.initialModel = selectedModel; + } +} @end diff --git a/contrib/mobile/iOS/Onelab/Onelab-Info.plist b/contrib/mobile/iOS/Onelab/Onelab-Info.plist index fb76d80fd55af7d7c5d2614acb4ba765557583e3..1b49d4553249bca0d5444e5460aae729a194b258 100644 --- a/contrib/mobile/iOS/Onelab/Onelab-Info.plist +++ b/contrib/mobile/iOS/Onelab/Onelab-Info.plist @@ -38,7 +38,7 @@ <key>UIFileSharingEnabled</key> <true/> <key>UIMainStoryboardFile</key> - <string>iPhoneStoryboard</string> + <string>iPhoneiPodStoryboard</string> <key>UIMainStoryboardFile~ipad</key> <string>iPadStoryboard</string> <key>UIRequiredDeviceCapabilities</key> diff --git a/contrib/mobile/iOS/Onelab/en.lproj/iPadStoryboard.storyboard b/contrib/mobile/iOS/Onelab/en.lproj/iPadStoryboard.storyboard index a3fb5e30768533ed28096566c9e4e1eec179fd4d..4fd38ef4d288446cdc3e961098adca0db8106b13 100644 --- a/contrib/mobile/iOS/Onelab/en.lproj/iPadStoryboard.storyboard +++ b/contrib/mobile/iOS/Onelab/en.lproj/iPadStoryboard.storyboard @@ -81,7 +81,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="dad-rm-zwY"> + <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ModelsCell" id="dad-rm-zwY"> <rect key="frame" x="0.0" y="22" width="768" height="44"/> <autoresizingMask key="autoresizingMask"/> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> @@ -93,9 +93,6 @@ </prototypes> </tableView> <navigationItem key="navigationItem" title="Models list" id="sdX-f6-lSz"/> - <connections> - <segue destination="5" kind="push" id="bSD-X0-f0E"/> - </connections> </tableViewController> <placeholder placeholderIdentifier="IBFirstResponder" id="zLU-RU-aDe" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> @@ -126,7 +123,7 @@ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="gray" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="tIi-5l-S0i" style="IBUITableViewCellStyleDefault" id="ZSw-0O-9Pw"> + <tableViewCell contentMode="scaleToFill" selectionStyle="gray" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SettingsCell" textLabel="tIi-5l-S0i" style="IBUITableViewCellStyleDefault" id="ZSw-0O-9Pw"> <rect key="frame" x="0.0" y="34" width="320" height="46"/> <autoresizingMask key="autoresizingMask"/> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> @@ -178,7 +175,6 @@ <class className="DetailViewController" superclassName="UIViewController"> <source key="sourceIdentifier" type="project" relativePath="./Classes/DetailViewController.h"/> <relationships> - <relationship kind="action" name="PViewIntervalType:"/> <relationship kind="action" name="pinch:" candidateClass="UIPinchGestureRecognizer"/> <relationship kind="action" name="tap:" candidateClass="UITapGestureRecognizer"/> <relationship kind="outlet" name="detailDescriptionLabel" candidateClass="UILabel"/> diff --git a/contrib/mobile/iOS/Onelab/en.lproj/iPhoneiPodStoryboard.storyboard b/contrib/mobile/iOS/Onelab/en.lproj/iPhoneiPodStoryboard.storyboard index d21f6a99ebe746678e9d5aefb867dfc598c7008b..92467778ee31ac9bc122c10d9fa589c954e83e09 100644 --- a/contrib/mobile/iOS/Onelab/en.lproj/iPhoneiPodStoryboard.storyboard +++ b/contrib/mobile/iOS/Onelab/en.lproj/iPhoneiPodStoryboard.storyboard @@ -7,7 +7,6 @@ <!--Model List Controller - Models list--> <scene sceneID="Y4S-jQ-WHz"> <objects> - <placeholder placeholderIdentifier="IBFirstResponder" id="5qi-J8-Zn2" userLabel="First Responder" sceneMemberID="firstResponder"/> <tableViewController id="aNd-kg-MlN" customClass="ModelListController" sceneMemberID="viewController"> <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="E1y-UA-Su2"> <rect key="frame" x="0.0" y="64" width="320" height="416"/> @@ -30,6 +29,7 @@ <segue destination="NyB-7w-cP0" kind="push" identifier="showModelSegue" id="urr-vz-3XW"/> </connections> </tableViewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="5qi-J8-Zn2" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="-329" y="160"/> </scene> @@ -47,7 +47,9 @@ <outletCollection property="gestureRecognizers" destination="qCm-Ub-mO2" appends="YES" id="yww-Ed-CcX"/> </connections> </view> - <navigationItem key="navigationItem" id="WX3-lU-bHf"/> + <navigationItem key="navigationItem" id="WX3-lU-bHf"> + <barButtonItem key="backBarButtonItem" title="Model" id="ed6-hv-E3j"/> + </navigationItem> <connections> <outlet property="glView" destination="zrj-Dd-WPc" id="sIP-YC-fg2"/> <segue destination="0h7-h3-thM" kind="push" identifier="showSettingsSegue" id="cJz-7s-fgZ"/> @@ -119,6 +121,8 @@ <class className="DetailViewController" superclassName="UIViewController"> <source key="sourceIdentifier" type="project" relativePath="./Classes/DetailViewController.h"/> <relationships> + <relationship kind="action" name="PViewIntervalType:"/> + <relationship kind="action" name="PViewVisible:"/> <relationship kind="action" name="pinch:" candidateClass="UIPinchGestureRecognizer"/> <relationship kind="action" name="tap:" candidateClass="UITapGestureRecognizer"/> <relationship kind="outlet" name="detailDescriptionLabel" candidateClass="UILabel"/>