马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
只能取得投影生成的点的三维坐标,现在我只能取得此生成点的X和Y的坐标,但一直无法取得Z轴的坐标值。
代码如下:
CATIDftGenGeomAccess *piGenGeomAccess = NULL;
IUnknown *piGenView = NULL;
if (NULL != piCurrentView)
{
if (SUCCEEDED( piCurrentView->GetApplicativeExtension(IID_CATIDftGenView,&piGenView)))
{
if (SUCCEEDED( piGenView->QueryInterface(IID_CATIDftGenGeomAccess, (void**) & piGenGeomAccess) ) )
{
CATIUnknownList * piList = NULL;
// Get a list containing all Generated Geometry of the view.
if( SUCCEEDED( piGenGeomAccess->GetAllGeneratedItems(IID_CATIDftGenGeom, &piList) ) )
{
unsigned int piListSize = 0;
piList->Count(&piListSize);
CATIDftGenGeom * piGenGeom = NULL;
IUnknown * item = NULL;
CATUnicodeString PartName;
CATIVisProperties *piVisProp = NULL;
CATVisPropertiesValues ioValues;
CATVisPropertyType iPropertyType = CATVPColor;
// Loop on all Generated Geometry of the view.
for(unsigned int i=0 ; i<piListSize ; i++)
{
if( SUCCEEDED( piList->Item(i, &item) ) )
{
if(SUCCEEDED( item->QueryInterface(IID_CATIDftGenGeom, (void**) & piGenGeom) ) )
{
// 只能获得X和Y
IDMPoint2D * Point2D = NULL;
if (SUCCEEDED(piGenGeom->QueryInterface(IID_IDMPoint2D,(void **)& Point2D)))
{
double pt1[2];
Point2D->GetPointData(pt1);
}
|