柱・梁セグメントのポリゴン情報を取得する
説明
- セグメントのGUIDはAPI_ElementMemoから取得する
- セグメントごとにポリゴン数をカウントするので、それぞれのGUIDを渡す
UInt32 DoCountPolygons (const API_Guid& elemGuid)
{
UInt32 elemPolygonCount = 0;
API_ElemInfo3D elemInfo3D = {};
API_Component3D comp3D = {};
comp3D.header.typeID = API_BodyID;
API_Elem_Head elemHead = {};
elemHead.guid = elemGuid;
if (ACAPI_Element_Get3DInfo (elemHead, &elemInfo3D) == NoError) {
for (Int32 iB = elemInfo3D.fbody; iB <= elemInfo3D.lbody; iB++) {
comp3D.header.index = iB;
GSErrCode err = ACAPI_3D_GetComponent (&comp3D);
if (err == NoError)
elemPolygonCount += comp3D.body.nPgon;
}
}
return elemPolygonCount;
}
UInt32 CountBeamPolygons (const API_BeamType& beam)
{
API_ElementMemo beamMemo = {};
UInt32 elemPolygonCount = 0;
GSErrCode err = ACAPI_Element_GetMemo (beam.head.guid, &beamMemo, APIMemoMask_BeamSegment);
if ( err != NoError)
return 0;
if (beamMemo.beamSegments != nullptr) {
for (UIndex i = 0; i < beam.nSegments; ++i){
elemPolygonCount += DoCountPolygons (beamMemo.beamSegments[i].head.guid);
}
}
ACAPI_DisposeElemMemoHdls (&beamMemo);
return elemPolygonCount;
}
柱・梁セグメントのポリゴン情報を取得する
説明
UInt32 DoCountPolygons (const API_Guid& elemGuid) { UInt32 elemPolygonCount = 0; API_ElemInfo3D elemInfo3D = {}; API_Component3D comp3D = {}; comp3D.header.typeID = API_BodyID; API_Elem_Head elemHead = {}; elemHead.guid = elemGuid; if (ACAPI_Element_Get3DInfo (elemHead, &elemInfo3D) == NoError) { for (Int32 iB = elemInfo3D.fbody; iB <= elemInfo3D.lbody; iB++) { comp3D.header.index = iB; GSErrCode err = ACAPI_3D_GetComponent (&comp3D); if (err == NoError) elemPolygonCount += comp3D.body.nPgon; } } return elemPolygonCount; } UInt32 CountBeamPolygons (const API_BeamType& beam) { API_ElementMemo beamMemo = {}; UInt32 elemPolygonCount = 0; GSErrCode err = ACAPI_Element_GetMemo (beam.head.guid, &beamMemo, APIMemoMask_BeamSegment); if ( err != NoError) return 0; if (beamMemo.beamSegments != nullptr) { for (UIndex i = 0; i < beam.nSegments; ++i){ elemPolygonCount += DoCountPolygons (beamMemo.beamSegments[i].head.guid); } } ACAPI_DisposeElemMemoHdls (&beamMemo); return elemPolygonCount; }