API_ElementDecomposerInterface
요소 분해 프로세스에 대한 인터페이스 클래스입니다.
class API_ElementDecomposerInterface { public: virtual ~API_ElementDecomposerInterface () {}; virtual GSErrCode GeneratePartElement (const API_Guid& guid, const API_ElemPartId& partId, const API_Element& partElem, const API_ElementMemo& partMemo) = 0; };
설명
ACAPI_Element_Decompose 함수로 Multi-plane 지붕 요소의 면들을 열거하기 위한 인터페이스 클래스입니다.
이 타입의 파생 클래스의 인스턴스는 decomposer 함수에게 전달되어야 합니다. 그러면 PolyRoof의 각 면들에 대하여 하나씩 그 객체의 GeneratePartElement
가상 메소드를 호출합니다.
GeneratePartElement
메소드의 파라미터들입니다:
- guid
- [in] 원래 PolyRoof 요소의 guid입니다.
- partId
- [in] 전체 구조 안에 있는 파트 요소를 식별합니다. Multi-plane 지붕들의 맥락에서 main 멤버는 피봇 폴리곤의 vertexID를 참조하며, sub는 지붕 레벨을 식별합니다.
- partElem
- [in] 요소 파트를 설명하는 데이터입니다. 현재 이 변수는 항상
API_PlaneRoofID
클래스와 함께 API_RoofType 파라미터들을 리턴합니다. - partMemo
- [in] 파트 요소의 메모 데이터입니다. 평면 지붕들의 경우 관련 있는 다음 멤버들만 초기화됩니다:
coords
,pends
,parcs
,vertexIDs
,edgeTrims
,roofEdgeTypes
,sideMaterials
.
이 메모 배열들은 호출 끝에 ACAPI_Element_Decompose로 폐기될 것입니다.
분해된 파트들은 trim 연결 및 스카이라이트 구멍들의 효과 없이 원래 모양을 보여준다는 것을 참고하십시오. 만약 당신이 지붕 면들의 실제 모양을 필요로 한다면, ACAPI_Element_Get3DInfo나 ModelAccess 인터페이스를 이용하여 원래 Multi-plane 지붕 요소의 3D 모델을 훑어보십시오.
예제
// 모든 Multi-plane 지붕 파트들의 정점들의 수를 리스트화 class PolyRoofConverter : public API_ElementDecomposerInterface { public: virtual GSErrCode GeneratePartElement (const API_Guid& guid, const API_ElemPartId& partId, const API_Element& partElem, const API_ElementMemo& /*partMemo*/) { GS::UniString reportString = GS::UniString::Printf ("Plane component [%d:%d] of Multi-plane Roof {%T} has %d vertices", partId.main, partId.sub, APIGuid2GSGuid (guid).ToUniString ().ToPrintf (), partElem.roof.u.planeRoof.poly.nCoords - 1); ACAPI_WriteReport (reportString.ToCStr ().Get (), false); return NoError; } } polyRoofConverter; GS::Array<API_Guid> roofs; GSErrCode err = ACAPI_Element_GetElemList (API_RoofID, &roofs); if (err == NoError) { for (GS::Array<API_Guid>::ConstIterator it = roofs.Enumerate (); it != NULL; ++it) { err = ACAPI_Element_Decompose (*it, &polyRoofConverter); if (err == APIERR_BADPARS) ACAPI_WriteReport ("This Roof is not Multi-plane, cannot be decomposed", false); } }
요구사항
- 버전: API 15 또는 이후
- 헤더: APIdefs_Callback.h