Skip to content

Commit

Permalink
Same thing again
Browse files Browse the repository at this point in the history
  • Loading branch information
cochrane committed May 6, 2024
1 parent 7800236 commit 443ae13
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 63 deletions.
10 changes: 4 additions & 6 deletions GLLara.xcodeproj/project.pbxproj
Expand Up @@ -22,7 +22,7 @@
5214471116DE22E1003E260F /* GLLara.help in Resources */ = {isa = PBXBuildFile; fileRef = 5214471016DE22E0003E260F /* GLLara.help */; };
52152CEF16B66951001AE54C /* GLLDDSFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52152CEE16B66951001AE54C /* GLLDDSFile.swift */; };
52232EAE1EFC57D4007FE9AD /* XYAlignedSquare.obj in Resources */ = {isa = PBXBuildFile; fileRef = 52232EAD1EFC57D4007FE9AD /* XYAlignedSquare.obj */; };
5224C8EE15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.m */; };
5224C8EE15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.swift */; };
5224C8F015FABC92002A6C76 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5224C8EF15FABC92002A6C76 /* Accelerate.framework */; };
5227833F1C0A6074002E43FD /* GLLNoSelectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 522783411C0A6074002E43FD /* GLLNoSelectionView.xib */; };
522783421C0A6079002E43FD /* GLLPoseExportViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 522783441C0A6079002E43FD /* GLLPoseExportViewController.xib */; };
Expand Down Expand Up @@ -411,8 +411,7 @@
5214471016DE22E0003E260F /* GLLara.help */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GLLara.help; sourceTree = "<group>"; };
52152CEE16B66951001AE54C /* GLLDDSFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GLLDDSFile.swift; sourceTree = "<group>"; };
52232EAD1EFC57D4007FE9AD /* XYAlignedSquare.obj */ = {isa = PBXFileReference; lastKnownFileType = text; name = XYAlignedSquare.obj; path = Shaders/XYAlignedSquare.obj; sourceTree = "<group>"; };
5224C8EC15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLLAngleRangeValueTransformer.h; sourceTree = "<group>"; };
5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLLAngleRangeValueTransformer.m; sourceTree = "<group>"; };
5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GLLAngleRangeValueTransformer.swift; sourceTree = "<group>"; };
5224C8EF15FABC92002A6C76 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
522783661C0A60E6002E43FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
522783671C0A60E6002E43FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/GLLRenderWindowController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1443,8 +1442,7 @@
52D6A09515F8B0F7002A0BB4 /* GLLMeshViewController.m */,
522783591C0A609B002E43FD /* GLLMeshView.xib */,
522783561C0A6096002E43FD /* GLLLightView.xib */,
5224C8EC15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.h */,
5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.m */,
5224C8ED15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.swift */,
52C9F60B15FF1752003272E1 /* GLLItemViewController.h */,
52C9F60C15FF1752003272E1 /* GLLItemViewController.m */,
522783531C0A6091002E43FD /* GLLItemView.xib */,
Expand Down Expand Up @@ -1879,7 +1877,7 @@
52D6A09715F8B0F7002A0BB4 /* GLLMeshViewController.m in Sources */,
52CDFEA82874161400BC4298 /* GLLVertexAttrib.swift in Sources */,
52BB217D15F972AB00937450 /* GLLSceneModel.xcdatamodeld in Sources */,
5224C8EE15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.m in Sources */,
5224C8EE15FA8FB0002A6C76 /* GLLAngleRangeValueTransformer.swift in Sources */,
5274448228031C0C00E5A3FD /* GLLModelDrawData.swift in Sources */,
52BB21C815FC732A00937450 /* GLLRenderParameter.m in Sources */,
521102EF2899C430001BE4BC /* GLLItemBoneExtensions.swift in Sources */,
Expand Down
17 changes: 0 additions & 17 deletions GLLara/GLLAngleRangeValueTransformer.h

This file was deleted.

39 changes: 0 additions & 39 deletions GLLara/GLLAngleRangeValueTransformer.m

This file was deleted.

38 changes: 38 additions & 0 deletions GLLara/GLLAngleRangeValueTransformer.swift
@@ -0,0 +1,38 @@
//
// GLLAngleRangeValueTransformer.m
// GLLara
//
// Created by Torsten Kammer on 07.09.12.
// Copyright (c) 2012 Torsten Kammer. All rights reserved.
//
import Foundation

/*
* Exactly what it says on the tin.
* The idea is that rotations are stored from 0…2pi here, but for sliders, you really want -pi…+pi instead. This transformer solves that issue.
*/
@objc class GLLAngleRangeValueTransformer: ValueTransformer {
@objc override class func allowsReverseTransformation() -> Bool {
return true
}
@objc override class func transformedValueClass() -> AnyClass {
return NSNumber.self
}

override func transformedValue(_ value: Any?) -> Any? {
let double = (value as! NSNumber).doubleValue
if double > Double.pi {
return double - Double.pi * 2
} else {
return double
}
}

override func reverseTransformedValue(_ value: Any?) -> Any? {
let double = (value as! NSNumber).doubleValue
if double < 0.0 {
return double + Double.pi * 2
} else {
return double
} }
}
1 change: 0 additions & 1 deletion GLLara/GLLDocument.m
Expand Up @@ -10,7 +10,6 @@

#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>

#import "GLLAngleRangeValueTransformer.h"
#import "GLLCamera.h"
#import "GLLDocumentWindowController.h"
#import "GLLItem.h"
Expand Down

0 comments on commit 443ae13

Please sign in to comment.