Changeset 337

Show
Ignore:
Timestamp:
03/18/07 23:28:59 (2 years ago)
Author:
cweider2
Message:

RenderFrameView: connects point from last frame with first of new frame

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/LaserLine_2.0/Src/Interface/LZRenderedFrameView.h

    r321 r337  
    1313  { 
    1414  NSData *rawFrameData; 
     15  RawPoint lastPoint; 
    1516  } 
    1617 
  • trunk/LaserLine_2.0/Src/Interface/LZRenderedFrameView.m

    r320 r337  
    1616    if (self) { 
    1717        rawFrameData = nil; 
     18                lastPoint = NullRawPoint; 
    1819    } 
    1920    return self; 
     
    5051  RawPoint *points = (RawPoint *)[rawFrameData bytes]; 
    5152   
     53  //draw line from the last fame's last point to this frame's first 
     54  if(count > 0) 
     55        { 
     56        [curve removeAllPoints]; 
     57        NSPoint point1 = NSMakePoint(lastPoint.x, lastPoint.y); 
     58        NSPoint point2 = NSMakePoint(points[0].x, points[0].y); 
     59         
     60        if(lastPoint.r | lastPoint.g | lastPoint.b)     //only do curve if color is non-zero 
     61                { 
     62                [curve moveToPoint:point1]; 
     63                [curve lineToPoint:point2]; 
     64                 
     65                [curve transformUsingAffineTransform:transform]; 
     66                 
     67                NSColor *laserColor = [NSColor colorWithCalibratedRed:(lastPoint.r/255.) green:(lastPoint.g/255.) blue:(lastPoint.b)/255. alpha:1]; 
     68                 
     69                [curve setLineWidth:400*scalingFactor]; 
     70                [[laserColor colorWithAlphaComponent:.5] set]; 
     71                [curve stroke]; 
     72                 
     73                [curve setLineWidth:200*scalingFactor]; 
     74                [laserColor set]; 
     75                [curve stroke]; 
     76                } 
     77        } 
     78   
    5279  for(i; i < count-1; i++) 
    5380        { 
     
    6087                [curve moveToPoint:point1]; 
    6188                [curve lineToPoint:point2]; 
     89                 
     90                if(i == 0 & 0) 
     91                        [curve appendBezierPathWithOvalInRect:NSMakeRect(point1.x-300,point1.y-300,600,600)]; 
    6292                 
    6393                [curve transformUsingAffineTransform:transform]; 
     
    75105        } 
    76106   
     107  if(count > 0) 
     108          lastPoint = points[count-1]; 
     109   
    77110  [curve release]; 
    78111  [transform release]; 
  • trunk/LaserLine_2.0/Src/OutputController/RawTypes.c

    r320 r337  
    11#import "RawTypes.h" 
    22 
    3 const RawFrame NullRawFrame = {0, 0}; 
     3const RawPoint NullRawPoint = {0, 0, 0, 0, 0, 0}; 
     4const RawFrame NullRawFrame = {&NullRawPoint, 0}; 
  • trunk/LaserLine_2.0/Src/OutputController/RawTypes.h

    r320 r337  
    1313} RawFrame; 
    1414 
     15const extern RawPoint NullRawPoint; 
    1516const extern RawFrame NullRawFrame;