Changeset 387
- Timestamp:
- 04/14/07 16:44:37 (1 year ago)
- Files:
-
- trunk/LaserTools/FlashInspector/FlashInspector.xcodeproj/project.pbxproj (modified) (5 diffs)
- trunk/LaserTools/LaserLineAnimations/TextTesting.fla (modified) (previous)
- trunk/LaserTools/LaserTools.xcodeproj/project.pbxproj (modified) (2 diffs)
- trunk/LaserTools/_DataStructures/LTPoint.h (modified) (1 diff)
- trunk/LaserTools/_DataStructures/LTPoint.m (modified) (6 diffs)
- trunk/LaserTools/_DataStructures/LTShapeWithStyle.m (modified) (1 diff)
- trunk/LaserTools/_Importer/LTFlashImporter.m (modified) (4 diffs)
- trunk/LaserTools/_Runtime/LTBufferedRenderer.h (modified) (3 diffs)
- trunk/LaserTools/_Runtime/LTBufferedRenderer.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LaserTools/FlashInspector/FlashInspector.xcodeproj/project.pbxproj
r380 r387 17 17 /* End PBXBuildFile section */ 18 18 19 /* Begin PBXBuildStyle section */ 20 DEBB6BC40BD180D2004DAE1B /* Development */ = { 21 isa = PBXBuildStyle; 22 buildSettings = { 23 COPY_PHASE_STRIP = NO; 24 }; 25 name = Development; 26 }; 27 DEBB6BC50BD180D2004DAE1B /* Deployment */ = { 28 isa = PBXBuildStyle; 29 buildSettings = { 30 COPY_PHASE_STRIP = YES; 31 }; 32 name = Deployment; 33 }; 34 /* End PBXBuildStyle section */ 35 19 36 /* Begin PBXContainerItemProxy section */ 20 37 D45A5EAC0BCCA05600368A33 /* PBXContainerItemProxy */ = { … … 22 39 containerPortal = D45A5EA80BCCA05600368A33 /* LaserTools.xcodeproj */; 23 40 proxyType = 2; 24 remoteGlobalIDString = 8DC2EF5B0486A6940098B216 /* LaserTools.framework */;41 remoteGlobalIDString = 8DC2EF5B0486A6940098B216; 25 42 remoteInfo = LaserTools; 26 43 }; … … 186 203 isa = PBXProject; 187 204 buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FlashInspector" */; 205 buildSettings = { 206 }; 207 buildStyles = ( 208 DEBB6BC40BD180D2004DAE1B /* Development */, 209 DEBB6BC50BD180D2004DAE1B /* Deployment */, 210 ); 188 211 hasScannedForEncodings = 1; 189 212 mainGroup = 29B97314FDCFA39411CA2CEA /* FlashInspector */; … … 260 283 buildSettings = { 261 284 ARCHS = "$(NATIVE_ARCH)"; 285 CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; 262 286 COPY_PHASE_STRIP = NO; 263 287 FRAMEWORK_SEARCH_PATHS = ( … … 274 298 INFOPLIST_FILE = Info.plist; 275 299 INSTALL_PATH = "$(HOME)/Applications"; 300 OBJROOT = ../../Build; 276 301 PRODUCT_NAME = FlashInspector; 277 302 SYMROOT = ../../Build; trunk/LaserTools/LaserTools.xcodeproj/project.pbxproj
r349 r387 88 88 DEEECF790B940A010051C017 /* LTBufferedRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = DEEECF770B940A010051C017 /* LTBufferedRenderer.m */; }; 89 89 /* End PBXBuildFile section */ 90 91 /* Begin PBXBuildStyle section */ 92 DEBB6BC90BD180D2004DAE1B /* Development */ = { 93 isa = PBXBuildStyle; 94 buildSettings = { 95 COPY_PHASE_STRIP = NO; 96 }; 97 name = Development; 98 }; 99 DEBB6BCA0BD180D2004DAE1B /* Deployment */ = { 100 isa = PBXBuildStyle; 101 buildSettings = { 102 COPY_PHASE_STRIP = YES; 103 }; 104 name = Deployment; 105 }; 106 /* End PBXBuildStyle section */ 90 107 91 108 /* Begin PBXFileReference section */ … … 455 472 isa = PBXProject; 456 473 buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "LaserTools" */; 474 buildSettings = { 475 }; 476 buildStyles = ( 477 DEBB6BC90BD180D2004DAE1B /* Development */, 478 DEBB6BCA0BD180D2004DAE1B /* Deployment */, 479 ); 457 480 hasScannedForEncodings = 1; 458 481 mainGroup = 0867D691FE84028FC02AAC07 /* LaserTools */; trunk/LaserTools/_DataStructures/LTPoint.h
r224 r387 26 26 27 27 - (id)init; 28 - (id)initWithNSPoint:(NSPoint)point color:(LTColor *)color; 28 29 - (void)dealloc; 29 30 trunk/LaserTools/_DataStructures/LTPoint.m
r224 r387 12 12 @implementation LTPoint 13 13 14 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//14 // -------------------------------------------------------------------------- // 15 15 // Core 16 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//16 // -------------------------------------------------------------------------- // 17 17 + (LTPoint *)point 18 18 { … … 29 29 + (LTPoint *)pointFromNSPoint:(NSPoint)point 30 30 { 31 LTPoint *newPoint = [LTPoint point];31 /*LTPoint *newPoint = [LTPoint point]; 32 32 [newPoint setX:point.x]; 33 [newPoint setY:point.y]; 33 [newPoint setY:point.y];*/ 34 LTPoint *newPoint = [[[LTPoint alloc] initWithNSPoint:point color:nil] autorelease]; 34 35 return newPoint; 35 36 } … … 38 39 - (id)init 39 40 { 41 return [self initWithNSPoint:NSZeroPoint color:nil]; 42 } 43 44 - (id)initWithNSPoint:(NSPoint)point color:(LTColor *)color 45 { 40 46 if (self = [super init]) // as long as super class initialization goes to plan 41 47 { 42 [self setX: 0.0F];43 [self setY: 0.0F];44 [self setColor: nil];48 [self setX:point.x]; 49 [self setY:point.y]; 50 [self setColor:color]; 45 51 } 46 52 … … 54 60 } 55 61 56 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//62 // -------------------------------------------------------------------------- // 57 63 // Class Properties 58 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//64 // -------------------------------------------------------------------------- // 59 65 - (float)x 60 66 { … … 101 107 } 102 108 103 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//109 // -------------------------------------------------------------------------- // 104 110 // Working with the point 105 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//111 // -------------------------------------------------------------------------- // 106 112 // OK, this totally doesn't make sense, the SWF coordinate space is positive down 107 113 // and then right is positive. Who does that? So, to get a regular point, we … … 168 174 } 169 175 170 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//176 // -------------------------------------------------------------------------- // 171 177 // Misc 172 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//178 // -------------------------------------------------------------------------- // 173 179 - (NSString *)description 174 180 { trunk/LaserTools/_DataStructures/LTShapeWithStyle.m
r287 r387 488 488 LTStraightEdgeRecord *shapeRecord = (LTStraightEdgeRecord *)retrievedShapeRecord; 489 489 490 // determine the new absolute x and y 490 // OK, so because the laser needs to have multiple points, even 491 // for a straight line, we are going to figure out how many 492 // points to use, and then create all those points, and then 493 // add the end point. 491 494 absoluteX = absoluteX + [shapeRecord delta].x; 492 495 absoluteY = absoluteY + [shapeRecord delta].y; 493 496 497 // Copy the color into the palette, and then using that and the 498 // start and end points we just computed, subdivide the line 499 // segments up 500 LTColor *copiedColor = [palette addAndCopyColor:[previousPoint color]]; 501 NSArray *subdividedPoints = 502 [LTBufferedRenderer subdivideLineBetweenPoints:[previousPoint nsPoint] 503 end:NSMakePoint(absoluteX, absoluteY) color:copiedColor]; 504 494 505 // create the point relative to the previous point 495 LTPoint *newPoint = [LTPoint point];506 /*LTPoint *newPoint = [LTPoint point]; 496 507 [newPoint setX:absoluteX]; 497 508 [newPoint setY:absoluteY]; 498 [newPoint setColor:[palette addAndCopyColor:[previousPoint color]]]; 509 [newPoint setColor:[palette addAndCopyColor:[previousPoint color]]];*/ 499 510 500 511 // add the point save the point as the previous point 501 [points addObject:newPoint]; 502 previousPoint = newPoint; 512 //[points addObject:newPoint]; 513 NSLog(@"here"); 514 [points addObjectsFromArray:subdividedPoints]; 515 previousPoint = [subdividedPoints lastObject]; 503 516 } 504 517 else trunk/LaserTools/_Importer/LTFlashImporter.m
r245 r387 12 12 @implementation LTFlashImporter 13 13 14 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 15 // Core 16 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 14 // -------------------------------------------------------------------------- // 15 #pragma mark - 16 #pragma mark Core 17 #pragma mark - 18 // -------------------------------------------------------------------------- // 17 19 - (id)init 18 20 { … … 30 32 } 31 33 32 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 33 // Main Import Calls 34 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 34 // -------------------------------------------------------------------------- // 35 #pragma mark - 36 #pragma mark Main Import Calls 37 #pragma mark - 38 // -------------------------------------------------------------------------- // 35 39 /* 36 40 * This is pretty much the top level importer method. It will get the file data (after … … 369 373 } 370 374 371 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 372 // Header Calls 373 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 375 // -------------------------------------------------------------------------- // 376 #pragma mark - 377 #pragma mark Header Calls 378 #pragma mark - 379 // -------------------------------------------------------------------------- // 374 380 375 381 /* … … 482 488 } 483 489 484 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 485 // Tag Calls 486 // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- // 490 // -------------------------------------------------------------------------- // 491 #pragma mark - 492 #pragma mark Tag Calls 493 #pragma mark - 494 // -------------------------------------------------------------------------- // 487 495 488 496 /* trunk/LaserTools/_Runtime/LTBufferedRenderer.h
r297 r387 22 22 23 23 #define LTCurveLinearizationQuality 6.0F 24 #define LTPointsPerUnitLength 50.0F 24 25 25 26 NSPoint LTDivideLineSegment(float t, NSPoint a, NSPoint b); … … 29 30 } 30 31 31 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//32 // -------------------------------------------------------------------------- // 32 33 // Core 33 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//34 // -------------------------------------------------------------------------- // 34 35 + (LTBufferedRenderer *)renderer; 35 36 … … 37 38 - (void)dealloc; 38 39 39 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//40 // -------------------------------------------------------------------------- // 40 41 // Rendering movie frames 41 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//42 // -------------------------------------------------------------------------- // 42 43 + (NSArray *)renderFrame:(uint16_t)frame inMovie:(LTFlashMovie *)movie; 43 44 + (NSArray *)renderFrameInstance:(LTFrameInstance *)instance inMovie:(LTFlashMovie *)movie; 44 + (NSArray *)renderObjectInstance:(LTObjectInstance *)instance withContext:(LTRenderedContext)context inFrameInstance:(LTFrameInstance *)frameInstance withBounds:(NSRect)bounds; 45 + (NSArray *)renderObjectInstance:(LTObjectInstance *)instance 46 withContext:(LTRenderedContext)context 47 inFrameInstance:(LTFrameInstance *)frameInstance 48 withBounds:(NSRect)bounds; 45 49 46 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//50 // -------------------------------------------------------------------------- // 47 51 // Curve and point manipulation 48 // -------------------------------------------------------------------------- ---------------------------------------------------------------------------------------//52 // -------------------------------------------------------------------------- // 49 53 + (NSArray *)linearizeCurve:(LTCurvedEdgeRecord *)curve fromAnchor:(NSPoint)anchor; 50 54 + (NSArray *)linearizeCurve:(LTCurvedEdgeRecord *)curve fromAnchor:(NSPoint)anchor quality:(float)quality; 51 55 56 + (NSArray *)subdivideLineBetweenPoints:(NSPoint)start end:(NSPoint)end color:(LTColor *)color; 57 52 58 @end trunk/LaserTools/_Runtime/LTBufferedRenderer.m
r244 r387 304 304 } 305 305 306 /* 307 * Subdivides a line segment into multiple segments. Then it puts LTPoints 308 * into an autoreleased array and returns it. 309 */ 310 + (NSArray *)subdivideLineBetweenPoints:(NSPoint)start end:(NSPoint)end 311 color:(LTColor *)color 312 { 313 // First, find the change 314 float deltaX = end.x - start.x; 315 float deltaY = end.y - start.y; 316 float lineDistance = sqrt(pow(deltaX, 2) + pow(deltaY, 2)); 317 318 // Get the number of points by dividing the line distance by the points per 319 // unit length. We floor it so that we do not add the last point. This is 320 // done by the user. 321 // So for example, if we have two points: 322 // . . 323 // we floor it so that we can do this: 324 // . . . . . . . . 325 // instead of: 326 // . . . . . . . . (which is off!) 327 signed numberOfPoints = floor(lineDistance/LTPointsPerUnitLength); 328 float deltaXPerPoint = deltaX / numberOfPoints; 329 float deltaYPerPoint = deltaY / numberOfPoints; 330 331 // Now, create an array of points to add to. 332 NSMutableArray *points = [NSMutableArray arrayWithCapacity:numberOfPoints + 1]; 333 334 // For every point, we just multiply by the deltaXPerPoint and deltaYPerPoint 335 // to get the next point 336 int i; 337 for (i = 0; i < numberOfPoints; i++) 338 { 339 // Compute the next point, convert it to an LTPoint using the passed 340 // color, and then add the point to the array of points 341 NSPoint next = NSMakePoint(start.x + deltaXPerPoint * (float)i, 342 start.y + deltaYPerPoint * (float)i); 343 LTPoint *point = [[LTPoint alloc] initWithNSPoint:next color:color]; 344 [points addObject:point]; 345 } 346 347 // Now make the last point and add it to the array 348 LTPoint *lastPoint = [LTPoint pointFromNSPoint:end]; 349 NSLog([lastPoint description]); 350 [lastPoint setColor:color]; 351 [points addObject:lastPoint]; 352 353 return points; 354 } 355 306 356 @end
