ShapeCollection
개요
ShapeCollection은(는) Aspose.Slides FOSS for C++의 클래스입니다.
슬라이드의 도형 컬렉션을 관리합니다. 두 가지 모드로 작동합니다: - 단순 모드 (기본값): 도형은 메모리 내에서만 관리됩니다. - XML-backed mode (after init_internal): 도형은 슬라이드의 spTree XML에서 로드되고 지속되며, 지연 캐싱이 적용됩니다.
이 클래스는 C++ 프로그램에서 ShapeCollection 객체를 다루기 위한 49개의 메서드를 제공합니다. 사용 가능한 메서드에는: ShapeCollection, Table, add_auto_shape, add_auto_shape_impl, add_connector, add_connector_impl, add_picture_frame, add_picture_frame_impl, add_table, add_table_impl, as_i_collection, as_i_enumerable 및 추가 25개의 메서드가 포함됩니다. Aspose.Slides FOSS for C++ 패키지를 설치한 후에는 모든 공개 멤버에 C++ 애플리케이션에서 접근할 수 있습니다. 속성: ShapeCollection, Table.
속성
| 이름 | 유형 | 액세스 | 설명 |
|---|---|---|---|
ShapeCollection | ShapeCollection | 읽기 | 모양 컬렉션을 가져옵니다. |
Table | Table | 읽기 | 테이블을 가져옵니다. |
메서드
| 시그니처 | 설명 |
|---|---|
ShapeCollection() → ShapeCollection | Property는 컬렉션 자체에 대한 액세스를 제공합니다. |
Table() → Table | Property는 컬렉션과 연관된 Table shape에 대한 액세스를 제공합니다. |
Table() → Table | |
ShapeCollection() | |
ShapeCollection() | |
init_internal(slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide) | 슬라이드 파트에서 초기화하고, XML 기반 모드에 들어갑니다. |
parent_group() → IGroupShape | 상위 그룹 도형을 반환하며, 최상위인 경우 nullptr를 반환합니다. |
as_i_collection() → IShapeCollection | 이 컬렉션을 일반 컬렉션 인터페이스로 반환합니다. |
as_i_enumerable() → IShapeCollection | 이 컬렉션을 일반 열거형 인터페이스로 반환합니다. |
size() → std::size_t | 도형의 수를 반환합니다. |
to_array() → std::vector<Shape*> | 비소유 포인터로 모든 도형을 반환합니다. |
to_array(start_index: std::size_t, count: std::size_t) → std::vector<Shape*> | 비소유 포인터로 모든 도형을 반환합니다. |
reorder(new_index: std::size_t, shape: Shape) | 지정된 위치(z-순서)로 도형을 이동합니다. |
reorder(index: std::size_t, shapes: std::span<Shape*>) | 지정된 위치(z-순서)로 도형을 이동합니다. |
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double) → AutoShape | 컬렉션에 AutoShape을 추가합니다. |
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → AutoShape | 컬렉션에 AutoShape을 추가합니다. |
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double) → AutoShape | 지정된 인덱스에 AutoShape을 삽입합니다. |
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → AutoShape | 지정된 인덱스에 AutoShape를 삽입합니다. |
add_connector(type: ShapeType, x: double, y: double, width: double, height: double) → Connector | 컬렉션에 Connector를 추가합니다. |
add_connector(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → Connector | 컬렉션에 Connector를 추가합니다. |
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double) → Connector | 지정된 인덱스에 Connector를 삽입합니다. |
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → Connector | 지정된 인덱스에 커넥터를 삽입합니다. |
index_of(shape: Shape) → std::ptrdiff_t | 형상의 0부터 시작하는 인덱스를 반환하며, 찾을 수 없으면 -1을 반환합니다. |
add_picture_frame(type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage) → PictureFrame | 컬렉션에 PictureFrame을(를) 추가합니다. |
insert_picture_frame(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage) → PictureFrame | 지정된 인덱스에 PictureFrame을(를) 삽입합니다. |
add_table(x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>) → Table | 컬렉션에 Table을 추가합니다. |
insert_table(index: std::size_t, x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>) → Table | 지정된 인덱스에 테이블을 삽입합니다. |
remove(shape: Shape) | 컬렉션에서 도형을 참조로 제거합니다. |
remove_at(index: std::size_t) | 주어진 인덱스에 있는 도형을 제거합니다. |
clear() | 모든 도형을 제거합니다. |
table_count() → std::size_t | 컬렉션에 있는 테이블 수를 반환합니다. |
table_at(index: std::size_t) → Table | 주어진 인덱스에 해당하는 테이블을 반환합니다. |
table_at(index: std::size_t) → Table | 주어진 인덱스에 해당하는 테이블을 반환합니다. |
begin() → iterator | 첫 번째 형태에 대한 이터레이터를 반환합니다 |
end() → iterator | 마지막 도형 이후의 반복자를 반환합니다 |
begin() → const_iterator | |
end() → const_iterator | |
get_sp_tree() → pugi::xml_node | 슬라이드 XML에서 spTree 요소를 가져옵니다. |
load_shapes() | 내부 캐시를 채우면서 XML에서 모든 도형을 로드합니다. 캐시가 이미 유효한 경우 아무 작업도 수행하지 않습니다. |
invalidate_cache() | 도형 캐시를 무효화하고, 다음 접근 시 다시 로드하도록 강제합니다. |
save_to_part() | 슬라이드 파트에 대한 변경 사항을 저장합니다. |
next_shape_id() → int | spTree에서 다음 사용 가능한 도형 ID를 찾습니다. |
build_auto_shape_xml(sp: pugi::xml_node, shape_id: int, name: std::string_view, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool) | 새로운 AutoShape 요소를 위한 XML 콘텐츠를 구축합니다. |
build_connector_xml(cxn_sp: pugi::xml_node, shape_id: int, name: std::string_view, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool) | 새 커넥터 (cxnSp) 요소에 대한 XML 콘텐츠를 구축합니다. |
add_auto_shape_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool) → AutoShape | add_auto_shape 및 insert_auto_shape에 대한 핵심 구현. |
add_connector_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, create_from_template: bool) → Connector | add_connector 및 insert_connector에 대한 핵심 구현. |
add_picture_frame_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, image: PPImage) → PictureFrame | add_picture_frame 및 insert_picture_frame에 대한 핵심 구현. |
add_table_impl(index: std::optional<std::size_t>, x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>) → Table | 핵심 구현: add_table 및 insert_table. |
reorder_single(new_index: std::size_t, shape: Shape) | 단일 모양을 XML의 새 위치로 재정렬하고 캐시합니다. |