Commits

Anonymous committed 0db3fe4

adding a curve and rectangle test case

  • Participants
  • Parent commits 4c65bba

Comments (0)

Files changed (3)

VectorBoolean/MyDocument.h

 - (IBAction) onMoreConcentricContours:(id)sender;
 - (IBAction) onCircleOverlappingHole:(id)sender;
 - (IBAction) onHoleOverlappingHole:(id)sender;
+- (IBAction) onCurvyShapeOverlappingRectangle:(id)sender;
 
 - (IBAction) onShowPoints:(id)sender;
 - (IBAction) onShowIntersections:(id)sender;

VectorBoolean/MyDocument.m

 - (void) addMoreConcentricContours;
 - (void) addOverlappingHole;
 - (void) addHoleOverlappingHole;
+- (void) addCurvyShapeOverlappingRectangle;
 
 - (void) addRectangle:(NSRect)rect;
 - (void) addCircleAtPoint:(NSPoint)center withRadius:(CGFloat)radius;
     [_view.canvas addPath:holeyRectangle2 withColor:[NSColor redColor]];
 }
 
+- (void) addCurvyShapeOverlappingRectangle
+{
+    NSBezierPath *curveyShape = [NSBezierPath bezierPath];
+    [curveyShape moveToPoint:NSMakePoint(335.000000, 203.000000)];
+    [curveyShape curveToPoint:NSMakePoint(335.000000, 200.000000) controlPoint1:NSMakePoint(335.000000, 202.000000) controlPoint2:NSMakePoint(335.000000, 201.000000)];
+    [curveyShape curveToPoint:NSMakePoint(270.000000, 90.000000) controlPoint1:NSMakePoint(335.000000, 153.000000) controlPoint2:NSMakePoint(309.000000, 111.000000)];
+    [curveyShape curveToPoint:NSMakePoint(240.000000, 145.000000) controlPoint1:NSMakePoint(252.000000, 102.000000) controlPoint2:NSMakePoint(240.000000, 122.000000)];
+    [curveyShape curveToPoint:NSMakePoint(305.000000, 210.000000) controlPoint1:NSMakePoint(240.000000, 181.000000) controlPoint2:NSMakePoint(269.000000, 210.000000)];
+    [curveyShape curveToPoint:NSMakePoint(335.000000, 203.000000) controlPoint1:NSMakePoint(316.000000, 210.000000) controlPoint2:NSMakePoint(326.000000, 207.000000)];
+    [_view.canvas addPath:curveyShape withColor:[NSColor blueColor]];
+
+    NSBezierPath *rectangle = [NSBezierPath bezierPath];
+    CGFloat top = 65.0 + 160.0 / 3.0;
+    [rectangle moveToPoint:NSMakePoint(40, top)];
+    [rectangle lineToPoint:NSMakePoint(410, top)];
+    [rectangle lineToPoint:NSMakePoint(410, 50)];
+    [rectangle lineToPoint:NSMakePoint(40, 50)];
+    [rectangle lineToPoint:NSMakePoint(40, top)];
+    [_view.canvas addPath:rectangle withColor:[NSColor redColor]];
+}
+
 - (void) addRectangle:(NSRect)rect
 {
     NSBezierPath *rectangle = [NSBezierPath bezierPath];
     [self onReset:sender];                
 }
 
