小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

ug提取參數(shù)

 昵稱14205145 2013-10-12
extern "C" DllExport void Feature_Fun()
{
    /* Initialize the API environment */
    int errorCode = UF_initialize();
    if ( 0 == errorCode )
    {
        /* TODO: Add your application code here */
        char part_fspec[MAX_FSPEC_SIZE+1];                                    //目錄
int curr_part, num_parts;                                             //當前零件;零件總數(shù)
int type;                                                             //Type of object on which to cycle
int count_1;                                                          //用于輸出特征總數(shù)
tag_t part;                                                           //零件被識別的唯一標識
tag_t feature;                                                        //特征被識別的唯一標識
char chr[50];
int i=0;
   char *strings=NULL,*feature_name=NULL;
int  number_of_exps;                                                  //指與當前特征有關的表達式的數(shù)量
tag_t *exps=NULL;
double value;

Json::Value root;
Json::Value arrayObj;
Json::Value item;


ofstream outfile("d://public.json",ios::out);
if (!outfile)
{
std::cerr << "open error!" << endl;
exit(1);
}

num_parts = UF_PART_ask_num_parts();   /* Get the total number of loaded parts. */
for ( curr_part=0 ; curr_part < num_parts ; curr_part++ )
{
part = UF_PART_ask_nth_part( curr_part );                       //Get the part tag for the current part number of the
//loaded part and get its part name.
UF_PART_ask_part_name( part, part_fspec );                       //Returns the file specification associated with a part tag. 
count_1 = 0; 
type = UF_feature_type;
feature = NULL_TAG;
UF_UI_open_listing_window();
sprintf(chr,"第 %d 個零件: ",curr_part+1);
UF_UI_write_listing_window(chr);
UF_UI_write_listing_window(part_fspec);
UF_UI_write_listing_window("\n");   
UF_OBJ_cycle_objs_in_part( part, type, &feature );              /* Start the cycling process by passing in a NULL_TAG. */
                                                               /* Keep cycling until there are no more features to cycle. */
//outfile << chr << part_fspec << endl;

while ( feature != NULL_TAG )
{       
UF_MODL_ask_exps_of_feature(feature,&number_of_exps,&exps);//Gets all expressions related to the supplied feature. 
UF_MODL_ask_feat_name(feature , &feature_name);            //得到特征名
sprintf(chr,"  第 %d 個特征:",count_1+1);
UF_UI_write_listing_window(chr);
UF_UI_write_listing_window("  ");
UF_UI_write_listing_window(feature_name);
UF_UI_write_listing_window("\n");

item["Name"]= feature_name;
//item["Type"]= "STRING";
//outfile << chr << "  " << feature_name << endl;
for( i=0;i<number_of_exps;i++)
{
UF_UI_write_listing_window("    ");
UF_MODL_ask_exp_tag_string(exps[i],&strings);
UF_MODL_ask_exp_tag_value(exps[i],&value);
UF_UI_write_listing_window(strings);
UF_UI_write_listing_window("\n");
item["Parameter"][i]["name"] = strings;
item["Parameter"][i]["value"] =value;
}
arrayObj.append(item);
root["feature"] = arrayObj;

                count_1++;  
UF_OBJ_cycle_objs_in_part( part, type, &feature ); 
root["path"] =part_fspec;
}
string out = root.toStyledString();
outfile << out << endl; 

sprintf(chr,"  總共:%d 個特征\n",count_1);
UF_UI_write_listing_window(chr);
UF_UI_write_listing_window("\n");
}
UF_free(strings);                                                 //釋放空間
UF_free(exps);                                                    //釋放空間
UF_free(feature_name); 

sprintf(chr,"  總共:%d 個零件\n",num_parts);
UF_UI_write_listing_window(chr);
UF_UI_write_listing_window("\n");

outfile.close();

/* Terminate the API environment */ 
errorCode = UF_terminate();
}
}

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多