Skip to content
Snippets Groups Projects
Commit ebdd5b59 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

Adapt iOS code for Trackball, ...

parent 93e58873
No related branches found
No related tags found
No related merge requests found
...@@ -55,8 +55,11 @@ if(ENABLE_BUILD_IOS_EMULATOR OR ENABLE_BUILD_IOS) ...@@ -55,8 +55,11 @@ if(ENABLE_BUILD_IOS_EMULATOR OR ENABLE_BUILD_IOS)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Onelab.xcodeproj/ ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab.xcodeproj/ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/iOS/Onelab.xcodeproj/ ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab.xcodeproj/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher_retina.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iOS/ic_launcher_retina.png ${CMAKE_CURRENT_BINARY_DIR}/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawGModel.cpp ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawContext.cpp ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawGModel.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/drawContext.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Trackball.cpp ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Trackball.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/movePosition.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iosGModel.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/iosGModel.h ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/frameworks/GetDP.framework/Headers/ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/frameworks/GetDP.framework/Headers/
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/frameworks/Gmsh.framework/Headers/ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Onelab/Onelab/frameworks/Gmsh.framework/Headers/
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "movePosition.h" #include "movePosition.h"
int onelab_cb(const std::string); int onelab_cb(std::string);
class drawContext{ class drawContext{
private: private:
......
...@@ -7,10 +7,6 @@ ...@@ -7,10 +7,6 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9C93C44A1743780900312E2E /* GetDP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C93C4471743780900312E2E /* GetDP.framework */; };
9C93C44B1743780900312E2E /* Gmsh.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C93C4481743780900312E2E /* Gmsh.framework */; };
9C93C44C1743780900312E2E /* petsc.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C93C4491743780900312E2E /* petsc.framework */; };
9C93C44F174378C200312E2E /* drawGModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9C93C44D174378C200312E2E /* drawGModel.cpp */; };
9C95B7F61726C88E00C0CCE2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C95B7F51726C88E00C0CCE2 /* main.m */; }; 9C95B7F61726C88E00C0CCE2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C95B7F51726C88E00C0CCE2 /* main.m */; };
9C96083B1712C16300E1D4A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C96083A1712C16300E1D4A0 /* UIKit.framework */; }; 9C96083B1712C16300E1D4A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C96083A1712C16300E1D4A0 /* UIKit.framework */; };
9C96083D1712C16300E1D4A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C96083C1712C16300E1D4A0 /* Foundation.framework */; }; 9C96083D1712C16300E1D4A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C96083C1712C16300E1D4A0 /* Foundation.framework */; };
...@@ -43,6 +39,15 @@ ...@@ -43,6 +39,15 @@
9C9975431737B55E0036EC24 /* pmsm_8p_circuit.pro in Resources */ = {isa = PBXBuildFile; fileRef = 9C9975421737B55E0036EC24 /* pmsm_8p_circuit.pro */; }; 9C9975431737B55E0036EC24 /* pmsm_8p_circuit.pro in Resources */ = {isa = PBXBuildFile; fileRef = 9C9975421737B55E0036EC24 /* pmsm_8p_circuit.pro */; };
9C9F8BCD174B5A1B004332C5 /* ic_launcher_retina.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */; }; 9C9F8BCD174B5A1B004332C5 /* ic_launcher_retina.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */; };
9C9F8BCF174B5A23004332C5 /* ic_launcher.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCE174B5A23004332C5 /* ic_launcher.png */; }; 9C9F8BCF174B5A23004332C5 /* ic_launcher.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C9F8BCE174B5A23004332C5 /* ic_launcher.png */; };
9CE08E10178AEB1600A83B4B /* GetDP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CE08E0D178AEB1600A83B4B /* GetDP.framework */; };
9CE08E11178AEB1600A83B4B /* Gmsh.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CE08E0E178AEB1600A83B4B /* Gmsh.framework */; };
9CE08E12178AEB1600A83B4B /* petsc.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CE08E0F178AEB1600A83B4B /* petsc.framework */; };
9CE08E13178AEC5F00A83B4B /* drawContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E01178AE6BE00A83B4B /* drawContext.cpp */; };
9CE08E14178AEC5F00A83B4B /* drawContext.h in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E02178AE6BE00A83B4B /* drawContext.h */; };
9CE08E15178AEC5F00A83B4B /* iosGModel.h in Sources */ = {isa = PBXBuildFile; fileRef = 9C99754C17390DEE0036EC24 /* iosGModel.h */; };
9CE08E16178AEC5F00A83B4B /* movePosition.h in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E03178AE6BE00A83B4B /* movePosition.h */; };
9CE08E17178AEC5F00A83B4B /* Trackball.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E04178AE6BE00A83B4B /* Trackball.cpp */; };
9CE08E18178AEC5F00A83B4B /* Trackball.h in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E05178AE6BE00A83B4B /* Trackball.h */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -56,11 +61,6 @@ ...@@ -56,11 +61,6 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9C93C4471743780900312E2E /* GetDP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GetDP.framework; path = Onelab/frameworks/GetDP.framework; sourceTree = "<group>"; };
9C93C4481743780900312E2E /* Gmsh.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gmsh.framework; path = Onelab/frameworks/Gmsh.framework; sourceTree = "<group>"; };
9C93C4491743780900312E2E /* petsc.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = petsc.framework; path = Onelab/frameworks/petsc.framework; sourceTree = "<group>"; };
9C93C44D174378C200312E2E /* drawGModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drawGModel.cpp; sourceTree = "<group>"; };
9C93C44E174378C200312E2E /* drawGModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = drawGModel.h; sourceTree = "<group>"; };
9C95B7F51726C88E00C0CCE2 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 9C95B7F51726C88E00C0CCE2 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
9C9608361712C16300E1D4A0 /* Onelab.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Onelab.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9C9608361712C16300E1D4A0 /* Onelab.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Onelab.app; sourceTree = BUILT_PRODUCTS_DIR; };
9C96083A1712C16300E1D4A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 9C96083A1712C16300E1D4A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
...@@ -100,6 +100,14 @@ ...@@ -100,6 +100,14 @@
9C99754C17390DEE0036EC24 /* iosGModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iosGModel.h; sourceTree = "<group>"; }; 9C99754C17390DEE0036EC24 /* iosGModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iosGModel.h; sourceTree = "<group>"; };
9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher_retina.png; sourceTree = "<group>"; }; 9C9F8BCC174B5A1B004332C5 /* ic_launcher_retina.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher_retina.png; sourceTree = "<group>"; };
9C9F8BCE174B5A23004332C5 /* ic_launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher.png; sourceTree = "<group>"; }; 9C9F8BCE174B5A23004332C5 /* ic_launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_launcher.png; sourceTree = "<group>"; };
9CE08E01178AE6BE00A83B4B /* drawContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drawContext.cpp; sourceTree = "<group>"; };
9CE08E02178AE6BE00A83B4B /* drawContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = drawContext.h; sourceTree = "<group>"; };
9CE08E03178AE6BE00A83B4B /* movePosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = movePosition.h; sourceTree = "<group>"; };
9CE08E04178AE6BE00A83B4B /* Trackball.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Trackball.cpp; sourceTree = "<group>"; };
9CE08E05178AE6BE00A83B4B /* Trackball.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Trackball.h; sourceTree = "<group>"; };
9CE08E0D178AEB1600A83B4B /* GetDP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GetDP.framework; path = Onelab/frameworks/GetDP.framework; sourceTree = "<group>"; };
9CE08E0E178AEB1600A83B4B /* Gmsh.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Gmsh.framework; path = Onelab/frameworks/Gmsh.framework; sourceTree = "<group>"; };
9CE08E0F178AEB1600A83B4B /* petsc.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = petsc.framework; path = Onelab/frameworks/petsc.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -113,9 +121,9 @@ ...@@ -113,9 +121,9 @@
9C96083B1712C16300E1D4A0 /* UIKit.framework in Frameworks */, 9C96083B1712C16300E1D4A0 /* UIKit.framework in Frameworks */,
9C96083D1712C16300E1D4A0 /* Foundation.framework in Frameworks */, 9C96083D1712C16300E1D4A0 /* Foundation.framework in Frameworks */,
9C96083F1712C16300E1D4A0 /* CoreGraphics.framework in Frameworks */, 9C96083F1712C16300E1D4A0 /* CoreGraphics.framework in Frameworks */,
9C93C44A1743780900312E2E /* GetDP.framework in Frameworks */, 9CE08E10178AEB1600A83B4B /* GetDP.framework in Frameworks */,
9C93C44B1743780900312E2E /* Gmsh.framework in Frameworks */, 9CE08E11178AEB1600A83B4B /* Gmsh.framework in Frameworks */,
9C93C44C1743780900312E2E /* petsc.framework in Frameworks */, 9CE08E12178AEB1600A83B4B /* petsc.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -156,9 +164,9 @@ ...@@ -156,9 +164,9 @@
9C9608391712C16300E1D4A0 /* Frameworks */ = { 9C9608391712C16300E1D4A0 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9C93C4471743780900312E2E /* GetDP.framework */, 9CE08E0D178AEB1600A83B4B /* GetDP.framework */,
9C93C4481743780900312E2E /* Gmsh.framework */, 9CE08E0E178AEB1600A83B4B /* Gmsh.framework */,
9C93C4491743780900312E2E /* petsc.framework */, 9CE08E0F178AEB1600A83B4B /* petsc.framework */,
9C96089C1712C7F600E1D4A0 /* QuartzCore.framework */, 9C96089C1712C7F600E1D4A0 /* QuartzCore.framework */,
9C96089A1712C7BE00E1D4A0 /* OpenGLES.framework */, 9C96089A1712C7BE00E1D4A0 /* OpenGLES.framework */,
9C9608981712C7B600E1D4A0 /* Accelerate.framework */, 9C9608981712C7B600E1D4A0 /* Accelerate.framework */,
...@@ -176,10 +184,13 @@ ...@@ -176,10 +184,13 @@
9C9608781712C5FE00E1D4A0 /* files */, 9C9608781712C5FE00E1D4A0 /* files */,
9C95B7F51726C88E00C0CCE2 /* main.m */, 9C95B7F51726C88E00C0CCE2 /* main.m */,
9C9608AA1712EF0900E1D4A0 /* MainStoryboard.storyboard */, 9C9608AA1712EF0900E1D4A0 /* MainStoryboard.storyboard */,
9C99754C17390DEE0036EC24 /* iosGModel.h */,
9C9608491712C16300E1D4A0 /* AppDelegate.h */, 9C9608491712C16300E1D4A0 /* AppDelegate.h */,
9C93C44D174378C200312E2E /* drawGModel.cpp */, 9CE08E01178AE6BE00A83B4B /* drawContext.cpp */,
9C93C44E174378C200312E2E /* drawGModel.h */, 9CE08E02178AE6BE00A83B4B /* drawContext.h */,
9C99754C17390DEE0036EC24 /* iosGModel.h */,
9CE08E03178AE6BE00A83B4B /* movePosition.h */,
9CE08E04178AE6BE00A83B4B /* Trackball.cpp */,
9CE08E05178AE6BE00A83B4B /* Trackball.h */,
9C96084A1712C16300E1D4A0 /* AppDelegate.mm */, 9C96084A1712C16300E1D4A0 /* AppDelegate.mm */,
9C96084F1712C16400E1D4A0 /* MasterViewController.h */, 9C96084F1712C16400E1D4A0 /* MasterViewController.h */,
9C9608501712C16400E1D4A0 /* MasterViewController.mm */, 9C9608501712C16400E1D4A0 /* MasterViewController.mm */,
...@@ -350,13 +361,18 @@ ...@@ -350,13 +361,18 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9CE08E13178AEC5F00A83B4B /* drawContext.cpp in Sources */,
9CE08E14178AEC5F00A83B4B /* drawContext.h in Sources */,
9CE08E15178AEC5F00A83B4B /* iosGModel.h in Sources */,
9CE08E16178AEC5F00A83B4B /* movePosition.h in Sources */,
9CE08E17178AEC5F00A83B4B /* Trackball.cpp in Sources */,
9CE08E18178AEC5F00A83B4B /* Trackball.h in Sources */,
9C96084B1712C16400E1D4A0 /* AppDelegate.mm in Sources */, 9C96084B1712C16400E1D4A0 /* AppDelegate.mm in Sources */,
9C9608511712C16400E1D4A0 /* MasterViewController.mm in Sources */, 9C9608511712C16400E1D4A0 /* MasterViewController.mm in Sources */,
9C9608541712C16400E1D4A0 /* DetailViewController.mm in Sources */, 9C9608541712C16400E1D4A0 /* DetailViewController.mm in Sources */,
9C9608741712C47200E1D4A0 /* EAGLView.mm in Sources */, 9C9608741712C47200E1D4A0 /* EAGLView.mm in Sources */,
9C96089F1712C8EB00E1D4A0 /* emulatorFix.c in Sources */, 9C96089F1712C8EB00E1D4A0 /* emulatorFix.c in Sources */,
9C95B7F61726C88E00C0CCE2 /* main.m in Sources */, 9C95B7F61726C88E00C0CCE2 /* main.m in Sources */,
9C93C44F174378C200312E2E /* drawGModel.cpp in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -466,9 +482,7 @@ ...@@ -466,9 +482,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Onelab/Onelab-Prefix.pch"; GCC_PREFIX_HEADER = "Onelab/Onelab-Prefix.pch";
INFOPLIST_FILE = "Onelab/Onelab-Info.plist"; INFOPLIST_FILE = "Onelab/Onelab-Info.plist";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = "$(inherited)";
"$(inherited)",
);
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
...@@ -496,9 +510,7 @@ ...@@ -496,9 +510,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Onelab/Onelab-Prefix.pch"; GCC_PREFIX_HEADER = "Onelab/Onelab-Prefix.pch";
INFOPLIST_FILE = "Onelab/Onelab-Info.plist"; INFOPLIST_FILE = "Onelab/Onelab-Info.plist";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = "$(inherited)";
"$(inherited)",
);
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
......
...@@ -57,17 +57,34 @@ ...@@ -57,17 +57,34 @@
{ {
scaleFactor *= [sender scale]; scaleFactor *= [sender scale];
scaleFactor = MAX(0.1, scaleFactor); scaleFactor = MAX(0.1, scaleFactor);
glView->mGModel->setScale(scaleFactor); glView->mContext->eventHandler(2,scaleFactor);
[glView drawView]; [glView drawView];
} }
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchPoint = [touch locationInView:self.view];
glView->mContext->eventHandler(0, touchPoint.x, touchPoint.y);
}
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
[self touchesEnded:touches withEvent:event];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchPoint = [touch locationInView:self.view];
glView->mContext->eventHandler(4, touchPoint.x, touchPoint.y);
}
- (IBAction)tap:(UITapGestureRecognizer *)sender - (IBAction)tap:(UITapGestureRecognizer *)sender
{ {
sender.numberOfTapsRequired = 2; sender.numberOfTapsRequired = 2;
if(sender.state == UIGestureRecognizerStateEnded){ if(sender.state == UIGestureRecognizerStateEnded){
scaleFactor = 1; scaleFactor = 1;
glView->mGModel->setScale(scaleFactor); glView->mContext->eventHandler(5);
glView->mGModel->setTranslation(0, 0);
glView->mGModel->setRotation(0, 0, 0);
[glView drawView]; [glView drawView];
} }
} }
...@@ -274,8 +291,8 @@ ...@@ -274,8 +291,8 @@
-(void)showMore: (UIBarButtonItem*)sender -(void)showMore: (UIBarButtonItem*)sender
{ {
UIActionSheet *popupMore = [[UIActionSheet alloc] initWithTitle:@"Other settings" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles: UIActionSheet *popupMore = [[UIActionSheet alloc] initWithTitle:@"Other settings" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:
(glView->mGModel->isShowedMesh())?@"Hide mesh":@"Show mesh", (glView->mContext->isShowedMesh())?@"Hide mesh":@"Show mesh",
(glView->mGModel->isShowedGeom())?@"Hide geometry" :@"Show geometry", (glView->mContext->isShowedGeom())?@"Hide geometry" :@"Show geometry",
@"Set X view", @"Set X view",
@"Set Y view", @"Set Y view",
@"Set Z view", @"Set Z view",
...@@ -288,22 +305,22 @@ ...@@ -288,22 +305,22 @@
{ {
NSString *text = [actionSheet buttonTitleAtIndex:buttonIndex]; NSString *text = [actionSheet buttonTitleAtIndex:buttonIndex];
if([text isEqualToString:@"Hide mesh"]) if([text isEqualToString:@"Hide mesh"])
glView->mGModel->showMesh(false); glView->mContext->showMesh(false);
else if([text isEqualToString:@"Show mesh"]) else if([text isEqualToString:@"Show mesh"])
glView->mGModel->showMesh(); glView->mContext->showMesh();
else if([text isEqualToString:@"Hide geometry"]) else if([text isEqualToString:@"Hide geometry"])
glView->mGModel->showGeom(false); glView->mContext->showGeom(false);
else if([text isEqualToString:@"Show geometry"]) else if([text isEqualToString:@"Show geometry"])
glView->mGModel->showGeom(); glView->mContext->showGeom();
else if([text isEqualToString:@"Set X view"]){ else if([text isEqualToString:@"Set X view"]){
glView->mGModel->setRotation(0, 0, 0); /*glView->mContext->setRotation(0, 0, 0);
glView->mGModel->setRotation(90, 0, 0); glView->mContext->setRotation(90, 0, 0);*/
} }
else if([text isEqualToString:@"Set Y view"]){ else if([text isEqualToString:@"Set Y view"]){
glView->mGModel->setRotation(0, 90, 0); //glView->mContext->setRotation(0, 90, 0);
} }
else if([text isEqualToString:@"Set Z view"]){ else if([text isEqualToString:@"Set Z view"]){
glView->mGModel->setRotation(0, 0, 0); //glView->mContext->setRotation(0, 0, 0);
} }
[glView drawView]; [glView drawView];
} }
...@@ -356,7 +373,7 @@ void messageFromCpp (void *self, std::string level, std::string msg) ...@@ -356,7 +373,7 @@ void messageFromCpp (void *self, std::string level, std::string msg)
{ {
NSString *modelName = [models objectAtIndex:indexPath.row]; NSString *modelName = [models objectAtIndex:indexPath.row];
NSString *ressourcePath = [[NSBundle mainBundle] resourcePath]; NSString *ressourcePath = [[NSBundle mainBundle] resourcePath];
glView->mGModel->load([[NSString stringWithFormat:@"%@%@%@%@",ressourcePath,@"/",modelName,@".geo"] UTF8String]); glView->mContext->load([[NSString stringWithFormat:@"%@%@%@%@",ressourcePath,@"/",modelName,@".geo"] UTF8String]);
[self hideModelsList]; [self hideModelsList];
[[NSNotificationCenter defaultCenter] postNotificationName:@"refreshParameters" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshParameters" object:nil];
return indexPath; return indexPath;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#import <OpenGLES/ES1/gl.h> #import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h> #import <OpenGLES/ES1/glext.h>
#import "drawGModel.h" #import "drawContext.h"
/* /*
This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
GLuint depthRenderbuffer; GLuint depthRenderbuffer;
@public @public
/* our GModel drawing class */ /* our GModel drawing class */
drawGModel *mGModel; drawContext *mContext;
} }
- (void)drawView; - (void)drawView;
......
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
NSString *ressourcePath = [[NSBundle mainBundle] resourcePath]; NSString *ressourcePath = [[NSBundle mainBundle] resourcePath];
NSString *startupModel = [ressourcePath stringByAppendingPathComponent:@"pmsm.geo"]; NSString *startupModel = [ressourcePath stringByAppendingPathComponent:@"pmsm.geo"];
mGModel = new drawGModel(); mContext = new drawContext();
mGModel->load(*new std::string([startupModel fileSystemRepresentation])); mContext->load(*new std::string([startupModel fileSystemRepresentation]));
} }
return self; return self;
} }
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glViewport(0, 0, backingWidth, backingHeight); // need this ...?? glViewport(0, 0, backingWidth, backingHeight); // need this ...??
mGModel->initView(backingWidth, backingHeight); mContext->initView(backingWidth, backingHeight);
mGModel->drawView(); mContext->drawView();
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES]; [context presentRenderbuffer:GL_RENDERBUFFER_OES];
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
{ {
NSString *ressourcePath = [[NSBundle mainBundle] resourcePath]; NSString *ressourcePath = [[NSBundle mainBundle] resourcePath];
NSString *msh = [ressourcePath stringByAppendingPathComponent: file]; NSString *msh = [ressourcePath stringByAppendingPathComponent: file];
mGModel = new drawGModel(); //mContext = new drawContext();
mGModel->load(*new std::string([msh fileSystemRepresentation])); mContext->load(*new std::string([msh fileSystemRepresentation]));
[self drawView]; [self drawView];
} }
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
{ {
case 1: case 1:
{ {
mGModel->setTranslation(position.x-lastPosition.x, -(position.y-lastPosition.y)); mContext->eventHandler(1,position.x,position.y);
} }
break; break;
case 2: case 2:
{ {
mGModel->setRotation(position.y-lastPosition.y, position.x-lastPosition.x,0); mContext->eventHandler(3,position.x,position.y);
} }
break; break;
default: default:
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "drawGModel.h" #include "drawContext.h"
void messageFromCpp (void *self, std::string level, std::string msg); void messageFromCpp (void *self, std::string level, std::string msg);
class MobileMessage : GmshMessage class MobileMessage : GmshMessage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment