Skip to content

Commit

Permalink
🎨 renaming viewer -> view
Browse files Browse the repository at this point in the history
  • Loading branch information
rastapasta committed Apr 15, 2017
1 parent 8bc25eb commit 2cd597d
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 60 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@

# react-native-gl-model-viewer
# react-native-gl-model-view

## Getting started

`$ npm install react-native-gl-model-viewer --save`
`$ npm install react-native-gl-model-view --save`

### Mostly automatic installation

`$ react-native link react-native-gl-model-viewer`
`$ react-native link react-native-gl-model-view`

### Manual installation


#### iOS

1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
2. Go to `node_modules``react-native-gl-model-viewer` and add `RNGLModelViewer.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNGLModelViewer.a` to your project's `Build Phases``Link Binary With Libraries`
2. Go to `node_modules``react-native-gl-model-view` and add `RNGLModelView.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNGLModelView.a` to your project's `Build Phases``Link Binary With Libraries`

## Usage
```javascript
import RNGLModelViewer from 'react-native-gl-model-viewer';
import RNGLModelView from 'react-native-gl-model-view';

// TODO: What to do with the module?
RNGLModelViewer;
RNGLModelView;
```

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { NativeModules } from 'react-native';

const { RNGLModelViewer } = NativeModules;
const { RNGLModelView } = NativeModules;

export default RNGLModelViewer;
export default RNGLModelView;
10 changes: 5 additions & 5 deletions ios/RNGLModelViewer.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// react-native-gl-model-viewer
// https://github.com/rastapasta/react-native-gl-model-viewer
// react-native-gl-model-view
// https://github.com/rastapasta/react-native-gl-model-view
//
// RNGLModelViewer.m
// RNGLModelView.m
//

#import "RNGLModelViewer.h"
#import "RNGLModelView.h"

@implementation RNGLModelViewer
@implementation RNGLModelView

- (void)didMoveToWindow
{
Expand Down
8 changes: 4 additions & 4 deletions ios/RNGLModelViewer.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// react-native-gl-model-viewer
// https://github.com/rastapasta/react-native-gl-model-viewer
// react-native-gl-model-view
// https://github.com/rastapasta/react-native-gl-model-view
//
// RNGLModelViewer.h
// RNGLModelView.h
//

#import <GLView/GLModelView.h>

@interface RNGLModelViewer : GLModelView
@interface RNGLModelView : GLModelView

@property (nonatomic, assign) BOOL animated;

Expand Down
8 changes: 4 additions & 4 deletions ios/RNGLModelViewer.podspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

Pod::Spec.new do |s|
s.name = "RNGLModelViewer"
s.name = "RNGLModelView"
s.version = "1.0.0"
s.summary = "React Native native bridge to GLView - display and animate Wavefront .OBJ 3D models"
s.description = <<-DESC
react-native-gl-model-viewer
react-native-gl-model-view
DESC
s.homepage = ""
s.license = "MIT"
s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "author" => "Michael Straßburger <[email protected]>" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/rastaoasta/react-native-gl-model-viewer.git", :tag => "master" }
s.source_files = "RNGLModelViewer/**/*.{h,m}"
s.source = { :git => "https://github.com/rastaoasta/react-native-gl-model-view.git", :tag => "master" }
s.source_files = "RNGLModelView/**/*.{h,m}"
s.requires_arc = true

s.dependency "React"
Expand Down
36 changes: 18 additions & 18 deletions ios/RNGLModelViewer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
B3E7B58A1CC2AC0600A0062D /* RNGLModelViewer.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNGLModelViewer.m */; };
B3E7B58A1CC2AC0600A0062D /* RNGLModelView.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNGLModelView.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -23,9 +23,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libRNGLModelViewer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNGLModelViewer.a; sourceTree = BUILT_PRODUCTS_DIR; };
B3E7B5881CC2AC0600A0062D /* RNGLModelViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNGLModelViewer.h; sourceTree = "<group>"; };
B3E7B5891CC2AC0600A0062D /* RNGLModelViewer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNGLModelViewer.m; sourceTree = "<group>"; };
134814201AA4EA6300B7C361 /* libRNGLModelView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNGLModelView.a; sourceTree = BUILT_PRODUCTS_DIR; };
B3E7B5881CC2AC0600A0062D /* RNGLModelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNGLModelView.h; sourceTree = "<group>"; };
B3E7B5891CC2AC0600A0062D /* RNGLModelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNGLModelView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -42,26 +42,26 @@
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
children = (
134814201AA4EA6300B7C361 /* libRNGLModelViewer.a */,
134814201AA4EA6300B7C361 /* libRNGLModelView.a */,
);
name = Products;
sourceTree = "<group>";
};
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
B3E7B5881CC2AC0600A0062D /* RNGLModelViewer.h */,
B3E7B5891CC2AC0600A0062D /* RNGLModelViewer.m */,
B3E7B5881CC2AC0600A0062D /* RNGLModelView.h */,
B3E7B5891CC2AC0600A0062D /* RNGLModelView.m */,
134814211AA4EA7D00B7C361 /* Products */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* RNGLModelViewer */ = {
58B511DA1A9E6C8500147676 /* RNGLModelView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNGLModelViewer" */;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNGLModelView" */;
buildPhases = (
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
Expand All @@ -71,9 +71,9 @@
);
dependencies = (
);
name = RNGLModelViewer;
name = RNGLModelView;
productName = RCTDataManager;
productReference = 134814201AA4EA6300B7C361 /* libRNGLModelViewer.a */;
productReference = 134814201AA4EA6300B7C361 /* libRNGLModelView.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
Expand All @@ -90,7 +90,7 @@
};
};
};
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNGLModelViewer" */;
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNGLModelView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
Expand All @@ -102,7 +102,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
58B511DA1A9E6C8500147676 /* RNGLModelViewer */,
58B511DA1A9E6C8500147676 /* RNGLModelView */,
);
};
/* End PBXProject section */
Expand All @@ -112,7 +112,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B3E7B58A1CC2AC0600A0062D /* RNGLModelViewer.m in Sources */,
B3E7B58A1CC2AC0600A0062D /* RNGLModelView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -204,7 +204,7 @@
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNGLModelViewer;
PRODUCT_NAME = RNGLModelView;
SKIP_INSTALL = YES;
};
name = Debug;
Expand All @@ -220,15 +220,15 @@
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNGLModelViewer;
PRODUCT_NAME = RNGLModelView;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNGLModelViewer" */ = {
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNGLModelView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511ED1A9E6C8500147676 /* Debug */,
Expand All @@ -237,7 +237,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNGLModelViewer" */ = {
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNGLModelView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511F01A9E6C8500147676 /* Debug */,
Expand Down
10 changes: 5 additions & 5 deletions ios/RNGLModelViewerManager.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// react-native-gl-model-viewer
// https://github.com/rastapasta/react-native-gl-model-viewer
// react-native-gl-model-View
// https://github.com/rastapasta/react-native-gl-model-view
//
// RNGLModelViewerManager.h
// RNGLModelViewManager.h
//

#if __has_include("RCTViewManager.h")
Expand All @@ -11,8 +11,8 @@
#import <React/RCTViewManager.h>
#endif

#import "RNGLModelViewer.h"
#import "RNGLModelView.h"

@interface RNGLModelViewerManager : RCTViewManager
@interface RNGLModelViewManager : RCTViewManager

@end
24 changes: 12 additions & 12 deletions ios/RNGLModelViewerManager.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// react-native-gl-model-viewer
// https://github.com/rastapasta/react-native-gl-model-viewer
// react-native-gl-model-view
// https://github.com/rastapasta/react-native-gl-model-view
//
// RNGLModelViewerManager.m
// RNGLModelViewManager.m
//

#if __has_include("RCTBridge.h")
Expand All @@ -11,19 +11,19 @@
#import <React/RCTBridge.h>
#endif

#import "RNGLModelViewerManager.h"
#import "RNGLModelViewManager.h"

@implementation RNGLModelViewerManager
@implementation RNGLModelViewManager
{
RNGLModelViewer *glModelViewer;
RNGLModelView *glModelView;
}

RCT_EXPORT_MODULE()

- (UIView *)view
{
glModelViewer = [[RNGLModelViewer alloc] init];
return glModelViewer;
glModelView = [[RNGLModelView alloc] init];
return glModelView;
}

RCT_EXPORT_VIEW_PROPERTY(rotateX, CGFloat);
Expand All @@ -41,19 +41,19 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(translateZ, CGFloat);

// Loads a model - Wavefront (OBJ) or WWDC2010 model format
RCT_CUSTOM_VIEW_PROPERTY(model, NSString, RNGLModelViewer)
RCT_CUSTOM_VIEW_PROPERTY(model, NSString, RNGLModelView)
{
view.model = [GLModel modelWithContentsOfFile:[RCTConvert NSString:json]];
}

// Loads a texture - PVR + all formats supported by UIImage
RCT_CUSTOM_VIEW_PROPERTY(texture, NSString, RNGLModelViewer)
RCT_CUSTOM_VIEW_PROPERTY(texture, NSString, RNGLModelView)
{
view.texture = [GLImage imageNamed:[RCTConvert NSString:json]];
}

// Starts or stops the animation loop to automatically re-render each 1/60 second
RCT_CUSTOM_VIEW_PROPERTY(animate, BOOL, RNGLModelViewer)
RCT_CUSTOM_VIEW_PROPERTY(animate, BOOL, RNGLModelView)
{
view.animated = [RCTConvert BOOL:json];
if (view.animated) {
Expand All @@ -66,7 +66,7 @@ - (UIView *)view
// Applys the current props and rerenders the scene
RCT_EXPORT_METHOD(render)
{
[glModelViewer display];
[glModelView display];
}

@end
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{
"name": "react-native-gl-model-viewer",
"name": "react-native-gl-model-view",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand All @@ -9,15 +9,15 @@
},
"repository": {
"type": "git",
"url": "https://github.com/rastapasta/react-native-gl-model-viewer.git"
"url": "https://github.com/rastapasta/react-native-gl-model-view.git"
},
"keywords": [
"react-native",
"native",
"bridge",
"opengl",
"model",
"viewer"
"View"
],
"author": "Michael Straßburger <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 2cd597d

Please sign in to comment.