Commits

Cliff Biffle committed 76d6883

Renderer can now be switched at runtime using Cmd1-7.

  • Participants
  • Parent commits 404e447

Comments (0)

Files changed (3)

English.lproj/MainMenu.xib

 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="296"/>
 			<integer value="372"/>
-			<integer value="29"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 									<reference key="NSOnImage" ref="35465992"/>
 									<reference key="NSMixedImage" ref="502551668"/>
 								</object>
+								<object class="NSMenuItem" id="851891320">
+									<reference key="NSMenu" ref="466310130"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="719261243">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Point Cloud</string>
+									<string key="NSKeyEquiv">1</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="481186390">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Mesh</string>
+									<string key="NSKeyEquiv">2</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="975867275">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Card Cloud</string>
+									<string key="NSKeyEquiv">3</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="477715379">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Filled Quads</string>
+									<string key="NSKeyEquiv">4</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="175723275">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Wireframe Quads</string>
+									<string key="NSKeyEquiv">5</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="578250298">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Filled Tris</string>
+									<string key="NSKeyEquiv">6</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1068619292">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Wireframe Tris</string>
+									<string key="NSKeyEquiv">7</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
 							</object>
 						</object>
 					</object>
 					</object>
 					<int key="connectionID">534</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectPointCloudRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="719261243"/>
+					</object>
+					<int key="connectionID">543</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectMeshRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="481186390"/>
+					</object>
+					<int key="connectionID">544</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectCardCloudRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="975867275"/>
+					</object>
+					<int key="connectionID">545</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectFilledQuadRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="477715379"/>
+					</object>
+					<int key="connectionID">546</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectMeshedQuadRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="175723275"/>
+					</object>
+					<int key="connectionID">547</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectFilledTriRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="578250298"/>
+					</object>
+					<int key="connectionID">548</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectMeshedTriRenderer:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1068619292"/>
+					</object>
+					<int key="connectionID">549</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="102151532"/>
 							<reference ref="237841660"/>
+							<reference ref="851891320"/>
+							<reference ref="719261243"/>
+							<reference ref="481186390"/>
+							<reference ref="975867275"/>
+							<reference ref="477715379"/>
+							<reference ref="175723275"/>
+							<reference ref="578250298"/>
+							<reference ref="1068619292"/>
 						</object>
 						<reference key="parent" ref="586577488"/>
 					</object>
 						<reference key="object" ref="706664223"/>
 						<reference key="parent" ref="439893737"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">535</int>
+						<reference key="object" ref="851891320"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">536</int>
+						<reference key="object" ref="719261243"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">537</int>
+						<reference key="object" ref="481186390"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">538</int>
+						<reference key="object" ref="975867275"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">539</int>
+						<reference key="object" ref="477715379"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">540</int>
+						<reference key="object" ref="175723275"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">541</int>
+						<reference key="object" ref="578250298"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">542</int>
+						<reference key="object" ref="1068619292"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
 					<string>517.IBPluginDependency</string>
 					<string>533.CustomClassName</string>
 					<string>533.IBPluginDependency</string>
+					<string>535.IBPluginDependency</string>
+					<string>536.IBPluginDependency</string>
+					<string>537.IBPluginDependency</string>
+					<string>538.IBPluginDependency</string>
+					<string>539.IBPluginDependency</string>
+					<string>540.IBPluginDependency</string>
+					<string>541.IBPluginDependency</string>
+					<string>542.IBPluginDependency</string>
 					<string>56.IBPluginDependency</string>
 					<string>56.ImportedFromIB2</string>
 					<string>57.IBEditorWindowLastContentRect</string>
 					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>{{654, 239}, {194, 73}}</string>
+					<string>{{707, 763}, {194, 73}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{{525, 802}, {197, 73}}</string>
 					<string>{74, 862}</string>
 					<string>{{6, 978}, {478, 20}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{604, 269}, {231, 43}}</string>
+					<string>{{657, 643}, {231, 193}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{475, 832}, {234, 43}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>KVDepthView</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{{286, 129}, {275, 183}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">534</int>
+			<int key="maxID">549</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 				<object class="IBPartialClassDescription">
 					<string key="className">KVDepthView</string>
 					<string key="superclassName">NSOpenGLView</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>selectCardCloudRenderer:</string>
+							<string>selectFilledQuadRenderer:</string>
+							<string>selectFilledTriRenderer:</string>
+							<string>selectMeshRenderer:</string>
+							<string>selectMeshedQuadRenderer:</string>
+							<string>selectMeshedTriRenderer:</string>
+							<string>selectPointCloudRenderer:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>selectCardCloudRenderer:</string>
+							<string>selectFilledQuadRenderer:</string>
+							<string>selectFilledTriRenderer:</string>
+							<string>selectMeshRenderer:</string>
+							<string>selectMeshedQuadRenderer:</string>
+							<string>selectMeshedTriRenderer:</string>
+							<string>selectPointCloudRenderer:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">selectCardCloudRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectFilledQuadRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectFilledTriRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectMeshRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectMeshedQuadRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectMeshedTriRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">selectPointCloudRenderer:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 						<string key="majorKey">IBProjectSource</string>
 						<string key="minorKey">KVDepthView.h</string>
   GLfloat spin;
   
   GLfloat depthTable[2048];
+  
+  void (^renderAction)();
 }
 
 @property(retain) NSMutableData *rawDepthField;
+@property(copy) void (^renderAction)();
 
 - (void) depthFieldUpdated: (KFKinect *)kinect;
 
+- (IBAction) selectPointCloudRenderer: sender;
+- (IBAction) selectMeshRenderer: sender;
+- (IBAction) selectCardCloudRenderer: sender;
+- (IBAction) selectFilledQuadRenderer: sender;
+- (IBAction) selectMeshedQuadRenderer: sender;
+- (IBAction) selectFilledTriRenderer: sender;
+- (IBAction) selectMeshedTriRenderer: sender;
+
 @end
   linearDepthField = [[NSMutableData alloc] initWithBytesNoCopy: calloc(640 * 480, sizeof(GLfloat))
                                                          length: (640 * 480 * sizeof(GLfloat))];
   [self buildDepthTable];
+  [self selectPointCloudRenderer: nil];
 }
 
 #pragma mark --- NSOpenGLView Overrides ---
   
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   
-  [self drawDepthFieldAsPoints];
-  
+  (self.renderAction)();
   
   [[self openGLContext] flushBuffer];
 }
   [self setNeedsDisplay: YES];
 }
 
+#pragma mark --- Actions ---
+
+- (IBAction) selectPointCloudRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsPoints]; };
+}
+
+- (IBAction) selectMeshRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsMesh]; };
+}
+
+- (IBAction) selectCardCloudRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsCards]; };
+}
+
+- (IBAction) selectFilledQuadRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsQuadsUsingMode: GL_FILL]; };
+}
+- (IBAction) selectMeshedQuadRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsQuadsUsingMode: GL_LINE]; };
+}
+- (IBAction) selectFilledTriRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsTrisUsingMode: GL_FILL]; };
+}
+- (IBAction) selectMeshedTriRenderer: sender {
+  self.renderAction = ^{ [self drawDepthFieldAsTrisUsingMode: GL_LINE]; };
+}
+
 
 #pragma mark --- Properties ---
 
 @synthesize rawDepthField;
+@synthesize renderAction;
 
 @end