Very early KRWorldBuilder scaffolding in progress.
New KRVector3 math functions --HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4058
This commit is contained in:
@@ -43,6 +43,16 @@
|
||||
E46DBE801512AF4600D59F86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E491016413C99B9E0098455B /* Foundation.framework */; };
|
||||
E46DBE811512AFE600D59F86 /* KRMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = E49E79FC15126146009CF99C /* KRMesh.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
E46DBE851512B9FA00D59F86 /* KREngine-common.h in Headers */ = {isa = PBXBuildFile; fileRef = E46DBE841512B9E200D59F86 /* KREngine-common.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
E46F4A00155DF46700CCF8B8 /* KRWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F49FF155DF46700CCF8B8 /* KRWorld.h */; };
|
||||
E46F4A01155DF46700CCF8B8 /* KRWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F49FF155DF46700CCF8B8 /* KRWorld.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
E46F4A04155DF47C00CCF8B8 /* KRWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A03155DF47C00CCF8B8 /* KRWorld.cpp */; };
|
||||
E46F4A05155DF47C00CCF8B8 /* KRWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A03155DF47C00CCF8B8 /* KRWorld.cpp */; };
|
||||
E46F4A09155DF6E400CCF8B8 /* KRWorld.cpp in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A03155DF47C00CCF8B8 /* KRWorld.cpp */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
E46F4A0B155E002100CCF8B8 /* KRDataBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */; };
|
||||
E46F4A0C155E002100CCF8B8 /* KRDataBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */; };
|
||||
E46F4A0E155E003000CCF8B8 /* KRDataBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */; };
|
||||
E46F4A0F155E003000CCF8B8 /* KRDataBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */; };
|
||||
E46F4A10155E004100CCF8B8 /* KRDataBlock.cpp in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
E47C25A213F4F65A00FF4370 /* KRShaderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E47C25A113F4F65A00FF4370 /* KRShaderManager.h */; };
|
||||
E47C25A513F4F66F00FF4370 /* KRShader.h in Headers */ = {isa = PBXBuildFile; fileRef = E47C25A413F4F66F00FF4370 /* KRShader.h */; };
|
||||
E47C25A713F4F6AB00FF4370 /* KRShaderManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47C25A613F4F6AB00FF4370 /* KRShaderManager.cpp */; };
|
||||
@@ -170,6 +180,10 @@
|
||||
E46C214A15364DEC009CABF3 /* KRSceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRSceneManager.cpp; path = Classes/KRSceneManager.cpp; sourceTree = "<group>"; };
|
||||
E46DBE7D1512AD4900D59F86 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; };
|
||||
E46DBE841512B9E200D59F86 /* KREngine-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "KREngine-common.h"; path = "Classes/KREngine-common.h"; sourceTree = "<group>"; };
|
||||
E46F49FF155DF46700CCF8B8 /* KRWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRWorld.h; path = Classes/KRWorld.h; sourceTree = "<group>"; };
|
||||
E46F4A03155DF47C00CCF8B8 /* KRWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRWorld.cpp; path = Classes/KRWorld.cpp; sourceTree = "<group>"; };
|
||||
E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRDataBlock.h; path = Classes/KRDataBlock.h; sourceTree = "<group>"; };
|
||||
E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRDataBlock.cpp; path = Classes/KRDataBlock.cpp; sourceTree = "<group>"; };
|
||||
E47C25A113F4F65A00FF4370 /* KRShaderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRShaderManager.h; path = Classes/KRShaderManager.h; sourceTree = "<group>"; };
|
||||
E47C25A413F4F66F00FF4370 /* KRShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRShader.h; path = Classes/KRShader.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
E47C25A613F4F6AB00FF4370 /* KRShaderManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRShaderManager.cpp; path = Classes/KRShaderManager.cpp; sourceTree = "<group>"; };
|
||||
@@ -438,6 +452,10 @@
|
||||
E46C214A15364DEC009CABF3 /* KRSceneManager.cpp */,
|
||||
E48C696E15374F5A00232E28 /* KRContext.h */,
|
||||
E48C697115374F7E00232E28 /* KRContext.cpp */,
|
||||
E46F49FF155DF46700CCF8B8 /* KRWorld.h */,
|
||||
E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */,
|
||||
E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */,
|
||||
E46F4A03155DF47C00CCF8B8 /* KRWorld.cpp */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
@@ -515,6 +533,8 @@
|
||||
E4F975321536220900FD60B2 /* KRNode.h in Headers */,
|
||||
E46C214715364BC8009CABF3 /* tinyxml2.h in Headers */,
|
||||
E48C696F15374F5B00232E28 /* KRContext.h in Headers */,
|
||||
E46F4A00155DF46700CCF8B8 /* KRWorld.h in Headers */,
|
||||
E46F4A0B155E002100CCF8B8 /* KRDataBlock.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -542,13 +562,17 @@
|
||||
E461A153152E54B500F2044A /* KRLight.h in Headers */,
|
||||
E4F97552153633EF00FD60B2 /* KRMaterialManager.h in Headers */,
|
||||
E461A176152E5C5600F2044A /* KRPointLight.h in Headers */,
|
||||
E46F4A09155DF6E400CCF8B8 /* KRWorld.cpp in Headers */,
|
||||
E4F975541536340400FD60B2 /* KRTexture.h in Headers */,
|
||||
E46F4A01155DF46700CCF8B8 /* KRWorld.h in Headers */,
|
||||
E48C697015374F5B00232E28 /* KRContext.h in Headers */,
|
||||
E46F4A10155E004100CCF8B8 /* KRDataBlock.cpp in Headers */,
|
||||
E4D13365153767FF0070068C /* KRShaderManager.h in Headers */,
|
||||
E461A15D152E563100F2044A /* KRDirectionalLight.h in Headers */,
|
||||
E461A169152E570700F2044A /* KRSpotLight.h in Headers */,
|
||||
E46C214815364BC8009CABF3 /* tinyxml2.h in Headers */,
|
||||
E46A6B701559EF0A000DBD37 /* KRResource+blend.h in Headers */,
|
||||
E46F4A0C155E002100CCF8B8 /* KRDataBlock.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -665,6 +689,8 @@
|
||||
E4D133BC1538F7560070068C /* light_directional.vsh in Sources */,
|
||||
E4A9DEBE154120C4009DF363 /* light_point.fsh in Sources */,
|
||||
E4A9DEC1154120E8009DF363 /* light_point.vsh in Sources */,
|
||||
E46F4A04155DF47C00CCF8B8 /* KRWorld.cpp in Sources */,
|
||||
E46F4A0E155E003000CCF8B8 /* KRDataBlock.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -700,6 +726,8 @@
|
||||
E46C214C15364DEC009CABF3 /* KRSceneManager.cpp in Sources */,
|
||||
E48C697315374F7E00232E28 /* KRContext.cpp in Sources */,
|
||||
E46A6B6D1559E97D000DBD37 /* KRResource+blend.cpp in Sources */,
|
||||
E46F4A05155DF47C00CCF8B8 /* KRWorld.cpp in Sources */,
|
||||
E46F4A0F155E003000CCF8B8 /* KRDataBlock.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
42
KREngine/KREngine/Classes/KRDataBlock.cpp
Normal file
42
KREngine/KREngine/Classes/KRDataBlock.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// KRDataBlock.cpp
|
||||
// KREngine
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-11.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "KRDataBlock.h"
|
||||
|
||||
KRDataBlock::KRDataBlock() {
|
||||
m_data = NULL;
|
||||
m_data_size = 0;
|
||||
}
|
||||
|
||||
KRDataBlock::~KRDataBlock() {
|
||||
if(m_data) {
|
||||
free(m_data);
|
||||
}
|
||||
}
|
||||
|
||||
void *KRDataBlock::getData() {
|
||||
return m_data;
|
||||
}
|
||||
|
||||
int KRDataBlock::getSize() {
|
||||
return m_data_size;
|
||||
}
|
||||
|
||||
void KRDataBlock::append(void *data, int size) {
|
||||
if(m_data == NULL) {
|
||||
m_data = malloc(size);
|
||||
memcpy(m_data, data, size);
|
||||
m_data_size = size;
|
||||
} else {
|
||||
m_data = realloc(m_data, m_data_size + size);
|
||||
memcpy((unsigned char *)m_data + size, data, size);
|
||||
m_data_size += size;
|
||||
}
|
||||
}
|
||||
26
KREngine/KREngine/Classes/KRDataBlock.h
Normal file
26
KREngine/KREngine/Classes/KRDataBlock.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// KRDataBlock.h
|
||||
// KREngine
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-11.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef KREngine_KRDataBlock_h
|
||||
#define KREngine_KRDataBlock_h
|
||||
|
||||
class KRDataBlock {
|
||||
public:
|
||||
KRDataBlock();
|
||||
~KRDataBlock();
|
||||
|
||||
void append(void *data, int size);
|
||||
|
||||
void *getData();
|
||||
int getSize();
|
||||
private:
|
||||
void *m_data;
|
||||
int m_data_size;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -39,6 +39,67 @@ KRVector3::KRVector3()
|
||||
z = 0.0f;
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::ZeroVector() {
|
||||
return KRVector3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::OneVector() {
|
||||
return KRVector3(1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::ForwardVector() {
|
||||
return KRVector3(0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::BackwardVector() {
|
||||
return KRVector3(0.0f, 0.0f, -1.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::UpVector() {
|
||||
return KRVector3(0.0f, 1.0f, 0.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::DownVector() {
|
||||
return KRVector3(0.0f, -1.0f, 0.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::LeftVector() {
|
||||
return KRVector3(-1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::RightVector() {
|
||||
return KRVector3(1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::Lerp(const KRVector3 &v1, const KRVector3 &v2, float d) {
|
||||
return v1 + (v2 - v1) * d;
|
||||
}
|
||||
|
||||
KRVector3 KRVector3::Slerp(const KRVector3 &v1, const KRVector3 &v2, float d) {
|
||||
// From: http://keithmaggio.wordpress.com/2011/02/15/math-magician-lerp-slerp-and-nlerp/
|
||||
// Dot product - the cosine of the angle between 2 vectors.
|
||||
float dot = KRVector3::Dot(v1, v2);
|
||||
// Clamp it to be in the range of Acos()
|
||||
if(dot < -1.0f) dot = -1.0f;
|
||||
if(dot > 1.0f) dot = 1.0f;
|
||||
// Acos(dot) returns the angle between start and end,
|
||||
// And multiplying that by percent returns the angle between
|
||||
// start and the final result.
|
||||
float theta = acos(dot)*d;
|
||||
KRVector3 RelativeVec = v2 - v1*dot;
|
||||
RelativeVec.normalize(); // Orthonormal basis
|
||||
// The final result.
|
||||
return ((v1*cos(theta)) + (RelativeVec*sin(theta)));
|
||||
}
|
||||
|
||||
void KRVector3::OrthoNormalize(KRVector3 &normal, KRVector3 &tangent) {
|
||||
// Gram-Schmidt Orthonormalization
|
||||
normal.normalize();
|
||||
KRVector3 proj = normal * Dot(tangent, normal);
|
||||
tangent = tangent - proj;
|
||||
tangent.normalize();
|
||||
}
|
||||
|
||||
KRVector3::KRVector3(float v) {
|
||||
x = v;
|
||||
y = v;
|
||||
@@ -73,7 +134,12 @@ KRVector3::~KRVector3()
|
||||
//calculate and return the magnitude of this vector
|
||||
float KRVector3::GetMagnitude()
|
||||
{
|
||||
return sqrtf(x * x + y * y + z * z);
|
||||
return sqrtf(GetSqrMagnitude());
|
||||
}
|
||||
|
||||
float KRVector3::GetSqrMagnitude()
|
||||
{
|
||||
return x * x + y * y + z * z;
|
||||
}
|
||||
|
||||
//multiply this vector by a scalar
|
||||
@@ -111,6 +177,10 @@ void KRVector3::normalize()
|
||||
z /= magnitude;
|
||||
}
|
||||
|
||||
float KRVector3::Dot(const KRVector3 &v1, const KRVector3 &v2) {
|
||||
return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
|
||||
}
|
||||
|
||||
//calculate and return dot product
|
||||
float KRVector3::dot(const KRVector3 &vec) const
|
||||
{
|
||||
|
||||
@@ -48,14 +48,30 @@ public:
|
||||
KRVector3();
|
||||
~KRVector3();
|
||||
|
||||
static KRVector3 ZeroVector();
|
||||
static KRVector3 OneVector();
|
||||
static KRVector3 ForwardVector();
|
||||
static KRVector3 BackwardVector();
|
||||
static KRVector3 UpVector();
|
||||
static KRVector3 DownVector();
|
||||
static KRVector3 LeftVector();
|
||||
static KRVector3 RightVector();
|
||||
static KRVector3 Lerp(const KRVector3 &v1, const KRVector3 &v2, float d);
|
||||
static KRVector3 Slerp(const KRVector3 &v1, const KRVector3 &v2, float d);
|
||||
static float Dot(const KRVector3 &v1, const KRVector3 &v2);
|
||||
static void OrthoNormalize(KRVector3 &normal, KRVector3 &tangent); // Gram-Schmidt Orthonormalization
|
||||
|
||||
KRVector3(const KRVector3& p);
|
||||
KRVector3& operator = ( const KRVector3& p );
|
||||
friend bool operator== (KRVector3 &v1, KRVector3 &v2);
|
||||
friend bool operator!= (KRVector3 &v1, KRVector3 &v2);
|
||||
|
||||
//calculate and return the magnitude of this vector
|
||||
// calculate and return the magnitude of this vector
|
||||
float GetMagnitude();
|
||||
|
||||
// calculate the square of the magnitude (useful for comparison of magnitudes without the cost of a sqrt() function used in GetMagnitude
|
||||
float GetSqrMagnitude();
|
||||
|
||||
//multiply this vector by a scalar
|
||||
KRVector3 operator*(float num) const;
|
||||
|
||||
@@ -70,6 +86,8 @@ public:
|
||||
|
||||
//normalize this vector
|
||||
void normalize();
|
||||
|
||||
|
||||
|
||||
//calculate and return dot product
|
||||
float dot(const KRVector3 &vec) const;
|
||||
|
||||
29
KREngine/KREngine/Classes/KRWorld.cpp
Normal file
29
KREngine/KREngine/Classes/KRWorld.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// KRWorld.cpp
|
||||
// KREngine
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-11.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "KRWorld.h"
|
||||
#include "KRDataBlock.h"
|
||||
|
||||
|
||||
KRWorld::KRWorld() {
|
||||
|
||||
}
|
||||
KRWorld::~KRWorld() {
|
||||
|
||||
}
|
||||
|
||||
void KRWorld::Load(void *data, int data_size) {
|
||||
|
||||
}
|
||||
|
||||
KRDataBlock *KRWorld::Save() {
|
||||
KRDataBlock *block = new KRDataBlock();
|
||||
return block;
|
||||
}
|
||||
24
KREngine/KREngine/Classes/KRWorld.h
Normal file
24
KREngine/KREngine/Classes/KRWorld.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// KRWorld.h
|
||||
// KREngine
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-11.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef KREngine_KRWorld_h
|
||||
#define KREngine_KRWorld_h
|
||||
|
||||
class KRDataBlock;
|
||||
|
||||
class KRWorld {
|
||||
public:
|
||||
KRWorld();
|
||||
~KRWorld();
|
||||
|
||||
void Load(void *data, int data_size);
|
||||
KRDataBlock *Save();
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -31,5 +31,5 @@ uniform highp mat4 mvp_matrix; // mvp_matrix is the result of multiplying the mo
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp_matrix * vertex_position;
|
||||
gl_Position.z = max(gl_Position.z / gl_Position.w, 0.0) * gl_Position.w;
|
||||
gl_Position.z = max(gl_Position.z / gl_Position.w, 0.00) * gl_Position.w;
|
||||
}
|
||||
@@ -7,16 +7,21 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
E440D976155E46DB00C4887B /* KRWBFileSystemItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E440D975155E46DB00C4887B /* KRWBFileSystemItem.m */; };
|
||||
E46F4A07155DF5E500CCF8B8 /* krengine_osx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E46F4A06155DF5E500CCF8B8 /* krengine_osx.framework */; };
|
||||
E474D77514E5BBF70017DCEC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E474D77414E5BBF70017DCEC /* Cocoa.framework */; };
|
||||
E474D77F14E5BBF70017DCEC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E474D77D14E5BBF70017DCEC /* InfoPlist.strings */; };
|
||||
E474D78114E5BBF70017DCEC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E474D78014E5BBF70017DCEC /* main.m */; };
|
||||
E474D78514E5BBF70017DCEC /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = E474D78314E5BBF70017DCEC /* Credits.rtf */; };
|
||||
E474D78814E5BBF70017DCEC /* KRWBDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = E474D78714E5BBF70017DCEC /* KRWBDocument.m */; };
|
||||
E474D78814E5BBF70017DCEC /* KRWBDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = E474D78714E5BBF70017DCEC /* KRWBDocument.mm */; };
|
||||
E474D78B14E5BBF70017DCEC /* KRWBDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = E474D78914E5BBF70017DCEC /* KRWBDocument.xib */; };
|
||||
E474D78E14E5BBF80017DCEC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E474D78C14E5BBF80017DCEC /* MainMenu.xib */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
E440D974155E46DB00C4887B /* KRWBFileSystemItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRWBFileSystemItem.h; sourceTree = "<group>"; };
|
||||
E440D975155E46DB00C4887B /* KRWBFileSystemItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KRWBFileSystemItem.m; sourceTree = "<group>"; };
|
||||
E46F4A06155DF5E500CCF8B8 /* krengine_osx.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = krengine_osx.framework; path = ../KREngine/build/Release/krengine_osx.framework; sourceTree = "<group>"; };
|
||||
E474D77014E5BBF70017DCEC /* KRWorldBuilder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KRWorldBuilder.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E474D77414E5BBF70017DCEC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
E474D77714E5BBF70017DCEC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
@@ -28,7 +33,7 @@
|
||||
E474D78214E5BBF70017DCEC /* KRWorldBuilder-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KRWorldBuilder-Prefix.pch"; sourceTree = "<group>"; };
|
||||
E474D78414E5BBF70017DCEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
|
||||
E474D78614E5BBF70017DCEC /* KRWBDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KRWBDocument.h; sourceTree = "<group>"; };
|
||||
E474D78714E5BBF70017DCEC /* KRWBDocument.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KRWBDocument.m; sourceTree = "<group>"; };
|
||||
E474D78714E5BBF70017DCEC /* KRWBDocument.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = KRWBDocument.mm; sourceTree = "<group>"; };
|
||||
E474D78A14E5BBF70017DCEC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/KRWBDocument.xib; sourceTree = "<group>"; };
|
||||
E474D78D14E5BBF80017DCEC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -38,6 +43,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E46F4A07155DF5E500CCF8B8 /* krengine_osx.framework in Frameworks */,
|
||||
E474D77514E5BBF70017DCEC /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -65,6 +71,7 @@
|
||||
E474D77314E5BBF70017DCEC /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E46F4A06155DF5E500CCF8B8 /* krengine_osx.framework */,
|
||||
E474D77414E5BBF70017DCEC /* Cocoa.framework */,
|
||||
E474D77614E5BBF70017DCEC /* Other Frameworks */,
|
||||
);
|
||||
@@ -85,8 +92,10 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E474D78614E5BBF70017DCEC /* KRWBDocument.h */,
|
||||
E474D78714E5BBF70017DCEC /* KRWBDocument.m */,
|
||||
E474D78714E5BBF70017DCEC /* KRWBDocument.mm */,
|
||||
E474D78914E5BBF70017DCEC /* KRWBDocument.xib */,
|
||||
E440D974155E46DB00C4887B /* KRWBFileSystemItem.h */,
|
||||
E440D975155E46DB00C4887B /* KRWBFileSystemItem.m */,
|
||||
E474D78C14E5BBF80017DCEC /* MainMenu.xib */,
|
||||
E474D77B14E5BBF70017DCEC /* Supporting Files */,
|
||||
);
|
||||
@@ -171,7 +180,8 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E474D78114E5BBF70017DCEC /* main.m in Sources */,
|
||||
E474D78814E5BBF70017DCEC /* KRWBDocument.m in Sources */,
|
||||
E474D78814E5BBF70017DCEC /* KRWBDocument.mm in Sources */,
|
||||
E440D976155E46DB00C4887B /* KRWBFileSystemItem.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -301,6 +311,7 @@
|
||||
E474D79314E5BBF80017DCEC /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface KRWBDocument : NSDocument
|
||||
class KRWorld;
|
||||
|
||||
@interface KRWBDocument : NSDocument <NSOutlineViewDelegate, NSOutlineViewDataSource>
|
||||
|
||||
@property (nonatomic, readonly) KRWorld *world;
|
||||
@property (nonatomic, retain) IBOutlet NSOutlineView *outlineView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,18 +8,48 @@
|
||||
|
||||
#import "KRWBDocument.h"
|
||||
|
||||
#import <KREngine_osx/KRVector2.h>
|
||||
#import <KREngine_osx/KRVector3.h>
|
||||
#import <KREngine_osx/KRMesh.h>
|
||||
#import <KREngine_osx/KRWorld.h>
|
||||
#import "KRWBFileSystemItem.h"
|
||||
|
||||
@interface KRWBDocument() {
|
||||
KRWorld *_world;
|
||||
NSOutlineView *_outlineView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation KRWBDocument
|
||||
|
||||
@synthesize outlineView = _outlineView;
|
||||
|
||||
- (KRWorld *)world
|
||||
{
|
||||
return _world;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
_world = NULL;
|
||||
self = [super init];
|
||||
if (self) {
|
||||
// Add your subclass-specific initialization here.
|
||||
// If an error occurs here, return nil.
|
||||
_world = new KRWorld();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if(_world) {
|
||||
delete _world;
|
||||
_world = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)windowNibName
|
||||
{
|
||||
// Override returning the nib file name of the document
|
||||
@@ -30,6 +60,8 @@
|
||||
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
|
||||
{
|
||||
[super windowControllerDidLoadNib:aController];
|
||||
|
||||
//[[self.windowControllers objectAtIndex:0] setBackgroundColor: [NSColor blackColor]];
|
||||
// Add any code here that needs to be executed once the windowController has loaded the document's window.
|
||||
}
|
||||
|
||||
@@ -51,8 +83,11 @@
|
||||
You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.
|
||||
*/
|
||||
/*
|
||||
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
|
||||
@throw exception;
|
||||
*/
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -61,4 +96,34 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
|
||||
if(item == nil) {
|
||||
return [[KRWBFileSystemItem rootItem] numberOfChildren];
|
||||
} else {
|
||||
return [item numberOfChildren];
|
||||
}
|
||||
//return (item == nil) ? 1 : [item numberOfChildren];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
|
||||
return (item == nil) ? YES : ([item numberOfChildren] != -1);
|
||||
}
|
||||
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
|
||||
if(item == nil) {
|
||||
return [[KRWBFileSystemItem rootItem] childAtIndex:index];
|
||||
} else {
|
||||
return [(KRWBFileSystemItem *)item childAtIndex:index];
|
||||
}
|
||||
//return (item == nil) ? [KRWBFileSystemItem rootItem] : [(KRWBFileSystemItem *)item childAtIndex:index];
|
||||
}
|
||||
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
|
||||
return (item == nil) ? @"/" : [item relativePath];
|
||||
}
|
||||
|
||||
@end
|
||||
25
KRWorldBuilder/KRWorldBuilder/KRWBFileSystemItem.h
Normal file
25
KRWorldBuilder/KRWorldBuilder/KRWBFileSystemItem.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// KRWBFileSystemItem.h
|
||||
// KRWorldBuilder
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-12.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface KRWBFileSystemItem : NSObject
|
||||
{
|
||||
NSURL *fullPath;
|
||||
KRWBFileSystemItem *parent;
|
||||
NSMutableArray *children;
|
||||
}
|
||||
|
||||
+ (KRWBFileSystemItem *)rootItem;
|
||||
- (NSInteger)numberOfChildren;// Returns -1 for leaf nodes
|
||||
- (KRWBFileSystemItem *)childAtIndex:(NSUInteger)n; // Invalid to call on leaf nodes
|
||||
- (NSURL *)fullPath;
|
||||
- (NSString *)relativePath;
|
||||
|
||||
@end
|
||||
|
||||
109
KRWorldBuilder/KRWorldBuilder/KRWBFileSystemItem.m
Normal file
109
KRWorldBuilder/KRWorldBuilder/KRWBFileSystemItem.m
Normal file
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// KRWBFileSystemItem.m
|
||||
// KRWorldBuilder
|
||||
//
|
||||
// Created by Kearwood Gilbert on 12-05-12.
|
||||
// Copyright (c) 2012 Kearwood Software. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KRWBFileSystemItem.h"
|
||||
|
||||
|
||||
@implementation KRWBFileSystemItem
|
||||
|
||||
static KRWBFileSystemItem *rootItem = nil;
|
||||
static NSMutableArray *leafNode = nil;
|
||||
|
||||
+ (void)initialize {
|
||||
if (self == [KRWBFileSystemItem class]) {
|
||||
leafNode = [[NSMutableArray alloc] init];
|
||||
}
|
||||
}
|
||||
|
||||
- (id)initWithPath:(NSURL *)url parent:(KRWBFileSystemItem *)parentItem {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
fullPath = url;
|
||||
parent = parentItem;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
+ (KRWBFileSystemItem *)rootItem {
|
||||
if (rootItem == nil) {
|
||||
rootItem = [[KRWBFileSystemItem alloc] initWithPath:[NSURL URLWithString:@"file://localhost/"] parent:nil];
|
||||
}
|
||||
return rootItem;
|
||||
}
|
||||
|
||||
|
||||
// Creates, caches, and returns the array of children
|
||||
// Loads children incrementally
|
||||
- (NSArray *)children {
|
||||
|
||||
if (children == nil) {
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSError *error;
|
||||
|
||||
BOOL valid = [fullPath checkResourceIsReachableAndReturnError:NULL];
|
||||
|
||||
|
||||
NSNumber *isDirectory = nil;
|
||||
if (! [fullPath getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:&error]) {
|
||||
// handle error
|
||||
}
|
||||
|
||||
BOOL isDir = [isDirectory boolValue];
|
||||
if (valid && isDir) {
|
||||
NSArray *keys = [NSArray arrayWithObject:NSURLIsDirectoryKey];
|
||||
|
||||
NSArray *child_urls = [fileManager contentsOfDirectoryAtURL:fullPath includingPropertiesForKeys:keys options: NSDirectoryEnumerationSkipsHiddenFiles error:&error];
|
||||
/*
|
||||
NSDirectoryEnumerator *enumerator = [fileManager
|
||||
enumeratorAtURL:fullPath
|
||||
includingPropertiesForKeys:keys
|
||||
options:0
|
||||
errorHandler:^(NSURL *url, NSError *error) {
|
||||
// Handle the error.
|
||||
// Return YES if the enumeration should continue after the error.
|
||||
return YES;
|
||||
}];
|
||||
*/
|
||||
|
||||
children = [[NSMutableArray alloc] init];
|
||||
|
||||
for (NSURL *url in child_urls) {
|
||||
KRWBFileSystemItem *newChild = [[KRWBFileSystemItem alloc]
|
||||
initWithPath:url parent:self];
|
||||
[children addObject:newChild];
|
||||
}
|
||||
} else {
|
||||
children = leafNode;
|
||||
}
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)relativePath {
|
||||
return [[fullPath lastPathComponent] copy];
|
||||
}
|
||||
|
||||
|
||||
- (KRWBFileSystemItem *)childAtIndex:(NSUInteger)n {
|
||||
return [[self children] objectAtIndex:n];
|
||||
}
|
||||
|
||||
|
||||
- (NSInteger)numberOfChildren {
|
||||
NSArray *tmp = [self children];
|
||||
return (tmp == leafNode) ? (-1) : [tmp count];
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -14,7 +14,7 @@
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DocumentType</string>
|
||||
<string>KREngine World</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>????</string>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11D50b</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1938</string>
|
||||
<string key="NS.object.0">2182</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSTableColumn</string>
|
||||
@@ -16,7 +16,6 @@
|
||||
<string>NSToolbarFlexibleSpaceItem</string>
|
||||
<string>NSSplitView</string>
|
||||
<string>NSScroller</string>
|
||||
<string>NSTableHeaderView</string>
|
||||
<string>NSScrollView</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSToolbarSpaceItem</string>
|
||||
@@ -47,7 +46,7 @@
|
||||
<object class="NSWindowTemplate" id="275939982">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{133, 235}, {507, 427}}</string>
|
||||
<string key="NSWindowRect">{{133, 235}, {857, 513}}</string>
|
||||
<int key="NSWTFlags">1886912512</int>
|
||||
<string key="NSWindowTitle">Window</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
@@ -61,7 +60,7 @@
|
||||
<bool key="NSToolbarAllowsUserCustomization">YES</bool>
|
||||
<bool key="NSToolbarAutosavesConfiguration">NO</bool>
|
||||
<int key="NSToolbarDisplayMode">1</int>
|
||||
<int key="NSToolbarSizeMode">1</int>
|
||||
<int key="NSToolbarSizeMode">2</int>
|
||||
<dictionary class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems">
|
||||
<object class="NSToolbarItem" key="NSToolbarCustomizeToolbarItem" id="323347159">
|
||||
<string key="NSToolbarItemIdentifier">NSToolbarCustomizeToolbarItem</string>
|
||||
@@ -211,7 +210,7 @@
|
||||
</object>
|
||||
</object>
|
||||
</dictionary>
|
||||
<array class="NSMutableArray" key="NSToolbarIBAllowedItems">
|
||||
<array key="NSToolbarIBAllowedItems">
|
||||
<reference ref="96577673"/>
|
||||
<reference ref="678544536"/>
|
||||
<reference ref="997438218"/>
|
||||
@@ -219,7 +218,7 @@
|
||||
<reference ref="996908587"/>
|
||||
<reference ref="323347159"/>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="NSToolbarIBDefaultItems">
|
||||
<array key="NSToolbarIBDefaultItems">
|
||||
<reference ref="96577673"/>
|
||||
<reference ref="678544536"/>
|
||||
<reference ref="996908587"/>
|
||||
@@ -250,22 +249,13 @@
|
||||
<object class="NSOutlineView" id="678629963">
|
||||
<reference key="NSNextResponder" ref="30156716"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{162, 410}</string>
|
||||
<string key="NSFrameSize">{209, 513}</string>
|
||||
<reference key="NSSuperview" ref="30156716"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="642699508"/>
|
||||
<reference key="NSNextKeyView" ref="952976906"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<string key="NSReuseIdentifierKey">_NS:1703</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTableHeaderView" key="NSHeaderView" id="568844948">
|
||||
<reference key="NSNextResponder" ref="451277198"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{162, 17}</string>
|
||||
<reference key="NSSuperview" ref="451277198"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="30156716"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1705</string>
|
||||
<reference key="NSTableView" ref="678629963"/>
|
||||
</object>
|
||||
<object class="_NSCornerView" key="NSCornerView">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
@@ -274,23 +264,23 @@
|
||||
</object>
|
||||
<array class="NSMutableArray" key="NSTableColumns">
|
||||
<object class="NSTableColumn" id="763595350">
|
||||
<double key="NSWidth">101</double>
|
||||
<double key="NSWidth">206</double>
|
||||
<double key="NSMinWidth">16</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
<object class="NSTableHeaderCell" key="NSHeaderCell">
|
||||
<int key="NSCellFlags">75628096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport" id="26">
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">11</double>
|
||||
<int key="NSfFlags">3100</int>
|
||||
</object>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="987013412">
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="786729093">
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">headerTextColor</string>
|
||||
@@ -304,7 +294,7 @@
|
||||
<int key="NSCellFlags">337772096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents">Text Cell</string>
|
||||
<object class="NSFont" key="NSSupport" id="661470994">
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
@@ -319,7 +309,7 @@
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="554098902">
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
@@ -331,32 +321,6 @@
|
||||
<bool key="NSIsEditable">YES</bool>
|
||||
<reference key="NSTableView" ref="678629963"/>
|
||||
</object>
|
||||
<object class="NSTableColumn" id="245451220">
|
||||
<double key="NSWidth">55</double>
|
||||
<double key="NSMinWidth">40</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
<object class="NSTableHeaderCell" key="NSHeaderCell">
|
||||
<int key="NSCellFlags">75628096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents"/>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSBackgroundColor" ref="987013412"/>
|
||||
<reference key="NSTextColor" ref="786729093"/>
|
||||
</object>
|
||||
<object class="NSTextFieldCell" key="NSDataCell" id="88949946">
|
||||
<int key="NSCellFlags">337772096</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<string key="NSContents">Text Cell</string>
|
||||
<reference key="NSSupport" ref="661470994"/>
|
||||
<reference key="NSControlView" ref="678629963"/>
|
||||
<reference key="NSBackgroundColor" ref="45682733"/>
|
||||
<reference key="NSTextColor" ref="554098902"/>
|
||||
</object>
|
||||
<int key="NSResizingMask">3</int>
|
||||
<bool key="NSIsResizeable">YES</bool>
|
||||
<bool key="NSIsEditable">YES</bool>
|
||||
<reference key="NSTableView" ref="678629963"/>
|
||||
</object>
|
||||
</array>
|
||||
<double key="NSIntercellSpacingWidth">3</double>
|
||||
<double key="NSIntercellSpacingHeight">2</double>
|
||||
@@ -385,14 +349,15 @@
|
||||
<int key="NSTableViewGroupRowStyle">1</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 17}, {162, 410}}</string>
|
||||
<string key="NSFrameSize">{209, 513}</string>
|
||||
<reference key="NSSuperview" ref="581171615"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="678629963"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<string key="NSReuseIdentifierKey">_NS:1701</string>
|
||||
<reference key="NSDocView" ref="678629963"/>
|
||||
<reference key="NSBGColor" ref="45682733"/>
|
||||
<int key="NScvFlags">4</int>
|
||||
<int key="NScvFlags">6</int>
|
||||
</object>
|
||||
<object class="NSScroller" id="952976906">
|
||||
<reference key="NSNextResponder" ref="581171615"/>
|
||||
@@ -400,58 +365,42 @@
|
||||
<string key="NSFrame">{{224, 17}, {15, 102}}</string>
|
||||
<reference key="NSSuperview" ref="581171615"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="949597853"/>
|
||||
<reference key="NSNextKeyView" ref="642699508"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1726</string>
|
||||
<reference key="NSTarget" ref="581171615"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSCurValue">37</double>
|
||||
<double key="NSPercent">0.13909779489040375</double>
|
||||
<double key="NSPercent">0.99805447470817121</double>
|
||||
</object>
|
||||
<object class="NSScroller" id="642699508">
|
||||
<reference key="NSNextResponder" ref="581171615"/>
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{1, 56.862202525138855}, {100.86830902099609, 15}}</string>
|
||||
<string key="NSFrame">{{0, 498}, {209, 15}}</string>
|
||||
<reference key="NSSuperview" ref="581171615"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="952976906"/>
|
||||
<reference key="NSNextKeyView" ref="949597853"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1728</string>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="581171615"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.68707482993197277</double>
|
||||
</object>
|
||||
<object class="NSClipView" id="451277198">
|
||||
<reference key="NSNextResponder" ref="581171615"/>
|
||||
<int key="NSvFlags">2304</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<reference ref="568844948"/>
|
||||
</array>
|
||||
<string key="NSFrameSize">{162, 17}</string>
|
||||
<reference key="NSSuperview" ref="581171615"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="568844948"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1706</string>
|
||||
<reference key="NSDocView" ref="568844948"/>
|
||||
<reference key="NSBGColor" ref="45682733"/>
|
||||
<int key="NScvFlags">4</int>
|
||||
<double key="NSPercent">0.99523809523809526</double>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{162, 427}</string>
|
||||
<string key="NSFrameSize">{209, 513}</string>
|
||||
<reference key="NSSuperview" ref="742882765"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="451277198"/>
|
||||
<reference key="NSNextKeyView" ref="30156716"/>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
<string key="NSReuseIdentifierKey">_NS:1699</string>
|
||||
<int key="NSsFlags">264752</int>
|
||||
<reference key="NSVScroller" ref="952976906"/>
|
||||
<reference key="NSHScroller" ref="642699508"/>
|
||||
<reference key="NSContentView" ref="30156716"/>
|
||||
<reference key="NSHeaderClipView" ref="451277198"/>
|
||||
<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
|
||||
</object>
|
||||
<object class="NSCustomView" id="949597853">
|
||||
<reference key="NSNextResponder" ref="742882765"/>
|
||||
<int key="NSvFlags">4352</int>
|
||||
<string key="NSFrame">{{163, 0}, {144, 427}}</string>
|
||||
<string key="NSFrame">{{210, 0}, {428, 513}}</string>
|
||||
<reference key="NSSuperview" ref="742882765"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="41920732"/>
|
||||
@@ -470,7 +419,7 @@
|
||||
<object class="NSCollectionView" id="178212487">
|
||||
<reference key="NSNextResponder" ref="237514163"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrameSize">{199, 427}</string>
|
||||
<string key="NSFrameSize">{218, 513}</string>
|
||||
<reference key="NSSuperview" ref="237514163"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="283770399"/>
|
||||
@@ -487,7 +436,7 @@
|
||||
<int key="NSDraggingSourceMaskForNonLocal">0</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{199, 427}</string>
|
||||
<string key="NSFrameSize">{218, 513}</string>
|
||||
<reference key="NSSuperview" ref="41920732"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="178212487"/>
|
||||
@@ -529,7 +478,7 @@
|
||||
<double key="NSPercent">0.63157892227172852</double>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{308, 0}, {199, 427}}</string>
|
||||
<string key="NSFrame">{{639, 0}, {218, 513}}</string>
|
||||
<reference key="NSSuperview" ref="742882765"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="237514163"/>
|
||||
@@ -541,7 +490,7 @@
|
||||
<reference key="NSContentView" ref="237514163"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{507, 427}</string>
|
||||
<string key="NSFrameSize">{857, 513}</string>
|
||||
<reference key="NSSuperview" ref="568628114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="581171615"/>
|
||||
@@ -551,25 +500,23 @@
|
||||
<int key="NSDividerStyle">2</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{507, 427}</string>
|
||||
<string key="NSFrameSize">{857, 513}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="742882765"/>
|
||||
<bool key="NSViewIsLayerTreeHost">YES</bool>
|
||||
<int key="NSViewLayerContentsRedrawPolicy">2</int>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMinSize">{94, 164}</string>
|
||||
<string key="NSMinSize">{94, 155}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<int key="NSWindowCollectionBehavior">128</int>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="796877042">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCollectionViewItem" id="375262593"/>
|
||||
<object class="NSView" id="322286456">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrameSize">{100, 100}</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
@@ -581,6 +528,14 @@
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">outlineView</string>
|
||||
<reference key="source" ref="512844837"/>
|
||||
<reference key="destination" ref="678629963"/>
|
||||
</object>
|
||||
<int key="connectionID">100069</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
@@ -599,11 +554,19 @@
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="375262593"/>
|
||||
<reference key="destination" ref="322286456"/>
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="678629963"/>
|
||||
<reference key="destination" ref="512844837"/>
|
||||
</object>
|
||||
<int key="connectionID">100053</int>
|
||||
<int key="connectionID">100067</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="678629963"/>
|
||||
<reference key="destination" ref="512844837"/>
|
||||
</object>
|
||||
<int key="connectionID">100068</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
@@ -739,18 +702,12 @@
|
||||
<reference key="object" ref="375262593"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100051</int>
|
||||
<reference key="object" ref="322286456"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100054</int>
|
||||
<reference key="object" ref="581171615"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="678629963"/>
|
||||
<reference ref="642699508"/>
|
||||
<reference ref="568844948"/>
|
||||
<reference ref="952976906"/>
|
||||
</array>
|
||||
<reference key="parent" ref="742882765"/>
|
||||
@@ -760,7 +717,6 @@
|
||||
<reference key="object" ref="678629963"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="763595350"/>
|
||||
<reference ref="245451220"/>
|
||||
</array>
|
||||
<reference key="parent" ref="581171615"/>
|
||||
</object>
|
||||
@@ -769,11 +725,6 @@
|
||||
<reference key="object" ref="642699508"/>
|
||||
<reference key="parent" ref="581171615"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100057</int>
|
||||
<reference key="object" ref="568844948"/>
|
||||
<reference key="parent" ref="581171615"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100058</int>
|
||||
<reference key="object" ref="952976906"/>
|
||||
@@ -787,19 +738,6 @@
|
||||
</array>
|
||||
<reference key="parent" ref="678629963"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100060</int>
|
||||
<reference key="object" ref="245451220"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="88949946"/>
|
||||
</array>
|
||||
<reference key="parent" ref="678629963"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100061</int>
|
||||
<reference key="object" ref="88949946"/>
|
||||
<reference key="parent" ref="245451220"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">100062</int>
|
||||
<reference key="object" ref="322998401"/>
|
||||
@@ -825,75 +763,66 @@
|
||||
<string key="100048.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100049.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100050.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100051.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100054.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100055.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100056.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100057.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100058.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100059.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100060.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100061.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="100062.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="5.IBWindowTemplateEditedContentRect">{{133, 170}, {507, 413}}</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<real value="0.0" key="6.IBViewIntegration.shadowBlurRadius"/>
|
||||
<reference key="6.IBViewIntegration.shadowColor" ref="937766609"/>
|
||||
<real value="0.0" key="6.IBViewIntegration.shadowOffsetHeight"/>
|
||||
<real value="0.0" key="6.IBViewIntegration.shadowOffsetWidth"/>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">100062</int>
|
||||
<int key="maxID">100078</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">KRWBDocument</string>
|
||||
<string key="superclassName">NSDocument</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">outlineView</string>
|
||||
<string key="NS.object.0">NSOutlineView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">outlineView</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">outlineView</string>
|
||||
<string key="candidateClassName">NSOutlineView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/KRWBDocument.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSDocument</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="printDocument:">id</string>
|
||||
<string key="revertDocumentToSaved:">id</string>
|
||||
<string key="runPageLayout:">id</string>
|
||||
<string key="saveDocument:">id</string>
|
||||
<string key="saveDocumentAs:">id</string>
|
||||
<string key="saveDocumentTo:">id</string>
|
||||
<string key="className">NSCollectionViewItem</string>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="imageView">NSImageView</string>
|
||||
<string key="textField">NSTextField</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<object class="IBActionInfo" key="printDocument:">
|
||||
<string key="name">printDocument:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<object class="IBToOneOutletInfo" key="imageView">
|
||||
<string key="name">imageView</string>
|
||||
<string key="candidateClassName">NSImageView</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="revertDocumentToSaved:">
|
||||
<string key="name">revertDocumentToSaved:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="runPageLayout:">
|
||||
<string key="name">runPageLayout:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="saveDocument:">
|
||||
<string key="name">saveDocument:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="saveDocumentAs:">
|
||||
<string key="name">saveDocumentAs:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="saveDocumentTo:">
|
||||
<string key="name">saveDocumentTo:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
<object class="IBToOneOutletInfo" key="textField">
|
||||
<string key="name">textField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NSDocument.h</string>
|
||||
<string key="minorKey">./Classes/NSCollectionViewItem.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
|
||||
Reference in New Issue
Block a user