]> OCCT Git - occt-copy.git/commitdiff
0032013: Samples - iOS sample compilation errors
authorkgv <kgv@opencascade.com>
Mon, 21 Dec 2020 14:14:49 +0000 (17:14 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 23 Dec 2020 16:45:33 +0000 (19:45 +0300)
Added missing includes.
Fixed usage of obsolete Standard_Failure interface.
Fixed file headers.

14 files changed:
samples/ios/UIKitSample/UIKitSample/AppDelegate.h
samples/ios/UIKitSample/UIKitSample/AppDelegate.mm
samples/ios/UIKitSample/UIKitSample/CafShapePrs.h
samples/ios/UIKitSample/UIKitSample/GLView.h
samples/ios/UIKitSample/UIKitSample/GLView.mm
samples/ios/UIKitSample/UIKitSample/GLViewController.h
samples/ios/UIKitSample/UIKitSample/GLViewController.mm
samples/ios/UIKitSample/UIKitSample/OcctDocument.h
samples/ios/UIKitSample/UIKitSample/OcctDocument.mm
samples/ios/UIKitSample/UIKitSample/OcctViewer.h
samples/ios/UIKitSample/UIKitSample/OcctViewer.mm
samples/ios/UIKitSample/UIKitSample/ViewController.h
samples/ios/UIKitSample/UIKitSample/ViewController.m
samples/ios/UIKitSample/UIKitSample/main.mm

index 09134faa85ae3855a4de2760f2ad01cc4965d20d..b63c6a2952c10f7c7a091412fb82266a94b0edfc 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <UIKit/UIKit.h>
 
@@ -20,4 +28,3 @@
 @property (strong, nonatomic) UIWindow *window;
 
 @end
-
index b6e2df383891f0c08c003265b762b767a4412893..7e81296a0e7b4caf4475dde23eca0a390e93fd32 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import "AppDelegate.h"
 
 
 - (BOOL)application:(UIApplication *)theApplication didFinishLaunchingWithOptions:(NSDictionary *)theLaunchOptions {
   // Override point for customization after application launch.
-    
-    CGRect screenBounds = [[UIScreen mainScreen] bounds];
+
+  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;
+  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:.
 }
index f470dc21b7d16f981b0c6e7fb80e33e1df1e1837..3e83986ce366e560ec1d9fcb52b22a78fc99cfc3 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #ifndef CafShapePrs_h
 #define CafShapePrs_h
@@ -25,40 +33,34 @@ typedef NCollection_DataMap<TDF_Label, Handle(AIS_InteractiveObject), TDF_LabelM
 //! Interactive object for shape in DECAF document
 class CafShapePrs : public XCAFPrs_AISObject
 {
-  
+  DEFINE_STANDARD_RTTIEXT(CafShapePrs, 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
index fc47bab31a0bd1355cd144a484badb88535bcaa2..0e90b2d02f50fb7fabc840fae4a03027226f6a3d 100644 (file)
@@ -1,34 +1,43 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #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
+//! OpenGL view
 @interface GLView : UIView {
-  
+
 @public
   GLViewController* myController;
-  
+
   EAGLContext* myGLContext;
-  
+
   int myBackingWidth;
   int myBackingHeight;
   GLuint myFrameBuffer;
@@ -37,4 +46,5 @@
 }
 
 @end
+
 #endif // GLView_h
index 78881144caeca08c865134ecddb8928d3a6c4e10..3e61a002d3cfef19a97970b543e65e40f69a25bb 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <Foundation/Foundation.h>
 
 {
   EAGLRenderingAPI aRendApi = kEAGLRenderingAPIOpenGLES2;
   myGLContext = [[EAGLContext alloc] initWithAPI:aRendApi];
-  if (!myGLContext) {
-    NSLog(@"Failed to initialize OpenGLES 2.0 context");
+  if (!myGLContext)
+  {
+    NSLog(@"Failed to initialize OpenGL ES 2.0 context");
   }
-  
-  if (![EAGLContext setCurrentContext:myGLContext]) {
-    NSLog(@"Failed to set current OpenGL context");
+
+  if (![EAGLContext setCurrentContext:myGLContext])
+  {
+    NSLog(@"Failed to set current OpenGL ES context");
   }
 }
 
   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);
 - (void) drawView
 {
   glBindFramebuffer(GL_FRAMEBUFFER, myFrameBuffer);
-  
+
   [myController Draw];
-  
+
   glBindRenderbuffer(GL_RENDERBUFFER, myRenderBuffer);
   [myGLContext presentRenderbuffer:GL_RENDERBUFFER];
 }
 - (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];
 }
 
 - (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;
 }
 
index cc4bf4bbd0d191a768ce01e65f763ec4aa2bda49..7f8f068221072ecf021427d338f176af037e66e4 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #ifndef GLViewController_h
 #define GLViewController_h
 
 #import "OcctViewer.h"
 
-//! Open GL view controller
+//! OpenGL view controller
 @interface GLViewController : UIViewController {
   OcctViewer* myOcctViewer;
-  
   CGPoint myFirstTouch[2];
 }
 
@@ -29,4 +36,5 @@
 -(void) Setup;
 
 @end
+
 #endif // GLViewController_h
index 4c713d36cb1b59e3663af8c28600dbad8110dceb..2021a81a2d29f07543b2938da090a2646f23ec8b 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <Foundation/Foundation.h>
 
index d9293776361f336abae590be9dc8a410d9e16bdc..f85acf12dd6d022f147f5aa65aa2724269b71154 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #ifndef OcctDocument_h
 #define OcctDocument_h
@@ -24,19 +32,18 @@ class OcctDocument : public 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; }
-  
+
+  Handle(TDocStd_Document)& ChangeDocument() { return myOcafDoc; }
+
+  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
index 8d33b78ed89b77c7ebe7629b8bd2b5e1f09bd2b0..6adfe78b7f16f14584ed5c1ea42222b7d6006efe 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <Foundation/Foundation.h>
 
@@ -29,18 +37,19 @@ IMPLEMENT_STANDARD_RTTIEXT(OcctDocument, Standard_Transient)
 // =======================================================================
 OcctDocument::OcctDocument()
 {
-  try {
+  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);
+  }
+  catch (const Standard_Failure& theFailure)
+  {
+    Message::SendFail (TCollection_AsciiString("Error in creating application") + theFailure.GetMessageString());
   }
 }
 
 // =======================================================================
-// function : OcctDocument
+// function : ~OcctDocument
 // purpose  :
 // =======================================================================
 OcctDocument::~OcctDocument()
@@ -60,23 +69,18 @@ void OcctDocument::InitDoc()
     {
       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);
   }
 }
