几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】layer onoff (http://www.dimcax.com/hust/showthread.php?t=17005)

yang686526 2009-05-06 04:37 PM

【转帖】layer onoff
 
layer on/off
layer on/off
hi,
i posted a query about this before christmas, but have received no response, so i thought i'd try again. i'm using dd 2.2.
i have a couple of layers turned off when i read in my dwg file. on each of these layers there are a couple of entities. when i initially display the file, these entities/layers are not displayed, which is what i would expect. however, if i call setisoff(false) for any of the layers, the entities already on the layer are still not displayed, though if i add new entities to the layer they are correctly displayed.
so what is it about the entities already on the layer which stops them being displayed? if i switch on the layers, and save the file, then reload it, the hidden entities are now correctly displayed.
it works fine in odamfxapp (of course!), but i can't see what the difference is between the two apps.
i'd really appreciate some help on this one, since i've been battling with it for some time now.
regards
ali smith
hi,
the only thing i see now why it could happen is that gs cache is not notified properly when layer's state is changed. default db->gs notification mechanism is encapsulated into odgslayouthelper. implementation for this object is being created inside oddbgsmanager::setupactivelayoutviews() and returned to caller. make sure you don't release it (don't ignore returned pointer; see odamfcapp/dwgviewer.cpp).
if nothing will help, try reduce your application down to small example illustrating the problem.
yes, i maintain the returned pointer from setupactivelayoutviews().
one thing i've noticed since i posted my original query, is that if i move the entities, so calling setposition() or equivalent depending on the entity type, the entity shows fine. don't know if this helps.
in the meantime, i'll try to reduce my app down to as small as i can get it to demonstrate the problem.
could your problem be related to the problem i described in this post:
i have not heard anything in response to my query.
we were able to work around the problem as described in the linked post (maybe you could try our workaround?), so we are not waiting on a fix. however, if possible, we would like some acknowledgement from oda as to whether or not oda believes that this is a real problem and whether or not they will make a fix in the future.
hi wageoghe,
i've found a work around now as well - by using winopengl instead of wingdi! this works exactly as i would expect. so it must presumably be a bug in the wingdi.gs code.
i saw your post when i was scanning for any clues, but we're using dd 2.2 which is much simpler to use than the 1.3 implementation. however, i must say that there did seem to be similarities, with one layer seeming to behave differently to the others, depending on which layer you played with first.
did you try using winopengl instead of wingdi?
yes, i see that entities are not redrawn when are modified in gdi gs...
it's definitely a bug, we'll take care about it.
it's fixed.


所有的时间均为北京时间。 现在的时间是 09:37 PM.