+- (IBAction) onCurvyShapeOverlappingRectangle:(id)sender
+{
+    _resetAction = @selector(addCurvyShapeOverlappingRectangle);
+    [self onReset:sender];                
+}
+
 - (IBAction) onShowPoints:(id)sender
 {
     _view.canvas.showPoints = !_view.canvas.showPoints;
         [menuItem setState:_resetAction == @selector(addOverlappingHole) ? NSOnState : NSOffState];
     } else if ( [anItem action] == @selector(onHoleOverlappingHole:) ) {
         [menuItem setState:_resetAction == @selector(addHoleOverlappingHole) ? NSOnState : NSOffState];
+    } else if ( [anItem action] == @selector(onCurvyShapeOverlappingRectangle:) ) {
+        [menuItem setState:_resetAction == @selector(addCurvyShapeOverlappingRectangle) ? NSOnState : NSOffState];
     } else if ( [anItem action] == @selector(onShowPoints:) ) {
         [menuItem setState:_view.canvas.showPoints ? NSOnState : NSOffState];
     } else if ( [anItem action] == @selector(onShowIntersections:) ) {

VectorBoolean/en.lproj/MainMenu.xib

 									<reference key="NSOnImage" ref="1033313550"/>
 									<reference key="NSMixedImage" ref="310636482"/>
 								</object>
-								<object class="NSMenuItem" id="892473285">
+								<object class="NSMenuItem" id="740527877">
 									<reference key="NSMenu" ref="930598111"/>
 									<string key="NSTitle">Rectangle w/hole Overlapping Rectangle w/hole</string>
 									<string key="NSKeyEquiv"/>
 									<reference key="NSOnImage" ref="1033313550"/>
 									<reference key="NSMixedImage" ref="310636482"/>
 								</object>
+								<object class="NSMenuItem" id="387499246">
+									<reference key="NSMenu" ref="930598111"/>
+									<string key="NSTitle">Curve Overlapping Rectangle</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="1033313550"/>
+									<reference key="NSMixedImage" ref="310636482"/>
+								</object>
 							</object>
 						</object>
 					</object>
 					<object class="IBActionConnection" key="connection">
 						<string key="label">onHoleOverlappingHole:</string>
 						<reference key="source" ref="1014"/>
-						<reference key="destination" ref="892473285"/>
+						<reference key="destination" ref="740527877"/>
 					</object>
 					<int key="connectionID">585</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">onCurvyShapeOverlappingRectangle:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="387499246"/>
+					</object>
+					<int key="connectionID">587</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 							<reference ref="21338714"/>
 							<reference ref="33431505"/>
 							<reference ref="94560581"/>
-							<reference ref="892473285"/>
+							<reference ref="740527877"/>
+							<reference ref="387499246"/>
 						</object>
 						<reference key="parent" ref="40719474"/>
 					</object>
 					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">584</int>
-						<reference key="object" ref="892473285"/>
+						<reference key="object" ref="740527877"/>
+						<reference key="parent" ref="930598111"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">586</int>
+						<reference key="object" ref="387499246"/>
 						<reference key="parent" ref="930598111"/>
 					</object>
 				</object>
 					<string>580.IBPluginDependency</string>
 					<string>582.IBPluginDependency</string>
 					<string>584.IBPluginDependency</string>
+					<string>586.IBPluginDependency</string>
 					<string>72.IBPluginDependency</string>
 					<string>72.ImportedFromIB2</string>
 					<string>73.IBPluginDependency</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>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 				<reference key="dict.values" ref="0"/>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">585</int>
+			<int key="maxID">587</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 							<string>onComplexShapes2:</string>
 							<string>onComplexShapes:</string>
 							<string>onConcentricContours:</string>
+							<string>onCurvyShapeOverlappingRectangle:</string>
 							<string>onDiamondInsideRectangle:</string>
 							<string>onDiamondOverlappingRectangle:</string>
 							<string>onDifference:</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
 							<string>onComplexShapes2:</string>
 							<string>onComplexShapes:</string>
 							<string>onConcentricContours:</string>
+							<string>onCurvyShapeOverlappingRectangle:</string>
 							<string>onDiamondInsideRectangle:</string>
 							<string>onDiamondOverlappingRectangle:</string>
 							<string>onDifference:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							<object class="IBActionInfo">
+								<string key="name">onCurvyShapeOverlappingRectangle:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
 								<string key="name">onDiamondInsideRectangle:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							<string>onComplexShapes2:</string>
 							<string>onComplexShapes:</string>
 							<string>onConcentricContours:</string>
+							<string>onCurvyShapeOverlappingRectangle:</string>
 							<string>onDiamondInsideRectangle:</string>
 							<string>onDiamondOverlappingRectangle:</string>
 							<string>onDifference:</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
 							<string>onComplexShapes2:</string>
 							<string>onComplexShapes:</string>
 							<string>onConcentricContours:</string>
+							<string>onCurvyShapeOverlappingRectangle:</string>
 							<string>onDiamondInsideRectangle:</string>
 							<string>onDiamondOverlappingRectangle:</string>
 							<string>onDifference:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							<object class="IBActionInfo">
+								<string key="name">onCurvyShapeOverlappingRectangle:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
 								<string key="name">onDiamondInsideRectangle:</string>
 								<string key="candidateClassName">id</string>
 							</object>