Shapes

This page covers IShape, IRectangle, ILinearShape, and IAnyShape. These interfaces appear inside pieces, stock, solution waste, and geometry-heavy export workflows.

The four IRectangle sides are signed Integer values. When the rectangle represents a minimum edge distance, a negative side means inherited or unspecified; consumers must not reinterpret it as an unsigned length.

Interfaces

Declarations are shown in Pascal and, where the SDK's generated language-support manifest lists the member for C++, in C++; the build fails if that manifest no longer matches TonCutPluginSdk.hpp. There is no C# declaration: C# plugins are native-shim-only, so a C++ shim owns every interface on this page. Methods are listed with their accessors folded into properties; open Vtable order for the exact slot sequence, and see ABI and marshalling for type sizes and ownership rules.

IShape

Abstract shape contract used for non-rectangular pieces and waste geometry.

IID
{D9FB6E15-5D6A-46A8-8391-9BC4722A22DC}
Parent
IUnknown (implicit: a Delphi interface without a parent is IUnknown)
Unit
uIShape

The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.

Vtable order (19 methods, slots 3 to 21, after the three IUnknown slots)
  1. function GetShapeType(): TShapeType;
  2. function SaveToString(aLengthUnit: TLengthUnits = luMillimeters; aAngleUnit: TAngleUnits = auRadians): WideString;
  3. function LoadFromString(const aString: WideString; aDefLengthUnit: TLengthUnits = luMillimeters; aDefAngleUnit: TAngleUnits = auRadians): Boolean;
  4. function GetNetPath(aNetLength, aNetWidth, aSurplus, aMargin: Integer): WideString;
  5. function GetGrossPath(aNetLength, aNetWidth, aSurplus, aMargin: Integer): WideString;
  6. function GetEdgeCount(): Integer;
  7. function GetEdgeInfo(aIndex: Integer; var aName, aTitle: WideString): Boolean;
  8. function GetEdgeBandByIndex(aIndex: Integer): IBand;
  9. procedure SetEdgeBandByIndex(aIndex: Integer; const aBand: IBand);
  10. function GetEdgeBandByName(const aName: WideString): IBand;
  11. procedure SetEdgeBandByName(const aName: WideString; const aBand: IBand);
  12. function GetParamCount(): Integer;
  13. function GetParamInfo(aIndex: Integer; var aName, aTitle: WideString; var aType: TShapeParamType): Boolean;
  14. function GetParamByIndex(aIndex: Integer): Integer;
  15. procedure SetParamByIndex(aIndex: Integer; aValue: Integer);
  16. function GetParamByName(const aName: WideString): Integer;
  17. procedure SetParamByName(const aName: WideString; aValue: Integer);
  18. function IsSame(const aOther: IShape): Boolean;
  19. function GetOnChange(): INotifyEvent;

Properties

  • Property name
    ShapeType
    Type
    Description

    Enumerated shape kind exposed by the current shape object.

    Declaration

    property ShapeType: TShapeType read GetShapeType;
  • Property name
    EdgeCount
    Type
    Integer
    Description

    Count of edge.

    Declaration

    property EdgeCount: Integer read GetEdgeCount;
  • Property name
    ParamCount
    Type
    Integer
    Description

    Count of param.

    Declaration

    property ParamCount: Integer read GetParamCount;
  • Property name
    OnChange
    Type
    INotifyEvent
    Description

    Event fired when the object or collection changes.

    Declaration

    property OnChange: INotifyEvent read GetOnChange;

