0028148: Samples - add 3D Viewer sample for iOS platform
authoraan <aan@opencascade.com>
Tue, 6 Dec 2016 14:35:22 +0000 (17:35 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Apr 2017 09:44:56 +0000 (12:44 +0300)
Sample that uses UIKit has been added.
- Import of STEP files is provided
- Zoom, Rotate, Pan actions are provided
- Selection of solids is supported

28 files changed:
samples/ios/UIKitSample/ReadMe.md [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/AppDelegate.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/AppDelegate.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/CafShapePrs.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/GLView.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/GLView.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/GLViewController.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/GLViewController.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/Info.plist [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/OcctDocument.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/OcctDocument.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/OcctViewer.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/OcctViewer.mm [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/ViewController.h [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/ViewController.m [new file with mode: 0644]
samples/ios/UIKitSample/UIKitSample/main.mm [new file with mode: 0644]

diff --git a/samples/ios/UIKitSample/ReadMe.md b/samples/ios/UIKitSample/ReadMe.md
new file mode 100644 (file)
index 0000000..524866d
--- /dev/null
@@ -0,0 +1,16 @@
+// This file contains a description of the UIKitSample and step-by-step instructions how to build and run it.
+
+Installation and configuration:
+    1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above.
+    2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation.
+    3. Build or download Freetype2 static library for desired device or/and simulator.
+    4. Open UIKitSample in XCode.
+    5. Select the UIKitSample project and add the OCCT static libraries and Freetype2 static library.
+    6. Select the UIKitSample and go to the "Build Settings" tab. After go to the section "Search Paths" and in the field "Header Search Paths" specify a path to the OCCT inc folder. Next in the field "Library Search Paths" specify a path/paths to the OCCT static libraries and Freetype2 static library folders.
+    7. Connect device and build sample for device or choose simulator as a target and build for simulator.
+    8. Run sample.
+
+ Description:
+    UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons.
+    The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog.
+    The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well.
diff --git a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj b/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..83043d9
--- /dev/null
@@ -0,0 +1,565 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 46;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               0A24B9FA1EB0A7CC00A5F490 /* linkrods.step in Resources */ = {isa = PBXBuildFile; fileRef = 0A24B9F91EB0A7CC00A5F490 /* linkrods.step */; };
+               0A7DEDD61E2D1D0F00267B9B /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDD41E2D1D0900267B9B /* libfreetype.a */; };
+               0A7DEDE71E2D28E300267B9B /* libTKBRep.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */; };
+               0A7DEDE81E2D28E300267B9B /* libTKernel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDDF1E2D28C800267B9B /* libTKernel.a */; };
+               0A7DEDE91E2D28E300267B9B /* libTKG2d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */; };
+               0A7DEDEA1E2D28E300267B9B /* libTKG3d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */; };
+               0A7DEDEB1E2D28E300267B9B /* libTKGeomAlgo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */; };
+               0A7DEDEC1E2D28E300267B9B /* libTKGeomBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */; };
+               0A7DEDED1E2D28E300267B9B /* libTKMath.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE41E2D28D800267B9B /* libTKMath.a */; };
+               0A7DEDEE1E2D28E300267B9B /* libTKShHealing.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */; };
+               0A7DEDEF1E2D28E300267B9B /* libTKTopAlgo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */; };
+               0A7DEDF21E2D297000267B9B /* libTKHLR.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF01E2D296900267B9B /* libTKHLR.a */; };
+               0A7DEDF31E2D297000267B9B /* libTKMesh.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF11E2D296C00267B9B /* libTKMesh.a */; };
+               0A7DEDF91E2D29FF00267B9B /* libTKCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */; };
+               0A7DEDFA1E2D29FF00267B9B /* libTKCDF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF51E2D29F200267B9B /* libTKCDF.a */; };
+               0A7DEDFB1E2D29FF00267B9B /* libTKLCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */; };
+               0A7DEDFC1E2D29FF00267B9B /* libTKV3d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF71E2D29F800267B9B /* libTKV3d.a */; };
+               0A7DEDFD1E2D29FF00267B9B /* libTKVCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */; };
+               0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */; };
+               0A7DEE2E1E2D2AE000267B9B /* libTKSTEP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0E1E2D2AA800267B9B /* libTKSTEP.a */; };
+               0A7DEE301E2D2AE000267B9B /* libTKSTEPAttr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE101E2D2AAE00267B9B /* libTKSTEPAttr.a */; };
+               0A7DEE311E2D2AE000267B9B /* libTKSTEPBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE111E2D2AB200267B9B /* libTKSTEPBase.a */; };
+               0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */; };
+               0A7DEE371E2D2AE000267B9B /* libTKXDESTEP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE171E2D2AC700267B9B /* libTKXDESTEP.a */; };
+               0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */; };
+               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */; };
+               0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0F1E2D2AAB00267B9B /* libTKSTEP209.a */; };
+               0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */; };
+               0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */ = {isa = PBXBuildFile; fileRef = 0AAE0DE51EAF816D00C1F65B /* screw.step */; };
+               0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AE286631EB0D29A00A9D719 /* libz.tbd */; };
+               3405C9E01DE2F04E008BADB9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405C9DF1DE2F04E008BADB9 /* main.mm */; };
+               3405C9E31DE2F04E008BADB9 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */; };
+               3405C9EB1DE2F04E008BADB9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */; };
+               3405C9EE1DE2F04E008BADB9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */; };
+               3405CA781DE303DC008BADB9 /* OcctViewer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405CA771DE303DC008BADB9 /* OcctViewer.mm */; };
+               3405CA7B1DE31566008BADB9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA7A1DE31566008BADB9 /* QuartzCore.framework */; };
+               3405CA7D1DE3156D008BADB9 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */; };
+               3405CA821DE332AB008BADB9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3405CA811DE332AB008BADB9 /* UIKit.framework */; };
+               3405CA851DE3331D008BADB9 /* GLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3405CA841DE3331D008BADB9 /* GLView.mm */; };
+               343FDCA61DE42F37009AEE51 /* GLViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 343FDCA51DE42F37009AEE51 /* GLViewController.mm */; };
+               34424E031DE70100008B56DA /* OcctDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34424E021DE70100008B56DA /* OcctDocument.mm */; };
+               34424E061DE72D2E008B56DA /* CafShapePrs.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34424E051DE72D2E008B56DA /* CafShapePrs.mm */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+               0A24B9F91EB0A7CC00A5F490 /* linkrods.step */ = {isa = PBXFileReference; lastKnownFileType = text; name = linkrods.step; path = ../occt/data/step/linkrods.step; sourceTree = "<group>"; };
+               0A7DED6E1E2D15B800267B9B /* dev */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dev; path = ..; sourceTree = "<group>"; };
+               0A7DEDD41E2D1D0900267B9B /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../3rdparty/lib/libfreetype.a; sourceTree = "<group>"; };
+               0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBRep.a; path = ../occt/lib/libTKBRep.a; sourceTree = "<group>"; };
+               0A7DEDDF1E2D28C800267B9B /* libTKernel.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKernel.a; path = ../occt/lib/libTKernel.a; sourceTree = "<group>"; };
+               0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKG2d.a; path = ../occt/lib/libTKG2d.a; sourceTree = "<group>"; };
+               0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKG3d.a; path = ../occt/lib/libTKG3d.a; sourceTree = "<group>"; };
+               0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKGeomAlgo.a; path = ../occt/lib/libTKGeomAlgo.a; sourceTree = "<group>"; };
+               0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKGeomBase.a; path = ../occt/lib/libTKGeomBase.a; sourceTree = "<group>"; };
+               0A7DEDE41E2D28D800267B9B /* libTKMath.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMath.a; path = ../occt/lib/libTKMath.a; sourceTree = "<group>"; };
+               0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKShHealing.a; path = ../occt/lib/libTKShHealing.a; sourceTree = "<group>"; };
+               0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKTopAlgo.a; path = ../occt/lib/libTKTopAlgo.a; sourceTree = "<group>"; };
+               0A7DEDF01E2D296900267B9B /* libTKHLR.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKHLR.a; path = ../occt/lib/libTKHLR.a; sourceTree = "<group>"; };
+               0A7DEDF11E2D296C00267B9B /* libTKMesh.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMesh.a; path = ../occt/lib/libTKMesh.a; sourceTree = "<group>"; };
+               0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKCAF.a; path = ../occt/lib/libTKCAF.a; sourceTree = "<group>"; };
+               0A7DEDF51E2D29F200267B9B /* libTKCDF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKCDF.a; path = ../occt/lib/libTKCDF.a; sourceTree = "<group>"; };
+               0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKLCAF.a; path = ../occt/lib/libTKLCAF.a; sourceTree = "<group>"; };
+               0A7DEDF71E2D29F800267B9B /* libTKV3d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKV3d.a; path = ../occt/lib/libTKV3d.a; sourceTree = "<group>"; };
+               0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKVCAF.a; path = ../occt/lib/libTKVCAF.a; sourceTree = "<group>"; };
+               0A7DEDFE1E2D2A7200267B9B /* libTKBin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBin.a; path = ../occt/lib/libTKBin.a; sourceTree = "<group>"; };
+               0A7DEDFF1E2D2A7600267B9B /* libTKBinL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinL.a; path = ../occt/lib/libTKBinL.a; sourceTree = "<group>"; };
+               0A7DEE001E2D2A7900267B9B /* libTKBinTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinTObj.a; path = ../occt/lib/libTKBinTObj.a; sourceTree = "<group>"; };
+               0A7DEE011E2D2A7C00267B9B /* libTKBinXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBinXCAF.a; path = ../occt/lib/libTKBinXCAF.a; sourceTree = "<group>"; };
+               0A7DEE021E2D2A7F00267B9B /* libTKBO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBO.a; path = ../occt/lib/libTKBO.a; sourceTree = "<group>"; };
+               0A7DEE031E2D2A8200267B9B /* libTKBool.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKBool.a; path = ../occt/lib/libTKBool.a; sourceTree = "<group>"; };
+               0A7DEE041E2D2A8500267B9B /* libTKFeat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKFeat.a; path = ../occt/lib/libTKFeat.a; sourceTree = "<group>"; };
+               0A7DEE051E2D2A8900267B9B /* libTKFillet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKFillet.a; path = ../occt/lib/libTKFillet.a; sourceTree = "<group>"; };
+               0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKIGES.a; path = ../occt/lib/libTKIGES.a; sourceTree = "<group>"; };
+               0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMeshVS.a; path = ../occt/lib/libTKMeshVS.a; sourceTree = "<group>"; };
+               0A7DEE081E2D2A9300267B9B /* libTKOffset.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOffset.a; path = ../occt/lib/libTKOffset.a; sourceTree = "<group>"; };
+               0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGl.a; path = ../occt/lib/libTKOpenGl.a; sourceTree = "<group>"; };
+               0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKPrim.a; path = ../occt/lib/libTKPrim.a; sourceTree = "<group>"; };
+               0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKService.a; path = ../occt/lib/libTKService.a; sourceTree = "<group>"; };
+               0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStd.a; path = ../occt/lib/libTKStd.a; sourceTree = "<group>"; };
+               0A7DEE0D1E2D2AA400267B9B /* libTKStdL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStdL.a; path = ../occt/lib/libTKStdL.a; sourceTree = "<group>"; };
+               0A7DEE0E1E2D2AA800267B9B /* libTKSTEP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKSTEP.a; path = ../occt/lib/libTKSTEP.a; sourceTree = "<group>"; };
+               0A7DEE0F1E2D2AAB00267B9B /* libTKSTEP209.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKSTEP209.a; path = ../occt/lib/libTKSTEP209.a; sourceTree = "<group>"; };
+               0A7DEE101E2D2AAE00267B9B /* libTKSTEPAttr.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKSTEPAttr.a; path = ../occt/lib/libTKSTEPAttr.a; sourceTree = "<group>"; };
+               0A7DEE111E2D2AB200267B9B /* libTKSTEPBase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKSTEPBase.a; path = ../occt/lib/libTKSTEPBase.a; sourceTree = "<group>"; };
+               0A7DEE121E2D2AB500267B9B /* libTKSTL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKSTL.a; path = ../occt/lib/libTKSTL.a; sourceTree = "<group>"; };
+               0A7DEE131E2D2AB900267B9B /* libTKTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKTObj.a; path = ../occt/lib/libTKTObj.a; sourceTree = "<group>"; };
+               0A7DEE141E2D2ABC00267B9B /* libTKVRML.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKVRML.a; path = ../occt/lib/libTKVRML.a; sourceTree = "<group>"; };
+               0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXCAF.a; path = ../occt/lib/libTKXCAF.a; sourceTree = "<group>"; };
+               0A7DEE161E2D2AC300267B9B /* libTKXDEIGES.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXDEIGES.a; path = ../occt/lib/libTKXDEIGES.a; sourceTree = "<group>"; };
+               0A7DEE171E2D2AC700267B9B /* libTKXDESTEP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXDESTEP.a; path = ../occt/lib/libTKXDESTEP.a; sourceTree = "<group>"; };
+               0A7DEE181E2D2ACA00267B9B /* libTKXMesh.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXMesh.a; path = ../occt/lib/libTKXMesh.a; sourceTree = "<group>"; };
+               0A7DEE191E2D2ACE00267B9B /* libTKXml.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXml.a; path = ../occt/lib/libTKXml.a; sourceTree = "<group>"; };
+               0A7DEE1A1E2D2AD100267B9B /* libTKXmlL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlL.a; path = ../occt/lib/libTKXmlL.a; sourceTree = "<group>"; };
+               0A7DEE1B1E2D2AD500267B9B /* libTKXmlTObj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlTObj.a; path = ../occt/lib/libTKXmlTObj.a; sourceTree = "<group>"; };
+               0A7DEE1C1E2D2AD900267B9B /* libTKXmlXCAF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXmlXCAF.a; path = ../occt/lib/libTKXmlXCAF.a; sourceTree = "<group>"; };
+               0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKXSBase.a; path = ../occt/lib/libTKXSBase.a; sourceTree = "<group>"; };
+               0AAE0DE51EAF816D00C1F65B /* screw.step */ = {isa = PBXFileReference; lastKnownFileType = text; name = screw.step; path = ../occt/data/step/screw.step; sourceTree = "<group>"; };
+               0AE286631EB0D29A00A9D719 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
+               3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIKitSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               3405C9DF1DE2F04E008BADB9 /* main.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+               3405C9E11DE2F04E008BADB9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+               3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
+               3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+               3405C9ED1DE2F04E008BADB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+               3405C9EF1DE2F04E008BADB9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               3405CA761DE30380008BADB9 /* OcctViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcctViewer.h; sourceTree = "<group>"; };
+               3405CA771DE303DC008BADB9 /* OcctViewer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OcctViewer.mm; sourceTree = "<group>"; };
+               3405CA7A1DE31566008BADB9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+               3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+               3405CA811DE332AB008BADB9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+               3405CA831DE3331D008BADB9 /* GLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLView.h; sourceTree = "<group>"; };
+               3405CA841DE3331D008BADB9 /* GLView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = GLView.mm; sourceTree = "<group>"; };
+               343FDCA41DE42D12009AEE51 /* GLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLViewController.h; sourceTree = "<group>"; };
+               343FDCA51DE42F37009AEE51 /* GLViewController.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = GLViewController.mm; sourceTree = "<group>"; };
+               34424E011DE6FF05008B56DA /* OcctDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OcctDocument.h; sourceTree = "<group>"; };
+               34424E021DE70100008B56DA /* OcctDocument.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = OcctDocument.mm; sourceTree = "<group>"; };
+               34424E041DE72C23008B56DA /* CafShapePrs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CafShapePrs.h; sourceTree = "<group>"; };
+               34424E051DE72D2E008B56DA /* CafShapePrs.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = CafShapePrs.mm; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               3405C9D81DE2F04E008BADB9 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */,
+                               0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */,
+                               0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */,
+                               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */,
+                               0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */,
+                               0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */,
+                               0A7DEE2E1E2D2AE000267B9B /* libTKSTEP.a in Frameworks */,
+                               0A7DEE301E2D2AE000267B9B /* libTKSTEPAttr.a in Frameworks */,
+                               0A7DEE311E2D2AE000267B9B /* libTKSTEPBase.a in Frameworks */,
+                               0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */,
+                               0A7DEE371E2D2AE000267B9B /* libTKXDESTEP.a in Frameworks */,
+                               0A7DEDE71E2D28E300267B9B /* libTKBRep.a in Frameworks */,
+                               0A7DEDF91E2D29FF00267B9B /* libTKCAF.a in Frameworks */,
+                               0A7DEDFA1E2D29FF00267B9B /* libTKCDF.a in Frameworks */,
+                               0A7DEDE81E2D28E300267B9B /* libTKernel.a in Frameworks */,
+                               0A7DEDE91E2D28E300267B9B /* libTKG2d.a in Frameworks */,
+                               0A7DEDEA1E2D28E300267B9B /* libTKG3d.a in Frameworks */,
+                               0A7DEDEB1E2D28E300267B9B /* libTKGeomAlgo.a in Frameworks */,
+                               0A7DEDEC1E2D28E300267B9B /* libTKGeomBase.a in Frameworks */,
+                               0A7DEDF21E2D297000267B9B /* libTKHLR.a in Frameworks */,
+                               0A7DEDFB1E2D29FF00267B9B /* libTKLCAF.a in Frameworks */,
+                               0A7DEDED1E2D28E300267B9B /* libTKMath.a in Frameworks */,
+                               0A7DEDF31E2D297000267B9B /* libTKMesh.a in Frameworks */,
+                               0A7DEDEE1E2D28E300267B9B /* libTKShHealing.a in Frameworks */,
+                               0A7DEDEF1E2D28E300267B9B /* libTKTopAlgo.a in Frameworks */,
+                               0A7DEDFC1E2D29FF00267B9B /* libTKV3d.a in Frameworks */,
+                               0A7DEDFD1E2D29FF00267B9B /* libTKVCAF.a in Frameworks */,
+                               0A7DEDD61E2D1D0F00267B9B /* libfreetype.a in Frameworks */,
+                               3405CA821DE332AB008BADB9 /* UIKit.framework in Frameworks */,
+                               3405CA7D1DE3156D008BADB9 /* OpenGLES.framework in Frameworks */,
+                               3405CA7B1DE31566008BADB9 /* QuartzCore.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               3405C9D21DE2F04E008BADB9 = {
+                       isa = PBXGroup;
+                       children = (
+                               0A24B9F91EB0A7CC00A5F490 /* linkrods.step */,
+                               0AAE0DE51EAF816D00C1F65B /* screw.step */,
+                               3405C9DD1DE2F04E008BADB9 /* UIKitSample */,
+                               3405C9DC1DE2F04E008BADB9 /* Products */,
+                               3405CA791DE31565008BADB9 /* Frameworks */,
+                       );
+                       sourceTree = "<group>";
+               };
+               3405C9DC1DE2F04E008BADB9 /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               3405C9DD1DE2F04E008BADB9 /* UIKitSample */ = {
+                       isa = PBXGroup;
+                       children = (
+                               34424E051DE72D2E008B56DA /* CafShapePrs.mm */,
+                               34424E041DE72C23008B56DA /* CafShapePrs.h */,
+                               34424E011DE6FF05008B56DA /* OcctDocument.h */,
+                               34424E021DE70100008B56DA /* OcctDocument.mm */,
+                               3405CA841DE3331D008BADB9 /* GLView.mm */,
+                               3405CA831DE3331D008BADB9 /* GLView.h */,
+                               343FDCA51DE42F37009AEE51 /* GLViewController.mm */,
+                               343FDCA41DE42D12009AEE51 /* GLViewController.h */,
+                               3405CA761DE30380008BADB9 /* OcctViewer.h */,
+                               3405CA771DE303DC008BADB9 /* OcctViewer.mm */,
+                               3405C9E11DE2F04E008BADB9 /* AppDelegate.h */,
+                               3405C9E21DE2F04E008BADB9 /* AppDelegate.mm */,
+                               3405C9EA1DE2F04E008BADB9 /* Assets.xcassets */,
+                               3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */,
+                               3405C9EF1DE2F04E008BADB9 /* Info.plist */,
+                               3405C9DE1DE2F04E008BADB9 /* Supporting Files */,
+                       );
+                       path = UIKitSample;
+                       sourceTree = "<group>";
+               };
+               3405C9DE1DE2F04E008BADB9 /* Supporting Files */ = {
+                       isa = PBXGroup;
+                       children = (
+                               3405C9DF1DE2F04E008BADB9 /* main.mm */,
+                       );
+                       name = "Supporting Files";
+                       sourceTree = "<group>";
+               };
+               3405CA791DE31565008BADB9 /* Frameworks */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0AE286631EB0D29A00A9D719 /* libz.tbd */,
+                               0A7DEDFE1E2D2A7200267B9B /* libTKBin.a */,
+                               0A7DEDFF1E2D2A7600267B9B /* libTKBinL.a */,
+                               0A7DEE001E2D2A7900267B9B /* libTKBinTObj.a */,
+                               0A7DEE011E2D2A7C00267B9B /* libTKBinXCAF.a */,
+                               0A7DEE021E2D2A7F00267B9B /* libTKBO.a */,
+                               0A7DEE031E2D2A8200267B9B /* libTKBool.a */,
+                               0A7DEE041E2D2A8500267B9B /* libTKFeat.a */,
+                               0A7DEE051E2D2A8900267B9B /* libTKFillet.a */,
+                               0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */,
+                               0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */,
+                               0A7DEE081E2D2A9300267B9B /* libTKOffset.a */,
+                               0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */,
+                               0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */,
+                               0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */,
+                               0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */,
+                               0A7DEE0D1E2D2AA400267B9B /* libTKStdL.a */,
+                               0A7DEE0E1E2D2AA800267B9B /* libTKSTEP.a */,
+                               0A7DEE0F1E2D2AAB00267B9B /* libTKSTEP209.a */,
+                               0A7DEE101E2D2AAE00267B9B /* libTKSTEPAttr.a */,
+                               0A7DEE111E2D2AB200267B9B /* libTKSTEPBase.a */,
+                               0A7DEE121E2D2AB500267B9B /* libTKSTL.a */,
+                               0A7DEE131E2D2AB900267B9B /* libTKTObj.a */,
+                               0A7DEE141E2D2ABC00267B9B /* libTKVRML.a */,
+                               0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */,
+                               0A7DEE161E2D2AC300267B9B /* libTKXDEIGES.a */,
+                               0A7DEE171E2D2AC700267B9B /* libTKXDESTEP.a */,
+                               0A7DEE181E2D2ACA00267B9B /* libTKXMesh.a */,
+                               0A7DEE191E2D2ACE00267B9B /* libTKXml.a */,
+                               0A7DEE1A1E2D2AD100267B9B /* libTKXmlL.a */,
+                               0A7DEE1B1E2D2AD500267B9B /* libTKXmlTObj.a */,
+                               0A7DEE1C1E2D2AD900267B9B /* libTKXmlXCAF.a */,
+                               0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */,
+                               0A7DEDF41E2D29EF00267B9B /* libTKCAF.a */,
+                               0A7DEDF51E2D29F200267B9B /* libTKCDF.a */,
+                               0A7DEDF61E2D29F500267B9B /* libTKLCAF.a */,
+                               0A7DEDF71E2D29F800267B9B /* libTKV3d.a */,
+                               0A7DEDF81E2D29FB00267B9B /* libTKVCAF.a */,
+                               0A7DEDF01E2D296900267B9B /* libTKHLR.a */,
+                               0A7DEDF11E2D296C00267B9B /* libTKMesh.a */,
+                               0A7DEDDE1E2D28C500267B9B /* libTKBRep.a */,
+                               0A7DEDDF1E2D28C800267B9B /* libTKernel.a */,
+                               0A7DEDE01E2D28CB00267B9B /* libTKG2d.a */,
+                               0A7DEDE11E2D28CE00267B9B /* libTKG3d.a */,
+                               0A7DEDE21E2D28D200267B9B /* libTKGeomAlgo.a */,
+                               0A7DEDE31E2D28D500267B9B /* libTKGeomBase.a */,
+                               0A7DEDE41E2D28D800267B9B /* libTKMath.a */,
+                               0A7DEDE51E2D28DC00267B9B /* libTKShHealing.a */,
+                               0A7DEDE61E2D28DF00267B9B /* libTKTopAlgo.a */,
+                               0A7DEDD41E2D1D0900267B9B /* libfreetype.a */,
+                               0A7DED6E1E2D15B800267B9B /* dev */,
+                               3405CA811DE332AB008BADB9 /* UIKit.framework */,
+                               3405CA7C1DE3156D008BADB9 /* OpenGLES.framework */,
+                               3405CA7A1DE31566008BADB9 /* QuartzCore.framework */,
+                       );
+                       name = Frameworks;
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+               3405C9DA1DE2F04E008BADB9 /* UIKitSample */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 3405CA081DE2F04E008BADB9 /* Build configuration list for PBXNativeTarget "UIKitSample" */;
+                       buildPhases = (
+                               3405C9D71DE2F04E008BADB9 /* Sources */,
+                               3405C9D81DE2F04E008BADB9 /* Frameworks */,
+                               3405C9D91DE2F04E008BADB9 /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = UIKitSample;
+                       productName = UIKitSample;
+                       productReference = 3405C9DB1DE2F04E008BADB9 /* UIKitSample.app */;
+                       productType = "com.apple.product-type.application";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               3405C9D31DE2F04E008BADB9 /* Project object */ = {
+                       isa = PBXProject;
+                       attributes = {
+                               CLASSPREFIX = "";
+                               LastUpgradeCheck = 0810;
+                               ORGANIZATIONNAME = "OPEN CASCADE";
+                               TargetAttributes = {
+                                       3405C9DA1DE2F04E008BADB9 = {
+                                               CreatedOnToolsVersion = 8.1;
+                                               ProvisioningStyle = Automatic;
+                                       };
+                               };
+                       };
+                       buildConfigurationList = 3405C9D61DE2F04E008BADB9 /* Build configuration list for PBXProject "UIKitSample" */;
+                       compatibilityVersion = "Xcode 3.2";
+                       developmentRegion = English;
+                       hasScannedForEncodings = 0;
+                       knownRegions = (
+                               en,
+                               Base,
+                       );
+                       mainGroup = 3405C9D21DE2F04E008BADB9;
+                       productRefGroup = 3405C9DC1DE2F04E008BADB9 /* Products */;
+                       projectDirPath = "";
+                       projectRoot = "";
+                       targets = (
+                               3405C9DA1DE2F04E008BADB9 /* UIKitSample */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+               3405C9D91DE2F04E008BADB9 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               0A24B9FA1EB0A7CC00A5F490 /* linkrods.step in Resources */,
+                               0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */,
+                               3405C9EE1DE2F04E008BADB9 /* LaunchScreen.storyboard in Resources */,
+                               3405C9EB1DE2F04E008BADB9 /* Assets.xcassets in Resources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+               3405C9D71DE2F04E008BADB9 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               3405C9E31DE2F04E008BADB9 /* AppDelegate.mm in Sources */,
+                               3405CA851DE3331D008BADB9 /* GLView.mm in Sources */,
+                               343FDCA61DE42F37009AEE51 /* GLViewController.mm in Sources */,
+                               34424E031DE70100008B56DA /* OcctDocument.mm in Sources */,
+                               3405CA781DE303DC008BADB9 /* OcctViewer.mm in Sources */,
+                               3405C9E01DE2F04E008BADB9 /* main.mm in Sources */,
+                               34424E061DE72D2E008B56DA /* CafShapePrs.mm in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+               3405C9EC1DE2F04E008BADB9 /* LaunchScreen.storyboard */ = {
+                       isa = PBXVariantGroup;
+                       children = (
+                               3405C9ED1DE2F04E008BADB9 /* Base */,
+                       );
+                       name = LaunchScreen.storyboard;
+                       sourceTree = "<group>";
+               };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+               3405CA061DE2F04E008BADB9 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_SUSPICIOUS_MOVES = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_BITCODE = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = "";
+                               IPHONEOS_DEPLOYMENT_TARGET = 10.2;
+                               LIBRARY_SEARCH_PATHS = "";
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               SDKROOT = iphoneos;
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                               USER_HEADER_SEARCH_PATHS = "";
+                               USE_HEADERMAP = YES;
+                               VALID_ARCHS = "$(ARCHS_STANDARD)";
+                       };
+                       name = Debug;
+               };
+               3405CA071DE2F04E008BADB9 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_SUSPICIOUS_MOVES = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_BITCODE = NO;
+                               ENABLE_NS_ASSERTIONS = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               HEADER_SEARCH_PATHS = "";
+                               IPHONEOS_DEPLOYMENT_TARGET = 10.2;
+                               LIBRARY_SEARCH_PATHS = "";
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               ONLY_ACTIVE_ARCH = YES;
+                               SDKROOT = iphoneos;
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                               USER_HEADER_SEARCH_PATHS = "";
+                               USE_HEADERMAP = YES;
+                               VALIDATE_PRODUCT = YES;
+                               VALID_ARCHS = "$(ARCHS_STANDARD)";
+                       };
+                       name = Release;
+               };
+               3405CA091DE2F04E008BADB9 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD)";
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CODE_SIGN_IDENTITY = "iPhone Developer";
+                               "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+                               DEVELOPMENT_TEAM = "";
+                               HEADER_SEARCH_PATHS = ../occt/inc;
+                               INFOPLIST_FILE = UIKitSample/Info.plist;
+                               IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       ../occt/lib,
+                                       ../3rdparty/lib,
+                               );
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               PRODUCT_BUNDLE_IDENTIFIER = org.opencascade.ios.sample;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE_SPECIFIER = "";
+                               SDKROOT = iphoneos;
+                               SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                               VALID_ARCHS = "$(ARCHS_STANDARD)";
+                       };
+                       name = Debug;
+               };
+               3405CA0A1DE2F04E008BADB9 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD)";
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CODE_SIGN_IDENTITY = "iPhone Developer";
+                               "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+                               DEVELOPMENT_TEAM = "";
+                               HEADER_SEARCH_PATHS = ../occt/inc;
+                               INFOPLIST_FILE = UIKitSample/Info.plist;
+                               IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+                               LIBRARY_SEARCH_PATHS = (
+                                       ../occt/lib,
+                                       ../3rdparty/lib,
+                               );
+                               OTHER_CFLAGS = "";
+                               OTHER_LDFLAGS = "";
+                               PRODUCT_BUNDLE_IDENTIFIER = org.opencascade.ios.sample;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE_SPECIFIER = "";
+                               SDKROOT = iphoneos;
+                               SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                               VALID_ARCHS = "$(ARCHS_STANDARD)";
+                       };
+                       name = Release;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               3405C9D61DE2F04E008BADB9 /* Build configuration list for PBXProject "UIKitSample" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               3405CA061DE2F04E008BADB9 /* Debug */,
+                               3405CA071DE2F04E008BADB9 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               3405CA081DE2F04E008BADB9 /* Build configuration list for PBXNativeTarget "UIKitSample" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               3405CA091DE2F04E008BADB9 /* Debug */,
+                               3405CA0A1DE2F04E008BADB9 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = 3405C9D31DE2F04E008BADB9 /* Project object */;
+}
diff --git a/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/ios/UIKitSample/UIKitSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644 (file)
index 0000000..6a3ecc7
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:UIKitSample.xcodeproj">
+   </FileRef>
+</Workspace>
diff --git a/samples/ios/UIKitSample/UIKitSample/AppDelegate.h b/samples/ios/UIKitSample/UIKitSample/AppDelegate.h
new file mode 100644 (file)
index 0000000..09134fa
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import <UIKit/UIKit.h>
+
+#import "GLView.h"
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
+
diff --git a/samples/ios/UIKitSample/UIKitSample/AppDelegate.mm b/samples/ios/UIKitSample/UIKitSample/AppDelegate.mm
new file mode 100644 (file)
index 0000000..b6e2df3
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import "AppDelegate.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+@synthesize window=_window;
+
+- (BOOL)application:(UIApplication *)theApplication didFinishLaunchingWithOptions:(NSDictionary *)theLaunchOptions {
+  // Override point for customization after application launch.
+    
+    CGRect screenBounds = [[UIScreen mainScreen] bounds];
+  self.window = [[UIWindow alloc] initWithFrame: screenBounds];
+  
+  GLViewController* aGLViewController = [[GLViewController alloc] init];
+  UINavigationController *aNavController =
+  [[UINavigationController alloc] initWithRootViewController: aGLViewController];
+  
+  self.window.rootViewController = aNavController;
+  [self.window makeKeyAndVisible];
+  
+    return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)theApplication {
+  // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+  // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)theApplication {
+  // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+  // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)theApplication {
+  // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)theApplication {
+  // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)theApplication {
+  // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644 (file)
index 0000000..536920e
--- /dev/null
@@ -0,0 +1,62 @@
+{
+  "images" : [
+    {
+      "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "Icon-60@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "76x76",
+      "idiom" : "ipad",
+      "filename" : "Icon-76.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "76x76",
+      "idiom" : "ipad",
+      "filename" : "Icon-76@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "iphone",
+      "filename" : "Icon-Small-40@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "ipad",
+      "filename" : "Icon-Small-40.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "ipad",
+      "filename" : "Icon-Small-40@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "iphone",
+      "filename" : "Icon-Small@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "ipad",
+      "filename" : "Icon-Small.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "ipad",
+      "filename" : "Icon-Small@2x.png",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
new file mode 100644 (file)
index 0000000..57121a6
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png
new file mode 100644 (file)
index 0000000..4fb3f91
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
new file mode 100644 (file)
index 0000000..817ddec
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png
new file mode 100644 (file)
index 0000000..d845c80
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
new file mode 100644 (file)
index 0000000..95dd562
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
new file mode 100644 (file)
index 0000000..911422e
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
new file mode 100644 (file)
index 0000000..a060ff2
Binary files /dev/null and b/samples/ios/UIKitSample/UIKitSample/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ
diff --git a/samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard b/samples/ios/UIKitSample/UIKitSample/Base.lproj/LaunchScreen.storyboard
new file mode 100644 (file)
index 0000000..fdf3f97
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="53" y="375"/>
+        </scene>
+    </scenes>
+</document>
diff --git a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.h b/samples/ios/UIKitSample/UIKitSample/CafShapePrs.h
new file mode 100644 (file)
index 0000000..f470dc2
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef CafShapePrs_h
+#define CafShapePrs_h
+
+#include <TDF_Label.hxx>
+#include <TDF_LabelMapHasher.hxx>
+#include <XCAFPrs_AISObject.hxx>
+#include <XCAFPrs_Style.hxx>
+
+typedef NCollection_DataMap<TopoDS_Shape, Handle(AIS_ColoredDrawer), TopTools_ShapeMapHasher> CafDataMapOfShapeColor;
+typedef NCollection_DataMap<TDF_Label, Handle(AIS_InteractiveObject), TDF_LabelMapHasher> MapOfPrsForShapes;
+
+//! Interactive object for shape in DECAF document
+class CafShapePrs : public XCAFPrs_AISObject
+{
+  
+public:
+  
+  //! Default constructor.
+  CafShapePrs (const TDF_Label&                theLabel,
+               const XCAFPrs_Style&            theStyle,
+               const Graphic3d_MaterialAspect& theMaterial);
+  
+  //! Search custom aspect for specified shape.
+  Standard_Boolean FindCustomAspects (const TopoDS_Shape&        theShape,
+                                      Handle(AIS_ColoredDrawer)& theAspects) const
+  {
+    return myShapeColors.Find (theShape, theAspects);
+  }
+  
+  //! Access the styles map.
+  const CafDataMapOfShapeColor& ShapeColors() const { return myShapeColors; }
+  
+  //! Override default style.
+  virtual void DefaultStyle (XCAFPrs_Style& theStyle) const Standard_OVERRIDE
+  {
+    theStyle = myDefStyle;
+  }
+  
+protected:
+  
+  XCAFPrs_Style myDefStyle; //!< default style
+  
+public: //! @name Declaration of CASCADE RTTI
+  
+  DEFINE_STANDARD_RTTIEXT(CafShapePrs, XCAFPrs_AISObject)
+  
+};
+
+DEFINE_STANDARD_HANDLE(CafShapePrs, XCAFPrs_AISObject)
+
+#endif // CafShapePrs_h
diff --git a/samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm b/samples/ios/UIKitSample/UIKitSample/CafShapePrs.mm
new file mode 100644 (file)
index 0000000..a23e9f0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include "CafShapePrs.h"
+
+#import <Foundation/Foundation.h>
+
+IMPLEMENT_STANDARD_RTTIEXT(CafShapePrs, XCAFPrs_AISObject)
+
+// =======================================================================
+// function : CafShapePrs
+// purpose  :
+// =======================================================================
+CafShapePrs::CafShapePrs(const TDF_Label&                theLabel,
+                         const XCAFPrs_Style&            theStyle,
+                         const Graphic3d_MaterialAspect& theMaterial)
+: XCAFPrs_AISObject (theLabel),
+  myDefStyle(theStyle)
+{
+  SetMaterial(theMaterial);
+}
diff --git a/samples/ios/UIKitSample/UIKitSample/GLView.h b/samples/ios/UIKitSample/UIKitSample/GLView.h
new file mode 100644 (file)
index 0000000..fc47bab
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef GLView_h
+#define GLView_h
+
+#import <UIKit/UIKit.h>
+#import <QuartzCore/QuartzCore.h>
+#include <OpenGLES/ES2/gl.h>
+#include <OpenGLES/ES2/glext.h>
+
+#import "GLViewController.h"
+
+//! Open GL view
+@interface GLView : UIView {
+  
+@public
+  GLViewController* myController;
+  
+  EAGLContext* myGLContext;
+  
+  int myBackingWidth;
+  int myBackingHeight;
+  GLuint myFrameBuffer;
+  GLuint myRenderBuffer;
+  GLuint myDepthBuffer;
+}
+
+@end
+#endif // GLView_h
diff --git a/samples/ios/UIKitSample/UIKitSample/GLView.mm b/samples/ios/UIKitSample/UIKitSample/GLView.mm
new file mode 100644 (file)
index 0000000..7888114
--- /dev/null
@@ -0,0 +1,160 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import <Foundation/Foundation.h>
+
+#import "GLView.h"
+#import "GLViewController.h"
+
+@implementation GLView
+
+// =======================================================================
+// function : layerClass
+// purpose  :
+// =======================================================================
++ (Class)layerClass
+{
+  return [CAEAGLLayer class];
+}
+
+// =======================================================================
+// function : setupLayer
+// purpose  :
+// =======================================================================
+- (void)setupLayer
+{
+  CAEAGLLayer* anEAGLLayer = (CAEAGLLayer*) self.layer;
+  anEAGLLayer.opaque = YES;
+  anEAGLLayer.contentsScale = [[UIScreen mainScreen] scale];
+}
+
+// =======================================================================
+// function : setupContext
+// purpose  :
+// =======================================================================
+- (void)setupContext
+{
+  EAGLRenderingAPI aRendApi = kEAGLRenderingAPIOpenGLES2;
+  myGLContext = [[EAGLContext alloc] initWithAPI:aRendApi];
+  if (!myGLContext) {
+    NSLog(@"Failed to initialize OpenGLES 2.0 context");
+  }
+  
+  if (![EAGLContext setCurrentContext:myGLContext]) {
+    NSLog(@"Failed to set current OpenGL context");
+  }
+}
+
+// =======================================================================
+// function : createBuffers
+// purpose  :
+// =======================================================================
+- (void) createBuffers
+{
+  glGenFramebuffers(1, &myFrameBuffer);
+  glBindFramebuffer(GL_FRAMEBUFFER, myFrameBuffer);
+  glGenRenderbuffers(1, &myRenderBuffer);
+  glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer);
+  
+  [myGLContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)self.layer];
+  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, myRenderBuffer);
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &myBackingWidth);
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &myBackingHeight);
+  
+  glGenRenderbuffers(1, &myDepthBuffer);
+  glBindRenderbuffer(GL_RENDERBUFFER, myDepthBuffer);
+  glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, myBackingWidth, myBackingHeight);
+  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, myDepthBuffer);
+}
+
+// =======================================================================
+// function : destroyBuffers
+// purpose  :
+// =======================================================================
+- (void) destroyBuffers
+{
+  glDeleteFramebuffers(1, &myFrameBuffer);
+  myFrameBuffer = 0;
+  glDeleteRenderbuffers(1, &myRenderBuffer);
+  myRenderBuffer = 0;
+  glDeleteRenderbuffers(1, &myDepthBuffer);
+  myDepthBuffer = 0;
+}
+
+// =======================================================================
+// function : drawView
+// purpose  :
+// =======================================================================
+- (void) drawView
+{
+  glBindFramebuffer(GL_FRAMEBUFFER, myFrameBuffer);
+  
+  [myController Draw];
+  
+  glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer);
+  [myGLContext presentRenderbuffer:GL_RENDERBUFFER];
+}
+
+// =======================================================================
+// function : layoutSubviews
+// purpose  :
+// =======================================================================
+- (void) layoutSubviews
+{
+  [EAGLContext setCurrentContext:myGLContext];
+  
+  [self destroyBuffers];
+  [self createBuffers];
+  [self drawView];
+  
+  glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer);
+  
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &myBackingWidth);
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &myBackingHeight);
+  
+  if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+  {
+    NSLog(@"Failed to make complete framebuffer object %u",
+          glCheckFramebufferStatus(GL_FRAMEBUFFER));
+  }
+  
+  glViewport(0, 0, myBackingWidth, myBackingHeight);
+  
+  [myController Setup];
+}
+
+// =======================================================================
+// function : init
+// purpose  :
+// =======================================================================
+- (id) init
+{
+  self = [super init];
+  
+  if (self) {
+    [self setupLayer];
+    [self setupContext];
+    
+    myController = NULL;
+    
+    myBackingWidth  = 0;
+    myBackingHeight = 0;
+    myFrameBuffer   = 0;
+    myRenderBuffer  = 0;
+    myDepthBuffer   = 0;
+  }
+  
+  return self;
+}
+
+@end
diff --git a/samples/ios/UIKitSample/UIKitSample/GLViewController.h b/samples/ios/UIKitSample/UIKitSample/GLViewController.h
new file mode 100644 (file)
index 0000000..cc4bf4b
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef GLViewController_h
+#define GLViewController_h
+
+#import <UIKit/UIKit.h>
+
+#import "OcctViewer.h"
+
+//! Open GL view controller
+@interface GLViewController : UIViewController {
+  OcctViewer* myOcctViewer;
+  
+  CGPoint myFirstTouch[2];
+}
+
+-(void) Draw;
+-(void) Setup;
+
+@end
+#endif // GLViewController_h
diff --git a/samples/ios/UIKitSample/UIKitSample/GLViewController.mm b/samples/ios/UIKitSample/UIKitSample/GLViewController.mm
new file mode 100644 (file)
index 0000000..4c713d3
--- /dev/null
@@ -0,0 +1,281 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import <Foundation/Foundation.h>
+
+#import "GLViewController.h"
+#import "GLView.h"
+
+@implementation GLViewController
+
+// =======================================================================
+// function : init
+// purpose  :
+// =======================================================================
+- (id) init
+{
+  self = [super init];
+  
+  if (self) {
+    myOcctViewer = new OcctViewer();
+  }
+  
+  return self;
+}
+
+// =======================================================================
+// function : Draw
+// purpose  :
+// =======================================================================
+- (void) Draw
+{
+}
+
+// =======================================================================
+// function : Setup
+// purpose  :
+// =======================================================================
+- (void) Setup {
+  if (!myOcctViewer->InitViewer(self.view)) {
+    NSLog(@"Failed to init viewer");
+  }
+  else {
+    [self importScrew:nullptr];
+  }
+}
+
+// =======================================================================
+// function : loadView
+// purpose  :
+// =======================================================================
+- (void) loadView
+{
+  GLView* aGLView = [[GLView alloc] init];
+  aGLView->myController = self;
+  self.view = aGLView;
+}
+
+// =======================================================================
+// function : touchesBegan
+// purpose  :
+// =======================================================================
+- (void)touchesBegan:(NSSet *)theTouches withEvent:(UIEvent *)theEvent
+{
+  [super touchesBegan:theTouches withEvent:theEvent];
+  
+  UITouch *aTouch = [theTouches anyObject];
+  if (aTouch != NULL) {
+    CGPoint aTouchPoint = [aTouch locationInView:self.view];
+    myOcctViewer->StartRotation((int)aTouchPoint.x, (int)aTouchPoint.y);
+  }
+}
+
+// =======================================================================
+// function : touchesMoved
+// purpose  :
+// =======================================================================
+- (void)touchesMoved:(NSSet *)theTouches withEvent:(UIEvent *)theEvent
+{
+  [super touchesMoved:theTouches withEvent:theEvent];
+  
+  UITouch *aTouch = [theTouches anyObject];
+  if (aTouch != NULL) {
+    CGPoint aTouchPoint = [aTouch locationInView:self.view];
+    myOcctViewer->Rotation((int)aTouchPoint.x, (int)aTouchPoint.y);
+  }
+  
+  return;
+}
+
+// =======================================================================
+// function : viewDidLoad
+// purpose  :
+// =======================================================================
+-(void)viewDidLoad
+{
+  // add zoom recognizer
+  UIPinchGestureRecognizer *aZoomRecognizer = [[UIPinchGestureRecognizer alloc]
+                                               initWithTarget:self
+                                               action:@selector(zoomHandler:)];
+  
+  [[self view] addGestureRecognizer:aZoomRecognizer];
+  
+  // add pan recognizer
+  UIPanGestureRecognizer *aPanRecognizer = [[UIPanGestureRecognizer alloc]
+                                            initWithTarget:self
+                                            action:@selector(panHandler:)];
+  
+  aPanRecognizer.maximumNumberOfTouches = 2;
+  aPanRecognizer.minimumNumberOfTouches = 2;
+  
+  [[self view] addGestureRecognizer:aPanRecognizer];
+  
+  UITapGestureRecognizer *aTapRecognizer = [[UITapGestureRecognizer alloc]
+                                            initWithTarget:self
+                                            action:@selector(tapHandler:)];
+  
+  [[self view] addGestureRecognizer:aTapRecognizer];
+  
+  
+  // add import buttons
+  UIBarButtonItem *importScrewBtn = [[UIBarButtonItem alloc]
+                                     initWithTitle:@"Sample 1"
+                                     style:UIBarButtonItemStylePlain
+                                     target:self
+                                     action:@selector(importScrew:)];
+  
+  UIBarButtonItem *importLinkrodsBtn = [[UIBarButtonItem alloc]
+                                        initWithTitle:@"Sample 2"
+                                        style:UIBarButtonItemStylePlain
+                                        target:self
+                                        action:@selector(importLinkrods:)];
+  
+  UIBarButtonItem *displayAboutDlgBtn = [[UIBarButtonItem alloc]
+                                         initWithTitle:@"About"
+                                         style:UIBarButtonItemStylePlain
+                                         target:self
+                                         action:@selector(displayAboutDlg:)];
+  
+  [self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:importScrewBtn, importLinkrodsBtn, nil]];
+  [self.navigationItem setRightBarButtonItem: displayAboutDlgBtn];
+}
+
+// =======================================================================
+// function : zoomHandler
+// purpose  :
+// =======================================================================
+- (void)zoomHandler:(UIPinchGestureRecognizer *)pinchRecognizer
+{
+  if ([pinchRecognizer numberOfTouches] > 1)
+  {
+    UIGestureRecognizerState aState = [pinchRecognizer state];
+    if (aState == UIGestureRecognizerStateBegan)
+    {
+      myFirstTouch[0] = [pinchRecognizer locationOfTouch:0 inView:self.view];
+      myFirstTouch[1] = [pinchRecognizer locationOfTouch:1 inView:self.view];
+    }
+    else if (aState == UIGestureRecognizerStateChanged) {
+      CGPoint aLastTouch[2] = {
+        [pinchRecognizer locationOfTouch:0 inView:self.view],
+        [pinchRecognizer locationOfTouch:1 inView:self.view]
+      };
+      
+      double aPinchCenterXStart = ( myFirstTouch[0].x + myFirstTouch[1].x ) / 2.0;
+      double aPinchCenterYStart = ( myFirstTouch[0].y + myFirstTouch[1].y ) / 2.0;
+      
+      double aStartDist = Sqrt( ( myFirstTouch[0].x - myFirstTouch[1].x ) * ( myFirstTouch[0].x - myFirstTouch[1].x ) +
+                              ( myFirstTouch[0].y - myFirstTouch[1].y ) * ( myFirstTouch[0].y - myFirstTouch[1].y ) );
+      double anEndDist = Sqrt( ( aLastTouch[0].x - aLastTouch[1].x ) * ( aLastTouch[0].x - aLastTouch[1].x ) +
+                            ( aLastTouch[0].y - aLastTouch[1].y ) * ( aLastTouch[0].y - aLastTouch[1].y ) );
+      
+      double aDeltaDist = anEndDist - aStartDist;
+      
+      myOcctViewer->Zoom(aPinchCenterXStart, aPinchCenterYStart, aDeltaDist);
+      
+      myFirstTouch[0] = aLastTouch[0];
+      myFirstTouch[1] = aLastTouch[1];
+    }
+  }
+}
+
+// =======================================================================
+// function : panHandler
+// purpose  :
+// =======================================================================
+- (void)panHandler:(UIPanGestureRecognizer *)panRecognizer
+{
+  if ([panRecognizer numberOfTouches] > 1)
+  {
+    UIGestureRecognizerState aState = [panRecognizer state];
+    if (aState == UIGestureRecognizerStateBegan)
+    {
+      myFirstTouch[0] = [panRecognizer locationOfTouch:0 inView:self.view];
+      myFirstTouch[1] = [panRecognizer locationOfTouch:1 inView:self.view];
+    }
+    else if (aState == UIGestureRecognizerStateChanged) {
+      CGPoint aLastTouch[2] = {
+        [panRecognizer locationOfTouch:0 inView:self.view],
+        [panRecognizer locationOfTouch:1 inView:self.view]
+      };
+      
+      double aPinchCenterXStart = ( myFirstTouch[0].x + myFirstTouch[1].x ) / 2.0;
+      double aPinchCenterYStart = ( myFirstTouch[0].y + myFirstTouch[1].y ) / 2.0;
+      
+      double aPinchCenterXEnd = ( aLastTouch[0].x + aLastTouch[1].x ) / 2.0;
+      double aPinchCenterYEnd = ( aLastTouch[0].y + aLastTouch[1].y ) / 2.0;
+      
+      double aPinchCenterXDev = aPinchCenterXEnd - aPinchCenterXStart;
+      double aPinchCenterYDev = aPinchCenterYEnd - aPinchCenterYStart;
+      
+      myOcctViewer->Pan((int)aPinchCenterXDev, (int)-aPinchCenterYDev);
+    }
+  }
+}
+
+// =======================================================================
+// function : tapHandler
+// purpose  :
+// =======================================================================
+- (void)tapHandler:(UITapGestureRecognizer *)tapRecognizer
+{
+  CGPoint aTapPoint = [tapRecognizer locationInView:self.view];
+  myOcctViewer->Select(aTapPoint.x, aTapPoint.y);
+}
+
+// =======================================================================
+// function : importScrew
+// purpose  :
+// =======================================================================
+- (void)importScrew:(UIBarButtonItem *)theSender
+{
+  NSString* aNsPath = [[NSBundle mainBundle] pathForResource:@"screw"
+                                                      ofType:@"step"];
+  std::string aPath = std::string([aNsPath UTF8String]);
+  
+  myOcctViewer->ImportSTEP(aPath);
+  myOcctViewer->FitAll();
+}
+
+// =======================================================================
+// function : importLinkrods
+// purpose  :
+// =======================================================================
+- (void)importLinkrods:(UIBarButtonItem *)theSender
+{
+  NSString* aNsPath = [[NSBundle mainBundle] pathForResource:@"linkrods"
+                                                      ofType:@"step"];
+  std::string aPath = std::string([aNsPath UTF8String]);
+  
+  myOcctViewer->ImportSTEP(aPath);
+  myOcctViewer->FitAll();
+}
+
+// =======================================================================
+// function : displayAboutDlg
+// purpose  :
+// =======================================================================
+- (void)displayAboutDlg:(UIBarButtonItem *)theSender
+{
+  UIAlertController* anAbout = [UIAlertController alertControllerWithTitle:@"About"
+                                message:@"UIKit based application for tutorial to Open CASCADE Technology.\n\n"
+                                      @"Copyright (c) 2017 OPEN CASCADE SAS"
+                                preferredStyle:UIAlertControllerStyleAlert];
+  
+  UIAlertAction* aDefaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
+                                                         handler:^(UIAlertAction * action) {}];
+  
+  [anAbout addAction:aDefaultAction];
+  [self presentViewController:anAbout animated:YES completion:nil];
+}
+
+@end
diff --git a/samples/ios/UIKitSample/UIKitSample/Info.plist b/samples/ios/UIKitSample/UIKitSample/Info.plist
new file mode 100644 (file)
index 0000000..92faa7f
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleDisplayName</key>
+       <string>OCCT Sample</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIdentifier</key>
+       <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.0</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+       <key>LSRequiresIPhoneOS</key>
+       <true/>
+       <key>UILaunchStoryboardName</key>
+       <string>LaunchScreen</string>
+       <key>UIMainStoryboardFile</key>
+       <string></string>
+       <key>UIRequiredDeviceCapabilities</key>
+       <array>
+               <string>armv7</string>
+       </array>
+       <key>UISupportedInterfaceOrientations</key>
+       <array>
+               <string>UIInterfaceOrientationLandscapeLeft</string>
+               <string>UIInterfaceOrientationLandscapeRight</string>
+       </array>
+       <key>UISupportedInterfaceOrientations~ipad</key>
+       <array>
+               <string>UIInterfaceOrientationPortrait</string>
+               <string>UIInterfaceOrientationPortraitUpsideDown</string>
+               <string>UIInterfaceOrientationLandscapeLeft</string>
+               <string>UIInterfaceOrientationLandscapeRight</string>
+       </array>
+</dict>
+</plist>
diff --git a/samples/ios/UIKitSample/UIKitSample/OcctDocument.h b/samples/ios/UIKitSample/UIKitSample/OcctDocument.h
new file mode 100644 (file)
index 0000000..d929377
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef OcctDocument_h
+#define OcctDocument_h
+
+#include <XCAFApp_Application.hxx>
+#include <TDocStd_Document.hxx>
+
+//! The document
+class OcctDocument : public Standard_Transient
+{
+  DEFINE_STANDARD_RTTIEXT(OcctDocument, Standard_Transient)
+  
+public:
+  Standard_EXPORT OcctDocument();
+  
+  Standard_EXPORT virtual ~OcctDocument();
+  
+  Standard_EXPORT void InitDoc();
+  
+  Standard_EXPORT Handle(TDocStd_Document)& ChangeDocument() { return myOcafDoc; }
+  Standard_EXPORT const Handle(TDocStd_Document)& Document() const { return myOcafDoc; }
+  
+private:
+  Handle(XCAFApp_Application) myApp;
+  Handle(TDocStd_Document) myOcafDoc;
+};
+
+DEFINE_STANDARD_HANDLE(OcctDocument, Standard_Transient)
+
+#endif // OcctDocument_h
diff --git a/samples/ios/UIKitSample/UIKitSample/OcctDocument.mm b/samples/ios/UIKitSample/UIKitSample/OcctDocument.mm
new file mode 100644 (file)
index 0000000..8d33b78
--- /dev/null
@@ -0,0 +1,82 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import <Foundation/Foundation.h>
+
+#include "OcctDocument.h"
+
+#include <Standard_ErrorHandler.hxx>
+#include <Message.hxx>
+#include <Message_Messenger.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(OcctDocument, Standard_Transient)
+
+// =======================================================================
+// function : OcctViewer
+// purpose  :
+// =======================================================================
+OcctDocument::OcctDocument()
+{
+  try {
+    OCC_CATCH_SIGNALS
+    
+    myApp = XCAFApp_Application::GetApplication();
+  } catch (Standard_Failure) {
+    Message::DefaultMessenger()->Send (TCollection_AsciiString("Error in creating application") +
+                                       Standard_Failure::Caught()->GetMessageString(), Message_Fail);
+  }
+}
+
+// =======================================================================
+// function : OcctDocument
+// purpose  :
+// =======================================================================
+OcctDocument::~OcctDocument()
+{
+}
+
+// =======================================================================
+// function : InitDoc
+// purpose  :
+// =======================================================================
+void OcctDocument::InitDoc()
+{
+  // close old document
+  if (!myOcafDoc.IsNull())
+  {
+    if (myOcafDoc->HasOpenCommand())
+    {
+      myOcafDoc->AbortCommand();
+    }
+    
+    myOcafDoc->Main().Root().ForgetAllAttributes(Standard_True);
+    
+    myApp->Close(myOcafDoc);
+    
+    myOcafDoc.Nullify();
+  }
+  
+  // create a new document
+  myApp->NewDocument(TCollection_ExtendedString("BinXCAF"), myOcafDoc);
+  
+  // set maximum number of available "undo" actions
+  if (!myOcafDoc.IsNull())
+  {
+    myOcafDoc->SetUndoLimit(10);
+  }
+}
+
+
+
diff --git a/samples/ios/UIKitSample/UIKitSample/OcctViewer.h b/samples/ios/UIKitSample/UIKitSample/OcctViewer.h
new file mode 100644 (file)
index 0000000..69120f1
--- /dev/null
@@ -0,0 +1,98 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef OcctViewer_H
+#define OcctViewer_H
+
+#include "OcctDocument.h"
+#include "CafShapePrs.h"
+
+#include <AIS_ColoredDrawer.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <OSD_Timer.hxx>
+#include <TColStd_HPackedMapOfInteger.hxx>
+#include <V3d_DirectionalLight.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <XCAFDoc_ShapeTool.hxx>
+#include <XCAFDoc_ColorTool.hxx>
+#include <XCAFPrs_Style.hxx>
+
+#import <UIKit/UIKit.h>
+
+//! OCCT 3D Viewer holder.
+class OcctViewer
+{
+public:
+  
+  //! Empty constructor.
+  Standard_EXPORT OcctViewer();
+  
+  //! Destructor.
+  Standard_EXPORT virtual ~OcctViewer();
+  
+  //! Release the viewer.
+  Standard_EXPORT void release();
+  
+public:
+  
+  //! Return viewer instance.
+  const Handle(V3d_Viewer)& V3dViewer() const { return myViewer; }
+  
+  //! Return active view.
+  const Handle(V3d_View)& ActiveView() const { return myView; }
+  
+  //! Interactive context.
+  const Handle(AIS_InteractiveContext)& AisContex() const { return myContext; }
+  
+  //! Invalidate active viewer.
+  void Invalidate()
+  {
+    myView->Invalidate();
+  }
+  
+public:
+  
+  //! Perform OCCT Viewer (re)initialization.
+  Standard_EXPORT bool InitViewer (UIView* theWin);
+  
+  Standard_EXPORT void FitAll();
+  
+  Standard_EXPORT void StartRotation(int theX, int theY);
+  Standard_EXPORT void Rotation(int theX, int theY);
+  Standard_EXPORT void Pan(int theX, int theY);
+  Standard_EXPORT void Zoom(int theX, int theY, double theDelta);
+  Standard_EXPORT void Select(int theX, int theY);
+  
+  Standard_EXPORT bool ImportSTEP(std::string theFilename);
+  
+private:
+  void clearSession(const Handle(XSControl_WorkSession)& theSession);
+  
+  void displayWithChildren (XCAFDoc_ShapeTool&             theShapeTool,
+                            XCAFDoc_ColorTool&             theColorTool,
+                            const TDF_Label&               theLabel,
+                            const TopLoc_Location&         theParentTrsf,
+                            const XCAFPrs_Style&           theParentStyle,
+                            const TCollection_AsciiString& theParentId,
+                            MapOfPrsForShapes&             theMapOfShapes);
+  void clearContext();
+  
+protected:
+  
+  Handle(V3d_Viewer)              myViewer;            //!< main viewer
+  Handle(V3d_View)                myView;              //!< main view
+  Handle(AIS_InteractiveContext)  myContext;           //!< interactive context containing displayed objects
+  Handle(OcctDocument)            myDoc;
+};
+
+#endif // OcctViewer_H
diff --git a/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm b/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm
new file mode 100644 (file)
index 0000000..c1d3aba
--- /dev/null
@@ -0,0 +1,396 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include "OcctViewer.h"
+#include "OcctDocument.h"
+
+#include <AIS_ConnectedInteractive.hxx>
+#include <AIS_Shape.hxx>
+#include <Aspect_DisplayConnection.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
+#include <BRepTools.hxx>
+#include <Cocoa_Window.hxx>
+#include <Message.hxx>
+#include <Message_Messenger.hxx>
+#include <OpenGl_GraphicDriver.hxx>
+#include <Prs3d.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <STEPControl_Reader.hxx>
+#include <STEPCAFControl_Reader.hxx>
+#include <TDF_Tool.hxx>
+#include <TDF_ChildIterator.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XCAFDoc_DocumentTool.hxx>
+
+// =======================================================================
+// function : OcctViewer
+// purpose  :
+// =======================================================================
+OcctViewer::OcctViewer()
+{
+  myDoc = new OcctDocument();
+}
+
+// =======================================================================
+// function : ~OcctViewer
+// purpose  :
+// =======================================================================
+OcctViewer::~OcctViewer()
+{
+  //
+}
+
+// =======================================================================
+// function : release
+// purpose  :
+// =======================================================================
+void OcctViewer::release()
+{
+  myContext.Nullify();
+  if (!myView.IsNull())
+  {
+    myView->Remove();
+  }
+  myView.Nullify();
+  myViewer.Nullify();
+  
+  myDoc.Nullify();
+}
+
+// =======================================================================
+// function : InitViewer
+// purpose  :
+// =======================================================================
+bool OcctViewer::InitViewer (UIView* theWin)
+{
+  EAGLContext* aRendCtx = [EAGLContext currentContext];
+  if (theWin == NULL || aRendCtx   == NULL)
+  {
+    NSLog(@"Error: No active EAGL context!");
+    release();
+    return false;
+  }
+  
+  if (!myView.IsNull())
+  {
+    myView->MustBeResized();
+    myView->Invalidate();
+  }
+  else
+  {
+    Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
+    Handle(Graphic3d_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
+    
+    // Create Viewer
+    myViewer = new V3d_Viewer(aGraphicDriver);
+    myViewer->SetDefaultLights();
+    myViewer->SetLightOn();
+    
+    // Create AIS context
+    myContext = new AIS_InteractiveContext(myViewer);
+    myContext->SetDisplayMode((int)AIS_DisplayMode::AIS_Shaded, false);
+    
+    myView = myViewer->CreateView();
+    myView->TriedronDisplay (Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.20, V3d_ZBUFFER);
+    
+    Handle(Cocoa_Window) aCocoaWindow = new Cocoa_Window(theWin);
+    myView->SetWindow(aCocoaWindow, aRendCtx);
+    if (!aCocoaWindow->IsMapped())
+    {
+      aCocoaWindow->Map();
+    }
+    
+    myView->Redraw();
+    myView->MustBeResized();
+  }
+  
+  return true;
+}
+
+// =======================================================================
+// function : FitAll
+// purpose  :
+// =======================================================================
+void OcctViewer::FitAll()
+{
+  if (!myView.IsNull())
+  {
+    myView->FitAll();
+    myView->ZFitAll();
+  }
+}
+
+// =======================================================================
+// function : StartRotation
+// purpose  :
+// =======================================================================
+void OcctViewer::StartRotation(int theX, int theY)
+{
+  if (!myView.IsNull())
+  {
+    myView->StartRotation(theX, theY);
+  }
+}
+
+// =======================================================================
+// function : Rotation
+// purpose  :
+// =======================================================================
+void OcctViewer::Rotation(int theX, int theY)
+{
+  if (!myView.IsNull())
+  {
+    myView->Rotation(theX, theY);
+  }
+}
+
+// =======================================================================
+// function : Pan
+// purpose  :
+// =======================================================================
+void OcctViewer::Pan(int theX, int theY)
+{
+  if (!myView.IsNull())
+  {
+    myView->Pan(theX, theY, 1, Standard_False);
+  }
+}
+
+// =======================================================================
+// function : Zoom
+// purpose  :
+// =======================================================================
+void OcctViewer::Zoom(int theX, int theY, double theDelta)
+{
+  if (!myView.IsNull())
+  {
+    if (theX >=0 && theY >=0)
+    {
+      myView->StartZoomAtPoint(theX, theY);
+      myView->ZoomAtPoint(0, 0, (int) theDelta, (int) theDelta);
+    }
+    else
+    {
+      double aCoeff = Abs(theDelta) / 100.0 + 1.0;
+      aCoeff = theDelta > 0.0 ? aCoeff : 1.0 / aCoeff;
+      myView->SetZoom(aCoeff, Standard_True);
+    }
+  }
+}
+
+// =======================================================================
+// function : Select
+// purpose  :
+// =======================================================================
+void OcctViewer::Select(int theX, int theY)
+{
+  if (!myContext.IsNull())
+  {
+    myContext->ClearSelected(Standard_False);
+    myContext->MoveTo(theX, theY, myView, Standard_False);
+    myContext->Select(Standard_False);
+  }
+}
+
+// =======================================================================
+// function : ImportSTEP
+// purpose  :
+// =======================================================================
+bool OcctViewer::ImportSTEP(std::string theFilename)
+{
+  // create a new document
+  myDoc->InitDoc();
+  
+  STEPCAFControl_Reader aReader;
+  Handle(XSControl_WorkSession) aSession = aReader.Reader().WS();
+  
+  try {
+    if (!aReader.ReadFile (theFilename.c_str()))
+    {
+      clearSession (aSession);
+      return false;
+    }
+    
+    if (!aReader.Transfer (myDoc->ChangeDocument()))
+    {
+      clearSession (aSession);
+      return false;
+    }
+    
+    clearSession(aSession);
+  } catch (Standard_Failure theFailure) {
+    Message::DefaultMessenger()->Send (TCollection_AsciiString ("Exception raised during STEP import\n[")
+                                       + theFailure.GetMessageString() + "]\n" + theFilename.c_str(), Message_Fail);
+    return false;
+  }
+  
+  Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool (myDoc->Document()->Main());
+  Handle(XCAFDoc_ColorTool) aColorTool = XCAFDoc_DocumentTool::ColorTool (myDoc->Document()->Main());
+  
+  TDF_LabelSequence aLabels;
+  aShapeTool->GetFreeShapes (aLabels);
+  
+  // perform meshing explicitly
+  TopoDS_Compound aCompound;
+  BRep_Builder    aBuildTool;
+  aBuildTool.MakeCompound (aCompound);
+  for (Standard_Integer aLabIter = 1; aLabIter <= aLabels.Length(); ++aLabIter)
+  {
+    TopoDS_Shape     aShape;
+    const TDF_Label& aLabel = aLabels.Value (aLabIter);
+    if (XCAFDoc_ShapeTool::GetShape (aLabel, aShape))
+    {
+      aBuildTool.Add (aCompound, aShape);
+    }
+  }
+  
+  Handle(Prs3d_Drawer) aDrawer = myContext->DefaultDrawer();
+  Standard_Real aDeflection = Prs3d::GetDeflection (aCompound, aDrawer);
+  if (!BRepTools::Triangulation (aCompound, aDeflection))
+  {
+    BRepMesh_IncrementalMesh anAlgo;
+    anAlgo.ChangeParameters().Deflection = aDeflection;
+    anAlgo.ChangeParameters().Angle = aDrawer->HLRAngle();
+    anAlgo.ChangeParameters().InParallel = Standard_True;
+    anAlgo.SetShape     (aCompound);
+    anAlgo.Perform();
+  }
+  
+  // clear presentations
+  clearContext();
+  
+  // create presentations
+  MapOfPrsForShapes aMapOfShapes;
+  XCAFPrs_Style aDefStyle;
+  aDefStyle.SetColorSurf (Quantity_NOC_GRAY65);
+  aDefStyle.SetColorCurv (Quantity_NOC_GRAY65);
+  for (Standard_Integer aLabIter = 1; aLabIter <= aLabels.Length(); ++aLabIter)
+  {
+    const TDF_Label& aLabel = aLabels.Value (aLabIter);
+    displayWithChildren (*aShapeTool, *aColorTool, aLabel, TopLoc_Location(), aDefStyle, "", aMapOfShapes);
+  }
+  
+  return true;
+}
+
+// =======================================================================
+// function : displayWithChildren
+// purpose  :
+// =======================================================================
+void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeTool,
+                                      XCAFDoc_ColorTool&             theColorTool,
+                                      const TDF_Label&               theLabel,
+                                      const TopLoc_Location&         theParentTrsf,
+                                      const XCAFPrs_Style&           theParentStyle,
+                                      const TCollection_AsciiString& theParentId,
+                                      MapOfPrsForShapes&             theMapOfShapes)
+{
+  TDF_Label aRefLabel = theLabel;
+  if (theShapeTool.IsReference (theLabel))
+  {
+    theShapeTool.GetReferredShape (theLabel, aRefLabel);
+  }
+  
+  TCollection_AsciiString anEntry;
+  TDF_Tool::Entry (theLabel, anEntry);
+  if (!theParentId.IsEmpty())
+  {
+    anEntry = theParentId + "\n" + anEntry;
+  }
+  anEntry += ".";
+  
+  if (!theShapeTool.IsAssembly (aRefLabel))
+  {
+    Handle(AIS_InteractiveObject) anAis;
+    if (!theMapOfShapes.Find (aRefLabel, anAis))
+    {
+      anAis = new CafShapePrs (aRefLabel, theParentStyle, Graphic3d_NOM_SHINY_PLASTIC);
+      theMapOfShapes.Bind (aRefLabel, anAis);
+    }
+    
+    Handle(TCollection_HAsciiString) anId      = new TCollection_HAsciiString (anEntry);
+    Handle(AIS_ConnectedInteractive) aConnected = new AIS_ConnectedInteractive();
+    aConnected->Connect (anAis, theParentTrsf.Transformation());
+    aConnected->SetOwner (anId);
+    aConnected->SetLocalTransformation (theParentTrsf.Transformation());
+    aConnected->SetHilightMode(1);
+    myContext->Display  (aConnected, Standard_False);
+    return;
+  }
+  
+  XCAFPrs_Style aDefStyle = theParentStyle;
+  Quantity_Color aColor;
+  if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorGen, aColor))
+  {
+    aDefStyle.SetColorCurv (aColor);
+    aDefStyle.SetColorSurf (aColor);
+  }
+  if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorSurf, aColor))
+  {
+    aDefStyle.SetColorSurf (aColor);
+  }
+  if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorCurv, aColor))
+  {
+    aDefStyle.SetColorCurv (aColor);
+  }
+  
+  for (TDF_ChildIterator childIter (aRefLabel); childIter.More(); childIter.Next())
+  {
+    TDF_Label aLabel = childIter.Value();
+    if (!aLabel.IsNull()
+        && (aLabel.HasAttribute() || aLabel.HasChild()))
+    {
+      TopLoc_Location aTrsf = theParentTrsf * theShapeTool.GetLocation (aLabel);
+      displayWithChildren (theShapeTool, theColorTool, aLabel, aTrsf, aDefStyle, anEntry, theMapOfShapes);
+    }
+  }
+}
+
+// =======================================================================
+// function : clearSession
+// purpose  :
+// =======================================================================
+void OcctViewer::clearSession (const Handle(XSControl_WorkSession)& theSession)
+{
+  if (theSession.IsNull())
+  {
+    return;
+  }
+  
+  Handle(Transfer_TransientProcess) aMapReader = theSession->TransferReader()->TransientProcess();
+  if (!aMapReader.IsNull())
+  {
+    aMapReader->Clear();
+  }
+  
+  Handle(XSControl_TransferReader) aTransferReader = theSession->TransferReader();
+  if (!aTransferReader.IsNull())
+  {
+    aTransferReader->Clear(1);
+  }
+}
+
+// =======================================================================
+// function : clearContext
+// purpose  :
+// =======================================================================
+void OcctViewer::clearContext ()
+{
+  if (!myContext.IsNull())
+  {
+    myContext->ClearSelected(Standard_False);
+    myContext->RemoveAll(Standard_False);
+  }
+}
diff --git a/samples/ios/UIKitSample/UIKitSample/ViewController.h b/samples/ios/UIKitSample/UIKitSample/ViewController.h
new file mode 100644 (file)
index 0000000..a3b07d3
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  ViewController.h
+//  UIKitSample
+//
+//  Created by aan on 21/11/16.
+//  Copyright © 2016 aan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UIViewController
+
+
+@end
+
diff --git a/samples/ios/UIKitSample/UIKitSample/ViewController.m b/samples/ios/UIKitSample/UIKitSample/ViewController.m
new file mode 100644 (file)
index 0000000..01acdab
--- /dev/null
@@ -0,0 +1,30 @@
+//
+//  ViewController.m
+//  UIKitSample
+//
+//  Created by aan on 21/11/16.
+//  Copyright © 2016 aan. All rights reserved.
+//
+
+#import "ViewController.h"
+#include "OcctViewer.h"
+
+@interface ViewController ()
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view, typically from a nib.
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+
+@end
diff --git a/samples/ios/UIKitSample/UIKitSample/main.mm b/samples/ios/UIKitSample/UIKitSample/main.mm
new file mode 100644 (file)
index 0000000..85e2f4d
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (c) 2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[])
+{
+  @autoreleasepool
+  {
+        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+  }
+}