Projects

This page covers IProject, IProjects, IProjectChangeEvent, and IProjectChangeEventHandler. Projects group imported pieces, track aggregate counters, and carry scheduling and state information used by the Desktop host.

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.

IProject

Project metadata plus aggregate counters for pieces, material groups, scheduling, and processing state.

IID
{D62A183C-3C58-419E-A266-913A1D17DDAD}
Parent
IUnknown (implicit: a Delphi interface without a parent is IUnknown)
Unit
uIProject
Vtable order (44 methods, slots 3 to 46, after the three IUnknown slots)
  1. function GetId(): Int64;
  2. procedure SetId(aId: Int64);
  3. function GetTitle(): WideString;
  4. procedure SetTitle(const aTitle: WideString);
  5. function GetDescription(): WideString;
  6. procedure SetDescription(const aDescription: WideString);
  7. function GetPriority(): TProjectPriority;
  8. procedure SetPriority(aPriority: TProjectPriority);
  9. function GetCreateDate(): TDateTime;
  10. procedure SetCreateDate(aCreateDate: TDateTime);
  11. function GetTargetDate(): TDateTime;
  12. procedure SetTargetDate(aTargetDate: TDateTime);
  13. function GetState(): TProjectState;
  14. procedure SetState(aState: TProjectState);
  15. function GetPieceCount(): Cardinal;
  16. procedure SetPieceCount(aCount: Cardinal);
  17. function GetPieceField2D(): TField;
  18. procedure SetPieceField2D(aField: TField);
  19. function GetPieceLength1D(): TField;
  20. procedure SetPieceLength1D(aLength: TField);
  21. function GetProcessedCount(): Integer;
  22. procedure SetProcessedCount(aCount: Integer);
  23. function GetProcessedField2D(): TField;
  24. procedure SetProcessedField2D(aField: TField);
  25. function GetProcessedLength1D(): TField;
  26. procedure SetProcessedLength1D(aLength: TField);
  27. function GetMaterialGroupCount(): Cardinal;
  28. procedure SetMaterialGroupCount(aCount: Cardinal);
  29. function GetLoading(): Boolean;
  30. procedure SetLoading(aLoading: Boolean);
  31. function GetLoaded(): Boolean;
  32. procedure SetLoaded(aLoaded: Boolean);
  33. function GetOnChange(): INotifyEvent;
  34. function GetOnIdChange(): IIdChangeEvent;
  35. function Clone(): IProject;
  36. procedure Assign(const aOther: IProject);
  37. procedure UpdateStats(const aAllFormats: IUnknown);
  38. procedure FormatAdded(aFormat: IUnknown);
  39. procedure FormatRemoved(aFormat: IUnknown);
  40. procedure FormatChanged(aFormat: IUnknown);
  41. procedure FormatIdChanged(aFormat: IUnknown; aNewId, aOldId: Int64);
  42. procedure GetFormats(aFormats: IUnknown; const aAllFormats: IUnknown; aKeepOrder: Boolean = False);
  43. procedure BeginUpdate();
  44. procedure EndUpdate();