Methods

  • Method name
    SaveToString()
    Type
    WideString
    Description

    Serialize the shape into a string representation.

    Declaration

    function SaveToString(aLengthUnit: TLengthUnits = luMillimeters; aAngleUnit: TAngleUnits = auRadians): WideString; safecall;
    Parameters
    aLengthUnit
    Value for length unit.
    aAngleUnit
    Value for angle unit.
    Returns
    The current shape serialized as a string.
  • Method name
    LoadFromString()
    Type
    Boolean
    Description

    Load the shape from a serialized string representation.

    Declaration

    function LoadFromString(const aString: WideString; aDefLengthUnit: TLengthUnits = luMillimeters; aDefAngleUnit: TAngleUnits = auRadians): Boolean; safecall;
    Parameters
    aStringconst
    WideString
    Text value for string.
    aDefLengthUnit
    Value for def length unit.
    aDefAngleUnit
    Value for def angle unit.
    Returns
    Returns true if the serialized shape was parsed successfully.
  • Method name
    GetNetPath()
    Type
    WideString
    Description

    Return an SVG-compatible path representation of the shape using the requested dimensional context.

    Declaration

    function GetNetPath(aNetLength: Integer; aNetWidth: Integer; aSurplus: Integer; aMargin: Integer): WideString; safecall;
    Parameters
    aNetLength
    Integer
    Value for net length.
    aNetWidth
    Integer
    Value for net width.
    aSurplus
    Integer
    Surplus value in hundredths of a millimeter.
    aMargin
    Integer
    Margin value in hundredths of a millimeter.
    Returns
    The SVG-compatible path string for the net shape outline.
  • Method name
    GetGrossPath()
    Type
    WideString
    Description

    Return an SVG-compatible path representation of the shape using the requested dimensional context.

    Declaration

    function GetGrossPath(aNetLength: Integer; aNetWidth: Integer; aSurplus: Integer; aMargin: Integer): WideString; safecall;
    Parameters
    aNetLength
    Integer
    Value for net length.
    aNetWidth
    Integer
    Value for net width.
    aSurplus
    Integer
    Surplus value in hundredths of a millimeter.
    aMargin
    Integer
    Margin value in hundredths of a millimeter.
    Returns
    The SVG-compatible path string for the gross shape outline.
  • Method name
    GetEdgeInfo()
    Type
    Boolean
    Description

    Return metadata for a named or indexed shape edge.

    Declaration

    function GetEdgeInfo(aIndex: Integer; var aName: WideString; var aTitle: WideString): Boolean; safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    aNamevar
    WideString
    Text value for name. Passed by reference and may be updated by the callee.
    aTitlevar
    WideString
    Human-readable title. Passed by reference and may be updated by the callee.
    Returns
    Returns true if edge metadata was found for the requested index and the output parameters were populated.
  • Method name
    GetEdgeBandByIndex()
    Type
    IBand
    Description

    Return or populate edge band by index.

    Declaration

    function GetEdgeBandByIndex(aIndex: Integer): IBand; safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    Returns
    The matching band interface instance.
  • Method name
    SetEdgeBandByIndex()
    Type
    procedure
    Description

    Assign edge band by index.

    Declaration

    procedure SetEdgeBandByIndex(aIndex: Integer; const aBand: IBand); safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    aBandconst
    Band instance being queried or modified.
  • Method name
    GetEdgeBandByName()
    Type
    IBand
    Description

    Return or populate edge band by name.

    Declaration

    function GetEdgeBandByName(const aName: WideString): IBand; safecall;
    Parameters
    aNameconst
    WideString
    Text value for name.
    Returns
    The matching band interface instance.
  • Method name
    SetEdgeBandByName()
    Type
    procedure
    Description

    Assign edge band by name.

    Declaration

    procedure SetEdgeBandByName(const aName: WideString; const aBand: IBand); safecall;
    Parameters
    aNameconst
    WideString
    Text value for name.
    aBandconst
    Band instance being queried or modified.
  • Method name
    GetParamInfo()
    Type
    Boolean
    Description

    Return metadata for a named or indexed shape parameter.

    Declaration

    function GetParamInfo(aIndex: Integer; var aName: WideString; var aTitle: WideString; var aType: TShapeParamType): Boolean; safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    aNamevar
    WideString
    Text value for name. Passed by reference and may be updated by the callee.
    aTitlevar
    WideString
    Human-readable title. Passed by reference and may be updated by the callee.
    aTypevar
    Extension category being enumerated. Passed by reference and may be updated by the callee.
    Returns
    Returns true if parameter metadata was found for the requested index and the output parameters were populated.
  • Method name
    GetParamByIndex()
    Type
    Integer
    Description

    Return or populate param by index.

    Declaration

    function GetParamByIndex(aIndex: Integer): Integer; safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    Returns
    Signed integer value.
  • Method name
    SetParamByIndex()
    Type
    procedure
    Description

    Assign param by index.

    Declaration

    procedure SetParamByIndex(aIndex: Integer; aValue: Integer); safecall;
    Parameters
    aIndex
    Integer
    Zero-based position within a collection.
    aValue
    Integer
    Value being formatted, assigned, or stored.
  • Method name
    GetParamByName()
    Type
    Integer
    Description

    Return or populate param by name.

    Declaration

    function GetParamByName(const aName: WideString): Integer; safecall;
    Parameters
    aNameconst
    WideString
    Text value for name.
    Returns
    Signed integer value.
  • Method name
    SetParamByName()
    Type
    procedure
    Description

    Assign param by name.

    Declaration

    procedure SetParamByName(const aName: WideString; aValue: Integer); safecall;
    Parameters
    aNameconst
    WideString
    Text value for name.
    aValue
    Integer
    Value being formatted, assigned, or stored.
  • Method name
    IsSame()
    Type
    Boolean
    Description

    Compare two shapes for structural equality.

    Declaration

    function IsSame(const aOther: IShape): Boolean; safecall;
    Parameters
    aOtherconst
    Source object whose values should be copied.
    Returns
    Returns true if the supplied shape describes the same geometry as the current shape.

IRectangle

Signed four-side helper used for margins, edging, and edge-distance measurements. A negative side represents an inherited or unspecified edge distance.

IID
{1B77A717-7561-46CA-B2E9-87CC4F69B4F4}
Parent
IUnknown (implicit: a Delphi interface without a parent is IUnknown)
Unit
uIRectangle

The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.

