[Drawkit] DXF Import Progress / Example
Allan
allandaly at me.com
Thu Jan 22 21:38:54 PST 2009
Thanks for your feedback, Graham and Brad.
I tried to use this approach to zoom the drawing view to show all of
my imported DXF object on the screen at one time. My application is
based on the DK Simple Demo program, so mDrawingView here is just the
same as defined in the DKSDController object and "dxfLayer" is the
layer that I'm using to hold the imported DXF objects.
[mDrawingView zoomViewToRect: [dxfLayer unionOfAllObjectBounds]];
It does not work and the following NSLog is reported in the debugger
console window.
2009-01-22 21:28:24.627 DKSimpleDXF[345:10b] *** -[NSView
documentVisibleRect]: unrecognized selector sent to instance 0x10283e0
From a bit of looking around it seems that only NSScrollView and
NSClipView from the AppKit implement the "documentVisibleRect" method.
In the DK Simple Demo application there is no object containing the
DKDrawingView that responds to this method -- so the method fails.
Does that make sense? Is the DK Simple Demo application not set up to
be able to use these zoom commands?
-Allan
>>>>>>>>>>>>>>>>>>>>
> Brad suggests using -zoomFitInWindow: which will work if the drawing
> size is set to the extents of the objects. But if your question is
> about how to zoom to the objects that exist ignoring the drawing
> size (for example if your objects are all clustered in one corner)
> then you'll probably find that -zoomViewToRect: would be more
> useful. You'll have to supply a suitable rect, either by calculating
> it as you work through importing your objects or afterwards by
> iterating over them and forming the union of their bounds - a
> helpful method for doing this is [DKObjectOwnerLayer
> unionOfAllObjectBounds];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.apptree.net/pipermail/drawkit-apptree.net/attachments/20090122/42926137/attachment.htm>
More information about the Drawkit
mailing list