Properties

  • Property name
    Id
    Type
    Int64
    Description

    Persistent numeric identifier used by TonCut to track the object.

    Declaration

    property Id: Int64 read GetId write SetId;
  • Property name
    Title
    Type
    WideString
    Description

    Human-readable title shown to users.

    Declaration

    property Title: WideString read GetTitle write SetTitle;
  • Property name
    Description
    Type
    WideString
    Description

    Name or descriptive text shown to the user.

    Declaration

    property Description: WideString read GetDescription write SetDescription;
  • Property name
    Priority
    Type
    Description

    Priority value of the object.

    Declaration

    property Priority: TProjectPriority read GetPriority write SetPriority;
  • Property name
    CreateDate
    Type
    TDateTime
    Description

    Project creation date.

    Declaration

    property CreateDate: TDateTime read GetCreateDate write SetCreateDate;
  • Property name
    TargetDate
    Type
    TDateTime
    Description

    Requested completion date for the project.

    Declaration

    property TargetDate: TDateTime read GetTargetDate write SetTargetDate;
  • Property name
    State
    Type
    Description

    Current project state.

    Declaration

    property State: TProjectState read GetState write SetState;
  • Property name
    Loading
    Type
    Boolean
    Description

    Whether the project or collection is currently loading data.

    Declaration

    property Loading: Boolean read GetLoading write SetLoading;
  • Property name
    Loaded
    Type
    Boolean
    Description

    Whether loading has already completed.

    Declaration

    property Loaded: Boolean read GetLoaded write SetLoaded;
  • Property name
    PieceCount
    Type
    Cardinal
    Description

    Total number of pieces tracked by the project or result.

    Declaration

    property PieceCount: Cardinal read GetPieceCount write SetPieceCount;
  • Property name
    PieceField2D
    Type
    TField
    Description

    Total two-dimensional piece area tracked by the object.

    Declaration

    property PieceField2D: TField read GetPieceField2D write SetPieceField2D;
  • Property name
    PieceLength1D
    Type
    TField
    Description

    Total one-dimensional piece length tracked by the object.

    Declaration

    property PieceLength1D: TField read GetPieceLength1D write SetPieceLength1D;
  • Property name
    ProcessedCount
    Type
    Integer
    Description

    Count already processed by TonCut.

    Declaration

    property ProcessedCount: Integer read GetProcessedCount write SetProcessedCount;
  • Property name
    ProcessedField2D
    Type
    TField
    Description

    Two-dimensional area already processed by TonCut.

    Declaration

    property ProcessedField2D: TField read GetProcessedField2D write SetProcessedField2D;
  • Property name
    ProcessedLength1D
    Type
    TField
    Description

    One-dimensional length already processed by TonCut.

    Declaration

    property ProcessedLength1D: TField read GetProcessedLength1D write SetProcessedLength1D;
  • Property name
    MaterialGroupCount
    Type
    Cardinal
    Description

    Number of distinct material groups currently used.

    Declaration

    property MaterialGroupCount: Cardinal read GetMaterialGroupCount write SetMaterialGroupCount;
  • Property name
    OnChange
    Type
    INotifyEvent
    Description

    Event fired when the object or collection changes.

    Declaration

    property OnChange: INotifyEvent read GetOnChange;
  • Property name
    OnIdChange
    Type
    IIdChangeEvent
    Description

    Event fired when an identifier changes.

    Declaration

    property OnIdChange: IIdChangeEvent read GetOnIdChange;

Methods

  • Method name
    Clone()
    Type
    IProject
    Description

    Create a copy of the current object.

    Declaration

    function Clone(): IProject; safecall;
    Returns
    A copied project interface instance.
  • Method name
    Assign()
    Type
    procedure
    Description

    Copy values from another object of the same type.

    Declaration

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

    Recalculate aggregate project counters from the available formats.

    Declaration

    procedure UpdateStats(const aAllFormats: IUnknown); safecall;
    Parameters
    aAllFormatsconst
    IUnknown
    Complete format set used as the source when filtering.
  • Method name
    FormatAdded()
    Type
    procedure
    Description

    Notify the project that a format was added.

    Declaration

    procedure FormatAdded(aFormat: IUnknown); safecall;
    Parameters
    aFormat
    IUnknown
    Format instance being queried or modified.
  • Method name
    FormatRemoved()
    Type
    procedure
    Description

    Notify the project that a format was removed.

    Declaration

    procedure FormatRemoved(aFormat: IUnknown); safecall;
    Parameters
    aFormat
    IUnknown
    Format instance being queried or modified.
  • Method name
    FormatChanged()
    Type
    procedure
    Description

    Notify the project that a format was changed.

    Declaration

    procedure FormatChanged(aFormat: IUnknown); safecall;
    Parameters
    aFormat
    IUnknown
    Format instance being queried or modified.
  • Method name
    FormatIdChanged()
    Type
    procedure
    Description

    Notify the project that a format was id changed.

    Declaration

    procedure FormatIdChanged(aFormat: IUnknown; aNewId: Int64; aOldId: Int64); safecall;
    Parameters
    aFormat
    IUnknown
    Format instance being queried or modified.
    aNewId
    Int64
    New TonCut object identifier.
    aOldId
    Int64
    Previous TonCut object identifier.
  • Method name
    GetFormats()
    Type
    procedure
    Description

    Populate or retrieve the formats that belong to the project.

    Declaration

    procedure GetFormats(aFormats: IUnknown; const aAllFormats: IUnknown; aKeepOrder: Boolean = False); safecall;
    Parameters
    aFormats
    IUnknown
    Piece collection: a new, empty staging collection in LoadFile, the live pieces in SaveFile. Do not keep it after the call.
    aAllFormatsconst
    IUnknown
    Complete format set used as the source when filtering.
    aKeepOrder
    Boolean
    Whether the output should preserve the original order.
  • 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;

