几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】double buffer does not work after change active layou (http://www.dimcax.com/hust/showthread.php?t=15779)

yang686526 2009-05-04 08:04 PM

【转帖】double buffer does not work after change active layou
 
double buffer does not work after change active layout.
double buffer does not work after change active layout.
hi all!
i have a problem with double buffering when change active layout. at the first time, double buffer work fine. after change active layout, it seem that double buffer does not work any more. my steps is below:
- change active layout: pdb->setcurrentlayout((odstring)szspace);
- release all device
- create device again (enablegsmodel(true))
- call onviewzoomextents: if the layout is paper space, set active view is overall view (to make model space and paper space zooming at the same time)
after change active layout, it redraw slowly, it have no double buffer anymore. the problem occurs with odamfcapp sample too. you can test with attached file.
code:
code:
void cdwgviewer::onviewzoomextents()
{
oddbcommandcontextptr pdbcmdctx(getdocument()->cmdctx());
oddbdatabaseptr pdb = pdbcmdctx->database();
oddblayoutptr playout = pdb->currentlayoutid().safeopenobject(oddb::kforwrite);
odstring layout = playout->getlayoutname();
if (layout != l"model")
{ // paper space

execmd( dd_t("zoom e ") );
oddbobjectid overallvpid = playout->overallvportid();
oddbviewportptr pactivevp = overallvpid.safeopenobject(oddb::kforwrite);
odrxobjectptr playoutview = pactivevp;
odgsviewptr poverallview = overallview(m_pdevice);
odgsviewptr pactiveview = m_pdevice->activeview();
m_pdevice->makeviewactive(poverallview.detach());
}
else execmd( dd_t("zoom e ") );do anybody know this problem? what can i do to have double buffer again?
please help...
attached files
please answer me!
do any body know how to fix this problem, please answer me. odamfcapp sample have this problem, but i know that many people know how to fix this. please help me soon...!!!
thank you!
trang

hi,
use:
code:
m_pdevice->makeviewactive(poverallview.get());, instead of:
code:
m_pdevice->makeviewactive(poverallview.detach());you corrupt smart pointer to overall view. problem with geometry cache goes from here.


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