几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】start-end- Points Of A Line After Zoom (http://www.dimcax.com/hust/showthread.php?t=18659)

yang686526 2009-05-07 04:21 PM

【转帖】start-end- Points Of A Line After Zoom
 
start-/end- points of a line after zoom?
start-/end- points of a line after zoom?
is there a way to locate start point and end point of a line after a dxf have been enlarged (zoom)?
i have opened a simple drawing in a mfc application i抦 working on. i can zoom using a window (rubber band) or i just click to enlarge it. if i zoom-click then the drawing will be zoomed 2x around the point where i clicked. it抯 now i need to find line starts and ends for lines chosen by the user, after i抳e zoomed. i have been looking at this for some time now and i抳e tried different approaches, so fare i抳e not been successful so please help me!
regards
kennet
hello kennet,
not sure of exactly what your trying to work out here:
if the line geometry for example in a drawing is 10.0f, 10.0f, 0.0f -> 20.0f, 10.0f, 0.0f
and then you zoom in, the geometry remains the same, the zoom is generally applied to the view (ie think of a camera moving forward in the real world, the object does not change in size, you just moved closer to the object, and hence now looks bigger.)
so therefore the geometry remains exactly the same.
hope this helps.
cheers
jason
okay, i抦 afraid that my question might have been a bit blurred, i抦 sorry for that.
i know that when something is zoomed a 搗irtual camera?is moved, closing in on the object. the coordinates remain the same it抯 just the image that get抯 enlarged on screen.
below a sample of what i had hoped to fix somehow.
let抯 say i have a line that reach almost from the left end of the client area to the right like the image to the left below (zoom 1x). i have the x and y coordinates no problem.
now i zoom the image to 2x. i have a line that reach from the left to right that cover the same length as the client area. the coordinates are still the same it抯 only the camera that has moved closer.
now we are down to my question.
is there a way to keep track of the coordinates for the end-points sticking out to the left respectively to the right of the screen, p1 and p2? this preferably relative screen or client coordinates.
code:
zoom 1x zoom 2x
┌─────────┐ ┌─────────┐
│ │ │ │
│ ─────── │ p1 ───│─────────│─── p2
│ │ │ │
└─────────┘ └─────────┘why i need to find p1 and p2 is a long story.
i hope this have cleared things a little bit.
regards
kennet


所有的时间均为北京时间。 现在的时间是 02:34 AM.