|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用的是TestGtol.C作为例子,
可是却无法遍历到模型中所有的几何位置公差?
如下所示,问题就出在ProMdlGtolVisit上:
ProError TestGtolCollect(ProMdl mdl, ProGtol **gtol)
{
 roGtol *tmp_gtol = NULL;
 roError error;
//  roAppData app_data;.23
if((gtol==NULL)||(mdl==NULL))
return(PRO_TK_BAD_INPUTS);
/*--------------------------------------------------------------------*\
Alloc memory for gtol array.
\*--------------------------------------------------------------------*/
error = ProArrayAlloc(0, sizeof(ProGtol),1,(ProArray*)[$tmp_gtol)]
TEST_CALL_REPORT ("roArrayAlloc()",
"TestGtolCollect()", error, error != PRO_TK_NO_ERROR);
TEST_CALL_REPORT ("roArrayAlloc()",
"TestGtolCollect()", error, error != PRO_TK_NO_ERROR);*/
if(error!=PRO_TK_NO_ERROR)
return(error);
/*--------------------------------------------------------------------*\
Visit and add all gtol from the specified model.
\*--------------------------------------------------------------------*/
error = ProMdlGtolVisit(mdl,(ProGtolVisitAction)TestGtolCollectVisit,
(ProGtolFilterAction)PRO_TK_NO_ERROR,(ProAppData)[$tmp_gtol)]
TEST_CALL_REPORT ("ProMdlGtolVisit()",
"TestGtolCollect()", error, error != PRO_TK_NO_ERROR);
/*--------------------------------------------------------------------*\
If error then free memory.
\*--------------------------------------------------------------------*/
if(error!=PRO_TK_NO_ERROR)
{
if(tmp_gtol!=NULL)
{
error=ProArrayFree((ProArray*)[$tmp_gtol)]
TEST_CALL_REPORT ("ProArrayFree()",
"TestGtolCollect()", error, error != PRO_TK_NO_ERROR);
tmp_gtol = NULL;
}
return(error);
}
error = ProArrayObjectAdd((ProArray*)[$tmp_gtol,PRO_VALUE_UNUSED,1,gtol)].2 add
TEST_CALL_REPORT ("ProArrayObjectAdd()",
"TestGtolCollectVisit()", error, error != PRO_TK_NO_ERROR);.2 add
*gtol = tmp_gtol;
return(PRO_TK_NO_ERROR);
} |
|