XSControl
OCCT package XSControl: XSControl, XSControl_ConnectedShapes, XSControl_Controller, XSControl_FuncShape, and 10 more bound classes.
XSControl
This package provides complements to IFSelect & Co for control of a session.
Constructors(1)
Static methods(2)
Returns the WorkSession of a SessionPilot, but casts it as from
XSControl: it then gives access to Control & Transfers.Parameters (1)pilot
- Vars(pilot: IFSelect_SessionPilot): XSControl_Vars
Returns the Vars of a SessionPilot, it is brought by Session it provides access to external variables.
Parameters (1)pilot
XSControl_ConnectedShapes
From a TopoDS_Shape, or from the entity which has produced it, searches for the shapes, and the entities which have produced them in last transfer, which are adjacent to it by VERTICES.
Constructors(2)
Creates a Selection ConnectedShapes. It remains to be set a TransferReader.
Creates a Selection ConnectedShapes, which will work with the current TransferProcess brought by the TransferReader.
Parameters (1)TR
Static methods(3)
- AdjacentEntities(ashape: TopoDS_Shape, TP: Transfer_TransientProcess, type_: TopAbs_ShapeEnum): NCollection_HSequence_handle_Standard_Transient
This functions considers a shape from a transfer and performs the search function explained above.
Parameters (3)ashapeTPtype_
- get_type_name(): string
Instance methods(3)
- SetReader(TR: XSControl_TransferReader): void
Sets a TransferReader to sort entities : it brings the TransferProcess which may change, while the TransferReader does not.
Parameters (1)TR
Returns a text defining the criterium. "Connected Entities through produced Shapes".
XSControl_Controller
This class allows a general X-STEP engine to run generic functions on any interface norm, in the same way. It includes the transfer operations. I.e. it gathers the already available general modules, the engine has just to know it.
The important point is that a given X-STEP Controller is attached to a given couple made of an Interface Norm (such as IGES-5.1) and an application data model (CasCade Shapes for instance).
Finally, Controller can be gathered in a general dictionary then retrieved later by a general call (method Recorded)
It does not manage the produced data, but the Actors make the link between the norm and the application
Static methods(3)
- Recorded(name: string): XSControl_Controller
Returns the Controller attached to a given name Returns a Null Handle if <name> is unknown.
Parameters (1)name
- get_type_name(): string
Instance methods(23)
- SetNames(theLongName: string, theShortName: string): void
Changes names if a name is empty, the formerly set one remains Remark : Does not call Record or AutoRecord.
Parameters (2)theLongNametheShortName
- AutoRecord(): void
Records <me> is a general dictionary under Short and Long Names (see method Name).
- Record(name: string): void
Records <me> in a general dictionary under a name Error if <name> already used for another one.
Parameters (1)name
- Name(rsc: boolean): string
Returns a name, as given when initializing : rsc = False (D) : True Name attached to the Norm (long name) rsc = True : Name of the resource set (i.e. short name).
Parameters (1)rsc
Returns the Protocol attached to the Norm (from field).
Returns the SignType attached to the norm (from field).
Returns the WorkLibrary attached to the Norm. Remark that it has to be in phase with the Protocol (read from field)Creates a new empty Model ready to receive data of the Norm Used to write data from Imagine to an interface file.
Returns the Actor for Read attached to the pair (norm,appli) It can be adapted for data of the input Model, as required Can be read from field then adapted with Model as required.
Parameters (1)model
Returns the Actor for Write attached to the pair (norm,appli) Read from field. Can be redefined.
- SetModeWrite(modemin: number, modemax: number, shape?: boolean): void
Sets minimum and maximum values for modetrans (write) Erases formerly recorded bounds and values Actually only for shape Then, for each value a little help can be attached.
Parameters (3)modeminmodemaxshape
- SetModeWriteHelp(modetrans: number, help: string, shape?: boolean): void
Attaches a short line of help to a value of modetrans (write).
Parameters (3)modetranshelpshape
- ModeWriteBounds(modemin: number, modemax: number, shape: boolean): { returnValue: boolean; modemin: number; modemax: number }
Returns recorded min and max values for modetrans (write) Actually only for shapes Returns True if bounds are set, False else (then, free value).
Parameters (3)modeminmodemaxshape
ReturnsA result object with fields:
returnValue: the C++ return valuemodemin: updated value from the call.modemax: updated value from the call.
- IsModeWrite(modetrans: number, shape?: boolean): boolean
Tells if a value of <modetrans> is a good value(within bounds) Actually only for shapes.
Parameters (2)modetransshape
- ModeWriteHelp(modetrans: number, shape: boolean): string
Returns the help line recorded for a value of modetrans empty if help not defined or not within bounds or if values are free.
Parameters (2)modetransshape
- RecognizeWriteTransient(obj: Standard_Transient, modetrans?: number): boolean
Tells if <obj> (an application object) is a valid candidate for a transfer to a Model. By default, asks the ActorWrite if known (through a TransientMapper). Can be redefined.
Parameters (2)objmodetrans
- TransferWriteTransient(obj: Standard_Transient, FP: Transfer_FinderProcess, model: Interface_InterfaceModel, modetrans?: number, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Takes one Transient Object and transfers it to an InterfaceModel (already created, e.g. by NewModel) (result is recorded in the model by AddWithRefs) FP records produced results and checks.
Default uses ActorWrite; can be redefined as necessary Returned value is a status, as follows : 0 OK , 1 No Result , 2 Fail (e.g. exception raised) -1 bad conditions , -2 bad model or null model For type of object not recognized : should return 1Parameters (5)objFPmodelmodetranstheProgress
- RecognizeWriteShape(shape: TopoDS_Shape, modetrans?: number): boolean
Tells if a shape is valid for a transfer to a model Asks the ActorWrite (through a ShapeMapper).
Parameters (2)shapemodetrans
- TransferWriteShape(shape: TopoDS_Shape, FP: Transfer_FinderProcess, model: Interface_InterfaceModel, modetrans?: number, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Takes one Shape and transfers it to an InterfaceModel (already created, e.g. by NewModel) Default uses ActorWrite; can be redefined as necessary Returned value is a status, as follows : Done OK , Void : No Result , Fail : Fail (e.g. exception) Error : bad conditions , bad model or null model.
Parameters (5)shapeFPmodelmodetranstheProgress
- AddSessionItem(theItem: Standard_Transient, theName: string, toApply?: boolean): void
Records a Session Item, to be added for customisation of the Work Session. It must have a specific name. <setapplied> is used if is a GeneralModifier, to decide If set to true, will be applied to the hook list "send". Else, it is not applied to any hook list. Remark : this method is to be called at Create time, the recorded items will be used by Customise Warning : if <name> conflicts, the last recorded item is kept.
Parameters (3)theItemtheNametoApply
- SessionItem(theName: string): Standard_Transient
Returns an item given its name to record in a Session If <name> is unknown, returns a Null Handle.
Parameters (1)theName
- Customise(): { WS: XSControl_WorkSession; [Symbol.dispose](): void }
Customises a WorkSession, by adding to it the recorded items (by AddSessionItem).
ReturnsA result object with fields:
WS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
XSControl_FuncShape
Defines additional commands for XSControl to :
- control of initialisation (xinit, xnorm, newmodel)
- analyse of the result of a transfer (recorded in a TransientProcess for Read, FinderProcess for Write) : statistics, various lists (roots,complete,abnormal), what about one specific entity, producing a model with the abnormal result
This appendix ofXSControlis compiled separately to distinguish basic features from user callable forms
Constructors(1)
Static methods(3)
- Init(): void
Defines and loads all functions which work on shapes for
XSControl(as ActFunc). - MoreShapes(session: XSControl_WorkSession, name: string): { returnValue: number; list: NCollection_HSequence_TopoDS_Shape; [Symbol.dispose](): void }
Analyses a name as designating Shapes from a Vars or from XSTEP transfer (last Transfer on Reading). <name> can be : "*" : all the root shapes produced by last Transfer (Read) i.e. considers roots of the TransientProcess a name : a name of a variable DRAW.
Returns the count of designated Shapes. Their list is put in
If
null, it is firstly created. Then it is completed (Append without Clear) by the Shapes found Returns 0 if no Shape could be foundParameters (2)sessionname
ReturnsA result object with fields:
returnValue: the C++ return valuelist: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- FileAndVar(session: XSControl_WorkSession, file: string, var_: string, def: string, resfile: TCollection_AsciiString, resvar: TCollection_AsciiString): boolean
Analyses given file name and variable name, with a default name for variables. Returns resulting file name and variable name plus status "file to read"(True) or "already read"(False) In the latter case, empty resfile means no file available.
If <file> is null or empty or equates ".", considers Session and returned status is False Else, returns resfile = file and status is True If is neither null nor empty, resvar = var Else, the root part of <resfile> is considered, if defined Else, <def> is takenParameters (6)sessionfilevar_defresfile—Mutated in place; read the updated value from this argument after the call.resvar—Mutated in place; read the updated value from this argument after the call.
XSControl_Functions
Constructors(1)
Static methods(1)
XSControl_Reader
A groundwork to convert a shape to data which complies with a particular norm. This data can be that of a whole model or that of a specific list of entities in the model. You specify the list using a single selection or a combination of selections. A selection is an operator which computes a list of entities from a list given in input. To specify the input, you can use:
- A predefined selection such as "xst-transferrable-roots"
- A filter based on a signature. A signature is an operator which returns a string from an entity according to its type. For example:
- "xst-type" (CDL)
- "iges-level"
- "step-type". A filter can be based on a signature by giving a value to be matched by the string returned. For example, "xst-type(Curve)". If no list is specified, the selection computes its list of entities from the whole model. To use this class, you have to initialize the transfer norm first, as shown in the example below.
Example: Control_Reader reader;IFSelect_ReturnStatusstatus = reader.ReadFile (filename.); When usingIGESControl_ReaderorSTEPControl_Reader- as the above example shows - the reader initializes the norm directly. Note that loading the file only stores the data. It does not translate this data. Shapes are accumulated by successive transfers. The last shape is cleared by: - ClearShapes which allows you to handle a new batch
- TransferRoots which restarts the list of shapes from scratch.
Constructors(3)
Creates a Reader from scratch (creates an empty WorkSession) A WorkSession or a Controller must be provided before running.
- constructor(norm: string): XSControl_Reader
Creates a Reader from scratch, with a norm name which identifies a Controller.
Parameters (1)norm
- constructor(WS: XSControl_WorkSession, scratch?: boolean): XSControl_Reader
Creates a Reader from an already existing Session, with a Controller already set Virtual destructor.
Parameters (2)WSscratch
Instance methods(25)
- SetWS(WS: XSControl_WorkSession, scratch?: boolean): void
Sets a specific session to <me>.
Parameters (2)WSscratch
Returns the session used in <me>.
- ReadFile(filename: string): IFSelect_ReturnStatus
Loads a file and returns the read status Zero for a Model which complies with the Controller.
Parameters (1)filename
Returns the model. It can then be consulted (header, product).
- GiveList(first: string, second: string): NCollection_HSequence_handle_Standard_Transient
Returns a list of entities from the IGES or STEP file according to the following rules:
- if first and second are empty strings, the whole file is selected.
- if first is an entity number or label, the entity referred to is selected.
- if first is a list of entity numbers/labels separated by commas, the entities referred to are selected,
- if first is the name of a selection in the worksession and second is not defined, the list contains the standard output for that selection.
- if first is the name of a selection and second is defined, the criterion defined by second is applied to the result of the first selection. A selection is an operator which computes a list of entities from a list given in input according to its type. If no list is specified, the selection computes its list of entities from the whole model. A selection can be:
- A predefined selection (xst-transferrable-mode)
- A filter based on a signature A Signature is an operator which returns a string from an entity according to its type. For example:
- "xst-type" (CDL)
- "iges-level"
- "step-type". For example, if you wanted to select only the advanced_faces in a STEP file you would use the following code: Example Reader.GiveList("xst-transferrable-roots","step-type(ADVANCED_FACE)"); Warning If the value given to second is incorrect, it will simply be ignored.
Parameters (2)firstsecond
- GiveList(first: string, ent: Standard_Transient): NCollection_HSequence_handle_Standard_Transient
Computes a List of entities from the model as follows <first> being a Selection, <ent> being an entity or a list of entities (as a HSequenceOfTransient) : the standard result of this selection applied to this list if <first> is erroneous, a null handle is returned.
Parameters (2)firstent
- NbRootsForTransfer(): number
Determines the list of root entities which are candidate for a transfer to a Shape, and returns the number of entities in the list.
- RootForTransfer(num?: number): Standard_Transient
Returns an IGES or STEP root entity for translation. The entity is identified by its rank in a list.
Parameters (1)num
- TransferOneRoot(num?: number, theProgress?: Message_ProgressRange): boolean
Translates a root identified by the rank num in the model. false is returned if no shape is produced.
Parameters (2)numtheProgress
- TransferOne(num: number, theProgress?: Message_ProgressRange): boolean
Translates an IGES or STEP entity identified by the rank num in the model. false is returned if no shape is produced.
Parameters (2)numtheProgress
- TransferEntity(start: Standard_Transient, theProgress?: Message_ProgressRange): boolean
Translates an IGES or STEP entity in the model. true is returned if a shape is produced; otherwise, false is returned.
Parameters (2)starttheProgress
- TransferList(list: NCollection_HSequence_handle_Standard_Transient, theProgress?: Message_ProgressRange): number
Translates a list of entities. Returns the number of IGES or STEP entities that were successfully translated. The list can be produced with GiveList. Warning - This function does not clear the existing output shapes.
Parameters (2)listtheProgress
- TransferRoots(theProgress?: Message_ProgressRange): number
Translates all translatable roots and returns the number of successful translations. Warning - This function clears existing output shapes first.
Parameters (1)theProgress
- ClearShapes(): void
Clears the list of shapes that may have accumulated in calls to TransferOne or TransferRoot.C.
- NbShapes(): number
Returns the number of shapes produced by translation.
- Shape(num?: number): TopoDS_Shape
Returns the shape resulting from a translation and identified by the rank num. num equals 1 by default. In other words, the first shape resulting from the translation is returned.
Parameters (1)num
Returns all of the results in a single shape which is:
- a null shape if there are no results,
- a shape if there is one result,
- a compound containing the resulting shapes if there are more than one.
- PrintCheckLoad(failsonly: boolean, mode: IFSelect_PrintCount): void
Prints the check list attached to loaded data, on the
StandardTrace File (starts at std::cout) All messages or fails only, according to <failsonly> mode = 0 : per entity, prints messages mode = 1 : per message, just gives count of entities per check mode = 2 : also gives entity numbers.Parameters (2)failsonlymode
- PrintCheckTransfer(failsonly: boolean, mode: IFSelect_PrintCount): void
Displays check results for the last translation of IGES or STEP entities to Open CASCADE entities. Only fail messages are displayed if failsonly is true. All messages are displayed if failsonly is false. mode determines the contents and the order of the messages according to the terms of the
IFSelect_PrintCountenumeration.Parameters (2)failsonlymode
- PrintStatsTransfer(what: number, mode: number): void
Displays the statistics for the last translation. what defines the kind of statistics that are displayed as follows:
- 0 gives general statistics (number of translated roots, number of warnings, number of fail messages),
- 1 gives root results,
- 2 gives statistics for all checked entities,
- 3 gives the list of translated entities,
- 4 gives warning and fail messages,
- 5 gives fail messages only. The use of mode depends on the value of what. If what is 0, mode is ignored. If what is 1, 2 or 3, mode defines the following:
- 0 lists the numbers of IGES or STEP entities in the respective model
- 1 gives the number, identifier, type and result type for each IGES or STEP entity and/or its status (fail, warning, etc.)
- 2 gives maximum information for each IGES or STEP entity (i.e. checks)
- 3 gives the number of entities per type of IGES or STEP entity
- 4 gives the number of IGES or STEP entities per result type and/or status
- 5 gives the number of pairs (IGES or STEP or result type and status)
- 6 gives the number of pairs (IGES or STEP or result type and status) AND the list of entity numbers in the IGES or STEP model. If what is 4 or 5, mode defines the warning and fail messages as follows:
- if mode is 0 all warnings and checks per entity are returned
- if mode is 2 the list of entities per warning is returned. If mode is not set, only the list of all entities per warning is given.
Parameters (2)whatmode
- GetStatsTransfer(list: NCollection_HSequence_handle_Standard_Transient, nbMapped: number, nbWithResult: number, nbWithFail: number): { nbMapped: number; nbWithResult: number; nbWithFail: number }
Gives statistics about Transfer.
Parameters (4)listnbMappednbWithResultnbWithFail
ReturnsA result object with fields:
nbMapped: updated value from the call.nbWithResult: updated value from the call.nbWithFail: updated value from the call.
- SetShapeFixParameters(theParameters: NCollection_DataMap_TCollection_AsciiString_TCollection_AsciiString): void
Sets parameters for shape processing.
Parameters (1)theParameters—the parameters for shape processing.
Returns parameters for shape processing that was set by SetParameters() method.
Returnsthe parameters for shape processing. Empty map if no parameters were set.
- SetShapeProcessFlags(theFlags: any): void
Sets flags defining operations to be performed on shapes.
Parameters (1)theFlags—The flags defining operations to be performed on shapes.
- GetShapeProcessFlags(): [any, boolean]
Returns flags defining operations to be performed on shapes.
ReturnsPair of values defining operations to be performed on shapes and a boolean value that indicates whether the flags were set.
XSControl_SelectForTransfer
This selection selects the entities which are recognised for transfer by an Actor for Read : current one or another one.
An Actor is an operator which runs transfers from interface entities to objects for Imagine. It has a method to recognize the entities it can process (by default, it recognises all, this method can be redefined).
A TransferReader brings an Actor, according to the currently selected norm and transfer conditions.
This selection considers, either the current Actor (brought by the TransferReader, updated as required), or a precise one.
Constructors(2)
Creates a SelectForTransfer, non initialised it sorts nothing, unless an Actor has been defined.
Creates a SelectForTransfer, which will work with the currently defined Actor brought by the TransferReader.
Parameters (1)TR
Static methods(2)
- get_type_name(): string
Instance methods(7)
- SetReader(TR: XSControl_TransferReader): void
Sets a TransferReader to sort entities : it brings the Actor, which may change, while the TransferReader does not.
Parameters (1)TR
- SetActor(act: Transfer_ActorOfTransientProcess): void
Sets a precise actor to sort entities This definition oversedes the creation with a TransferReader.
Parameters (1)act
Returns the Actor used as precised one. Returns a Null Handle for a creation from a TransferReader without any further setting.
Returns the Reader (if created with a Reader) Returns a Null Handle if not created with a Reader.
- Sort(rank: number, ent: Standard_Transient, model: Interface_InterfaceModel): boolean
Returns True for an Entity which is recognized by the Actor, either the precised one, or the one defined by TransferReader.
Parameters (3)rankentmodel
Returns a text defining the criterium : "Recognized for Transfer [(current actor)]".
XSControl_SignTransferStatus
This Signatures gives the Transfer Status of an entity, as recorded in a TransferProcess. It can be :
- Void : not recorded, or recorded as void with no message (attributes are not taken into account)
- Warning : no result, warning message(s), no fail
- Fail : no result, fail messages (with or without warning)
- Result.. : result, no message (neither warning nor fail) Result.. i.e. Result:TypeName of the result
- Result../Warning : result, with warning but no fail
- Result../Fail : result, with fail (.e. bad result)
- Fail on run : no result yet recorded, no message, but an exception occurred while recording the result (this should not appear and indicates a programming error)
Constructors(2)
Creates a SignTransferStatus, not initialised it gives nothing (empty string).
Creates a SignTransferStatus, which will work on the current TransientProcess brought by the TransferReader (its MapReader).
Parameters (1)TR
Static methods(2)
- get_type_name(): string
Instance methods(6)
- SetReader(TR: XSControl_TransferReader): void
Sets a TransferReader to work.
Parameters (1)TR
- SetMap(TP: Transfer_TransientProcess): void
Sets a precise map to sign entities This definition oversedes the creation with a TransferReader.
Parameters (1)TP
Returns the TransientProcess used as precised one Returns a Null Handle for a creation from a TransferReader without any further setting.
Returns the Reader (if created with a Reader) Returns a Null Handle if not created with a Reader.
- Value(ent: Standard_Transient, model: Interface_InterfaceModel): string
Returns the Signature for a Transient object, as its transfer status.
Parameters (2)entmodel
XSControl_TransferReader
A TransferReader performs, manages, handles results of, transfers done when reading a file (i.e. from entities of an InterfaceModel, to objects for Imagine).
Running is organised around basic tools : TransientProcess and its Actor, results are Binders and CheckIterators. It implies control by a Controller (which prepares the Actor as required)
Getting results can be done directly on TransientProcess, but these are immediate "last produced" results. Each transfer of an entity gives a final result, but also possible intermediate data, and checks, which can be attached to sub-entities.
Hence, final results (which intermediates and checks) are recorded as ResultFromModel and can be queried individually.
Some more direct access are given for results which are Transient or Shapes
Constructors(1)
Creates a TransferReader, empty.
Static methods(4)
- PrintStatsProcess(theTP: Transfer_TransientProcess, theWhat: number, theMode?: number): void
This routines prints statistics about a TransientProcess It can be called, by a TransferReader, or isolately Prints are done on the default trace file <what> defines what kind of statistics are to be printed : 0 : basic figures 1 : root results 2 : all recorded (roots, intermediate, checked entities) 3 : abnormal records 4 : check messages (warnings and fails) 5 : fail messages.
<mode> is used according <what> : <what> = 0 : <mode> is ignored <what> = 1,2,3 : <mode> as follows : 0 (D) : just lists numbers of concerned entities in the model 1 : for each entity, gives number,label, type and result type and/or status (fail/warning...) 2 : for each entity, gives maximal information (i.e. checks) 3 : counts per type of starting entity (class type) 4 : counts per result type and/or status 5 : counts per couple (starting type / result type/status) 6 : idem plus gives for each item, the list of numbers of entities in the starting model
<what> = 4,5 : modes relays on an enum PrintCount : 0 (D) : ItemsByEntity (sequential list by entity) 1 : CountByItem 2 : ShortByItem (count + 5 first numbers) 3 : ListByItem (count + entity numbers) 4 : EntitiesByItem (count + entity numbers and labels)Parameters (3)theTPtheWhattheMode
- PrintStatsOnList(theTP: Transfer_TransientProcess, theList: NCollection_HSequence_handle_Standard_Transient, theWhat: number, theMode?: number): void
Works as PrintStatsProcess, but displays data only on the entities which are in filter).
Parameters (4)theTPtheListtheWhattheMode
- get_type_name(): string
Instance methods(39)
- SetActor(theActor: Transfer_ActorOfTransientProcess): void
Sets the Actor directly : this value will be used if the Controller is not set.
Parameters (1)theActor
Returns the Actor, determined by the Controller, or if this one is unknown, directly set. Once it has been defined, it can then be edited.
- SetModel(theModel: Interface_InterfaceModel): void
Sets an InterfaceModel. This causes former results, computed from another one, to be lost (see also Clear).
Parameters (1)theModel
Returns the currently set InterfaceModel.
- SetContext(theName: string, theCtx: Standard_Transient): void
Sets a Context : according to receiving appli, to be interpreted by the Actor.
Parameters (2)theNametheCtx
- GetContext(theName: string, theType: Standard_Type): { returnValue: boolean; theCtx: Standard_Transient; [Symbol.dispose](): void }
Returns the Context attached to a name, if set and if it is Kind of the type, else a Null Handle Returns True if OK, False if no Context.
Parameters (2)theNametheType
ReturnsA result object with fields:
returnValue: the C++ return valuetheCtx: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
Returns (modifiable) the whole definition of Context Rather for internal use (ex.: preparing and setting in once).
- SetFileName(theName: string): void
Sets a new value for (loaded) file name.
Parameters (1)theName
- FileName(): string
Returns actual value of file name.
- Clear(theMode: number): void
Clears data, according mode : -1 all 0 nothing done +1 final results +2 working data (model, context, transfer process).
Parameters (1)theMode
Returns the currently used TransientProcess It is computed from the model by TransferReadRoots, or by BeginTransferRead.
- SetTransientProcess(theTP: Transfer_TransientProcess): void
Forces the TransientProcess Remark : it also changes the Model and the Actor, from those recorded in the new TransientProcess.
Parameters (1)theTP
- RecordResult(theEnt: Standard_Transient): boolean
Records a final result of transferring an entity This result is recorded as a ResultFromModel, taken from the TransientProcess Returns True if a result is available, False else.
Parameters (1)theEnt
- IsRecorded(theEnt: Standard_Transient): boolean
Returns True if a final result is recorded for an entity Remark that it can bring no effective result if transfer has completely failed (FinalResult brings only fail messages ...).
Parameters (1)theEnt
- HasResult(theEnt: Standard_Transient): boolean
Returns True if a final result is recorded AND BRINGS AN EFFECTIVE RESULT (else, it brings only fail messages).
Parameters (1)theEnt
Returns the list of entities to which a final result is attached (i.e. processed by RecordResult).
- Skip(theEnt: Standard_Transient): boolean
Note that an entity has been required for transfer but no result at all is available (typically : case not implemented) It is not an error, but it gives a specific status : Skipped Returns True if done, False if <ent> is not in starting model.
Parameters (1)theEnt
- IsSkipped(theEnt: Standard_Transient): boolean
Returns True if an entity is noted as skipped.
Parameters (1)theEnt
- IsMarked(theEnt: Standard_Transient): boolean
Returns True if an entity has been asked for transfert, hence it is marked, as : Recorded (a computation has ran, with or without an effective result), or Skipped (case ignored).
Parameters (1)theEnt
Returns the final result recorded for an entity, as such.
Parameters (1)theEnt
- FinalEntityLabel(theEnt: Standard_Transient): string
Returns the label attached to an entity recorded for final, or an empty string if not recorded.
Parameters (1)theEnt
- FinalEntityNumber(theEnt: Standard_Transient): number
Returns the number attached to the entity recorded for final, or zero if not recorded (looks in the ResultFromModel).
Parameters (1)theEnt
- ResultFromNumber(theNum: number): Transfer_ResultFromModel
Returns the final result recorded for a NUMBER of entity (internal use). Null if out of range.
Parameters (1)theNum
Returns the resulting object as a Transient Null Handle if no result or result not transient.
Parameters (1)theEnt
- ShapeResult(theEnt: Standard_Transient): TopoDS_Shape
Returns the resulting object as a Shape Null Shape if no result or result not a shape.
Parameters (1)theEnt
- ClearResult(theEnt: Standard_Transient, theMode: number): boolean
Clears recorded result for an entity, according mode <mode> = -1 : true, complete, clearing (erasing result) <mode> >= 0 : simple "stripping", see ResultFromModel, in particular, 0 for simple internal strip, 10 for all but final result, 11 for all : just label, status and filename are kept Returns True when done, False if nothing was to clear.
Parameters (2)theEnttheMode
- EntityFromResult(theRes: Standard_Transient, theMode?: number): Standard_Transient
Returns an entity from which a given result was produced. If <mode> = 0 (D), searches in last root transfers If <mode> = 1, searches in last (root & sub) transfers If <mode> = 2, searches in root recorded results If <mode> = 3, searches in all (root & sub) recordeds <res> can be, either a transient object (result itself) or a binder. For a binder of shape, calls EntityFromShapeResult Returns a Null Handle if <res> not recorded.
Parameters (2)theRestheMode
- EntityFromShapeResult(theRes: TopoDS_Shape, theMode?: number): Standard_Transient
Returns an entity from which a given shape result was produced Returns a Null Handle if <res> not recorded or not a Shape.
Parameters (2)theRestheMode
- EntitiesFromShapeList(theRes: NCollection_HSequence_TopoDS_Shape, theMode?: number): NCollection_HSequence_handle_Standard_Transient
Returns the list of entities from which some shapes were produced : it corresponds to a loop on EntityFromShapeResult, but is optimised.
Parameters (2)theRestheMode
- HasChecks(theEnt: Standard_Transient, FailsOnly: boolean): boolean
Returns True if an entity (with a final result) has checks :
- failsonly = False : any kind of check message
- failsonly = True : fails only Returns False if <ent> is not recorded
Parameters (2)theEntFailsOnly
- CheckedList(theEnt: Standard_Transient, WithCheck?: Interface_CheckStatus, theResult?: boolean): NCollection_HSequence_handle_Standard_Transient
Returns the list of starting entities to which a given check status is attached, IN FINAL RESULTS <ent> can be an entity, or the model to query all entities Below, "entities" are, either <ent> plus its sub-transferred, or all the entities of the model.
<check> = -2 , all entities whatever the check (see result) <check> = -1 , entities with no fail (warning allowed) <check> = 0 , entities with no check at all <check> = 1 , entities with warning but no fail <check> = 2 , entities with fail <result> : if True, only entities with an attached result Remark : result True and check=0 will give an empty listParameters (3)theEntWithChecktheResult
- BeginTransfer(): boolean
Defines a new TransferProcess for reading transfer Returns True if done, False if data are not properly defined (the Model, the Actor for Read).
- Recognize(theEnt: Standard_Transient): boolean
Tells if an entity is recognized as a valid candidate for Transfer. Calls method Recognize from the Actor (if known).
Parameters (1)theEnt
- TransferOne(theEnt: Standard_Transient, theRec?: boolean, theProgress?: Message_ProgressRange): number
Commands the transfer on reading for an entity to data for Imagine, using the selected Actor for Read Returns count of transferred entities, ok or with fails (0/1) If <rec> is True (D), the result is recorded by RecordResult.
Parameters (3)theEnttheRectheProgress
- TransferList(theList: NCollection_HSequence_handle_Standard_Transient, theRec?: boolean, theProgress?: Message_ProgressRange): number
Commands the transfer on reading for a list of entities to data for Imagine, using the selected Actor for Read Returns count of transferred entities, ok or with fails (0/1) If <rec> is True (D), the results are recorded by RecordResult.
Parameters (3)theListtheRectheProgress
- TransferClear(theEnt: Standard_Transient, theLevel?: number): void
Clears the results attached to an entity if <ents> equates the starting model, clears all results.
Parameters (2)theEnttheLevel
- LastTransferList(theRoots: boolean): NCollection_HSequence_handle_Standard_Transient
Returns the list of entities recorded as lastly transferred i.e. from TransientProcess itself, recorded from last Clear If <roots> is True , considers only roots of transfer If <roots> is False, considers all entities bound with result.
Parameters (1)theRoots
- ShapeResultList(theRec: boolean): NCollection_HSequence_TopoDS_Shape
Returns a list of result Shapes If <rec> is True , sees RecordedList If <rec> is False, sees LastTransferList (last ROOT transfers) For each one, if it is a Shape, it is cumulated to the list If no Shape is found, returns an empty Sequence.
Parameters (1)theRec
XSControl_TransferWriter
TransferWriter gives help to control transfer to write a file after having converted data from Cascade/Imagine.
It works with a Controller (which itself can work with an Actor to Write) and a FinderProcess. It records results and checks
Constructors(1)
Creates a TransferWriter, empty, ready to run with an empty FinderProcess (but no controller, etc).
Static methods(2)
- get_type_name(): string
Instance methods(13)
Returns the FinderProcess itself.
- SetFinderProcess(theFP: Transfer_FinderProcess): void
Sets a new FinderProcess and forgets the former one.
Parameters (1)theFP
Returns the currently used Controller.
- SetController(theCtl: XSControl_Controller): void
Sets a new Controller, also sets a new FinderProcess.
Parameters (1)theCtl
- Clear(theMode: number): void
Clears recorded data according a mode 0 clears FinderProcess (results, checks) -1 create a new FinderProcess.
Parameters (1)theMode
- TransferMode(): number
Returns the current Transfer Mode (an Integer) It will be interpreted by the Controller to run Transfers This call form could be later replaced by more specific ones (parameters suited for each norm / transfer case).
- SetTransferMode(theMode: number): void
Changes the Transfer Mode.
Parameters (1)theMode
- PrintStats(theWhat: number, theMode?: number): void
Prints statistics on current Trace File, according what,mode See PrintStatsProcess for details.
Parameters (2)theWhattheMode
- RecognizeTransient(theObj: Standard_Transient): boolean
Tells if a transient object (from an application) is a valid candidate for a transfer to a model Asks the Controller (RecognizeWriteTransient) If <obj> is a HShape, calls RecognizeShape.
Parameters (1)theObj
- TransferWriteTransient(theModel: Interface_InterfaceModel, theObj: Standard_Transient, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Transfers a Transient object (from an application) to a model of current norm, according to the last call to SetTransferMode Works by calling the Controller Returns status : =0 if OK, >0 if error during transfer, <0 if transfer badly initialised.
Parameters (3)theModeltheObjtheProgress
- RecognizeShape(theShape: TopoDS_Shape): boolean
Tells if a Shape is valid for a transfer to a model Asks the Controller (RecognizeWriteShape).
Parameters (1)theShape
- TransferWriteShape(theModel: Interface_InterfaceModel, theShape: TopoDS_Shape, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Transfers a Shape from CasCade to a model of current norm, according to the last call to SetTransferMode Works by calling the Controller Returns status : =0 if OK, >0 if error during transfer, <0 if transfer badly initialised.
Parameters (3)theModeltheShapetheProgress
XSControl_Utils
This class provides various useful utility routines, to facilitate handling of most common data structures : transients (type, type name ...), strings (ascii or extended, pointed or handled or ...), shapes (reading, writing, testing ...), sequences & arrays (of strings, of transients, of shapes ...), ...
Also it gives some helps on some data structures from XSTEP, such as printing on standard trace file, recignizing most currently used auxiliary types (Binder,Mapper ...)
Constructors(1)
the only use of this, is to allow a frontal to get one distinct "Utils" set per separate engine
Instance methods(37)
- TraceLine(line: string): void
Just prints a line into the current Trace File. This allows to better characterise the various trace outputs, as desired.
Parameters (1)line
- TraceLines(lines: Standard_Transient): void
Just prints a line or a set of lines into the current Trace File. <lines> can be a HAscii/ExtendedString (produces a print without ending line) or a HSequence or HArray1 Of .. (one new line per item).
Parameters (1)lines
- IsKind(item: Standard_Transient, what: Standard_Type): booleanParameters (2)
itemwhat
- TypeName(item: Standard_Transient, nopk: boolean): string
Returns the name of the dynamic type of an object, i.e. : If it is a Type, its Name If it is a object not a type, the Name of its DynamicType If it is Null, an empty string If <nopk> is False (D), gives complete name If <nopk> is True, returns class name without package.
Parameters (2)itemnopk
- TraValue(list: Standard_Transient, num: number): Standard_TransientParameters (2)
listnum
- AppendTra(seqval: NCollection_HSequence_handle_Standard_Transient, traval: Standard_Transient): voidParameters (2)
seqvaltraval
- DateString(yy: number, mm: number, dd: number, hh: number, mn: number, ss: number): stringParameters (6)
yymmddhhmnss
- DateValues(text: string, yy: number, mm: number, dd: number, hh: number, mn: number, ss: number): { yy: number; mm: number; dd: number; hh: number; mn: number; ss: number }Parameters (7)
textyymmddhhmnss
- ToCString(strval: TCollection_HAsciiString): stringParameters (1)
strval
- ToCString(strval: TCollection_AsciiString): stringParameters (1)
strval
- ToHString(strcon: string): TCollection_HAsciiStringParameters (1)
strcon
- ToAString(strcon: string): TCollection_AsciiStringParameters (1)
strcon
- ToEString(strval: TCollection_HExtendedString): stringParameters (1)
strval
- ToEString(strval: TCollection_ExtendedString): stringParameters (1)
strval
- ToXString(strcon: string): TCollection_ExtendedStringParameters (1)
strcon
- AsciiToExtended(str: string): stringParameters (1)
str
- IsAscii(str: string): booleanParameters (1)
str
- ExtendedToAscii(str: string): stringParameters (1)
str
- CStrValue(list: Standard_Transient, num: number): stringParameters (2)
listnum
- EStrValue(list: Standard_Transient, num: number): stringParameters (2)
listnum
- AppendCStr(seqval: NCollection_HSequence_handle_TCollection_HAsciiString, strval: string): voidParameters (2)
seqvalstrval
- AppendEStr(seqval: NCollection_HSequence_handle_TCollection_HExtendedString, strval: string): voidParameters (2)
seqvalstrval
Converts a list of Shapes to a Compound (a kind of Shape).
Parameters (1)seqval
- ShapeType(shape: TopoDS_Shape, compound: boolean): TopAbs_ShapeEnum
Returns the type of a Shape : true type if <compound> is False If <compound> is True and <shape> is a Compound, iterates on its items. If all are of the same type, returns this type. Else, returns COMPOUND. If it is empty, returns SHAPE For a Null Shape, returns SHAPE.
Parameters (2)shapecompound
- SortedCompound(shape: TopoDS_Shape, type_: TopAbs_ShapeEnum, explore: boolean, compound: boolean): TopoDS_Shape
From a Shape, builds a Compound as follows : explores it level by level If <explore> is False, only COMPOUND items. Else, all items Adds to the result, shapes which comply to <type>.
- if <type> is WIRE, considers free edges (and makes wires)
- if <type> is SHELL, considers free faces (and makes shells) If <compound> is True, gathers items in compounds which correspond to starting COMPOUND,SOLID or SHELL containers, or items directly contained in a Compound
Parameters (4)shapetype_explorecompound
- ShapeValue(seqv: NCollection_HSequence_TopoDS_Shape, num: number): TopoDS_ShapeParameters (2)
seqvnum
- AppendShape(seqv: NCollection_HSequence_TopoDS_Shape, shape: TopoDS_Shape): voidParameters (2)
seqvshape
- ShapeBinder(shape: TopoDS_Shape, hs?: boolean): Standard_Transient
Creates a Transient Object from a Shape : it is either a Binder (used by functions which require a Transient but can process a Shape, such as viewing functions) or a HShape (according to hs) Default is a HShape.
Parameters (2)shapehs
From a Transient, returns a Shape. In fact, recognizes ShapeBinder ShapeMapper and HShape.
Parameters (1)tr
- SeqLength(list: Standard_Transient): numberParameters (1)
list
- SeqToArr(seq: Standard_Transient, first?: number): Standard_TransientParameters (2)
seqfirst
- Parameters (1)
arr
- SeqIntValue(list: NCollection_HSequence_int, num: number): numberParameters (2)
listnum
XSControl_Vars
Defines a receptacle for externally defined variables, each one has a name.
I.E. a WorkSession for XSTEP is generally used inside a context, which brings variables, especially shapes and geometries. For instance DRAW or an application engine
This class provides a common form for this. It also provides a default implementation (locally recorded variables in a dictionary), but which is aimed to be redefined
XSControl_WorkSession
This WorkSession completes the basic one, by adding :
- use of Controller, with norm selection...
- management of transfers (both ways) with auxiliary classes TransferReader and TransferWriter -> these transfers may work with a Context List : its items are given by the user, according to the transfer to be i.e. it is interpreted by the Actors Each item is accessed by a Name
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(23)
- ClearData(mode: number): void
In addition to basic ClearData, clears Transfer and Management for interactive use, for mode = 0,1,2 and over 4 Plus : mode = 5 to clear Transfers (both ways) only mode = 6 to clear enforced results mode = 7 to clear transfers, results.
Parameters (1)mode
- SelectNorm(theNormName: string): boolean
Selects a Norm defined by its name. A Norm is described and handled by a Controller Returns True if done, False if <normname> is unknown.
The current Profile for this Norm is taken.Parameters (1)theNormName
- SetController(theCtl: XSControl_Controller): void
Selects a Norm defined by its Controller itself.
Parameters (1)theCtl
- SelectedNorm(theRsc: boolean): string
Returns the name of the last Selected Norm. If none is defined, returns an empty string By default, returns the complete name of the norm If <rsc> is True, returns the short name used for resource.
Parameters (1)theRsc
Returns the norm controller itself.
Returns the current Context List, Null if not defined The Context is given to the TransientProcess for TransferRead.
- SetAllContext(theContext: NCollection_DataMap_TCollection_AsciiString_handle_Standard_Transient): void
Sets the current Context List, as a whole Sets it to the TransferReader.
Parameters (1)theContext
- ClearContext(): void
Clears the whole current Context (nullifies it).
- InitTransferReader(theMode: number): void
Sets a Transfer Reader, by internal ways, according mode : 0 recreates it clear 1 clears it (does not recreate) 2 aligns Roots of TransientProcess from final Results 3 aligns final Results from Roots of TransientProcess 4 begins a new transfer (by BeginTransfer) 5 recreates TransferReader then begins a new transfer.
Parameters (1)theMode
- SetTransferReader(theTR: XSControl_TransferReader): void
Sets a Transfer Reader, which manages transfers on reading.
Parameters (1)theTR
Returns the Transfer Reader, Null if not set.
Returns the TransientProcess(internal data for TransferReader).
- SetMapReader(theTP: Transfer_TransientProcess): boolean
Changes the Map Reader, i.e. considers that the new one defines the relevant read results (forgets the former ones) Returns True when done, False in case of bad definition, i.e. if Model from TP differs from that of Session.
Parameters (1)theTP
- Result(theEnt: Standard_Transient, theMode: number): Standard_Transient
Returns the result attached to a starting entity If <mode> = 0, returns Final Result If <mode> = 1, considers Last Result If <mode> = 2, considers Final, else if absent, Last returns it as Transient, if result is not transient returns the Binder <mode> = 10,11,12 idem but returns the Binder itself (if it is not, e.g. Shape, returns the Binder) <mode> = 20, returns the ResultFromModel.
Parameters (2)theEnttheMode
- TransferReadOne(theEnts: Standard_Transient, theProgress?: Message_ProgressRange): number
Commands the transfer of, either one entity, or a list I.E. calls the TransferReader after having analysed <ents> It is cumulated from the last BeginTransfer <ents> is processed by GiveList, hence :
- <ents> a Selection : its SelectionResult
- <ents> a HSequenceOfTransient : this list
- <ents> the Model : in this specific case, all the roots, with no cumulation of former transfers (TransferReadRoots)
Parameters (2)theEntstheProgress
- TransferReadRoots(theProgress?: Message_ProgressRange): number
Commands the transfer of all the root entities of the model i.e. calls TransferRoot from the TransferReader with the Graph No cumulation with former calls to TransferReadOne.
Parameters (1)theProgress
produces and returns a new Model well conditioned It is produced by the Norm Controller It can be Null (if this function is not implemented)
Returns the Transfer Reader, Null if not set.
- SetMapWriter(theFP: Transfer_FinderProcess): boolean
Changes the Map Reader, i.e. considers that the new one defines the relevant read results (forgets the former ones) Returns True when done, False if <FP> is Null.
Parameters (1)theFP
- TransferWriteShape(theShape: TopoDS_Shape, theCompGraph?: boolean, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Transfers a Shape from CasCade to a model of current norm, according to the last call to SetModeWriteShape Returns status :Done if OK, Fail if error during transfer, Error if transfer badly initialised.
Parameters (3)theShapetheCompGraphtheProgress
- SetVars(theVars: XSControl_Vars): voidParameters (1)
theVars
XSControl_Writer
This class gives a simple way to create then write a Model compliant to a given norm, from a Shape The model can then be edited by tools by other appropriate tools.
Constructors(3)
Creates a Writer from scratch.
- constructor(norm: string): XSControl_Writer
Creates a Writer from scratch, with a norm name which identifie a Controller.
Parameters (1)norm
- constructor(WS: XSControl_WorkSession, scratch?: boolean): XSControl_Writer
Creates a Writer from an already existing Session If <scratch> is True (D), clears already recorded data.
Parameters (2)WSscratch
Instance methods(7)
- SetNorm(norm: string): boolean
Sets a specific norm to <me> Returns True if done, False if <norm> is not available.
Parameters (1)norm
- SetWS(WS: XSControl_WorkSession, scratch?: boolean): void
Sets a specific session to <me>.
Parameters (2)WSscratch
Returns the session used in <me>.
- Model(newone?: boolean): Interface_InterfaceModel
Returns the produced model. Produces a new one if not yet done or if <newone> is True This method allows for instance to edit product or header data before writing.
Parameters (1)newone
- TransferShape(sh: TopoDS_Shape, mode?: number, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Transfers a Shape according to the mode.
Parameters (3)shmodetheProgress
- WriteFile(filename: string): IFSelect_ReturnStatus
Writes the produced model.
Parameters (1)filename
- PrintStatsTransfer(what: number, mode?: number): void
Prints Statistics about Transfer.
Parameters (2)whatmode