OpenCascade.js
API ReferenceDataExchangeTKXSBase

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)

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)

Static methods(3)

Instance methods(3)

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)

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)
    • theLongName
    • theShortName
  • 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)
    • modemin
    • modemax
    • shape
  • SetModeWriteHelp(modetrans: number, help: string, shape?: boolean): void

    Attaches a short line of help to a value of modetrans (write).

    Parameters (3)
    • modetrans
    • help
    • shape
  • 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)
    • modemin
    • modemax
    • shape
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • modemin: 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)
    • modetrans
    • shape
  • 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)
    • modetrans
    • shape
  • 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)
    • obj
    • modetrans
  • 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 1

    Parameters (5)
    • obj
    • FP
    • model
    • modetrans
    • theProgress
  • 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)
    • shape
    • modetrans
  • 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)
    • shape
    • FP
    • model
    • modetrans
    • theProgress
  • 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)
    • theItem
    • theName
    • toApply
  • 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).

    Returns

    A 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 of XSControl is 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 found

    Parameters (2)
    • session
    • name
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • list: 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 taken

    Parameters (6)
    • session
    • file
    • var_
    • def
    • resfile
      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_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_ReturnStatus status = reader.ReadFile (filename.); When using IGESControl_Reader or STEPControl_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)

Instance methods(25)

  • SetWS(WS: XSControl_WorkSession, scratch?: boolean): void

    Sets a specific session to <me>.

    Parameters (2)
    • WS
    • scratch
  • 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).

  • 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)
    • first
    • second
  • 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)
    • first
    • ent
  • Determines the list of root entities which are candidate for a transfer to a Shape, and returns the number of entities in the list.

  • 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)
    • num
    • theProgress
  • 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)
    • num
    • theProgress
  • Translates an IGES or STEP entity in the model. true is returned if a shape is produced; otherwise, false is returned.

    Parameters (2)
    • start
    • theProgress
  • 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)
    • list
    • theProgress
  • 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 Standard Trace 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)
    • failsonly
    • mode
  • 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_PrintCount enumeration.

    Parameters (2)
    • failsonly
    • mode
  • 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)
    • what
    • mode
  • 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)
    • list
    • nbMapped
    • nbWithResult
    • nbWithFail
    Returns

    A result object with fields:

    • nbMapped: updated value from the call.
    • nbWithResult: updated value from the call.
    • nbWithFail: updated value from the call.
  • Sets parameters for shape processing.

    Parameters (1)
    • theParameters
      the parameters for shape processing.
  • Returns parameters for shape processing that was set by SetParameters() method.

    Returns

    the 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.

    Returns

    Pair 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)

Static methods(2)

Instance methods(7)

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)

Static methods(2)

Instance methods(6)

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)

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)
    • theTP
    • theWhat
    • theMode
  • 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)
    • theTP
    • theList
    • theWhat
    • theMode
  • get_type_name(): string

Instance methods(39)

  • 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.

  • 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)
    • theName
    • theCtx
  • 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)
    • theName
    • theType
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • theCtx: 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.

  • Forces the TransientProcess Remark : it also changes the Model and the Actor, from those recorded in the new TransientProcess.

    Parameters (1)
    • theTP
  • 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
  • Returns the label attached to an entity recorded for final, or an empty string if not recorded.

    Parameters (1)
    • theEnt
  • Returns the number attached to the entity recorded for final, or zero if not recorded (looks in the ResultFromModel).

    Parameters (1)
    • theEnt
  • 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
  • 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)
    • theEnt
    • theMode
  • 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)
    • theRes
    • theMode
  • 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)
    • theRes
    • theMode
  • Returns the list of entities from which some shapes were produced : it corresponds to a loop on EntityFromShapeResult, but is optimised.

    Parameters (2)
    • theRes
    • theMode
  • 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)
    • theEnt
    • FailsOnly
  • 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 list

    Parameters (3)
    • theEnt
    • WithCheck
    • theResult
  • 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)
    • theEnt
    • theRec
    • theProgress
  • 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)
    • theList
    • theRec
    • theProgress
  • 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)
    • theEnt
    • theLevel
  • 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
  • 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)

Static methods(2)

Instance methods(13)

  • Returns the FinderProcess itself.

  • Sets a new FinderProcess and forgets the former one.

    Parameters (1)
    • theFP
  • Returns the currently used Controller.

  • 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)
    • theWhat
    • theMode
  • 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
  • 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)
    • theModel
    • theObj
    • theProgress
  • RecognizeShape(theShape: TopoDS_Shape): boolean

    Tells if a Shape is valid for a transfer to a model Asks the Controller (RecognizeWriteShape).

    Parameters (1)
    • theShape
  • 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)
    • theModel
    • theShape
    • theProgress

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)

Instance methods(37)

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)

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
  • 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.

  • 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
  • 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).

  • 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)
    • theEnt
    • theMode
  • 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)
    • theEnts
    • theProgress
  • 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.

  • 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)
    • theShape
    • theCompGraph
    • theProgress
  • SetVars(theVars: XSControl_Vars): void
    Parameters (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)

Instance methods(7)