TFunction
OCCT package TFunction: TFunction_Driver, TFunction_DriverTable, TFunction_ExecutionStatus, TFunction_Function, and 5 more bound classes.
TFunction_Driver
This driver class provide services around function execution. One instance of this class is built for the whole session. The driver is bound to the DriverGUID in the DriverTable class. It allows you to create classes which inherit from this abstract class. These subclasses identify the various algorithms which can be applied to the data contained in the attributes of sub-labels of a model. A single instance of this class and each of its subclasses is built for the whole session.
Static methods(2)
- get_type_name(): string
Instance methods(8)
Initializes the label L for this function prior to its execution.
Parameters (1)L
Returns the label of the driver for this function.
- Validate(log: TFunction_Logbook): void
Validates labels of a function in <log>. This function is the one initialized in this function driver. Warning In regeneration mode, the solver must call this method even if the function is not executed.
execution of functionParameters (1)log
- MustExecute(log: TFunction_Logbook): boolean
Analyzes the labels in the logbook log. Returns true if attributes have been modified. If the function label itself has been modified, the function must be executed.
Parameters (1)log
- Execute(): { returnValue: number; log: TFunction_Logbook; [Symbol.dispose](): void }
Executes the function in this function driver and puts the impacted labels in the logbook log.
arguments & results of functionsReturnsA result object with fields:
returnValue: the C++ return valuelog: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- Arguments(args: NCollection_List_TDF_Label): void
The method fills-in the list by labels, where the arguments of the function are located.
Parameters (1)args—Mutated in place; read the updated value from this argument after the call.
- Results(res: NCollection_List_TDF_Label): void
The method fills-in the list by labels, where the results of the function are located.
Parameters (1)res—Mutated in place; read the updated value from this argument after the call.
TFunction_DriverTable
A container for instances of drivers. You create a new instance of TFunction_Driver and use the method AddDriver to load it into the driver table.
Constructors(1)
Default constructor.
Static methods(3)
Returns the driver table. If a driver does not exist, creates it.
- get_type_name(): string
Instance methods(6)
- AddDriver(guid: Standard_GUID, driver: TFunction_Driver, thread?: number): boolean
Returns true if the driver has been added successfully to the driver table.
Parameters (3)guiddriverthread
- HasDriver(guid: Standard_GUID, thread?: number): boolean
Returns true if the driver exists in the driver table.
Parameters (2)guidthread
- FindDriver(guid: Standard_GUID, thread: number): { returnValue: boolean; driver: TFunction_Driver; [Symbol.dispose](): void }
Returns true if the driver was found.
Parameters (2)guidthread
ReturnsA result object with fields:
returnValue: the C++ return valuedriver: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- RemoveDriver(guid: Standard_GUID, thread?: number): boolean
Removes a driver with the given GUID. Returns true if the driver has been removed successfully.
Parameters (2)guidthread
- Clear(): void
Removes all drivers. Returns true if the driver has been removed successfully.
TFunction_ExecutionStatus
Properties(5)
TFunction_Function
Provides the following two services.
- a link to an evaluation driver
- the means of providing a link between a function and an evaluation driver.
Constructors(1)
Static methods(5)
Static methods:
Finds or Creates a function attribute on the label <L>. Returns the function attribute.Parameters (1)L
- Set(L: TDF_Label, DriverID: Standard_GUID): TFunction_Function
Finds or Creates a function attribute on the label <L>. Sets a driver ID to the function. Returns the function attribute.
Parameters (2)LDriverID
Returns the GUID for functions. Returns a function found on the label.
Instance methods:- get_type_name(): string
Instance methods(11)
Returns the GUID for this function's driver.
- SetDriverGUID(guid: Standard_GUID): void
Sets the driver for this function as that identified by the GUID guid.
Parameters (1)guid
- Failed(): boolean
Returns true if the execution failed.
- SetFailure(mode?: number): void
Sets the failed index.
Parameters (1)mode
- GetFailure(): number
Returns an index of failure if the execution of this function failed. If this integer value is 0, no failure has occurred.
Implementation of Attribute methods: - ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- References(aDataSet: TDF_DataSet): void
Adds the first level referenced attributes and labels to <aDataSet>.
For this, use the AddLabel or AddAttribute of DataSet.
If there is none, do not implement the method.Parameters (1)aDataSet
TFunction_GraphNode
Provides links between functions.
Constructors(1)
Static methods(4)
Static methods
Finds or Creates a graph node attribute at the label <L>. Returns the attribute.Parameters (1)L
Returns the GUID for GraphNode attribute.
Instant methods
Constructor (empty).- get_type_name(): string
Instance methods(20)
- AddPrevious(funcID: number): boolean
Defines a reference to the function as a previous one.
Parameters (1)funcID
- AddPrevious(func: TDF_Label): boolean
Defines a reference to the function as a previous one.
Parameters (1)func
- RemovePrevious(funcID: number): boolean
Removes a reference to the function as a previous one.
Parameters (1)funcID
- RemovePrevious(func: TDF_Label): boolean
Removes a reference to the function as a previous one.
Parameters (1)func
Returns a map of previous functions.
- RemoveAllPrevious(): void
Clears a map of previous functions.
- AddNext(funcID: number): boolean
Defines a reference to the function as a next one.
Parameters (1)funcID
Defines a reference to the function as a next one.
Parameters (1)func
- RemoveNext(funcID: number): boolean
Removes a reference to the function as a next one.
Parameters (1)funcID
- RemoveNext(func: TDF_Label): boolean
Removes a reference to the function as a next one.
Parameters (1)func
Returns a map of next functions.
- RemoveAllNext(): void
Clears a map of next functions.
Returns the execution status of the function.
- SetStatus(status: TFunction_ExecutionStatus): void
Defines an execution status for a function.
Implementation of Attribute methodsParameters (1)status
- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
- References(aDataSet: TDF_DataSet): void
Adds the first level referenced attributes and labels to <aDataSet>.
For this, use the AddLabel or AddAttribute of DataSet.
If there is none, do not implement the method.Parameters (1)aDataSet
TFunction_IFunction
Interface class for usage of Function Mechanism.
Constructors(2)
A constructor. Initializes the interface by the label of function.
Parameters (1)L
Static methods(3)
- NewFunction(L: TDF_Label, ID: Standard_GUID): boolean
Sets a new function attached to a label <L> with <ID>. It creates a new
TFunction_Functionattribute initialized by the <ID>, a newTFunction_GraphNodewith an empty list of dependencies and the status equal to TFunction_ES_WrongDefinition. It registers the function in the scope of functions for this document.Parameters (2)LID
- DeleteFunction(L: TDF_Label): boolean
Deletes a function attached to a label <L>. It deletes a
TFunction_Functionattribute and aTFunction_GraphNode. It deletes the functions from the scope of function of this document.Parameters (1)L
- UpdateDependencies(Access: TDF_Label): boolean
Updates dependencies for all functions of the scope. It returns false in case of an error. An empty constructor.
Parameters (1)Access
Instance methods(13)
- UpdateDependencies(): boolean
Updates the dependencies of this function only.
Initializes the interface by the label of function.
Parameters (1)L
Returns a label of the function.
- Arguments(args: NCollection_List_TDF_Label): void
The method fills-in the list by labels, where the arguments of the function are located.
Parameters (1)args—Mutated in place; read the updated value from this argument after the call.
- Results(res: NCollection_List_TDF_Label): void
The method fills-in the list by labels, where the results of the function are located.
Parameters (1)res—Mutated in place; read the updated value from this argument after the call.
- GetPrevious(prev: NCollection_List_TDF_Label): void
Returns a list of previous functions.
Parameters (1)prev—Mutated in place; read the updated value from this argument after the call.
- GetNext(prev: NCollection_List_TDF_Label): void
Returns a list of next functions.
Parameters (1)prev—Mutated in place; read the updated value from this argument after the call.
Returns the execution status of the function.
- SetStatus(status: TFunction_ExecutionStatus): void
Defines an execution status for a function.
Parameters (1)status
Returns the scope of all functions.
Returns the Logbook - keeper of modifications.
- GetDriver(thread?: number): TFunction_Driver
Returns a driver of the function.
Parameters (1)thread
Returns a graph node of the function.
TFunction_Iterator
Iterator of the graph of functions.
Constructors(2)
An empty constructor.
- constructor(Access: TDF_Label): TFunction_Iterator
A constructor. Initializes the iterator.
Parameters (1)Access
Instance methods(9)
Initializes the
Iterator.Parameters (1)Access
- SetUsageOfExecutionStatus(usage: boolean): void
Defines the mode of iteration - usage or not of the execution status. If the iterator takes into account the execution status, the method ::Current() returns only "not executed" functions while their status is not changed. If the iterator ignores the execution status, the method ::Current() returns the functions following their dependencies and ignoring the execution status.
Parameters (1)usage
- GetUsageOfExecutionStatus(): boolean
Returns usage of execution status by the iterator.
- GetMaxNbThreads(): number
Analyses the graph of dependencies and returns maximum number of threads may be used to calculate the model.
Returns the current list of functions. If the iterator uses the execution status, the returned list contains only the functions with "not executed" status.
- More(): boolean
Returns false if the graph of functions is fully iterated.
- Next(): void
Switches the iterator to the next list of current functions.
A help-function aimed to help the user to check the status of retrurned function. It calls
TFunction_GraphNode::GetStatus()inside.Parameters (1)func
- SetStatus(func: TDF_Label, status: TFunction_ExecutionStatus): void
A help-function aimed to help the user to change the execution status of a function. It calls
TFunction_GraphNode::SetStatus()inside.Parameters (2)funcstatus
TFunction_Logbook
This class contains information which is written and read during the solving process. Information is divided in three groups.
- Touched Labels (modified by the end user),
- Impacted Labels (modified during execution of the function),
- Valid Labels (within the valid label scope).
Constructors(1)
The methods manipulating the data (touched, impacted and valid labels).
Constructor (empty).
Static methods(4)
- Set(Access: TDF_Label): TFunction_Logbook
Finds or Creates a
TFunction_Logbookattribute at the root label accessed by <Access>. Returns the attribute.Parameters (1)Access
Returns the GUID for logbook attribute.
- get_type_name(): string
Instance methods(18)
- Clear(): void
Clears this logbook to its default, empty state.
- IsEmpty(): boolean
- SetTouched(L: TDF_Label): void
Sets the label L as a touched label in this logbook. In other words, L is understood to have been modified by the end user.
Parameters (1)L
- SetImpacted(L: TDF_Label, WithChildren?: boolean): void
Sets the label L as an impacted label in this logbook. This method is called by execution of the function driver.
Parameters (2)LWithChildren
Sets the label L as a valid label in this logbook.
Parameters (2)LWithChildren
- SetValid(Ls: NCollection_Map_TDF_Label): voidParameters (1)
Ls
- IsModified(L: TDF_Label, WithChildren?: boolean): boolean
Returns True if the label L is touched or impacted. This method is called by <TFunction_FunctionDriver::MustExecute>. If <WithChildren> is set to true, the method checks all the sublabels of <L> too.
Parameters (2)LWithChildren
Returns the map of touched labels in this logbook. A touched label is the one modified by the end user.
Returns the map of impacted labels contained in this logbook.
Returns the map of valid labels in this logbook.
- GetValid(Ls: NCollection_Map_TDF_Label): voidParameters (1)
Ls
- Done(status: boolean): void
Sets status of execution.
Parameters (1)status
- IsDone(): boolean
Returns status of execution.
- ID(): Standard_GUID
The methods inherited from
TDF_Attribute.
Returns the ID of the attribute. - Restore(anAttribute: TDF_Attribute): void
Undos (and redos) the attribute.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
Pastes the attribute to another label.
Parameters (2)intoAttributeaRelocationTable
Returns a new empty instance of the attribute.
TFunction_Scope
Keeps a scope of functions.
Constructors(1)
Static methods(4)
- Set(Access: TDF_Label): TFunction_Scope
Static methods
Finds or Creates aTFunction_Scopeattribute at the root label accessed by <Access>. Returns the attribute.Parameters (1)Access
Returns the GUID for Scope attribute.
Instant methods
Constructor (empty).- get_type_name(): string
Instance methods(18)
- AddFunction(L: TDF_Label): boolean
Adds a function to the scope of functions.
Parameters (1)L
- RemoveFunction(L: TDF_Label): boolean
Removes a function from the scope of functions.
Parameters (1)L
- RemoveFunction(ID: number): boolean
Removes a function from the scope of functions.
Parameters (1)ID
- RemoveAllFunctions(): void
Removes all functions from the scope of functions.
- HasFunction(ID: number): boolean
Returns true if the function exists with such an ID.
Parameters (1)ID
- HasFunction(L: TDF_Label): boolean
Returns true if the label contains a function of this scope.
Parameters (1)L
- GetFunction(L: TDF_Label): number
Returns an ID of the function.
Parameters (1)L
- GetFunction(ID: number): TDF_Label
Returns the label of the function with this ID.
Parameters (1)ID
Returns the Logbook used in
TFunction_Drivermethods.
Implementation of Attribute methods- ID(): Standard_GUID
Returns the ID of the attribute.
- Restore(anAttribute: TDF_Attribute): void
Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
Parameters (1)anAttribute
- Paste(intoAttribute: TDF_Attribute, aRelocationTable: TDF_RelocationTable): void
This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!
It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.Parameters (2)intoAttributeaRelocationTable
Returns an new empty attribute from the good end type. It is used by the copy algorithm.
Returns the scope of functions.
Returns the scope of functions for modification. Warning: Don't use this method if You are not sure what You do!
- SetFreeID(ID: number): voidParameters (1)
ID
- GetFreeID(): number