parent feature get

RemoveUnneededFeaturesInRail()
{
    ProError err;

    // 1. 遍歷所有模腳,查找QUILT_CUT的UDF
    // 2. 查看QUILT_CUT的父特徵
    // 3. 如果其父特徵是PULL_BACK中的特徵,則刪除
    int rail_num(0);
    err = ProArraySizeGet(frt_moldbase.rail_mdls, &rail_num);
    if (err != PRO_TK_NO_ERROR || rail_num < 1)
    {
        return PRO_TK_USER_ABORT;
    }

    char temp[PRO_NAME_SIZE];
    for (int i = 0; i < rail_num; ++i)
    {
        ProGroup *udfs;
        err = ProSolidGroupsCollect((ProSolid)frt_moldbase.rail_mdls[i], &udfs);

        ProName udf_name;
        ProName udf_instance;
        int udf_num(0);

        err = ProArraySizeGet(udfs, &udf_num);
        if (err != PRO_TK_NO_ERROR || udf_num < 1)
        {
            continue;
        }

        for (int j = 0; j < udf_num; ++j)
        {            
            bool is_unneeded_feat(false);

            err = ProUdfNameGet(&udfs[j], udf_name, udf_instance);
            ProWstringToString(temp, udf_name);
            if (stricmp(temp, "QUILT_CUT"))
            {
                continue;
            }

            int udf_feat_num(0);
            ProFeature *udf_feats;
            err = ProGroupFeaturesCollect(&udfs[j], &udf_feats);
            err = ProArraySizeGet(udf_feats, &udf_feat_num);
            if (err != PRO_TK_NO_ERROR || udf_feat_num < 2)
            {
                continue;
            }
                    
            // 第1個特徵是群組頭特徵,第2個特徵是CUTOUT特徵
            int parent_num(0);
            ProExtRefInfo    *parent_infos = NULL;
            err = ProFeatureExternParentsGet(&udf_feats[1], PRO_EXT_GEOM_REF, &parent_infos, &parent_num);
            for (int k = 0; k < parent_num; ++k)
            {
                for (int m = 0; m < parent_infos[k].n_refs; ++m)
                {
                    ProFeature  ref_feat;
                    err = ProExtRefFeatGet(parent_infos[k].ext_refs[m], &ref_feat);
                    if (err != PRO_TK_NO_ERROR)
                    {
                        continue;
                    }

                    ProName ref_feat_owner_name;
                    err = ProMdlNameGet(ref_feat.owner, ref_feat_owner_name);
                    ProWstringToString(temp, ref_feat_owner_name);
                    if (strstr(strupr(temp), "PB") != NULL)
                    {
                        // 此特徵是PULL_BACK中的特徵

                        is_unneeded_feat = true;
                        break;
                    }
                }

                if (is_unneeded_feat)
                {
                    break;
                }
            }
            // 刪除不需要的特徵
            if (is_unneeded_feat)
            {               
                ProFeatureDeleteOptions  deleteopt = PRO_FEAT_DELETE_CLIP;
                err = ProFeatureDelete((ProSolid)frt_moldbase.rail_mdls[i], &udf_feats[1].id, 1, &deleteopt, 1);
            }
           
            err = ProArrayFree((ProArray*)&udf_feats);
        }

        err = ProArrayFree((ProArray*)&udfs);
    }


    return PRO_TK_NO_ERROR;
}

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25306814/viewspace-702540/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25306814/viewspace-702540/

function generateReport() { try { var getUrl = window.location; var baseUrl = getUrl.protocol + "//" + getUrl.host + "/"; var url = baseUrl + 'polarion/ImpactAnalysisTree/ImpactAnalysisTree?projectId=' + projectId; var parameters = ""; var Id = false; var title = false; var workItemId = document.forms["tracegraph"]["itemId"]; if (workItemId != null) { if (!workItemId.value.trim().length == 0) { parameters = '&op=search&workItemId=' + workItemId.value; Id = true; } } if (!Id) { $(".widget-errors").text("Enter a valid Work Item ID /Title to generate traceability report.").show(); return false; } setTimeout(function() { var jsonTree = [{"name": "DAIS-2183","title": "系统架构测试使用","image": "/polarion/icons/default/enums/type_purple_feature.png","url": "#/project/DAISCHproject/workitem?id=DAIS-2183","nodeDispText": "DAIS-2183 : 系统架构测试使用","nodeDispType": "7","parent": "null","backlinked": [{"name": "DAIS-2332","title": "集成","image": "/polarion/icons/default/enums/type_purple_testcase.png","url": "#/project/DAISCHproject/workitem?id=DAIS-2332","nodeDispText": "DAIS-2332 : 集成","nodeDispType": "7","parent": "DAIS-2183","linkcolor": "#ccc","backlinked": [{"name": "DAIS-2333","title": "任务","image": "/polarion/icons/default/enums/type_task.gif","url": "#/project/DAISCHproject/workitem?id=DAIS-2333","nodeDispText": "DAIS-2333 : 任务","nodeDispType": "7","parent": "DAIS-2332","linkcolor": "#ccc","backlinked": []}]}],"linked": [{"name": "DAIS-2320","title": "系统需求","image": "/polarion/icons/default/enums/type_purple_spec.png","url": "#/project/DAISCHproject/workitem?id=DAIS-2320","nodeDispText": "DAIS-2320 : 系统需求","nodeDispType": "7","parent": "DAIS-2183","linkcolor": "#ccc","linked": []},]}]; root = jsonTree[0]; root.x0 = height / 2; root.y0 = width; console.log(root); var t1 = d3.layout.tree().nodeSize([30, 10]) .separation(function separation(a, b) { return a.parent == b.parent ? 1.2 : 1.4; }) .children(function(d) { return d.linked; }); var t2 = d3.layout.tree().nodeSize([30, 10]) .separation(function separation(a, b) { return a.parent == b.parent ? 1.2 : 1.2; }).children(function(d) { return d.backlinked; }); t1.nodes(root); t2.nodes(root); var rebuildChildren = function(node) { node.children = getChildren(node); if (node.children) node.children.forEach(rebuildChildren); } rebuildChildren(root); root.isRight = false; update(root); }); $(location).attr('href', url+parameters); } catch (e) { console.log(e); alert(e); } return false; } 使用ajax重新渲染页面
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值