Vtable order (12 methods, slots 3 to 14, after the three IUnknown slots)
  1. function GetNorth(): Integer;
  2. procedure SetNorth(aNorth: Integer);
  3. function GetSouth(): Integer;
  4. procedure SetSouth(aSouth: Integer);
  5. function GetWest(): Integer;
  6. procedure SetWest(aWest: Integer);
  7. function GetEast(): Integer;
  8. procedure SetEast(aEast: Integer);
  9. function GetOnChange(): INotifyEvent;
  10. procedure Assign(const aOther: IRectangle);
  11. procedure BeginUpdate();
  12. procedure EndUpdate();

Properties

  • Property name
    North
    Type
    Integer
    Description

    Signed value assigned to the north or top edge; a negative edge-distance value means inherited or unspecified.

    Declaration

    property North: Integer read GetNorth write SetNorth;
  • Property name
    South
    Type
    Integer
    Description

    Signed value assigned to the south or bottom edge; a negative edge-distance value means inherited or unspecified.

    Declaration

    property South: Integer read GetSouth write SetSouth;
  • Property name
    West
    Type
    Integer
    Description

    Signed value assigned to the west or left edge; a negative edge-distance value means inherited or unspecified.

    Declaration

    property West: Integer read GetWest write SetWest;
  • Property name
    East
    Type
    Integer
    Description

    Signed value assigned to the east or right edge; a negative edge-distance value means inherited or unspecified.

    Declaration

    property East: Integer read GetEast write SetEast;
  • Property name
    Top
    Type
    Integer
    Description

    Alias of North; a negative edge-distance value means inherited or unspecified.

    Declaration

    property Top: Integer read GetNorth write SetNorth;
  • Property name
    Bottom
    Type
    Integer
    Description

    Alias of South; a negative edge-distance value means inherited or unspecified.

    Declaration

    property Bottom: Integer read GetSouth write SetSouth;
  • Property name
    Left
    Type
    Integer
    Description

    Alias of West; a negative edge-distance value means inherited or unspecified.

    Declaration

    property Left: Integer read GetWest write SetWest;
  • Property name
    Right
    Type
    Integer
    Description

    Alias of East; a negative edge-distance value means inherited or unspecified.

    Declaration

    property Right: Integer read GetEast write SetEast;
  • Property name
    OnChange
    Type
    INotifyEvent
    Description

    Event fired when the object or collection changes.

    Declaration

    property OnChange: INotifyEvent read GetOnChange;

Methods

  • Method name
    Assign()
    Type
    procedure
    Description

    Copy values from another object of the same type.

    Declaration

    procedure Assign(const aOther: IRectangle); safecall;
    Parameters
    aOtherconst
    Source object whose values should be copied.
  • Method name
    BeginUpdate()
    Type
    procedure
    Description

    Start a batched update so change notifications can be delayed.

    Declaration

    procedure BeginUpdate(); safecall;
  • Method name
    EndUpdate()
    Type
    procedure
    Description

    Finish a batched update and allow deferred notifications to resume.

    Declaration

    procedure EndUpdate(); safecall;

ILinearShape

Linear shape specialization that stores a sequence of segments.

IID
{62102D28-C799-4709-A0C4-CFF6FDB5A5FB}
Parent
IShape
Unit
uILinearShape

The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.

Vtable order (4 methods, slots 22 to 25, after the IUnknown and IShape slots)
  1. function GetLeftAngle(): Double;
  2. procedure SetLeftAngle(aAngle: Double);
  3. function GetRightAngle(): Double;
  4. procedure SetRightAngle(aAngle: Double);

Properties

  • Property name
    LeftAngle
    Type
    Double
    Description

    Slant angle of the left end of a linear shape, a Double in radians; 0 is a square end. It is always measured from the middle to the right, regardless of the device slant-measurement settings. To show it to the user, format it with ITonCut.FormatRadians.

    Declaration

    property LeftAngle: Double read GetLeftAngle write SetLeftAngle;
    Diagram of a slanted left end of a linear piece. The left angle is measured from the middle of the end towards the right.
  • Property name
    RightAngle
    Type
    Double
    Description

    Slant angle of the right end of a linear shape, a Double in radians; 0 is a square end. It is always measured from the middle to the left, regardless of the device slant-measurement settings. To show it to the user, format it with ITonCut.FormatRadians.

    Declaration

    property RightAngle: Double read GetRightAngle write SetRightAngle;
    Diagram of a slanted right end of a linear piece. The right angle is measured from the middle of the end towards the left.

IAnyShape

Arbitrary-path shape variant whose geometry is stored as a serialized path string.

IID
{814BFA57-1A8A-4459-8C6B-00FF9F5E1223}
Parent
IShape
Unit
uIAnyShape

The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.

Vtable order (2 methods, slots 22 to 23, after the IUnknown and IShape slots)
  1. function GetPath(): WideString;
  2. procedure SetPath(const aPath: WideString);

Properties

  • Property name
    Path
    Type
    WideString
    Description

    SVG-compatible path content stored by the arbitrary-shape object.

    Declaration

    property Path: WideString read GetPath write SetPath;

Was this page helpful?