Message 1 of 6
AcGs question
Not applicable
06-13-2002
05:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a modal dialog with a list. When I select a list item, I do the
following:
//------------------------------------------------------------------
m_pGSManager = acgsGetGsManager(acedGetAcadDwgView());
m_pGSDevice = m_pGSManager->getGUIDevice();
m_pGSView = m_pGSManager->getGSClassFactory()->createView();
resbuf wcs, ccs, dcs;
wcs.restype = RTSHORT;
wcs.resval.rint = 0;
ccs.restype = RTSHORT;
ccs.resval.rint = 1;
dcs.restype = RTSHORT;
dcs.resval.rint = 2;
resbuf rb,rbVMin,rbVMax;
AcGeVector3d viewDir;
AcGePoint3d cenPt,vsMin,vsMax;
acedGetVar("VSMIN", &rbVMin);
acedTrans(rbVMin.resval.rpoint, &ccs, &wcs, 0, asDblArray(vsMin));
acedGetVar("VSMAX", &rbVMax);
acedTrans(rbVMax.resval.rpoint, &ccs, &wcs, 0, asDblArray(vsMax));
cenPt = AcGeLineSeg3d(vsMin,vsMax).midPoint();
acedGetVar("VIEWDIR", &rb);
acedTrans(rb.resval.rpoint, &ccs, &wcs, 0, asDblArray(viewDir));
m_pGSView->setView(cenPt+viewDir,cenPt,viewDir,vsMax.x-vsMin.x,vsMax.y-vsMin
.y);
m_pConnectionMarker = new
AcDbBlockReference(AcGePoint3d::kOrigin,m_idOfConnectionMarkerBlock); //
m_idOfConnectionMarkerBlock is in the current dwg and valid
m_pConnectionMarker->setPosition(m_pListOfItems->connectionPoint(l_hItem));
// the point is on the screen. I'm sure.
m_pGSView->add(m_pConnectionMarker,m_pGSManager->getDBModel());
m_pGSDevice->add(m_pGSView);
m_pGSView->invalidateCachedViewportGeometry();
m_pGSView->invalidate();
m_pGSManager->getDBModel()->invalidate(AcGsModel::kInvalidateAll);
//------------------------------------------------------------------
The block not displayed.
How can I display a non-database resident entity (a drawable) using the GS
system?
The blockview sample doesn't help.
Any idea? Or a code snippet?
Thanx
Zé
I have a modal dialog with a list. When I select a list item, I do the
following:
//------------------------------------------------------------------
m_pGSManager = acgsGetGsManager(acedGetAcadDwgView());
m_pGSDevice = m_pGSManager->getGUIDevice();
m_pGSView = m_pGSManager->getGSClassFactory()->createView();
resbuf wcs, ccs, dcs;
wcs.restype = RTSHORT;
wcs.resval.rint = 0;
ccs.restype = RTSHORT;
ccs.resval.rint = 1;
dcs.restype = RTSHORT;
dcs.resval.rint = 2;
resbuf rb,rbVMin,rbVMax;
AcGeVector3d viewDir;
AcGePoint3d cenPt,vsMin,vsMax;
acedGetVar("VSMIN", &rbVMin);
acedTrans(rbVMin.resval.rpoint, &ccs, &wcs, 0, asDblArray(vsMin));
acedGetVar("VSMAX", &rbVMax);
acedTrans(rbVMax.resval.rpoint, &ccs, &wcs, 0, asDblArray(vsMax));
cenPt = AcGeLineSeg3d(vsMin,vsMax).midPoint();
acedGetVar("VIEWDIR", &rb);
acedTrans(rb.resval.rpoint, &ccs, &wcs, 0, asDblArray(viewDir));
m_pGSView->setView(cenPt+viewDir,cenPt,viewDir,vsMax.x-vsMin.x,vsMax.y-vsMin
.y);
m_pConnectionMarker = new
AcDbBlockReference(AcGePoint3d::kOrigin,m_idOfConnectionMarkerBlock); //
m_idOfConnectionMarkerBlock is in the current dwg and valid
m_pConnectionMarker->setPosition(m_pListOfItems->connectionPoint(l_hItem));
// the point is on the screen. I'm sure.
m_pGSView->add(m_pConnectionMarker,m_pGSManager->getDBModel());
m_pGSDevice->add(m_pGSView);
m_pGSView->invalidateCachedViewportGeometry();
m_pGSView->invalidate();
m_pGSManager->getDBModel()->invalidate(AcGsModel::kInvalidateAll);
//------------------------------------------------------------------
The block not displayed.
How can I display a non-database resident entity (a drawable) using the GS
system?
The blockview sample doesn't help.
Any idea? Or a code snippet?
Thanx
Zé