ShapeCollection
Översikt
ShapeCollection är en klass i Aspose.Slides FOSS för C++.
Hantera samlingen av former på en slide. fungerar i två lägen: - Enkel mode (default): former hanteras endast i minnet. - XML-stödda lägen (efter init_internal): former laddas från och persistera till slidan spTree XML, med lazy caching.
Denna klass ger 49 metoder för att arbeta med ShapeCollection objekt i C++-program. Tillgängliga metoder inkluderar: 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,och 25 ytterligare metoder. Alla offentliga medlemmar är tillgängliga för alla C++-applikationer efter att ha installerat Aspose.Slides FOSS för C ++-paketet. och egenskaper: ShapeCollection, Table.
ägodelar
| Namn | Typ av | Access | Beskrivning |
|---|---|---|---|
ShapeCollection | ShapeCollection | Läsning | Hämtar formsamlingen. |
Table | Table | Läsning | Hämtar tabellen. |
Metoder
| Signature | Beskrivning |
|---|---|
ShapeCollection() → ShapeCollection | Fastigheten ger tillgång till samlingen själv |
Table() → Table | Fastigheten ger tillgång till tabellformet som är associerat med samlingen. |
Table() → Table | |
ShapeCollection() | |
ShapeCollection() | |
init_internal(slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide) | Initialisera från en slidesida, genom att komma in i XML-stödda läge. |
parent_group() → IGroupShape | Returnerar föräldralagsformen, eller nullptr om toppnivå. |
as_i_collection() → IShapeCollection | Återställer denna samling som ett generiskt samlingsgränssnitt. |
as_i_enumerable() → IShapeCollection | Återställer denna samling som en generisk uppsummerbar gränssnitt. |
size() → std::size_t | återställer antalet former. |
to_array() → std::vector<Shape*> | Returnerar alla former som icke-ägande indikatorer. |
to_array(start_index: std::size_t, count: std::size_t) → std::vector<Shape*> | Returnerar alla former som icke-ägande indikatorer. |
reorder(new_index: std::size_t, shape: Shape) | Flytta en form till den angivna positionen (z-order). |
reorder(index: std::size_t, shapes: std::span<Shape*>) | Flytta en form till den angivna positionen (z-order). |
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double) → AutoShape | Lägg till en AutoShape i samlingen. |
add_auto_shape(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → AutoShape | Lägg till en AutoShape i samlingen. |
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double) → AutoShape | Ange en AutoShape i den angivna indexet. |
insert_auto_shape(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → AutoShape | Ange en AutoShape i den angivna indexet. |
add_connector(type: ShapeType, x: double, y: double, width: double, height: double) → Connector | Lägg till en anslutning till samlingen. |
add_connector(type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → Connector | Lägg till en anslutning till samlingen. |
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double) → Connector | Ange en anslutning på den angivna indexet. |
insert_connector(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, create_from_template: bool) → Connector | Ange en anslutning på den angivna indexet. |
index_of(shape: Shape) → std::ptrdiff_t | Returnerar nollbaserad index av en form, eller -1 om inte hittats. |
add_picture_frame(type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage) → PictureFrame | Lägg till en PictureFrame i samlingen. |
insert_picture_frame(index: std::size_t, type: ShapeType, x: double, y: double, width: double, height: double, image: PPImage) → PictureFrame | Ange en PictureFrame i den angivna indexet. |
add_table(x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>) → Table | Lägg till en tabell i samlingen. |
insert_table(index: std::size_t, x: double, y: double, column_widths: std::span<const double>, row_heights: std::span<const double>) → Table | Ange en tabell på den angivna indexet. |
remove(shape: Shape) | Ta bort en form från samlingen genom referens. |
remove_at(index: std::size_t) | Ta bort formen på den angivna indexet. |
clear() | Ta bort alla former. |
table_count() → std::size_t | Återställ antalet tabeller i samlingen. |
table_at(index: std::size_t) → Table | Återställ tabellen till den angivna indexet. |
table_at(index: std::size_t) → Table | Återställ tabellen till den angivna indexet. |
begin() → iterator | Returnerar en iterator till den första formen |
end() → iterator | Returnerar en iterator över den sista formen |
begin() → const_iterator | |
end() → const_iterator | |
get_sp_tree() → pugi::xml_node | Hämta spTree‑elementet från bilden XML. |
load_shapes() | Ladda alla former från XML, populera den interna cache. No-op om cachen redan är giltig. |
invalidate_cache() | Invaliderar cache-formarna, tvingar en omlastning vid nästa åtkomst. |
save_to_part() | Spara ändringar i slide delen. |
next_shape_id() → int | Hitta nästa tillgängliga form ID i spTree. |
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) | Bygg XML-innehåll för ett nytt AutoShape element. |
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) | Bygg XML-innehåll för ett nytt anslutningselement (cxnSp). |
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 | Kernimplementation för add_auto_shape och 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 | Kernimplementering för add_connector och insert_Connect. |
add_picture_frame_impl(index: std::optional<std::size_t>, type: ShapeType, x: double, y: double, w: double, h: double, image: PPImage) → PictureFrame | Kernimplementering för add_picture_frame och insert_icture-fram. |
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 | Kernimplementering för add_table och insert_tabell. |
reorder_single(new_index: std::size_t, shape: Shape) | Omför en enda form till en ny position i XML och cache. |