-
-
-
index 69120f112078d10d8c3708303a952920a6b90fa7..de7baa3ec05163158a801b454f59a9556ea7db7c 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #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 <V3d_View.hxx>
+#include <V3d_Viewer.hxx>
 #include <XSControl_WorkSession.hxx>
 #include <XCAFDoc_ShapeTool.hxx>
 #include <XCAFDoc_ColorTool.hxx>
 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,
@@ -86,12 +92,12 @@ private:
                             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(V3d_Viewer)              myViewer;  //!< main viewer
+  Handle(V3d_View)                myView;    //!< main view
+  Handle(AIS_InteractiveContext)  myContext; //!< interactive context containing displayed objects
   Handle(OcctDocument)            myDoc;
 };
 
index 277646aaa3b5c1d70a80ed6ec4e3abcd67f64953..de4eff8c3a5209c3f20a641f912fc54586a6c95c 100644 (file)
@@ -1,21 +1,30 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #include "OcctViewer.h"
 #include "OcctDocument.h"
 
+#include <OpenGl_GraphicDriver.hxx>
+
 #include <AIS_ConnectedInteractive.hxx>
-#include <AIS_Shape.hxx>
 #include <Aspect_DisplayConnection.hxx>
 #include <BRep_Builder.hxx>
 #include <BRepMesh_IncrementalMesh.hxx>
@@ -23,9 +32,8 @@
 #include <Cocoa_Window.hxx>
 #include <Message.hxx>
 #include <Message_Messenger.hxx>
-#include <OpenGl_GraphicDriver.hxx>
-#include <StdPrs_ToolTriangulatedShape.hxx>
 #include <Prs3d_Drawer.hxx>
+#include <StdPrs_ToolTriangulatedShape.hxx>
 #include <STEPControl_Reader.hxx>
 #include <STEPCAFControl_Reader.hxx>
 #include <TDF_Tool.hxx>
@@ -82,40 +90,37 @@ bool OcctViewer::InitViewer (UIView* theWin)
     release();
     return false;
   }
-  
   if (!myView.IsNull())
   {
     myView->MustBeResized();
     myView->Invalidate();
+    return true;
   }
-  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())
   {
-    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();
+    aCocoaWindow->Map();
   }
-  
+
+  myView->Redraw();
+  myView->MustBeResized();
   return true;
 }
 
@@ -212,11 +217,12 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
 {
   // create a new document
   myDoc->InitDoc();
-  
+
   STEPCAFControl_Reader aReader;
   Handle(XSControl_WorkSession) aSession = aReader.Reader().WS();
-  
-  try {
+
+  try
+  {
     if (!aReader.ReadFile (theFilename.c_str()))
     {
       clearSession (aSession);
@@ -228,20 +234,22 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
       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);
+  }
+  catch (const Standard_Failure& theFailure)
+  {
+    Message::SendFail (TCollection_AsciiString ("Exception raised during STEP import\n[")
+                     + theFailure.GetMessageString() + "]\n" + theFilename.c_str());
     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;
@@ -255,7 +263,7 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
       aBuildTool.Add (aCompound, aShape);
     }
   }
-  
+
   Handle(Prs3d_Drawer) aDrawer = myContext->DefaultDrawer();
   Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection (aCompound, aDrawer);
   if (!BRepTools::Triangulation (aCompound, aDeflection))
@@ -264,13 +272,13 @@ bool OcctViewer::ImportSTEP(std::string theFilename)
     anAlgo.ChangeParameters().Deflection = aDeflection;
     anAlgo.ChangeParameters().Angle = aDrawer->DeviationAngle();
     anAlgo.ChangeParameters().InParallel = Standard_True;
-    anAlgo.SetShape     (aCompound);
+    anAlgo.SetShape (aCompound);
     anAlgo.Perform();
   }