IProjects

Collection interface used to create, enumerate, query, and reload a shared Desktop object set.

IID
{6A337290-EA4F-408E-9F67-D1ECFEFDEA4B}
Parent
IUnknown (implicit: a Delphi interface without a parent is IUnknown)
Unit
uIProjects
Vtable order (23 methods, slots 3 to 25, after the three IUnknown slots)
  1. function CreateProject(): IProject;
  2. procedure Add(aProject: IProject);
  3. procedure DeleteByIndex(aIndex: Cardinal);
  4. procedure DeleteById(aId: Int64);
  5. procedure Remove(const aProject: IProject);
  6. function IndexOf(const aProject: IProject): Integer; overload;
  7. function IndexOf(aId: Int64): Integer; overload;
  8. function FindDuplicate(const aProject: IProject; aCheckTitle: Boolean = False): IProject;
  9. function FindByTitle(const aTitle: WideString): IProject;
  10. function FindUniqueName(const aBaseName: WideString): WideString;
  11. function CheckUniqueName(const aTitle: WideString; const aIgnoreProject: IProject): Boolean; overload;
  12. function CheckUniqueName(aProject: IProject; aAutoFix: Boolean = False): Boolean; overload;
  13. function GetCount(): Integer;
  14. function GetByIndex(aIndex: Cardinal): IProject;
  15. function GetById(aId: Int64): IProject;
  16. function GetOnAdd(): IProjectChangeEvent;
  17. function GetOnRemove(): IProjectChangeEvent;
  18. function GetOnChange(): INotifyEvent;
  19. procedure Load(aStartDate: TDateTime; aIncludeCanceled, aIncludeDeleted: Boolean);
  20. procedure Reload();
  21. procedure BeginUpdate();
  22. procedure EndUpdate();
  23. function IsUpdating(): Boolean;

Properties

  • Property name
    Count
    Type
    Integer
    Description

    Number of items currently exposed by the interface.

    Declaration

    property Count: Integer read GetCount;
  • Property name
    Items
    Type
    IProject
    Description

    Indexed property used to read one item from the collection.

    Declaration

    property Items[aIndex: Cardinal]: IProject read GetByIndex; default;
    Index Parameters
    aIndex
    Cardinal
    Zero-based position within a collection.
    Value
    The collection item located at the supplied index.
  • Property name
    OnAdd
    Type
    IProjectChangeEvent
    Description

    Event fired when an item is added.

    Declaration

    property OnAdd: IProjectChangeEvent read GetOnAdd;
  • Property name
    OnRemove
    Type
    IProjectChangeEvent
    Description

    Event fired when an item is removed.

    Declaration

    property OnRemove: IProjectChangeEvent read GetOnRemove;
  • Property name
    OnChange
    Type
    INotifyEvent
    Description

    Event fired when the object or collection changes.

    Declaration

    property OnChange: INotifyEvent read GetOnChange;

