Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OdgShape

Namespace OfficeIMO.OpenDocument
Assembly OfficeIMO.OpenDocument
Modifiers sealed

A Draw shape backed by its original XML, including elements outside the editable profile.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Methods

public OdgGluePoint AddGluePoint(OdgGluePointAlignment alignment = Center, Nullable<OdfLength> offsetX = null, Nullable<OdfLength> offsetY = null) #
Returns: OdgGluePoint

Adds an attachment point with absolute offsets from the selected edge or corner. Bottom uses a native relative point because ODF has no bottom-center alignment token; its offsets must be zero.

Parameters

alignment OfficeIMO.OpenDocument.OdgGluePointAlignment = Center optionalposition: 0
offsetX System.Nullable{OfficeIMO.OpenDocument.OdfLength} = null optionalposition: 1
offsetY System.Nullable{OfficeIMO.OpenDocument.OdfLength} = null optionalposition: 2
public OdfTextList AddList(Boolean ordered = false) #
Returns: OdfTextList

Appends a native ordered or unordered list with its own automatic list style.

Parameters

ordered System.Boolean = false optionalposition: 0
public OdfTextParagraph AddParagraph(String text = null) #
Returns: OdfTextParagraph

Appends a native paragraph while retaining existing text, lists and shape metadata.

Parameters

text System.String = null optionalposition: 0
public Void AttachEnd(OdgGluePoint point) #
Returns: Void

Attaches the end to a glue point. Null detaches it while retaining its current position.

Parameters

point OfficeIMO.OpenDocument.OdgGluePoint requiredposition: 0
public Void AttachEndToShape(OdgShape shape) #
Returns: Void

Attaches the end using automatic selection among the shape's four edge centers. Null detaches it.

Parameters

shape OfficeIMO.OpenDocument.OdgShape requiredposition: 0
public Void AttachStart(OdgGluePoint point) #
Returns: Void

Attaches the start to a glue point. Null detaches it while retaining its current position.

Parameters

point OfficeIMO.OpenDocument.OdgGluePoint requiredposition: 0
public Void AttachStartToShape(OdgShape shape) #
Returns: Void

Attaches the start using automatic selection among the shape's four edge centers. Null detaches it.

Parameters

shape OfficeIMO.OpenDocument.OdgShape requiredposition: 0
public Void BakeConnectorTransform() #
Returns: Void

Bakes a free connector's own affine transform into its endpoints and saved route, including curve controls. Clears the transform and native routing offsets; preserves the routing kind, declared stroke and other styles. Scaling changes geometry without scaling the declared stroke width. Attached ends, transformed parents and rotated, scaled or sheared connector labels are outside this profile. Translation retains labels. Unsupported input leaves the document unchanged.

public Byte[] GetImageBytes() #
Returns: Byte[]

Returns embedded image bytes without resolving external image references.

public Void RouteOrthogonal(OdgConnectorRouteOrientation orientation = Auto, Double offset = 0) #
Returns: Void

Replaces the route with three orthogonal segments and selects Standard routing. Offset is in connector-local points. This method does not avoid obstacles or enforce escape directions. Native applications can subsequently recalculate the route.

Parameters

orientation OfficeIMO.OpenDocument.OdgConnectorRouteOrientation = Auto optionalposition: 0
offset System.Double = 0 optionalposition: 1
RouteOrthogonalAroundShapes 2 overloads
public Void RouteOrthogonalAroundShapes(IEnumerable<OdgShape> obstacles, Double padding = 6, Int32 maxLanes = 12) #
Returns: Void

Searches a bounded set of orthogonal lanes avoiding the declared bounds of unrelated shapes. Padding is in connector-local points, before transforms. Up to 4096 bounded shapes and 32 lanes per direction are accepted. Attached shapes and line/connector obstacles are ignored; groups must be supplied as individual bounded children. No clear lane, unsupported input, or invalid geometry leaves the previous route intact. Native applications can reroute it.

Parameters

obstacles System.Collections.Generic.IEnumerable{OfficeIMO.OpenDocument.OdgShape} requiredposition: 0
padding System.Double = 6 optionalposition: 1
maxLanes System.Int32 = 12 optionalposition: 2
public Void RouteOrthogonalAroundShapes(IEnumerable<OdgShape> obstacles, Boolean respectEscapeDirections, Double padding = 6, Int32 maxLanes = 12) #
Returns: Void

Optionally enforces explicit glue-point escape directions while avoiding obstacles and attached shape bounds. With constraints enabled, routes, padding and departure directions use page coordinates; the saved route is mapped back into the connector's coordinate space. Free, automatic and standard glue endpoints allow all directions. Every route must remain orthogonal, retain its departures and match its attachments within 0.1 page point after native-grid rounding. Unsupported input or an exhausted bounded search leaves the document unchanged. Native applications may subsequently reroute it.

Parameters

obstacles System.Collections.Generic.IEnumerable{OfficeIMO.OpenDocument.OdgShape} requiredposition: 0
respectEscapeDirections System.Boolean requiredposition: 1
padding System.Double = 6 optionalposition: 2
maxLanes System.Int32 = 12 optionalposition: 3
public Void SetConnectorRoute(IEnumerable<OfficePathCommand> commands) #
Returns: Void

Replaces the saved open route with commands in connector-local points. Free endpoints follow the route; attached endpoints within 0.1 point of their glue positions are snapped to those positions before native-grid rounding. Native applications can subsequently reroute it.

Parameters