-  
+
   // clear presentations
   clearContext();
-  
+
   // create presentations
   MapOfPrsForShapes aMapOfShapes;
   XCAFPrs_Style aDefStyle;
@@ -302,7 +310,7 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeToo
   {
     theShapeTool.GetReferredShape (theLabel, aRefLabel);
   }
-  
+
   TCollection_AsciiString anEntry;
   TDF_Tool::Entry (theLabel, anEntry);
   if (!theParentId.IsEmpty())
@@ -310,7 +318,7 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeToo
     anEntry = theParentId + "\n" + anEntry;
   }
   anEntry += ".";
-  
+
   if (!theShapeTool.IsAssembly (aRefLabel))
   {
     Handle(AIS_InteractiveObject) anAis;
@@ -319,8 +327,8 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeToo
       anAis = new CafShapePrs (aRefLabel, theParentStyle, Graphic3d_NameOfMaterial_ShinyPlastified);
       theMapOfShapes.Bind (aRefLabel, anAis);
     }
-    
-    Handle(TCollection_HAsciiString) anId      = new TCollection_HAsciiString (anEntry);
+
+    Handle(TCollection_HAsciiString) anId       = new TCollection_HAsciiString (anEntry);
     Handle(AIS_ConnectedInteractive) aConnected = new AIS_ConnectedInteractive();
     aConnected->Connect (anAis, theParentTrsf.Transformation());
     aConnected->SetOwner (anId);
@@ -329,7 +337,7 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeToo
     myContext->Display  (aConnected, Standard_False);
     return;
   }
-  
+
   XCAFPrs_Style aDefStyle = theParentStyle;
   Quantity_Color aColor;
   if (theColorTool.GetColor (aRefLabel, XCAFDoc_ColorGen, aColor))
@@ -345,7 +353,7 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool&             theShapeToo
   {
     aDefStyle.SetColorCurv (aColor);
   }
-  
+
   for (TDF_ChildIterator childIter (aRefLabel); childIter.More(); childIter.Next())
   {
     TDF_Label aLabel = childIter.Value();
@@ -368,13 +376,13 @@ void OcctViewer::clearSession (const Handle(XSControl_WorkSession)& theSession)
   {
     return;
   }
-  
+
   Handle(Transfer_TransientProcess) aMapReader = theSession->TransferReader()->TransientProcess();
   if (!aMapReader.IsNull())
   {
     aMapReader->Clear();
   }
-  
+
   Handle(XSControl_TransferReader) aTransferReader = theSession->TransferReader();
   if (!aTransferReader.IsNull())
   {
@@ -386,7 +394,7 @@ void OcctViewer::clearSession (const Handle(XSControl_WorkSession)& theSession)
 // function : clearContext
 // purpose  :
 // =======================================================================
-void OcctViewer::clearContext ()
+void OcctViewer::clearContext()
 {
   if (!myContext.IsNull())
   {
index a3b07d3798422de1e5a257cd6d14f82872888a39..004fc808eee96aa189d2fad8e7bcce6b71fed295 100644 (file)
@@ -1,15 +1,26 @@
+// Copyright (c) 2016 OPEN CASCADE SAS
 //
-//  ViewController.h
-//  UIKitSample
+// This file is part of the examples of the Open CASCADE Technology software library.
 //
-//  Created by aan on 21/11/16.
-//  Copyright © 2016 aan. All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <UIKit/UIKit.h>
 
 @interface ViewController : UIViewController
 
-
 @end
-
index 01acdabf2d7ceb432ea5a61a3600efe4d0acb114..e019f32f05a49acf98d69bcfbf335646a64b06f5 100644 (file)
@@ -1,12 +1,26 @@
+// Copyright (c) 2016 OPEN CASCADE SAS
 //
-//  ViewController.m
-//  UIKitSample
+// This file is part of the examples of the Open CASCADE Technology software library.
 //
-//  Created by aan on 21/11/16.
-//  Copyright © 2016 aan. All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import "ViewController.h"
+
 #include "OcctViewer.h"
 
 @interface ViewController ()
 @implementation ViewController
 
 - (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view, typically from a nib.
+  [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.
+  [super didReceiveMemoryWarning];
+  // Dispose of any resources that can be recreated.
 }
 
-
 @end
index 85e2f4d84d32fea25ecdff3a4733c611aec0d52b..7e27d76391f220f9883627cb4bc7d3de44773f33 100644 (file)
@@ -1,15 +1,23 @@
 // Copyright (c) 2017 OPEN CASCADE SAS
 //
-// This file is part of Open CASCADE Technology software library.
+// This file is part of the examples of the 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.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
 //
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 #import <UIKit/UIKit.h>
 
@@ -19,6 +27,6 @@ int main(int argc, char * argv[])
 {
   @autoreleasepool
   {
-        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
   }
 }