ShapeCollection
General
ShapeCollection és una classe en Aspose.Slides FOSS per a C++.
Gestiona la col·lecció de formes en una diapositiva. Opera en dos modes: - Modo senzill (default): les formes es gestionen només a memòria. - Modeu amb suport XML (després d’init_internal): Les formes s’embalen des del spTree XML de la diapassió i persisteixen, amb caixes lènides.
Propietats
| Name | Type | Access | Description |
|---|---|---|---|
ShapeCollection | ShapeCollection | Read | Property provides access to the ShapeCollection itself |
Table | Table | Read | Returns a Table object representing a table shape |
Mètodes
| Signature | Description |
|---|---|
ShapeCollection() → ShapeCollection | Property provides access to the ShapeCollection itself |
Table() → Table | Returns a Table object representing a table shape |
Table() → Table | |
init_internal(slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide) | Initialize from a slide part, entering XML-backed mode. |
size() → std::size_t | Returns the number of shapes. |
to_array() → std::vector<Shape*> | Returns all shapes as non-owning pointers. |
to_array(start_index: std::size_t, count: std::size_t) → std::vector<Shape*> | Returns all shapes as non-owning pointers. |
reorder(new_index: std::size_t, shape: Shape) | Moves a shape to the specified position (z-order). |
reorder(index: std::size_t, shapes: std::span<Shape*>) | Moves a shape to the specified position (z-order). |
index_of(shape: Shape) → std::ptrdiff_t | Returns the zero-based index of a shape, or -1 if not found. |
remove(shape: Shape) | Removes a shape from the collection by reference. |
remove_at(index: std::size_t) | Removes the shape at the given index. |
clear() | Removes all shapes. |
begin() → iterator | Returns an iterator to the first shape |
end() → iterator | Returns an iterator past the last shape |
begin() → const_iterator | |
end() → const_iterator | |
get_sp_tree() → pugi::xml_node | Get the spTree element from the slide XML. |
load_shapes() | Load all shapes from the XML, populating the internal cache. No-op if the cache is already valid. |
invalidate_cache() | Invalidate the shapes cache, forcing a reload on next access. |
save_to_part() | Save changes to the slide part. |
next_shape_id() → int | Find the next available shape ID in the 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) | Build XML content for a new 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) | Build XML content for a new connector (cxnSp) element. |
reorder_single(new_index: std::size_t, shape: Shape) | Reorder a single shape to a new position in XML and cache. |