Shape
Overview
Shape is a class in Aspose.Slides FOSS for C++.
Base class for all shapes on a slide.
This class declares 85 methods for Shape objects in C++ programs.
Available methods include: EffectFormat, FillFormat, IBaseSlide, IPresentation, IPresentationComponent, ISlideComponent, LineFormat, ShapeFrame, ShapeType, ThreeDFormat, alternative_text, alternative_text_title, and 58 additional methods.
Public members are accessible to any C++ application after installing the Aspose.Slides FOSS for C++ package.
Accessor methods: EffectFormat, FillFormat, IBaseSlide, IPresentation, IPresentationComponent, ISlideComponent, and 4 more.
Accessor Methods
| Name | Type | Access | Description |
|---|---|---|---|
ShapeType | ShapeType | Read | Gets the shape type. |
EffectFormat | EffectFormat | Read | Gets the effect format. |
FillFormat | FillFormat | Read | Gets the fill format. |
LineFormat | LineFormat | Read | Gets the line format. |
ThreeDFormat | ThreeDFormat | Read | Gets the three d format. |
ShapeFrame | ShapeFrame | Read | Gets the shape frame. |
ISlideComponent | ISlideComponent | Read | Gets the i slide component. |
IPresentation | IPresentation | Read | Gets the i presentation. |
IBaseSlide | IBaseSlide | Read | Gets the i base slide. |
IPresentationComponent | IPresentationComponent | Read | Gets the i presentation component. |
Methods
| Signature | Description |
|---|---|
ShapeType() → ShapeType | Returns the shape type. |
EffectFormat() → EffectFormat | Returns the effect format for this shape. |
EffectFormat() → EffectFormat | Property provides access to the shape’s effect formatting |
FillFormat() → FillFormat | Returns the fill format for this shape. |
FillFormat() → FillFormat | Returns the fill formatting object for the shape |
LineFormat() → LineFormat | Returns the line format for this shape. |
LineFormat() → LineFormat | Property provides access to the shape’s line formatting |
ThreeDFormat() → ThreeDFormat | Returns the 3D format for this shape. |
ThreeDFormat() → ThreeDFormat | Property provides access to the shape’s 3‑D formatting |
ShapeFrame() → ShapeFrame | Returns the raw shape frame. |
ShapeFrame() → ShapeFrame | Returns the shape frame. |
ISlideComponent() → ISlideComponent | Returns the base ISlideComponent interface. |
IPresentation() → IPresentation | Property references the presentation interface containing the shape |
IPresentation() → IPresentation | |
IBaseSlide() → IBaseSlide | Property references the base slide interface that holds the shape |
IBaseSlide() → IBaseSlide | |
IPresentationComponent() → IPresentationComponent | Returns the presentation component interface of the shape |
IPresentationComponent() → IPresentationComponent | |
~Shape() | Calls ~Shape on this Shape instance. |
shape_type() → ShapeType | Returns the shape type. |
set_shape_type(value: ShapeType) | Sets the shape type. |
x() → double | Returns the x-coordinate of the shape. |
set_x(value: double) | Sets the shape’s X coordinate |
y() → double | Returns the y-coordinate of the shape. |
set_y(value: double) | Sets the shape’s Y coordinate |
width() → double | Returns the width of the shape. |
set_width(value: double) | Calls set_width(value) on this Shape instance. |
height() → double | Returns the height of the shape. |
set_height(value: double) | Calls set_height(value) on this Shape instance. |
rotation() → double | Returns the rotation angle in degrees. |
set_rotation(value: double) | Sets the shape’s rotation angle |
name() → std::string | Returns the shape name. |
set_name(value: std::string) | Calls set_name(value) on this Shape instance. |
effect_format() → EffectFormat | Returns the effect format for this shape. |
effect_format() → EffectFormat | Calls effect_format on this Shape instance. |
fill_format() → FillFormat | Returns the fill format for this shape. |
fill_format() → FillFormat | Calls fill_format on this Shape instance. |
line_format() → LineFormat | Returns the line format for this shape. |
line_format() → LineFormat | Calls line_format on this Shape instance. |
three_d_format() → ThreeDFormat | Returns the 3D format for this shape. |
three_d_format() → ThreeDFormat | Calls three_d_format on this Shape instance. |
is_text_holder() → bool | Determines whether the shape is a TextHolder. Default: false. |
placeholder() | Returns the placeholder. Default: nullptr. |
custom_data() | Returns the custom data. Default: nullptr. |
raw_frame() → ShapeFrame | Returns the raw shape frame. |
set_raw_frame(value: ShapeFrame) | Calls set_raw_frame(value) on this Shape instance. |
frame() → ShapeFrame | Returns the shape frame. |
set_frame(value: ShapeFrame) | Calls set_frame(value) on this Shape instance. |
hidden() → bool | Determines whether the shape is hidden. |
set_hidden(value: bool) | Calls set_hidden(value) on this Shape instance. |
z_order_position() → std::int32_t | Returns the z-order position. |
connection_site_count() → std::int32_t | Returns the number of connection sites (default 4). |
alternative_text() → std::string | Returns the alternative text. |
set_alternative_text(value: std::string) | Calls set_alternative_text(value) on this Shape instance. |
alternative_text_title() → std::string | Returns the alternative text title. |
set_alternative_text_title(value: std::string) | Calls set_alternative_text_title(value) on this Shape instance. |
is_decorative() → bool | Gets the ‘Mark as decorative’ option. |
set_is_decorative(value: bool) | Calls set_is_decorative(value) on this Shape instance. |
unique_id() → std::uint32_t | Returns the presentation-scoped unique identifier. |
office_interop_shape_id() → std::uint32_t | Returns the slide-scoped shape identifier. |
is_grouped() → bool | Determines whether the shape is grouped. |
as_i_slide_component() → ISlideComponent | Returns the base ISlideComponent interface. |
presentation() → IPresentation | Calls presentation on this Shape instance. |
presentation() → IPresentation | |
slide() → IBaseSlide | Calls slide on this Shape instance. |
slide() → IBaseSlide | |
as_i_presentation_component() → IPresentationComponent | Calls as_i_presentation_component on this Shape instance. |
as_i_presentation_component() → IPresentationComponent | |
set_z_order_position(value: std::int32_t) | Sets the z-order position (used internally by ShapeCollection). |
set_unique_id(value: std::uint32_t) | Sets the unique id (used internally). |
set_office_interop_shape_id(value: std::uint32_t) | Sets the office interop shape id (used internally). |
init_internal(xml_element: pugi::xml_node, slide_part: Internal::pptx::SlidePart, parent_slide: IBaseSlide) | Initialize this shape from an XML element within a slide part. |
build_frame() → ShapeFrame | Build a ShapeFrame from the current xfrm element. |
apply_frame(value: IShapeFrame) | Apply a ShapeFrame’s values to the xfrm element. |
get_sp_pr() → pugi::xml_node | Get the spPr (or grpSpPr) element for this shape. |
ensure_sp_pr() → pugi::xml_node | Get or create the spPr element. |
get_c_nv_pr() → pugi::xml_node | Get the cNvPr element from the shape XML. |
find_xfrm_in_element(xml_element: pugi::xml_node) → pugi::xml_node | Find the a:xfrm element directly within a shape XML element. |
get_placeholder_info() → std::optional<std::pair<std::optional<std::string>, std::string>> | Get (type, idx) from element if this shape is a placeholder. |
find_placeholder_xfrm_in_xml(root: pugi::xml_node, ph_type: std::optional<std::string>, ph_idx: std::string_view) → pugi::xml_node | Find the xfrm for a matching placeholder in a layout/master XML root. |
xml_element() → pugi::xml_node | Returns the XML element backing this shape. |
frame_from_xfrm(xfrm: pugi::xml_node) → ShapeFrame | Read a frame out of an a:xfrm element. An empty node gives a zero frame. |
get_inherited_frame() → std::optional<ShapeFrame> | Walk the layout -> master chain for the frame a placeholder inherits. Returns a value rather than a node. The layout and master parts are parsed into documents local to this call and destroyed when it returns; a pugi::xml_node is a non-owning handle into its document’s memory pool, so returning one would hand the caller a dangling reference. |
get_xfrm() → pugi::xml_node | Get the a:xfrm element from this shape’s own XML. Placeholder inheritance is deliberately not resolved here: an inherited a:xfrm lives in the layout or master part, which is shared by every slide that uses it, and must never be handed out for mutation. Use get_inherited_frame() to read inherited geometry. |
ensure_xfrm() → pugi::xml_node | Get or create the a:xfrm element. |