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)
- function GetId(): Int64;
- procedure SetId(aId: Int64);
- function GetTitle(): WideString;
- procedure SetTitle(const aTitle: WideString);
- function GetDescription(): WideString;
- procedure SetDescription(const aDescription: WideString);
- function GetPriority(): TProjectPriority;
- procedure SetPriority(aPriority: TProjectPriority);
- function GetCreateDate(): TDateTime;
- procedure SetCreateDate(aCreateDate: TDateTime);
- function GetTargetDate(): TDateTime;
- procedure SetTargetDate(aTargetDate: TDateTime);
- function GetState(): TProjectState;
- procedure SetState(aState: TProjectState);
- function GetPieceCount(): Cardinal;
- procedure SetPieceCount(aCount: Cardinal);
- function GetPieceField2D(): TField;
- procedure SetPieceField2D(aField: TField);
- function GetPieceLength1D(): TField;
- procedure SetPieceLength1D(aLength: TField);
- function GetProcessedCount(): Integer;
- procedure SetProcessedCount(aCount: Integer);
- function GetProcessedField2D(): TField;
- procedure SetProcessedField2D(aField: TField);
- function GetProcessedLength1D(): TField;
- procedure SetProcessedLength1D(aLength: TField);
- function GetMaterialGroupCount(): Cardinal;
- procedure SetMaterialGroupCount(aCount: Cardinal);
- function GetLoading(): Boolean;
- procedure SetLoading(aLoading: Boolean);
- function GetLoaded(): Boolean;
- procedure SetLoaded(aLoaded: Boolean);
- function GetOnChange(): INotifyEvent;
- function GetOnIdChange(): IIdChangeEvent;
- function Clone(): IProject;
- procedure Assign(const aOther: IProject);
- procedure UpdateStats(const aAllFormats: IUnknown);
- procedure FormatAdded(aFormat: IUnknown);
- procedure FormatRemoved(aFormat: IUnknown);
- procedure FormatChanged(aFormat: IUnknown);
- procedure FormatIdChanged(aFormat: IUnknown; aNewId, aOldId: Int64);
- procedure GetFormats(aFormats: IUnknown; const aAllFormats: IUnknown; aKeepOrder: Boolean = False);
- procedure BeginUpdate();
- 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;ReturnsA 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
- Method name
- UpdateStats()
- Type
- procedure
- Description
Recalculate aggregate project counters from the available formats.
Declaration
procedure UpdateStats(const aAllFormats: IUnknown); safecall;ParametersaAllFormatsconstIUnknownComplete 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;ParametersaFormatIUnknownFormat 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;ParametersaFormatIUnknownFormat 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;ParametersaFormatIUnknownFormat 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;ParametersaFormatIUnknownFormat instance being queried or modified.aNewIdInt64New TonCut object identifier.aOldIdInt64Previous 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;ParametersaFormatsIUnknownPiece collection: a new, empty staging collection inLoadFile, the live pieces inSaveFile. Do not keep it after the call.aAllFormatsconstIUnknownComplete format set used as the source when filtering.aKeepOrderBooleanWhether 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)
- function CreateProject(): IProject;
- procedure Add(aProject: IProject);
- procedure DeleteByIndex(aIndex: Cardinal);
- procedure DeleteById(aId: Int64);
- procedure Remove(const aProject: IProject);
- function IndexOf(const aProject: IProject): Integer; overload;
- function IndexOf(aId: Int64): Integer; overload;
- function FindDuplicate(const aProject: IProject; aCheckTitle: Boolean = False): IProject;
- function FindByTitle(const aTitle: WideString): IProject;
- function FindUniqueName(const aBaseName: WideString): WideString;
- function CheckUniqueName(const aTitle: WideString; const aIgnoreProject: IProject): Boolean; overload;
- function CheckUniqueName(aProject: IProject; aAutoFix: Boolean = False): Boolean; overload;
- function GetCount(): Integer;
- function GetByIndex(aIndex: Cardinal): IProject;
- function GetById(aId: Int64): IProject;
- function GetOnAdd(): IProjectChangeEvent;
- function GetOnRemove(): IProjectChangeEvent;
- function GetOnChange(): INotifyEvent;
- procedure Load(aStartDate: TDateTime; aIncludeCanceled, aIncludeDeleted: Boolean);
- procedure Reload();
- procedure BeginUpdate();
- procedure EndUpdate();
- 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 ParametersaIndexCardinalZero-based position within a collection.ValueThe 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 toAdd. A new object has a temporary negativeId.Declaration
function CreateProject(): IProject; safecall;ReturnsA new, empty project that is not yet in the collection; nevernull.
- 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.Adddoes not check title uniqueness, and adding an object that is already in the collection raises an error.Declaration
procedure Add(aProject: IProject); safecall;Parameters
- Method name
- DeleteByIndex()
- Type
- procedure
- Description
Delete the item at the specified zero-based index.
Declaration
procedure DeleteByIndex(aIndex: Cardinal); safecall;ParametersaIndexCardinalZero-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;ParametersaIdInt64TonCut object identifier.
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(const aProject: IProject); safecall;Parameters
- 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.ParametersReturnsZero-based index of the matching item, or-1when 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.ParametersaIdInt64TonCut object identifier.ReturnsZero-based index of the matching item, or-1when 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;ParametersaCheckTitleBooleanWhether title collisions should count as duplicates.ReturnsThe matching project interface instance, ornullwhen not found.
- Method name
- FindByTitle()
- Type
- IProject
- Description
Find a project by title. Inside
LoadFileit searches only what the current call has staged.Declaration
function FindByTitle(const aTitle: WideString): IProject; safecall;ParametersaTitleconstWideStringHuman-readable title.ReturnsThe matching project interface instance, ornullwhen 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;ParametersaBaseNameconstWideStringBase title used while generating a unique name.ReturnsA 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;ParametersaTitleconstWideStringHuman-readable title.ReturnsReturnstrueif 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.ParametersaAutoFixBooleanWhether the method may adjust data automatically.ReturnsReturnstrueif 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;ParametersaIdInt64TonCut object identifier.ReturnsThe matching project interface instance.
- Method name
- Load()
- Type
- procedure
- Description
Load .
Declaration
procedure Load(aStartDate: TDateTime; aIncludeCanceled: Boolean; aIncludeDeleted: Boolean); safecall;ParametersaStartDateTDateTimeValue for start date.aIncludeCanceledBooleanBooleanflag controlling include canceled.aIncludeDeletedBooleanBooleanflag 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;ReturnsReturnstruewhile the interface is inside aBeginUpdate/EndUpdatebatch.
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)
- 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;ParametersaSenderIUnknownObject that raised the event.aIndexIntegerZero-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)
- procedure Add(aHandler: IProjectChangeEventHandler);
- procedure Remove(aHandler: IProjectChangeEventHandler);
- 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
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(aHandler: IProjectChangeEventHandler); safecall;Parameters
- 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;ParametersaSenderIUnknownObject that raised the event.aIndexIntegerEvent payload field for index.