Methods

  • Method name
    CreateProject()
    Type
    IProject
    Description

    Create a new, empty project. No dialog opens, the result is never null, and the object is not in the collection until you pass it to Add. A new object has a temporary negative Id.

    Declaration

    function CreateProject(): IProject; safecall;
    Returns
    A new, empty project that is not yet in the collection; never null.
  • Method name
    Add()
    Type
    procedure
    Description

    Add an object created by this collection’s factory method. In LoadFile, add to the staging collection you received. Add does not check title uniqueness, and adding an object that is already in the collection raises an error.

    Declaration

    procedure Add(aProject: IProject); safecall;
    Parameters
    aProject
    Project instance being queried or modified.
  • Method name
    DeleteByIndex()
    Type
    procedure
    Description

    Delete the item at the specified zero-based index.

    Declaration

    procedure DeleteByIndex(aIndex: Cardinal); safecall;
    Parameters
    aIndex
    Cardinal
    Zero-based position within a collection.
  • Method name
    DeleteById()
    Type
    procedure
    Description

    Delete the item with the specified TonCut identifier.

    Declaration

    procedure DeleteById(aId: Int64); safecall;
    Parameters
    aId
    Int64
    TonCut object identifier.
  • Method name
    Remove()
    Type
    procedure
    Description

    Remove an item or handler.

    Declaration

    procedure Remove(const aProject: IProject); safecall;
    Parameters
    aProjectconst
    Project instance being queried or modified.
  • Method name
    IndexOf()
    Type
    Integer
    Description

    Return the zero-based index of the matching item.

    Declaration

    function IndexOf(const aProject: IProject): Integer; overload; safecall;

    C++ name: IndexOfByObject. The C++ header gives each Pascal overload its own name; the vtable slot is the same.

    Parameters
    aProjectconst
    Project instance being queried or modified.
    Returns
    Zero-based index of the matching item, or -1 when no match exists.
  • Method name
    IndexOf()
    Type
    Integer
    Description

    Return the zero-based index of the matching item.

    Declaration

    function IndexOf(aId: Int64): Integer; overload; safecall;

    C++ name: IndexOfById. The C++ header gives each Pascal overload its own name; the vtable slot is the same.

    Parameters
    aId
    Int64
    TonCut object identifier.
    Returns
    Zero-based index of the matching item, or -1 when no match exists.
  • Method name
    FindDuplicate()
    Type
    IProject
    Description

    Search for an existing item that duplicates the supplied object.

    Declaration

    function FindDuplicate(const aProject: IProject; aCheckTitle: Boolean = False): IProject; safecall;
    Parameters
    aProjectconst
    Project instance being queried or modified.
    aCheckTitle
    Boolean
    Whether title collisions should count as duplicates.
    Returns
    The matching project interface instance, or null when not found.
  • Method name
    FindByTitle()
    Type
    IProject
    Description

    Find a project by title. Inside LoadFile it searches only what the current call has staged.

    Declaration

    function FindByTitle(const aTitle: WideString): IProject; safecall;
    Parameters
    aTitleconst
    WideString
    Human-readable title.
    Returns
    The matching project interface instance, or null when not found.
  • Method name
    FindUniqueName()
    Type
    WideString
    Description

    Generate or return a title that is unique within the collection.

    Declaration

    function FindUniqueName(const aBaseName: WideString): WideString; safecall;
    Parameters
    aBaseNameconst
    WideString
    Base title used while generating a unique name.
    Returns
    A title string that is unique within the collection.
  • Method name
    CheckUniqueName()
    Type
    Boolean
    Description

    Check whether a proposed title is unique within the collection.

    Declaration

    function CheckUniqueName(const aTitle: WideString; const aIgnoreProject: IProject): Boolean; overload; safecall;
    Parameters
    aTitleconst
    WideString
    Human-readable title.
    aIgnoreProjectconst
    Project to exclude from uniqueness checks.
    Returns
    Returns true if the proposed title is unique within the collection.
  • Method name
    CheckUniqueName()
    Type
    Boolean
    Description

    Check whether a proposed title is unique within the collection.

    Declaration

    function CheckUniqueName(aProject: IProject; aAutoFix: Boolean = False): Boolean; overload; safecall;

    C++ name: CheckUniqueNameByProject. The C++ header gives each Pascal overload its own name; the vtable slot is the same.

    Parameters
    aProject
    Project instance being queried or modified.
    aAutoFix
    Boolean
    Whether the method may adjust data automatically.
    Returns
    Returns true if the proposed title is unique within the collection.
  • Method name
    GetById()
    Type
    IProject
    Description

    Return the item stored under the specified TonCut identifier.

    Declaration

    function GetById(aId: Int64): IProject; safecall;
    Parameters
    aId
    Int64
    TonCut object identifier.
    Returns
    The matching project interface instance.
  • Method name
    Load()
    Type
    procedure
    Description

    Load .

    Declaration

    procedure Load(aStartDate: TDateTime; aIncludeCanceled: Boolean; aIncludeDeleted: Boolean); safecall;
    Parameters
    aStartDate
    TDateTime
    Value for start date.
    aIncludeCanceled
    Boolean
    Boolean flag controlling include canceled.
    aIncludeDeleted
    Boolean
    Boolean flag controlling include deleted.
  • Method name
    Reload()
    Type
    procedure
    Description

    Reload the underlying data from the host or storage layer.

    Declaration

    procedure Reload(); safecall;
  • 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;
  • Method name
    IsUpdating()
    Type
    Boolean
    Description

    Report whether the interface is currently inside an update batch.

    Declaration

    function IsUpdating(): Boolean; safecall;
    Returns
    Returns true while the interface is inside a BeginUpdate / EndUpdate batch.

