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

NameTypeAccessDescription
ShapeTypeShapeTypeReadGets the shape type.
EffectFormatEffectFormatReadGets the effect format.
FillFormatFillFormatReadGets the fill format.
LineFormatLineFormatReadGets the line format.
ThreeDFormatThreeDFormatReadGets the three d format.
ShapeFrameShapeFrameReadGets the shape frame.
ISlideComponentISlideComponentReadGets the i slide component.
IPresentationIPresentationReadGets the i presentation.
IBaseSlideIBaseSlideReadGets the i base slide.
IPresentationComponentIPresentationComponentReadGets the i presentation component.

Methods

SignatureDescription
ShapeType() → ShapeTypeReturns the shape type.
EffectFormat() → EffectFormatReturns the effect format for this shape.
EffectFormat() → EffectFormatProperty provides access to the shape’s effect formatting
FillFormat() → FillFormatReturns the fill format for this shape.
FillFormat() → FillFormatReturns the fill formatting object for the shape
LineFormat() → LineFormatReturns the line format for this shape.
LineFormat() → LineFormatProperty provides access to the shape’s line formatting
ThreeDFormat() → ThreeDFormatReturns the 3D format for this shape.
ThreeDFormat() → ThreeDFormatProperty provides access to the shape’s 3‑D formatting
ShapeFrame() → ShapeFrameReturns the raw shape frame.
ShapeFrame() → ShapeFrameReturns the shape frame.
ISlideComponent() → ISlideComponentReturns the base ISlideComponent interface.
IPresentation() → IPresentationProperty references the presentation interface containing the shape
IPresentation() → IPresentation
IBaseSlide() → IBaseSlideProperty references the base slide interface that holds the shape
IBaseSlide() → IBaseSlide
IPresentationComponent() → IPresentationComponentReturns the presentation component interface of the shape
IPresentationComponent() → IPresentationComponent
~Shape()Calls ~Shape on this Shape instance.
shape_type() → ShapeTypeReturns the shape type.
set_shape_type(value: ShapeType)Sets the shape type.
x() → doubleReturns the x-coordinate of the shape.
set_x(value: double)Sets the shape’s X coordinate
y() → doubleReturns the y-coordinate of the shape.
set_y(value: double)Sets the shape’s Y coordinate
width() → doubleReturns the width of the shape.
set_width(value: double)Calls set_width(value) on this Shape instance.
height() → doubleReturns the height of the shape.
set_height(value: double)Calls set_height(value) on this Shape instance.
rotation() → doubleReturns the rotation angle in degrees.
set_rotation(value: double)Sets the shape’s rotation angle
name() → std::stringReturns the shape name.
set_name(value: std::string)Calls set_name(value) on this Shape instance.
effect_format() → EffectFormatReturns the effect format for this shape.
effect_format() → EffectFormatCalls effect_format on this Shape instance.
fill_format() → FillFormatReturns the fill format for this shape.
fill_format() → FillFormatCalls fill_format on this Shape instance.
line_format() → LineFormatReturns the line format for this shape.
line_format() → LineFormatCalls line_format on this Shape instance.
three_d_format() → ThreeDFormatReturns the 3D format for this shape.
three_d_format() → ThreeDFormatCalls three_d_format on this Shape instance.
is_text_holder() → boolDetermines whether the shape is a TextHolder. Default: false.
placeholder()Returns the placeholder. Default: nullptr.
custom_data()Returns the custom data. Default: nullptr.
raw_frame() → ShapeFrameReturns the raw shape frame.
set_raw_frame(value: ShapeFrame)Calls set_raw_frame(value) on this Shape instance.
frame() → ShapeFrameReturns the shape frame.
set_frame(value: ShapeFrame)Calls set_frame(value) on this Shape instance.
hidden() → boolDetermines whether the shape is hidden.
set_hidden(value: bool)Calls set_hidden(value) on this Shape instance.
z_order_position() → std::int32_tReturns the z-order position.
connection_site_count() → std::int32_tReturns the number of connection sites (default 4).
alternative_text() → std::stringReturns the alternative text.
set_alternative_text(value: std::string)Calls set_alternative_text(value) on this Shape instance.
alternative_text_title() → std::stringReturns the alternative text title.
set_alternative_text_title(value: std::string)Calls set_alternative_text_title(value) on this Shape instance.
is_decorative() → boolGets the ‘Mark as decorative’ option.
set_is_decorative(value: bool)Calls set_is_decorative(value) on this Shape instance.
unique_id() → std::uint32_tReturns the presentation-scoped unique identifier.
office_interop_shape_id() → std::uint32_tReturns the slide-scoped shape identifier.
is_grouped() → boolDetermines whether the shape is grouped.
as_i_slide_component() → ISlideComponentReturns the base ISlideComponent interface.
presentation() → IPresentationCalls presentation on this Shape instance.
presentation() → IPresentation
slide() → IBaseSlideCalls slide on this Shape instance.
slide() → IBaseSlide
as_i_presentation_component() → IPresentationComponentCalls 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() → ShapeFrameBuild 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_nodeGet the spPr (or grpSpPr) element for this shape.
ensure_sp_pr() → pugi::xml_nodeGet or create the spPr element.
get_c_nv_pr() → pugi::xml_nodeGet the cNvPr element from the shape XML.
find_xfrm_in_element(xml_element: pugi::xml_node) → pugi::xml_nodeFind 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_nodeFind the xfrm for a matching placeholder in a layout/master XML root.
xml_element() → pugi::xml_nodeReturns the XML element backing this shape.
frame_from_xfrm(xfrm: pugi::xml_node) → ShapeFrameRead 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_nodeGet 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_nodeGet or create the a:xfrm element.

See Also

 English