commands System.Collections.Generic.IEnumerable{OfficeIMO.Drawing.OfficePathCommand} requiredposition: 0
public Void SetPathCommands(IEnumerable<OfficePathCommand> commands) #
Returns: Void

Replaces native path data using bounded shared Drawing commands.

Parameters

commands System.Collections.Generic.IEnumerable{OfficeIMO.Drawing.OfficePathCommand} requiredposition: 0
public Void SetPoints(IEnumerable<OfficePoint> points) #
Returns: Void

Replaces polygon/polyline vertices. Coordinates must be signed 32-bit integers; at most 20,000 vertices are accepted.

Parameters

points System.Collections.Generic.IEnumerable{OfficeIMO.Drawing.OfficePoint} requiredposition: 0
public XElement ToXml() #
Returns: XElement

Returns a detached copy of the native element for inspection.

public Void TransformChildren(String transform) #
Returns: Void

Applies an affine transform to existing group children in their parent coordinate space. Nested groups remain groups; free connector and line coordinates are baked. Attached connectors and unknown elements are rejected before any child changes. Connector labels permit translation only; baking free connector geometry preserves the declared stroke width rather than scaling it.

Parameters

transform System.String requiredposition: 0
public Void UseNativeThreeSegmentRouting() #
Returns: Void

Encodes the saved three-segment route as native Lines routing, departure directions and segment offsets. Both ends must attach to untransformed rectangles, frames or full ellipses/circles with declared SVG bounds. The outer segments must be horizontal or vertical and nonzero; the middle segment may be diagonal. Equivalent directional glue points are reused, otherwise cloned without altering shared points. The connector's own transform is baked into the route; transformed parents and transformed connector text are rejected. Native applications may adjust bends for painted bounds, strokes or subsequent shape edits. Unsupported input leaves the document unchanged.

Properties

public IReadOnlyList<OfficePathCommand> ConnectorRouteCommands { get; } #

Returns a detached route in connector-local points, before the connector and parent transforms. Saved routes must match the resolved endpoints; non-straight connectors without a saved route require native routing.

public Boolean IsConnector { get; } #

Whether this element is a native connector.

public IReadOnlyList<OdgGluePoint> GluePoints { get; } #

Explicit glue points on this shape.

public OdgConnectorKind ConnectorKind { get; set; } #

Native connector routing style.

public String StartShapeId { get; } #

Identifier of the shape attached to the start, or null for a free endpoint.

public String EndShapeId { get; } #

Identifier of the shape attached to the end, or null for a free endpoint.

public String ElementName { get; } #

Native element name, for example rect, ellipse, frame, line, or g.

public Boolean IsGroup { get; } #

Whether this is a shape group.

public OdgShapes Children { get; } #

Children of a group. Access on other shapes throws.

public Boolean IsImage { get; } #

Whether the shape has an embedded or linked image.

public String Layer { get; set; } #

Layer name. Layer definitions and visibility remain preserved in the document XML.

public override OdfRect Bounds { get; set; } #

Geometry for rectangular shapes. Lines use endpoints; groups use child geometry and transforms.

public String Text { get; set; } #

Plain text of paragraphs, headings and lists in the selected text container, including text boxes and image captions. Assignment replaces their rich formatting.

public Nullable<OdfLength> FontSize { get; set; } #

Uniform font size for the shape's plain text profile.

public String FontFamily { get; set; } #

Uniform font family for the shape's plain text profile.

public Nullable<OdfColor> TextColor { get; set; } #

Uniform text color for the shape's plain text profile.

public OdfLength X1 { get; set; } #

Line start horizontal coordinate.

public OdfLength Y1 { get; set; } #

Line start vertical coordinate.

public OdfLength X2 { get; set; } #

Line end horizontal coordinate.

public OdfLength Y2 { get; set; } #

Line end vertical coordinate.

public OdfViewBox ViewBox { get; set; } #

Local coordinate canvas for a path, polygon, or polyline. Changing bounds scales this canvas.

public String PathData { get; set; } #

Native SVG path data. Assignment validates the bounded shared path grammar and retains the supplied notation.

public IReadOnlyList<OfficePathCommand> PathCommands { get; } #

Parsed path commands in view-box coordinates; SVG arcs and shorthand are normalized by the shared Drawing parser.

public IReadOnlyList<OfficePoint> Points { get; } #

Polygon or polyline vertices in integer view-box coordinates. The returned list is detached.

public Nullable<OdfLength> CornerRadius { get; set; } #

Circular rectangle corner radius. Setting this clears the alternate elliptical radii.

public Nullable<OdfLength> CornerRadiusX { get; set; } #

Horizontal rectangle corner radius. When only one elliptical radius is present it supplies both axes.

public Nullable<OdfLength> CornerRadiusY { get; set; } #

Vertical rectangle corner radius. Setting this clears the circular radius.

public override String Transform { get; set; } #

Native transform for a leaf shape. Use TransformChildren to transform a group.

public Nullable<OdfInsets> Crop { get; set; } #

Image crop offsets in intrinsic image lengths, ordered top, right, bottom, left.

public Nullable<OdfImageMirror> Mirror { get; set; } #

Mirrors image pixels through the native graphic style without changing the resource.

public IReadOnlyList<OdfTextParagraph> Paragraphs { get; } #

Native paragraphs and headings in reading order, including list items. Excludes other text stories.

public IReadOnlyList<OdfTextList> Lists { get; } #

Direct native lists in this shape's text container.