ShapeCollection
概要
ShapeCollection は Aspose.Slides の C++ 用 FOSS におけるクラスです。
スライド上のシェイプのコレクションを管理します。2つのモードで動作します: - シンプルモード (デフォルト): シェイプはメモリ内のみで管理されます。 - XML バックエンドモード (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 の C++ 用 FOSS パッケージをインストールすれば、すべてのパブリックメンバーは任意の C++ アプリケーションから利用可能です。プロパティ: ShapeCollection, Table。
プロパティ
| 名前 | 型 | アクセス | 説明 |
|---|---|---|---|
ShapeCollection | ShapeCollection | 読み取り | シェイプコレクションを取得します。 |
Table | Table | 読み取り | テーブルを取得します。 |
メソッド
| シグネチャ | 説明 |
|---|---|
ShapeCollection() → ShapeCollection | プロパティはコレクション自体へのアクセスを提供します |
Table() → Table | プロパティはコレクションに関連付けられた 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-order)に移動します。 |
reorder(index: std::size_t, shapes: std::span<Shape*>) | シェイプを指定された位置(z-order)に移動します。 |
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 | 指定されたインデックスにConnectorを挿入します。 |
index_of(shape: Shape) → std::ptrdiff_t | 形状のゼロベースインデックスを返します。見つからない場合は -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) | 参照によってコレクションから shape を削除します。 |
remove_at(index: std::size_t) | 指定されたインデックスの shape を削除します。 |
clear() | すべての shape を削除します。 |
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() | shapes cache を無効化し、次回アクセス時にリロードを強制します。 |
save_to_part() | slide 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内の新しい位置に並べ替えてキャッシュする。 |