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
IProject
Project metadata plus aggregate counters for pieces, material groups, scheduling, and processing state.
Source: SDK/include/pascal/uIProject.pas
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;Published SDK declaration languages: Pascal, C++.
- Property name
- Title
- Type
- WideString
- Description
Human-readable title shown to users.
Declaration
property Title: WideString read GetTitle write SetTitle;Published SDK declaration languages: Pascal, C++.
- Property name
- Description
- Type
- WideString
- Description
Longer descriptive text stored with the object.
Declaration
property Description: WideString read GetDescription write SetDescription;Published SDK declaration languages: Pascal.
- Property name
- Priority
- Type
- Description
Priority level assigned to the project.
Declaration
property Priority: TProjectPriority read GetPriority write SetPriority;Published SDK declaration languages: Pascal.
- Property name
- CreateDate
- Type
- TDateTime
- Description
Project creation date.
Declaration
property CreateDate: TDateTime read GetCreateDate write SetCreateDate;Published SDK declaration languages: Pascal.
- Property name
- TargetDate
- Type
- TDateTime
- Description
Requested completion date for the project.
Declaration
property TargetDate: TDateTime read GetTargetDate write SetTargetDate;Published SDK declaration languages: Pascal.
- Property name
- State
- Type
- Description
Current project state.
Declaration
property State: TProjectState read GetState write SetState;Published SDK declaration languages: Pascal.
- Property name
- Loading
- Type
- Boolean
- Description
Whether the project or collection is currently loading data.
Declaration
property Loading: Boolean read GetLoading write SetLoading;Published SDK declaration languages: Pascal.
- Property name
- Loaded
- Type
- Boolean
- Description
Whether loading has already completed.
Declaration
property Loaded: Boolean read GetLoaded write SetLoaded;Published SDK declaration languages: Pascal.
- Property name
- PieceCount
- Type
- Cardinal
- Description
Total number of pieces tracked by the project or result.
Declaration
property PieceCount: Cardinal read GetPieceCount write SetPieceCount;Published SDK declaration languages: Pascal.
- Property name
- PieceField2D
- Type
- TField
- Description
Total two-dimensional piece area tracked by the object.
Declaration
property PieceField2D: TField read GetPieceField2D write SetPieceField2D;Published SDK declaration languages: Pascal.
- Property name
- PieceLength1D
- Type
- TField
- Description
Total one-dimensional piece length tracked by the object.
Declaration
property PieceLength1D: TField read GetPieceLength1D write SetPieceLength1D;Published SDK declaration languages: Pascal.
- Property name
- ProcessedCount
- Type
- Integer
- Description
Count already processed by TonCut.
Declaration
property ProcessedCount: Integer read GetProcessedCount write SetProcessedCount;Published SDK declaration languages: Pascal.
- Property name
- ProcessedField2D
- Type
- TField
- Description
Two-dimensional area already processed by TonCut.
Declaration
property ProcessedField2D: TField read GetProcessedField2D write SetProcessedField2D;Published SDK declaration languages: Pascal.
- Property name
- ProcessedLength1D
- Type
- TField
- Description
One-dimensional length already processed by TonCut.
Declaration
property ProcessedLength1D: TField read GetProcessedLength1D write SetProcessedLength1D;Published SDK declaration languages: Pascal.
- Property name
- MaterialGroupCount
- Type
- Cardinal
- Description
Number of distinct material groups currently used.
Declaration
property MaterialGroupCount: Cardinal read GetMaterialGroupCount write SetMaterialGroupCount;Published SDK declaration languages: Pascal.
- Property name
- OnChange
- Type
- INotifyEvent
- Description
Event fired when the object or collection changes.
Declaration
property OnChange: INotifyEvent read GetOnChange;Published SDK declaration languages: Pascal.
- Property name
- OnIdChange
- Type
- IIdChangeEvent
- Description
Event fired when an identifier changes.
Declaration
property OnIdChange: IIdChangeEvent read GetOnIdChange;Published SDK declaration languages: Pascal.
Methods
- Method name
- Clone()
- Type
- IProject
- Description
Create a copy of the current object.
Declaration
function Clone(): IProject; safecall;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
Parameters
- Method name
- UpdateStats()
- Type
- procedure
- Description
Recalculate aggregate project counters from the available formats.
Declaration
procedure UpdateStats(const aAllFormats: IUnknown); safecall;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
ParametersaFormatsIUnknownDestination or source format collection supplied by the host.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;Published SDK declaration languages: Pascal.
- Method name
- EndUpdate()
- Type
- procedure
- Description
Finish a batched update and allow deferred notifications to resume.
Declaration
procedure EndUpdate(); safecall;Published SDK declaration languages: Pascal.
IProjects
Collection interface used to create, enumerate, query, and reload a shared Desktop object set.
Source: SDK/include/pascal/uIProjects.pas
Properties
- Property name
- Count
- Type
- Integer
- Description
Number of items currently exposed by the interface.
Declaration
property Count: Integer read GetCount;Published SDK declaration languages: Pascal, C++.
- 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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
- Property name
- OnRemove
- Type
- IProjectChangeEvent
- Description
Event fired when an item is removed.
Declaration
property OnRemove: IProjectChangeEvent read GetOnRemove;Published SDK declaration languages: Pascal, C++.
- Property name
- OnChange
- Type
- INotifyEvent
- Description
Event fired when the object or collection changes.
Declaration
property OnChange: INotifyEvent read GetOnChange;Published SDK declaration languages: Pascal, C++.
Methods
- Method name
- CreateProject()
- Type
- IProject
- Description
Open the Desktop project dialog for a new project. The user can review and update the details before confirming; if the dialog is cancelled, the method returns
null.Declaration
function CreateProject(): IProject; safecall;Published SDK declaration languages: Pascal, C++.
ReturnsThe created project interface instance, ornullif the user cancels the dialog.
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aProject: IProject); safecall;Published SDK declaration languages: Pascal, C++.
Parameters
- Method name
- DeleteByIndex()
- Type
- procedure
- Description
Delete the item at the specified zero-based index.
Declaration
procedure DeleteByIndex(aIndex: Cardinal); safecall;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
ParametersaIdInt64TonCut object identifier.
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(const aProject: IProject); safecall;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal, C++.
ParametersaCheckTitleBooleanWhether title collisions should count as duplicates.ReturnsThe matching project interface instance, ornullwhen not found.
- Method name
- FindByTitle()
- Type
- IProject
- Description
Find an item by its title and any additional matching fields.
Declaration
function FindByTitle(const aTitle: WideString): IProject; safecall;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
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;Published SDK declaration languages: Pascal, C++.
- Method name
- BeginUpdate()
- Type
- procedure
- Description
Start a batched update so change notifications can be delayed.
Declaration
procedure BeginUpdate(); safecall;Published SDK declaration languages: Pascal, C++.
- Method name
- EndUpdate()
- Type
- procedure
- Description
Finish a batched update and allow deferred notifications to resume.
Declaration
procedure EndUpdate(); safecall;Published SDK declaration languages: Pascal, C++.
- Method name
- IsUpdating()
- Type
- Boolean
- Description
Report whether the interface is currently inside an update batch.
Declaration
function IsUpdating(): Boolean; safecall;Published SDK declaration languages: Pascal, C++.
ReturnsReturnstruewhile the interface is inside aBeginUpdate/EndUpdatebatch.
IProjectChangeEventHandler
Callback sink consumed by the matching change-event interface.
Source: SDK/include/pascal/uIProjectChangeEvent.pas
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;Published SDK declaration languages: Pascal.
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.
Source: SDK/include/pascal/uIProjectChangeEvent.pas
Methods
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aHandler: IProjectChangeEventHandler); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(aHandler: IProjectChangeEventHandler); safecall;Published SDK declaration languages: Pascal.
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;Published SDK declaration languages: Pascal.
ParametersaSenderIUnknownObject that raised the event.aIndexIntegerEvent payload field for index.