Changeset 394
- Timestamp:
- 04/14/07 18:57:14 (1 year ago)
- Files:
-
- trunk/LaserTools/FlashInspector/FlashInspector.xcodeproj/project.pbxproj (modified) (4 diffs)
- trunk/LaserTools/FlashInspector/LTRenderedContextView.h (modified) (1 diff)
- trunk/LaserTools/FlashInspector/LTRenderedContextView.m (modified) (4 diffs)
- trunk/LaserTools/LaserTools.xcodeproj/project.pbxproj (modified) (1 diff)
- trunk/LaserTools/_DataStructures/LTShapeWithStyle.m (modified) (1 diff)
- trunk/LaserTools/_Runtime/LTBufferedRenderer.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LaserTools/FlashInspector/FlashInspector.xcodeproj/project.pbxproj
r387 r394 40 40 proxyType = 2; 41 41 remoteGlobalIDString = 8DC2EF5B0486A6940098B216; 42 remoteInfo = LaserTools; 43 }; 44 DEBB6C1F0BD186B2004DAE1B /* PBXContainerItemProxy */ = { 45 isa = PBXContainerItemProxy; 46 containerPortal = D45A5EA80BCCA05600368A33 /* LaserTools.xcodeproj */; 47 proxyType = 1; 48 remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* LaserTools */; 42 49 remoteInfo = LaserTools; 43 50 }; … … 190 197 ); 191 198 dependencies = ( 199 DEBB6C200BD186B2004DAE1B /* PBXTargetDependency */, 192 200 ); 193 201 name = FlashInspector; … … 258 266 }; 259 267 /* End PBXSourcesBuildPhase section */ 268 269 /* Begin PBXTargetDependency section */ 270 DEBB6C200BD186B2004DAE1B /* PBXTargetDependency */ = { 271 isa = PBXTargetDependency; 272 name = LaserTools; 273 targetProxy = DEBB6C1F0BD186B2004DAE1B /* PBXContainerItemProxy */; 274 }; 275 /* End PBXTargetDependency section */ 260 276 261 277 /* Begin PBXVariantGroup section */ … … 299 315 INSTALL_PATH = "$(HOME)/Applications"; 300 316 OBJROOT = ../../Build; 317 OTHER_CFLAGS = ""; 301 318 PRODUCT_NAME = FlashInspector; 302 319 SYMROOT = ../../Build; trunk/LaserTools/FlashInspector/LTRenderedContextView.h
r224 r394 12 12 NSPoint LTOffsetPoint(NSPoint point, float x, float y); 13 13 NSPoint LTScaledPoint(NSPoint point, float w, float h); 14 15 #define LTRenderSegments 0 16 #define LTOvalPointRadius 1 14 17 15 18 // -------------------------------------------------------------------------- // trunk/LaserTools/FlashInspector/LTRenderedContextView.m
r227 r394 78 78 // it after we have drawn each color. 79 79 NSBezierPath *segments = [[NSBezierPath alloc] init]; 80 NSBezierPath *dots = [[NSBezierPath alloc] init]; 81 80 82 LTPoint *firstPoint = [[self points] objectAtIndex:0]; 81 83 float xScale = rect.size.width/2.0F; … … 83 85 float yScale = xScale; 84 86 [segments moveToPoint:LTOffsetPoint(LTScaledPoint([firstPoint nsPoint], xScale, yScale), 0.0F, 0.0F)]; 87 [dots moveToPoint:LTScaledPoint([firstPoint nsPoint], xScale, yScale)]; 85 88 86 89 // Now we set the starting line width and color 87 90 [segments setLineWidth:[firstPoint pixelLineWidth]]; 91 [dots setLineWidth:1.0F]; 92 88 93 [[firstPoint nsColor] set]; 89 94 LTColor *currColor = [firstPoint color]; … … 101 106 LTPoint *curr = [[self points] objectAtIndex:i]; 102 107 NSPoint scaledPoint = LTScaledPoint([curr nsPoint], xScale, yScale); 103 [segments lineToPoint:LTOffsetPoint(scaledPoint, 0.0F, 0.0F)]; 108 //[segments lineToPoint:LTOffsetPoint(scaledPoint, 0.0F, 0.0F)]; 109 110 // LTRenderSegments tells us whether or not we are going to render the 111 // line segment in between the given point (YES), or if we are just going 112 // to draw an oval around the point (NO). 113 if (LTRenderSegments) 114 { 115 [segments lineToPoint:scaledPoint]; 116 } 117 else 118 { 119 NSRect ovalRect = NSMakeRect(scaledPoint.x - LTOvalPointRadius, 120 scaledPoint.y - LTOvalPointRadius, 121 LTOvalPointRadius, LTOvalPointRadius); 122 123 [dots appendBezierPathWithOvalInRect:ovalRect]; 124 } 104 125 [segments setLineWidth:[curr pixelLineWidth]]; 126 127 // If we have a color change 105 128 if (![currColor isEqualToColor:[curr color]]) 106 129 { 107 [segments stroke]; 108 [ segments release];130 [segments stroke]; [segments release]; 131 [dots stroke]; [dots release]; 109 132 110 133 currColor = [curr color]; 111 134 segments = [[NSBezierPath alloc] init]; 112 [segments moveToPoint:LTOffsetPoint(scaledPoint, 0.0F, 0.0F)]; 135 dots = [[NSBezierPath alloc] init]; 136 //[segments moveToPoint:LTOffsetPoint(scaledPoint, 0.0F, 0.0F)]; 137 [segments moveToPoint:scaledPoint]; 138 [dots moveToPoint:scaledPoint]; 113 139 } 114 140 [[curr nsColor] set]; … … 117 143 } 118 144 119 [segments stroke]; 145 if (LTRenderSegments) 146 [segments stroke]; 147 else 148 [dots stroke]; 149 120 150 [segments release]; 151 [dots release]; 121 152 } 122 153 trunk/LaserTools/LaserTools.xcodeproj/project.pbxproj
r387 r394 575 575 INFOPLIST_FILE = Info.plist; 576 576 INSTALL_PATH = "@executable_path/../Frameworks/"; 577 OTHER_CFLAGS = "-D__LTSUBDIVIDESTRAIGHTS__=1"; 577 578 PRODUCT_NAME = LaserTools; 578 579 WRAPPER_EXTENSION = framework; trunk/LaserTools/_DataStructures/LTShapeWithStyle.m
r387 r394 494 494 absoluteX = absoluteX + [shapeRecord delta].x; 495 495 absoluteY = absoluteY + [shapeRecord delta].y; 496 NSPoint endPoint = NSMakePoint(absoluteX, absoluteY); 496 497 497 498 // Copy the color into the palette, and then using that and the 498 499 // start and end points we just computed, subdivide the line 499 500 // segments up 501 //#if __LTSUBDIVIDESTRAIGHTS__ 500 502 LTColor *copiedColor = [palette addAndCopyColor:[previousPoint color]]; 501 503 NSArray *subdividedPoints = 502 [LTBufferedRenderer subdivideLineBetweenPoints:[previousPoint nsPoint] 503 end:NSMakePoint(absoluteX, absoluteY) color:copiedColor]; 504 [LTBufferedRenderer subdivideLineBetweenPoints:[previousPoint reversedNsPoint] 505 end:endPoint color:copiedColor]; 506 507 [points addObjectsFromArray:subdividedPoints]; 508 previousPoint = [subdividedPoints lastObject]; 509 [points addObject:[LTPoint pointFromNSPoint:endPoint]]; 504 510 505 511 // create the point relative to the previous point 506 /*LTPoint *newPoint = [LTPoint point]; 512 /*#else 513 LTPoint *newPoint = [LTPoint point]; 507 514 [newPoint setX:absoluteX]; 508 515 [newPoint setY:absoluteY]; 509 [newPoint setColor:[palette addAndCopyColor:[previousPoint color]]]; */516 [newPoint setColor:[palette addAndCopyColor:[previousPoint color]]]; 510 517 511 518 // add the point save the point as the previous point 512 //[points addObject:newPoint]; 513 NSLog(@"here"); 514 [points addObjectsFromArray:subdividedPoints]; 515 previousPoint = [subdividedPoints lastObject]; 519 [points addObject:newPoint]; 520 #endif*/ 516 521 } 517 522 else trunk/LaserTools/_Runtime/LTBufferedRenderer.m
r387 r394 22 22 @implementation LTBufferedRenderer 23 23 24 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//24 // -------------------------------------------------------------------------- // 25 25 // Core 26 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//26 // -------------------------------------------------------------------------- // 27 27 + (LTBufferedRenderer *)renderer 28 28 { … … 44 44 } 45 45 46 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//46 // -------------------------------------------------------------------------- // 47 47 // Rendering movie frames 48 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//48 // -------------------------------------------------------------------------- // 49 49 // renders a single frame of the given flash movie. 50 50 // What is does is go through each frame instance and obtain points for … … 315 315 float deltaY = end.y - start.y; 316 316 float lineDistance = sqrt(pow(deltaX, 2) + pow(deltaY, 2)); 317 float signX = (signbit(deltaX) == 0) ? 1.0 : -1.0; 318 float signY = (signbit(deltaY) == 0) ? 1.0 : -1.0; 317 319 318 320 // Get the number of points by dividing the line distance by the points per … … 325 327 // instead of: 326 328 // . . . . . . . . (which is off!) 327 signednumberOfPoints = floor(lineDistance/LTPointsPerUnitLength);329 float numberOfPoints = floor(lineDistance/LTPointsPerUnitLength); 328 330 float deltaXPerPoint = deltaX / numberOfPoints; 329 331 float deltaYPerPoint = deltaY / numberOfPoints; … … 343 345 LTPoint *point = [[LTPoint alloc] initWithNSPoint:next color:color]; 344 346 [points addObject:point]; 347 //NSLog(NSStringFromPoint(next)); 345 348 } 346 349 347 350 // Now make the last point and add it to the array 348 351 LTPoint *lastPoint = [LTPoint pointFromNSPoint:end]; 349 NSLog([lastPoint description]);352 //NSLog([lastPoint description]); 350 353 [lastPoint setColor:color]; 351 354 [points addObject:lastPoint];
