// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _IFSelect_WorkSession_HeaderFile #define _IFSelect_WorkSession_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_IFSelect_WorkSession_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Handle_IFSelect_ShareOut_HeaderFile #include #endif #ifndef _Handle_IFSelect_WorkLibrary_HeaderFile #include #endif #ifndef _Handle_Interface_Protocol_HeaderFile #include #endif #ifndef _Handle_Interface_InterfaceModel_HeaderFile #include #endif #ifndef _Handle_Interface_HGraph_HeaderFile #include #endif #ifndef _TCollection_AsciiString_HeaderFile #include #endif #ifndef _Handle_Interface_GTool_HeaderFile #include #endif #ifndef _Interface_CheckIterator_HeaderFile #include #endif #ifndef _TColStd_IndexedDataMapOfTransientTransient_HeaderFile #include #endif #ifndef _Handle_Dico_DictionaryOfTransient_HeaderFile #include #endif #ifndef _Handle_IFSelect_ModelCopier_HeaderFile #include #endif #ifndef _MMgt_TShared_HeaderFile #include #endif #ifndef _Handle_IFSelect_Signature_HeaderFile #include #endif #ifndef _Standard_CString_HeaderFile #include #endif #ifndef _IFSelect_ReturnStatus_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _Handle_Standard_Transient_HeaderFile #include #endif #ifndef _Handle_TCollection_HAsciiString_HeaderFile #include #endif #ifndef _Handle_TColStd_HSequenceOfTransient_HeaderFile #include #endif #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile #include #endif #ifndef _Handle_Standard_Type_HeaderFile #include #endif #ifndef _Handle_TColStd_HSequenceOfHAsciiString_HeaderFile #include #endif #ifndef _Handle_IFSelect_IntParam_HeaderFile #include #endif #ifndef _Handle_IFSelect_Selection_HeaderFile #include #endif #ifndef _Handle_IFSelect_SignCounter_HeaderFile #include #endif #ifndef _Handle_IFSelect_Dispatch_HeaderFile #include #endif #ifndef _Handle_IFSelect_GeneralModifier_HeaderFile #include #endif #ifndef _Handle_IFSelect_Modifier_HeaderFile #include #endif #ifndef _Handle_IFSelect_Transformer_HeaderFile #include #endif #ifndef _Handle_IFSelect_PacketList_HeaderFile #include #endif #ifndef _IFSelect_RemainMode_HeaderFile #include #endif #ifndef _Handle_Message_Messenger_HeaderFile #include #endif #ifndef _IFSelect_PrintCount_HeaderFile #include #endif #ifndef _Handle_IFSelect_SignatureList_HeaderFile #include #endif class IFSelect_ShareOut; class IFSelect_WorkLibrary; class Interface_Protocol; class Interface_InterfaceModel; class Interface_HGraph; class Interface_GTool; class Dico_DictionaryOfTransient; class IFSelect_ModelCopier; class Standard_DomainError; class IFSelect_Signature; class Standard_Transient; class TCollection_HAsciiString; class Interface_Graph; class TColStd_HSequenceOfTransient; class Interface_CheckIterator; class TColStd_HSequenceOfInteger; class Standard_Type; class TColStd_HSequenceOfHAsciiString; class IFSelect_IntParam; class TCollection_AsciiString; class IFSelect_Selection; class Interface_EntityIterator; class IFSelect_SelectionIterator; class IFSelect_SignCounter; class IFSelect_Dispatch; class IFSelect_GeneralModifier; class IFSelect_Modifier; class IFSelect_Transformer; class IFSelect_PacketList; class TColStd_SequenceOfTransient; class TColStd_SequenceOfInteger; class Message_Messenger; class IFSelect_SignatureList; //! This class can be used to simply manage a process such as
//! splitting a file, extracting a set of Entities ...
//! It allows to manage different types of Variables : Integer or
//! Text Parameters, Selections, Dispatches, in addition to a
//! ShareOut. To each of these variables, a unique Integer
//! Identifier is attached. A Name can be attached too as desired.
class IFSelect_WorkSession : public MMgt_TShared { public: //! Creates a Work Session
//! It provides default, empty ShareOut and ModelCopier, which can
//! be replaced (if required, should be done just after creation).
Standard_EXPORT IFSelect_WorkSession(); //! Changes the Error Handler status (by default, it is not set)
Standard_EXPORT void SetErrorHandle(const Standard_Boolean hand) ; //! Returns the Error Handler status
Standard_EXPORT Standard_Boolean ErrorHandle() const; //! Returns the ShareOut defined at creation time
Standard_EXPORT const Handle_IFSelect_ShareOut& ShareOut() const; //! Sets a new ShareOut. Fills Items which its content
//! Warning : data from the former ShareOut are lost
Standard_EXPORT void SetShareOut(const Handle(IFSelect_ShareOut)& shareout) ; //! Sets a WorkLibrary, which will be used to Read and Write Files
Standard_EXPORT void SetLibrary(const Handle(IFSelect_WorkLibrary)& lib) ; //! Returns the WorkLibrary. Null Handle if not yet set
//! should be C++ : return const &
Standard_EXPORT Handle_IFSelect_WorkLibrary WorkLibrary() const; //! Sets a Protocol, which will be used to determine Graphs, to
//! Read and to Write Files
Standard_EXPORT void SetProtocol(const Handle(Interface_Protocol)& protocol) ; //! Returns the Protocol. Null Handle if not yet set
//! should be C++ : return const &
Standard_EXPORT Handle_Interface_Protocol Protocol() const; //! Sets a specific Signature to be the SignType, i.e. the
//! Signature which will determine TypeName from the Model
//! (basic function). It is recorded in the GTool
//! This Signature is also set as "xst-sign-type" (reserved name)
//!
Standard_EXPORT void SetSignType(const Handle(IFSelect_Signature)& signtype) ; //! Returns the current SignType
Standard_EXPORT Handle_IFSelect_Signature SignType() const; //! Returns True is a Model has been set
Standard_EXPORT Standard_Boolean HasModel() const; //! Sets a Model as input : this will be the Model from which the
//! ShareOut will work
//! if is True (default) all SelectPointed items
//! are cleared, else they must be managed by the caller
//! Remark : SetModel clears the Graph, recomputes it if a
//! Protocol is set and if the Model is not empty, of course
Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model,const Standard_Boolean clearpointed = Standard_True) ; //! Returns the Model of the Work Session (Null Handle if none)
//! should be C++ : return const &
Standard_EXPORT Handle_Interface_InterfaceModel Model() const; //! Stores the filename used for read for setting the model
//! It is cleared by SetModel and ClearData(1)
Standard_EXPORT void SetLoadedFile(const Standard_CString filename) ; //! Returns the filename used to load current model
//! empty if unknown
Standard_EXPORT Standard_CString LoadedFile() const; //! Reads a file with the WorkLibrary (sets Model and LoadedFile)
//! Returns a integer status which can be :
//! RetDone if OK, RetVoid if no Protocol not defined,
//! RetError for file not found, RetFail if fail during read
Standard_EXPORT IFSelect_ReturnStatus ReadFile(const Standard_CString filename) ; //! Returns the count of Entities stored in the Model, or 0
Standard_EXPORT Standard_Integer NbStartingEntities() const; //! Returns an Entity stored in the Model of the WorkSession
//! (Null Handle is no Model or num out of range)
Standard_EXPORT Handle_Standard_Transient StartingEntity(const Standard_Integer num) const; //! Returns the Number of an Entity in the Model
//! (0 if no Model set or not in the Model)
Standard_EXPORT Standard_Integer StartingNumber(const Handle(Standard_Transient)& ent) const; //! From a given label in Model, returns the corresponding number
//! Starts from first entity by Default, may start after a given
//! number : this number may be given negative, its absolute value
//! is then considered. Hence a loop on NumberFromLabel may be
//! programmed (stop test is : returned value positive or null)
//!
//! Returns 0 if not found, < 0 if more than one found (first
//! found in negative).
//! If just gives an integer value, returns it
Standard_EXPORT Standard_Integer NumberFromLabel(const Standard_CString val,const Standard_Integer afternum = 0) const; //! Returns the label for , as the Model does
//! If is not in the Model or if no Model is loaded, a Null
//! Handle is returned
Standard_EXPORT Handle_TCollection_HAsciiString EntityLabel(const Handle(Standard_Transient)& ent) const; //! Returns the Name of an Entity
//! This Name is computed by the general service Name
//! Returns a Null Handle if fails
Standard_EXPORT Handle_TCollection_HAsciiString EntityName(const Handle(Standard_Transient)& ent) const; //! Returns the Category Number determined for an entity
//! it is computed by the class Category
//! An unknown entity (number 0) gives a value -1
Standard_EXPORT Standard_Integer CategoryNumber(const Handle(Standard_Transient)& ent) const; //! Returns the Category Name determined for an entity
//! it is computed by the class Category
//! Remark : an unknown entity gives an empty string
Standard_EXPORT Standard_CString CategoryName(const Handle(Standard_Transient)& ent) const; //! Returns the Validity Name determined for an entity
//! it is computed by the class SignValidity
//! Remark : an unknown entity gives an empty string
Standard_EXPORT Standard_CString ValidityName(const Handle(Standard_Transient)& ent) const; //! Clears recorded data (not the items) according mode :
//! 1 : all Data : Model, Graph, CheckList, + ClearData 4
//! 2 : Graph and CheckList (they will then be recomputed later)
//! 3 : CheckList (it will be recomputed by ComputeCheck)
//! 4 : just content of SelectPointed and Counters
//! Plus 0 : does nothing but called by SetModel
//! ClearData is virtual, hence it can be redefined to clear
//! other data of a specialised Work Session
Standard_EXPORT virtual void ClearData(const Standard_Integer mode) ; //! Computes the Graph used for Selections, Displays ...
//! If a HGraph is already set, with same model as given by method
//! Model, does nothing. Else, computes a new Graph.
//! If is given True, computes a new Graph anyway.
//! Remark that a call to ClearGraph will cause ComputeGraph to
//! really compute a new Graph
//! Returns True if Graph is OK, False else (i.e. if no Protocol
//! is set, or if Model is absent or empty).
Standard_EXPORT Standard_Boolean ComputeGraph(const Standard_Boolean enforce = Standard_False) ; //! Returns the Computed Graph as HGraph (Null Handle if not set)
Standard_EXPORT Handle_Interface_HGraph HGraph() ; //! Returns the Computed Graph, for Read only
Standard_EXPORT const Interface_Graph& Graph() ; //! Returns the list of entities shared by (can be empty)
//! Returns a null Handle if is unknown
Standard_EXPORT Handle_TColStd_HSequenceOfTransient Shareds(const Handle(Standard_Transient)& ent) ; //! Returns the list of entities sharing (can be empty)
//! Returns a null Handle if is unknown
Standard_EXPORT Handle_TColStd_HSequenceOfTransient Sharings(const Handle(Standard_Transient)& ent) ; //! Returns True if a Model is defined and really loaded (not
//! empty), a Protocol is set and a Graph has been computed.
//! In this case, the WorkSession can start to work
Standard_EXPORT Standard_Boolean IsLoaded() const; //! Computes the CheckList for the Model currently loaded
//! It can then be used for displays, querries ...
//! Returns True if OK, False else (i.e. no Protocol set, or Model
//! absent). If is False, works only if not already done
//! or if a new Model has been loaded from last call.
//! Remark : computation is enforced by every call to
//! SetModel or RunTransformer
Standard_EXPORT Standard_Boolean ComputeCheck(const Standard_Boolean enforce = Standard_False) ; //! Returns the Check List for the Model currently loaded :
//! = True : complete (syntactic & semantic messages),
//! computed if not yet done
//! = False : only syntactic (check file form)
Standard_EXPORT Interface_CheckIterator ModelCheckList(const Standard_Boolean complete = Standard_True) ; //! Returns a Check for a single entity, under the form of a
//! CheckIterator (this gives only one form for the user)
//! if is Null or equates the current Model, it gives the
//! Global Check, else the Check for the given entity
//! as for ModelCheckList
Standard_EXPORT Interface_CheckIterator CheckOne(const Handle(Standard_Transient)& ent,const Standard_Boolean complete = Standard_True) ; //! Returns the Check List produced by the last execution of
//! either : EvaluateFile(for Split), SendSplit, SendAll,
//! SendSelected, RunTransformer-RunModifier
//! Cleared by SetModel or ClearData(1)
//! The field is protected, hence a specialized WorkSession may
//! fill it
Standard_EXPORT Interface_CheckIterator LastRunCheckList() const; //! Returns the Maximum Value for an Item Identifier. It can be
//! greater to the count of known Items, because some can have
//! been removed
Standard_EXPORT Standard_Integer MaxIdent() const; //! Returns an Item, given its Ident. Returns a Null Handle if
//! no Item corresponds to this Ident.
Standard_EXPORT Handle_Standard_Transient Item(const Standard_Integer id) const; //! Returns the Ident attached to an Item in the WorkSession, or
//! Zero if it is unknown
Standard_EXPORT Standard_Integer ItemIdent(const Handle(Standard_Transient)& item) const; //! Returns the Item which corresponds to a Variable, given its
//! Name (whatever the type of this Item).
//! Returns a Null Handle if this Name is not recorded
Standard_EXPORT Handle_Standard_Transient NamedItem(const Standard_CString name) const; //! Same as above, but is given through a Handle
//! Especially Usefull with methods SelectionNames, etc...
Standard_EXPORT Handle_Standard_Transient NamedItem(const Handle(TCollection_HAsciiString)& name) const; //! Returns the Ident attached to a Name, 0 if name not recorded
Standard_EXPORT Standard_Integer NameIdent(const Standard_CString name) const; //! Returns True if an Item of the WorkSession has an attached Name
Standard_EXPORT Standard_Boolean HasName(const Handle(Standard_Transient)& item) const; //! Returns the Name attached to an Item as a Variable of this
//! WorkSession. If is Null or not recorded, returns an
//! empty string.
Standard_EXPORT Handle_TCollection_HAsciiString Name(const Handle(Standard_Transient)& item) const; //! Adds an Item and returns its attached Ident. Does nothing
//! if is already recorded (and returns its attached Ident)
//! if True commands call to SetActive (see below)
//! Remark : the determined Ident is used if is a Dispatch,
//! to fill the ShareOut
Standard_EXPORT Standard_Integer AddItem(const Handle(Standard_Transient)& item,const Standard_Boolean active = Standard_True) ; //! Adds an Item with an attached Name. If the Name is already
//! known in the WorkSession, the older item losts it
//! Returns Ident if Done, 0 else, i.e. if is null
//! If is empty, works as AddItem (i.e. with no name)
//! If is already known but with no attached Name, this
//! method tries to attached a Name to it
//! if True commands call to SetActive (see below)
Standard_EXPORT Standard_Integer AddNamedItem(const Standard_CString name,const Handle(Standard_Transient)& item,const Standard_Boolean active = Standard_True) ; //! Following the type of :
//! - Dispatch : Adds or Removes it in the ShareOut & FileNaming
//! - GeneralModifier : Adds or Removes it for final sending
//! (i.e. in the ModelCopier)
//! Returns True if it did something, False else (state unchanged)
Standard_EXPORT Standard_Boolean SetActive(const Handle(Standard_Transient)& item,const Standard_Boolean mode) ; //! Removes an Item from the Session, given its Name
//! Returns True if Done, False else (Name not recorded)
//! (Applies only on Item which are Named)
Standard_EXPORT Standard_Boolean RemoveNamedItem(const Standard_CString name) ; //! Removes a Name without removing the Item
//! Returns True if Done, False else (Name not recorded)
Standard_EXPORT Standard_Boolean RemoveName(const Standard_CString name) ; //! Removes an Item given its Ident. Returns False if is
//! attached to no Item in the WorkSession. For a Named Item,
//! also removes its Name.
Standard_EXPORT Standard_Boolean RemoveItem(const Handle(Standard_Transient)& item) ; //! Clears all the recorded Items : Selections, Dispatches,
//! Modifiers, and Strings & IntParams, with their Idents & Names.
//! Remark that if a Model has been loaded, it is not cleared.
Standard_EXPORT void ClearItems() ; //! Returns a Label which illustrates the content of an Item,
//! given its Ident. This Label is :
//! - for a Text Parameter, "Text:"
//! - for an Integer Parameter, "Integer:"
//! - for a Selection, a Dispatch or a Modifier, its Label
//! (see these classes)
//! - for any other kind of Variable, its cdl type
Standard_EXPORT Handle_TCollection_HAsciiString ItemLabel(const Standard_Integer id) const; //! Fills a Sequence with the List of Idents attached to the Items
//! of which Type complies with (IsKind) (alphabetic order)
//! Remark : = TYPE(Standard_Transient) gives all the
//! Idents which are suitable in the WorkSession
Standard_EXPORT Handle_TColStd_HSequenceOfInteger ItemIdents(const Handle(Standard_Type)& type) const; //! Fills a Sequence with the list of the Names attached to Items
//! of which Type complies with (IsKind) (alphabetic order)
//! Remark : = TYPE(Standard_Transient) gives all the Names
Standard_EXPORT Handle_TColStd_HSequenceOfHAsciiString ItemNames(const Handle(Standard_Type)& type) const; //! Fills a Sequence with the NAMES of the control items, of which
//! the label matches