get regenabort() to work.
get regenabort() to work.
in the sample odamfcapp the cdwgviewer class
implements "bool regenabort() const". i tried to do
this as well in the singledoc sample, but there it
does not work. i really do not understand why this is.
regards, jeroen posch.
hi,
i've inserted
bool csingledocview::regenabort() const
{
return false;
}
and it's called from vectorization (i got there in debugger).
or do you mean you copy implementation of regenabort() from odamfcapp to singledoc sample..? then you should copy other related functions e.g.:
afx_msg lresult cdwgviewer:

nredraw(wparam wparam, lparam lparam),
void cdwgviewer:

npaint().
what behaviour of singledoc do you want to achieve ?
regenabort in simpledoc sample app
hi dmitry,
i modified the singledoc sample to do the vecorisation in
a thread (like in the odamfcapp sample) so i can do zoom
in/out and panning using the scroll wheel and things like that, and then interrupt the vectorisation when a new
wheel/move message is received while the vectorisation is
still in progress. the threaded vectorisation i got to work
perfectly.
i then added "bool regenabort(void) const" to the header file, and an implementation to the source file where i return the value of a "volatile bool m_babortregen" which
is set when required so the vectorisation will be
interrupted if required. it did not work (?).
i am now working at home and have an unmodified version
of all the example sources here and did the same here as
you say yo did. to my shame i must admit that indeed it
does work now ;-(.
i do not have the modified sources from the office with me now, so it is a bit hard for me to find out what i did wrong.
i will get back on that monday.
what i want to do with the singledoc sample is find out
how i can integrate the vectorisation/rasterisation of the
library into our own products. these are dredging support navigation programs for hopper/cutter/backhoe dredgers.
for that purpose i only need to be able to vectorize/ rasterize a dwg to a memorydc/bitmap for off-screen display preperation. i think i have found out how i can do that with the wingdi sample vectorizer but i needed to be able to abort the proces, i must have overlooked something.
one other thing i need to be able to do is have the vectorizer only re-process a small rectangular area
(in pixel space) of the drawing. i now do that by telling
the vectorizer the size of the vectorisation area has
changed with the funtion onsize() and then adjusting the world to device conversion with odgsbasevectorizeview::setview(). this works ok, but it results in small shifts of pixels in the resulting image.
--> is there a way to leave the size of the image the same as when the original vectorisation took place, but have the
vectorizer only re-vectorize a part of the image where that part is based on a rectangle in pixel space? thus setting
"world clipping limits" for the vectorizer/rasterizer. remember i only process 2d entities.
i find it very hard to find this out from the documentation.
looking through the forum i saw someone asking about the possibility to simplify the contents of a dwg into lines,
polylines, (filled) polygons, arcs and circles. i think this would be a very good idea because my code for rasterizing
polyline/polygon based drawings is much faster then the
wingdi sample. this is probably because i only handle 2d
entities and thus do not need the extra geometry conversion for handling the more complex 3d to display translation required for a general dwg file.
if you have a suggestion on how the achieve the conversion of a dwg (including texts) to lines, polylines, polygons, arc and circles easily i would be very gratefull.
kind regards,
jeroen posch.
hi jeroen,
we rejected separate thread rendering and modified odamfcapp to render in the main thread because of complexity of proper thread synchronization and other problems with third-party code (e.g. ole).
i'm sorry but i can't say what's wrong with your code...
quote:
originally posted by jepo
--> is there a way to leave the size of the image the same as when the original vectorisation took place, but have the
vectorizer only re-vectorize a part of the image where that part is based on a rectangle in pixel space
1. the logical view and viewport parameters must be left original.
2. hdc must be clipped to enable modification of required part only.
3. in odgsview::update() only geometry intersecting requested area should be queried to redraw.
but it can be done only inside wingdi gs implementation, i see no way to do it outside.