IProjectChangeEventHandler

Callback sink consumed by the matching change-event interface.

IID
{FE8C043B-F245-40BF-AAB2-352D902546F6}
Parent
IUnknown
Unit
uIProjectChangeEvent

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 (1 methods, slots 3 to 3, after the three IUnknown slots)
  1. procedure Invoke(aSender: IUnknown; aProject: IProject; aIndex: Integer);

Methods

  • Method name
    Invoke()
    Type
    procedure
    Description

    Handle the event callback when the owning event interface invokes it.

    Declaration

    procedure Invoke(aSender: IUnknown; aProject: IProject; aIndex: Integer); safecall;
    Parameters
    aSender
    IUnknown
    Object that raised the event.
    aProject
    Project instance being queried or modified.
    aIndex
    Integer
    Zero-based position within a collection.

IProjectChangeEvent

Event interface with Add, Remove, and Invoke hooks for collection or entity change notifications.

IID
{479C92D6-81C2-43DA-BA12-2DFECBC2B9CA}
Parent
IUnknown
Unit
uIProjectChangeEvent

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 (3 methods, slots 3 to 5, after the three IUnknown slots)
  1. procedure Add(aHandler: IProjectChangeEventHandler);
  2. procedure Remove(aHandler: IProjectChangeEventHandler);
  3. procedure Invoke(aSender: IUnknown; aProject: IProject; aIndex: Integer);

Methods

  • Method name
    Add()
    Type
    procedure
    Description

    Add an item or handler.

    Declaration

    procedure Add(aHandler: IProjectChangeEventHandler); safecall;
    Parameters
    aHandler
    The handler interface instance to use.
  • Method name
    Remove()
    Type
    procedure
    Description

    Remove an item or handler.

    Declaration

    procedure Remove(aHandler: IProjectChangeEventHandler); safecall;
    Parameters
    aHandler
    The handler interface instance to use.
  • Method name
    Invoke()
    Type
    procedure
    Description

    Raise the typed change event for the current payload.

    Declaration

    procedure Invoke(aSender: IUnknown; aProject: IProject; aIndex: Integer); safecall;
    Parameters
    aSender
    IUnknown
    Object that raised the event.
    aProject
    Event payload field for project.
    aIndex
    Integer
    Event payload field for index.

Was this page helpful?