www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawXEvents::CustomEntity_transformBy 方法

变换自定义实体

IDL
[id(11)]
void CustomEntity_transformBy(IDispatch* pCustomEntity, IDispatch* pMatXform, LONG* pOk);
参数 
说明 
IDispatch* pCustomEntity 
IMxDrawCustomEntity对象 
IDispatch* pMatXform 
IMxDrawMatrix3d对象,变换矩阵 
pRet 
返回值,成功回 1. 

例如: VC COM

            void CTestVc2005Dlg::CustomEntity_transformByMxdrawxctrl1(LPDISPATCH pCustomEntity, LPDISPATCH pMatXform, long* pOk)
            {
                // TODO: 在此处添加消息处理程序代码
                *pOk = 1;
                IMxDrawCustomEntityPtr spDrawData;
                pCustomEntity->QueryInterface(&spDrawData);

                IMxDrawMatrix3dPtr spMat;
                pMatXform->QueryInterface(&spMat);

                CString sGuid = spDrawData->Guid;
                if(sGuid == MX_CUSTOM_ENTITY_ID)
                {
                    if(spDrawData->IsHave(_T("ept") )  != VARIANT_TRUE)
                        return;

                    IMxDrawPointPtr stp =  spDrawData->GetPoint(_T("spt"));
                    if(stp == NULL)
                        return;

                    IMxDrawPointPtr ept =  spDrawData->GetPoint(_T("ept"));
                    if(ept == NULL)
                        return;

                    stp->TransformBy(spMat);
                    ept->TransformBy(spMat);

                    spDrawData->SetPoint(_T("ept"),ept);
                    spDrawData->SetPoint(_T("spt"),stp);
                }
            }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!