非注释是通过CATIMovable接口获取,注释的是通过CAT3DBagRep类获取。区别在于:在DELMIA中仿真时,通过CATIMovable全局位置矩阵不会变化而通过CAT3DBagRep类获取的可以变化。
ExportedByARKDocumentStructureItf HRESULT ARKEProduct::GetAbsPosition(Transfor &oabsPosition){
if(_posTag){
oabsPosition = _currentPos;
return S_OK;
}
_posTag = 1;
CATIMovable_var spMovable=this;
spMovable -> GetAbsPosition(_currentPos);
oabsPosition = _currentPos;
return S_OK;
//if(_posRepTag){
// oabsPosition = _currentPos;
// return S_OK;
//}
//_posRepTag = 1;
//CATI3DGeoVisu *pGeoVisu = NULL;
//if(SUCCEEDED(this -> QueryInterface(IID_CATI3DGeoVisu,(void**)&pGeoVisu)) && pGeoVisu != NULL){
// CAT3DBagRep *pBagRep = (CAT3DBagRep *)pGeoVisu -> GiveRep();
// if(pBagRep == NULL){
// oabsPosition = Transfor();
// return S_OK;
// }
// pGeoVisu -> Release();
// pGeoVisu = NULL;
// const CAT4x4Matrix *pMatrix = pBagRep -> GetMatrix();
// CATMathDirectionf duf,dvf,dwf;
// CATMathPointf tpf;
// pMatrix -> GetComponents(duf,dvf,dwf,tpf);
// Direction du,dv,dw;
// Point tp;
// duf.GetValue(du);
// dvf.GetValue(dv);
// dwf.GetValue(dw);
// tpf.GetValue(tp);
// ARKIProduct *pFather = NULL;
// this -> GetFather(pFather);
// if(pFather != NULL){
// Transfor fatherPos;
// pFather -> GetAbsPosition(fatherPos);
// _currentPos = fatherPos*Transfor(CATMath3x3Matrix(du,dv,dw),Vector(tp.GetX(),tp.GetY(),tp.GetZ()));
// }
// else
// _currentPos = Transfor(CATMath3x3Matrix(du,dv,dw),Vector(tp.GetX(),tp.GetY(),tp.GetZ()));
//}
//oabsPosition = _currentPos;
//return S_OK;
}