ACAPI_Element_Decompose
Multi-plane 지붕의 면들을 열거합니다.
GSErrCode ACAPI_Element_Decompose ( const API_Guid& elemGuid, API_ElementDecomposerInterface* elementDecomposer );
파라미터
- elemGuid
- [in] 분해할 요소의 식별자입니다. 현재 이것은 PolyRoof 요소이어야 합니다.
- elementDecomposer
- [in] 분해하는 동안 사용되는 호출자가 구현한 객체에 대한 인터페이스 포인터입니다.
리턴 값
NoError
- 함수가 성공적으로 완료되었습니다.
APIERR_BADPARS
- elementDecomposer 포인터가
NULL
이거나 elemGuid로 지정한 요소가 PolyRoof 타입이 아닙니다. APIERR_BADID
- elemGuid 파라미터가 유효한 요소를 식별하지 않습니다.
설명
이 함수를 사용하여 Multi-plane 지붕의 평면들을 Single-plane API_RoofType 요소들의 집합으로 열거합니다.
먼저 API_ElementDecomposerInterface의 파생 클래스를 구현할 필요가 있습니다.
이 클래스의 객체 인스턴스는 GeneratePartElement
메서드에 의해 콜백되는 ACAPI_Element_Decompose에게 전달되어야 합니다.
예제
API_ElementDecomposerInterface 타입의 클래스 선언:
class PolyRoofConverter : public API_ElementDecomposerInterface { public: PolyRoofConverter (const API_Guid& polyRoofGuid); virtual GSErrCode GeneratePartElement (const API_Guid& guid, const API_ElemPartId& partId, const API_Element& partElem, const API_ElementMemo& partMemo); };
주어진 지붕 요소에 대한 분해 호출하기:
void DecomposeRoof (const API_Guid& roofGuid) { API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.guid = roofGuid; GSErrCode err = ACAPI_Element_Get (&element); if (err == NoError && element.roof.roofClass == API_PolyRoofID) { PolyRoofConverter polyRoofConverter (element.header.guid); err = ACAPI_Element_Decompose (element.header.guid, &polyRoofConverter); } }
Element Test 예제 애드온의 snippet 함수들도 보십시오.
요구사항
- 버전: API 15 또는 이후
- 헤더: ACAPinc.h