iCAx开思工具箱

标题: 请教下曲线类型判断过程中遇到的问题 [打印本页]

作者: 青春路不拾遗    时间: 2015-7-5 21:51
标题: 请教下曲线类型判断过程中遇到的问题
问题是这样的 想通过程序来得到与基准点相邻的两条拓扑线,其中一条是圆弧类型,另一条位直线类型。图中的白色线条是通过plane与实体模型做intersect相交出来的,现在已经得到了圆弧和直线的cell但是无论通过用IsATypeOf函数还是用QI到CATLine的方法都无法判断出来哪一条是圆弧或是直线
(, 下载次数: 3)
判断类型的程序段是这样的
for(int currentCell=1; currentCell<=cells.Size(); currentCell++)
{
    CATCell* _piLineCell=cells[currentCell];
    CATEdge * _piCurrentEdge=(CATEdge *)_piLineCell;
    CATVertex * _pStart=NULL;
    CATVertex * _pEnd=NULL;
    _piCurrentEdge->GetVertices(&_pStart,&_pEnd);
    if ((_piTheTopPtCell==_pStart)||(_piTheTopPtCell==_pEnd))
    {
        CATGeometry *pGeometry = _piLineCell->GetGeometry();
        if ((NULL != pGeometry))
        {
            cout<<"succeed get geo"<<endl;


            if (SUCCEEDED(pGeometry->QueryInterface(IID_CATLine, (void**)&spLine)))//((CATICGMUnknown*)pGeometry)->IsATypeOf(CATLineType)
            {
                cout<<"find the line"<<endl;
                //_piTheNextLineCell=_piLineCell;


            }
            else if (SUCCEEDED(pGeometry->QueryInterface(IID_CATCircle, (void**)&spCircle)))//((CATICGMUnknown*)pGeometry)->IsATypeOf(CATCircleType)
            {
                cout<<"find the circle"<<endl;
                //_piTheNextCircleCell=_piLineCell;
            }
            else
                cout<<"no type found"<<endl;
        }


    }


}
烦请路过的高手们解答下,多谢啦!






欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3