然后你可以在写一个函数,比如取一个只有一个点组成的body的CATPOint
CATPoint_var WSHSampleUtil::FindPointFromBody( const CATBody_var& ispBody )
{
CATPoint_var spPoint = NULL_var;
do {
if ( !ispBody ) {
break;
}
// we just limit to 1 domain only here
CATLONG32 NbDomain = isBody->GetNbDomains();
if ( NbDomain != 1 ) {
break;
}
CATDomain_var spDomain = isBody->GetDomain( NbDomain );
if ( !spDomain ) {
break;
}
CATLONG32 NbCell = spDomain->GetNbCellUses();
if ( NbCell < 1 ) {
break;
}
CATCell_var spCell = spDomain->GetCell( 1);
if ( !spCell ) {
break;
}
if ( !spCell->IsATypeOf( CATPointType ) ) {
break;
}
CATVertex_var spVertex = spCell;
if ( !spVertex ) {
break;
}
spPoint = spVertex->GetCurve();
if ( !spPoint ) {
break;
}
} while (FALSE);
return spPoint;
}
当然实际上还要考虑你的点会是个什么样的点,比如一个3D点和一个edge上的构成点的特性还是有些地方不同的,你有时候可能需要取RepGeomertry,或不能直接用smartpoint来转型
这2个函数只是看着帮助随便写的,所以可能实际上还需要对转型做些修正