iphone: mechanical drawing & layers

Posted by d_CFO on Stack Overflow See other posts from Stack Overflow or by d_CFO
Published on 2010-05-17T20:31:26Z Indexed on 2010/05/17 23:30 UTC
Read the original article Hit count: 310

Filed under:
|

I need to do a bit of mechanical drawing. I can (1) display the part’s image,

[self.view addSubview:thePartAsImageView];

(2) implement two sliders (one horizontal for part’s width and one vertical for part’s height),

heightSlider.transform = CGAffineTransformRotate(heightSlider.transform, 270.0/180*M_PI);

(3) display the corresponding values (dimensions) as the user moves the sliders, and even (4) draw the dimensioning lines with arrowheads:

CGContextAddLineToPoint

What I can’t do is (5) remove those lines after I’ve drawn them.

What I want is “if userTouchedTheHorizontalControl then eraseTheLinesForTheVerticalControl.”

If I understand correctly – first, that Quartz composites everything to a single layer, and second, that CALayer, GeekGameBoard and so on only work on Mac -- then I have to do something different. But isn’t there something I can do other than switch to Open GL?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about layers