|
||||
File indexing completed on 2025-01-18 10:03:55
0001 // Created on: 1992-12-15 0002 // Created by: Christian CAILLET 0003 // Copyright (c) 1992-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _IFSelect_WorkSession_HeaderFile 0018 #define _IFSelect_WorkSession_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <TCollection_AsciiString.hxx> 0024 #include <Interface_CheckIterator.hxx> 0025 #include <TColStd_IndexedDataMapOfTransientTransient.hxx> 0026 #include <Standard_Transient.hxx> 0027 #include <NCollection_Vector.hxx> 0028 #include <NCollection_DataMap.hxx> 0029 #include <Standard_CString.hxx> 0030 #include <IFSelect_ReturnStatus.hxx> 0031 #include <Standard_Integer.hxx> 0032 #include <TColStd_HSequenceOfTransient.hxx> 0033 #include <TColStd_HSequenceOfInteger.hxx> 0034 #include <TColStd_HSequenceOfHAsciiString.hxx> 0035 #include <IFSelect_RemainMode.hxx> 0036 #include <IFSelect_PrintCount.hxx> 0037 class IFSelect_ShareOut; 0038 class IFSelect_WorkLibrary; 0039 class Interface_Protocol; 0040 class Interface_InterfaceModel; 0041 class Interface_HGraph; 0042 class Interface_GTool; 0043 0044 class IFSelect_ModelCopier; 0045 class IFSelect_Signature; 0046 class TCollection_HAsciiString; 0047 class Interface_Graph; 0048 class IFSelect_IntParam; 0049 class IFSelect_Selection; 0050 class Interface_EntityIterator; 0051 class IFSelect_SelectionIterator; 0052 class IFSelect_SignCounter; 0053 class IFSelect_Dispatch; 0054 class IFSelect_GeneralModifier; 0055 class IFSelect_Modifier; 0056 class IFSelect_Transformer; 0057 class IFSelect_PacketList; 0058 class IFSelect_SignatureList; 0059 0060 class IFSelect_WorkSession; 0061 DEFINE_STANDARD_HANDLE(IFSelect_WorkSession, Standard_Transient) 0062 0063 //! This class can be used to simply manage a process such as 0064 //! splitting a file, extracting a set of Entities ... 0065 //! It allows to manage different types of Variables : Integer or 0066 //! Text Parameters, Selections, Dispatches, in addition to a 0067 //! ShareOut. To each of these variables, a unique Integer 0068 //! Identifier is attached. A Name can be attached too as desired. 0069 class IFSelect_WorkSession : public Standard_Transient 0070 { 0071 0072 public: 0073 0074 //! Creates a Work Session 0075 //! It provides default, empty ShareOut and ModelCopier, which can 0076 //! be replaced (if required, should be done just after creation). 0077 Standard_EXPORT IFSelect_WorkSession(); 0078 0079 //! Changes the Error Handler status (by default, it is not set) 0080 Standard_EXPORT void SetErrorHandle (const Standard_Boolean toHandle); 0081 0082 //! Returns the Error Handler status 0083 Standard_Boolean ErrorHandle() const 0084 { return theerrhand; } 0085 0086 //! Returns the ShareOut defined at creation time 0087 const Handle(IFSelect_ShareOut) & ShareOut() const 0088 { return theshareout; } 0089 0090 //! Sets a new ShareOut. Fills Items which its content 0091 //! Warning : data from the former ShareOut are lost 0092 Standard_EXPORT void SetShareOut (const Handle(IFSelect_ShareOut)& shareout); 0093 0094 //! Set value of mode responsible for presence of selections after loading 0095 //! If mode set to true that different selections will be accessible after loading 0096 //! else selections will be not accessible after loading( for economy memory in applications) 0097 void SetModeStat (const Standard_Boolean theMode) 0098 { themodelstat = theMode; } 0099 0100 //! Return value of mode defining of filling selection during loading 0101 Standard_Boolean GetModeStat() const 0102 { return themodelstat; } 0103 0104 //! Sets a WorkLibrary, which will be used to Read and Write Files 0105 void SetLibrary (const Handle(IFSelect_WorkLibrary) &theLib) 0106 { thelibrary = theLib; } 0107 0108 //! Returns the WorkLibrary. Null Handle if not yet set 0109 //! should be C++ : return const & 0110 const Handle(IFSelect_WorkLibrary) & WorkLibrary() const 0111 { return thelibrary; } 0112 0113 //! Sets a Protocol, which will be used to determine Graphs, to 0114 //! Read and to Write Files 0115 Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& protocol); 0116 0117 //! Returns the Protocol. Null Handle if not yet set 0118 //! should be C++ : return const & 0119 const Handle(Interface_Protocol) & Protocol() const 0120 { return theprotocol; } 0121 0122 //! Sets a specific Signature to be the SignType, i.e. the 0123 //! Signature which will determine TypeName from the Model 0124 //! (basic function). It is recorded in the GTool 0125 //! This Signature is also set as "xst-sign-type" (reserved name) 0126 Standard_EXPORT void SetSignType (const Handle(IFSelect_Signature)& signtype); 0127 0128 //! Returns the current SignType 0129 Standard_EXPORT Handle(IFSelect_Signature) SignType() const; 0130 0131 //! Returns True is a Model has been set 0132 Standard_Boolean HasModel() const 0133 { return (!myModel.IsNull()); } 0134 0135 //! Sets a Model as input : this will be the Model from which the 0136 //! ShareOut will work 0137 //! if <clearpointed> is True (default) all SelectPointed items 0138 //! are cleared, else they must be managed by the caller 0139 //! Remark : SetModel clears the Graph, recomputes it if a 0140 //! Protocol is set and if the Model is not empty, of course 0141 Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model, const Standard_Boolean clearpointed = Standard_True); 0142 0143 //! Returns the Model of the Work Session (Null Handle if none) 0144 //! should be C++ : return const & 0145 const Handle(Interface_InterfaceModel) & Model () const 0146 { return myModel; } 0147 0148 //! Stores the filename used for read for setting the model 0149 //! It is cleared by SetModel and ClearData(1) 0150 void SetLoadedFile (const Standard_CString theFileName) 0151 { theloaded = theFileName; } 0152 0153 //! Returns the filename used to load current model 0154 //! empty if unknown 0155 Standard_CString LoadedFile() const 0156 { return theloaded.ToCString(); } 0157 0158 //! Reads a file with the WorkLibrary (sets Model and LoadedFile) 0159 //! Returns a integer status which can be : 0160 //! RetDone if OK, RetVoid if no Protocol not defined, 0161 //! RetError for file not found, RetFail if fail during read 0162 Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString filename); 0163 0164 //! Reads a file from stream with the WorkLibrary (sets Model and LoadedFile) 0165 //! Returns a integer status which can be : 0166 //! RetDone if OK, RetVoid if no Protocol not defined, 0167 //! RetError for file not found, RetFail if fail during read 0168 Standard_EXPORT IFSelect_ReturnStatus ReadStream (const Standard_CString theName, std::istream& theIStream); 0169 0170 //! Returns the count of Entities stored in the Model, or 0 0171 Standard_EXPORT Standard_Integer NbStartingEntities() const; 0172 0173 //! Returns an Entity stored in the Model of the WorkSession 0174 //! (Null Handle is no Model or num out of range) 0175 Standard_EXPORT Handle(Standard_Transient) StartingEntity (const Standard_Integer num) const; 0176 0177 //! Returns the Number of an Entity in the Model 0178 //! (0 if no Model set or <ent> not in the Model) 0179 Standard_EXPORT Standard_Integer StartingNumber (const Handle(Standard_Transient)& ent) const; 0180 0181 //! From a given label in Model, returns the corresponding number 0182 //! Starts from first entity by Default, may start after a given 0183 //! number : this number may be given negative, its absolute value 0184 //! is then considered. Hence a loop on NumberFromLabel may be 0185 //! programmed (stop test is : returned value positive or null) 0186 //! 0187 //! Returns 0 if not found, < 0 if more than one found (first 0188 //! found in negative). 0189 //! If <val> just gives an integer value, returns it 0190 Standard_EXPORT Standard_Integer NumberFromLabel (const Standard_CString val, const Standard_Integer afternum = 0) const; 0191 0192 //! Returns the label for <ent>, as the Model does 0193 //! If <ent> is not in the Model or if no Model is loaded, a Null 0194 //! Handle is returned 0195 Standard_EXPORT Handle(TCollection_HAsciiString) EntityLabel (const Handle(Standard_Transient)& ent) const; 0196 0197 //! Returns the Name of an Entity 0198 //! This Name is computed by the general service Name 0199 //! Returns a Null Handle if fails 0200 Standard_EXPORT Handle(TCollection_HAsciiString) EntityName (const Handle(Standard_Transient)& ent) const; 0201 0202 //! Returns the Category Number determined for an entity 0203 //! it is computed by the class Category 0204 //! An unknown entity (number 0) gives a value -1 0205 Standard_EXPORT Standard_Integer CategoryNumber (const Handle(Standard_Transient)& ent) const; 0206 0207 //! Returns the Category Name determined for an entity 0208 //! it is computed by the class Category 0209 //! Remark : an unknown entity gives an empty string 0210 Standard_EXPORT Standard_CString CategoryName (const Handle(Standard_Transient)& ent) const; 0211 0212 //! Returns the Validity Name determined for an entity 0213 //! it is computed by the class SignValidity 0214 //! Remark : an unknown entity gives an empty string 0215 Standard_EXPORT Standard_CString ValidityName (const Handle(Standard_Transient)& ent) const; 0216 0217 //! Clears recorded data (not the items) according mode : 0218 //! 1 : all Data : Model, Graph, CheckList, + ClearData 4 0219 //! 2 : Graph and CheckList (they will then be recomputed later) 0220 //! 3 : CheckList (it will be recomputed by ComputeCheck) 0221 //! 4 : just content of SelectPointed and Counters 0222 //! Plus 0 : does nothing but called by SetModel 0223 //! ClearData is virtual, hence it can be redefined to clear 0224 //! other data of a specialised Work Session 0225 Standard_EXPORT virtual void ClearData (const Standard_Integer mode); 0226 0227 //! Computes the Graph used for Selections, Displays ... 0228 //! If a HGraph is already set, with same model as given by method 0229 //! Model, does nothing. Else, computes a new Graph. 0230 //! If <enforce> is given True, computes a new Graph anyway. 0231 //! Remark that a call to ClearGraph will cause ComputeGraph to 0232 //! really compute a new Graph 0233 //! Returns True if Graph is OK, False else (i.e. if no Protocol 0234 //! is set, or if Model is absent or empty). 0235 Standard_EXPORT Standard_Boolean ComputeGraph (const Standard_Boolean enforce = Standard_False); 0236 0237 //! Returns the Computed Graph as HGraph (Null Handle if not set) 0238 Standard_EXPORT Handle(Interface_HGraph) HGraph(); 0239 0240 //! Returns the Computed Graph, for Read only 0241 Standard_EXPORT const Interface_Graph& Graph(); 0242 0243 //! Returns the list of entities shared by <ent> (can be empty) 0244 //! Returns a null Handle if <ent> is unknown 0245 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Shareds (const Handle(Standard_Transient)& ent); 0246 0247 //! Returns the list of entities sharing <ent> (can be empty) 0248 //! Returns a null Handle if <ent> is unknown 0249 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Sharings (const Handle(Standard_Transient)& ent); 0250 0251 //! Returns True if a Model is defined and really loaded (not 0252 //! empty), a Protocol is set and a Graph has been computed. 0253 //! In this case, the WorkSession can start to work 0254 Standard_EXPORT Standard_Boolean IsLoaded() const; 0255 0256 //! Computes the CheckList for the Model currently loaded 0257 //! It can then be used for displays, queries ... 0258 //! Returns True if OK, False else (i.e. no Protocol set, or Model 0259 //! absent). If <enforce> is False, works only if not already done 0260 //! or if a new Model has been loaded from last call. 0261 //! Remark : computation is enforced by every call to 0262 //! SetModel or RunTransformer 0263 Standard_EXPORT Standard_Boolean ComputeCheck (const Standard_Boolean enforce = Standard_False); 0264 0265 //! Returns the Check List for the Model currently loaded : 0266 //! <complete> = True : complete (syntactic & semantic messages), 0267 //! computed if not yet done 0268 //! <complete> = False : only syntactic (check file form) 0269 Standard_EXPORT Interface_CheckIterator ModelCheckList (const Standard_Boolean complete = Standard_True); 0270 0271 //! Returns a Check for a single entity, under the form of a 0272 //! CheckIterator (this gives only one form for the user) 0273 //! if <ent> is Null or equates the current Model, it gives the 0274 //! Global Check, else the Check for the given entity 0275 //! <complete> as for ModelCheckList 0276 Standard_EXPORT Interface_CheckIterator CheckOne (const Handle(Standard_Transient)& ent, const Standard_Boolean complete = Standard_True); 0277 0278 //! Returns the Check List produced by the last execution of 0279 //! either : EvaluateFile(for Split), SendSplit, SendAll, 0280 //! SendSelected, RunTransformer-RunModifier 0281 //! Cleared by SetModel or ClearData(1) 0282 //! The field is protected, hence a specialized WorkSession may 0283 //! fill it 0284 Interface_CheckIterator LastRunCheckList() const 0285 { return thecheckrun; } 0286 0287 //! Returns the Maximum Value for an Item Identifier. It can be 0288 //! greater to the count of known Items, because some can have 0289 //! been removed 0290 Standard_EXPORT Standard_Integer MaxIdent() const; 0291 0292 //! Returns an Item, given its Ident. Returns a Null Handle if 0293 //! no Item corresponds to this Ident. 0294 Standard_EXPORT Handle(Standard_Transient) Item (const Standard_Integer id) const; 0295 0296 //! Returns the Ident attached to an Item in the WorkSession, or 0297 //! Zero if it is unknown 0298 Standard_EXPORT Standard_Integer ItemIdent (const Handle(Standard_Transient)& item) const; 0299 0300 //! Returns the Item which corresponds to a Variable, given its 0301 //! Name (whatever the type of this Item). 0302 //! Returns a Null Handle if this Name is not recorded 0303 Standard_EXPORT Handle(Standard_Transient) NamedItem (const Standard_CString name) const; 0304 0305 //! Same as above, but <name> is given through a Handle 0306 //! Especially useful with methods SelectionNames, etc... 0307 Standard_EXPORT Handle(Standard_Transient) NamedItem (const Handle(TCollection_HAsciiString)& name) const; 0308 0309 //! Returns the Ident attached to a Name, 0 if name not recorded 0310 Standard_EXPORT Standard_Integer NameIdent (const Standard_CString name) const; 0311 0312 //! Returns True if an Item of the WorkSession has an attached Name 0313 Standard_EXPORT Standard_Boolean HasName (const Handle(Standard_Transient)& item) const; 0314 0315 //! Returns the Name attached to an Item as a Variable of this 0316 //! WorkSession. If <item> is Null or not recorded, returns an 0317 //! empty string. 0318 Standard_EXPORT Handle(TCollection_HAsciiString) Name (const Handle(Standard_Transient)& item) const; 0319 0320 //! Adds an Item and returns its attached Ident. Does nothing 0321 //! if <item> is already recorded (and returns its attached Ident) 0322 //! <active> if True commands call to SetActive (see below) 0323 //! Remark : the determined Ident is used if <item> is a Dispatch, 0324 //! to fill the ShareOut 0325 Standard_EXPORT Standard_Integer AddItem (const Handle(Standard_Transient)& item, const Standard_Boolean active = Standard_True); 0326 0327 //! Adds an Item with an attached Name. If the Name is already 0328 //! known in the WorkSession, the older item losts it 0329 //! Returns Ident if Done, 0 else, i.e. if <item> is null 0330 //! If <name> is empty, works as AddItem (i.e. with no name) 0331 //! If <item> is already known but with no attached Name, this 0332 //! method tries to attached a Name to it 0333 //! <active> if True commands call to SetActive (see below) 0334 Standard_EXPORT Standard_Integer AddNamedItem (const Standard_CString name, const Handle(Standard_Transient)& item, const Standard_Boolean active = Standard_True); 0335 0336 //! Following the type of <item> : 0337 //! - Dispatch : Adds or Removes it in the ShareOut & FileNaming 0338 //! - GeneralModifier : Adds or Removes it for final sending 0339 //! (i.e. in the ModelCopier) 0340 //! Returns True if it did something, False else (state unchanged) 0341 Standard_EXPORT Standard_Boolean SetActive (const Handle(Standard_Transient)& item, const Standard_Boolean mode); 0342 0343 //! Removes an Item from the Session, given its Name 0344 //! Returns True if Done, False else (Name not recorded) 0345 //! (Applies only on Item which are Named) 0346 Standard_EXPORT Standard_Boolean RemoveNamedItem (const Standard_CString name); 0347 0348 //! Removes a Name without removing the Item 0349 //! Returns True if Done, False else (Name not recorded) 0350 Standard_EXPORT Standard_Boolean RemoveName (const Standard_CString name); 0351 0352 //! Removes an Item given its Ident. Returns False if <id> is 0353 //! attached to no Item in the WorkSession. For a Named Item, 0354 //! also removes its Name. 0355 Standard_EXPORT Standard_Boolean RemoveItem (const Handle(Standard_Transient)& item); 0356 0357 //! Clears all the recorded Items : Selections, Dispatches, 0358 //! Modifiers, and Strings & IntParams, with their Idents & Names. 0359 //! Remark that if a Model has been loaded, it is not cleared. 0360 Standard_EXPORT void ClearItems(); 0361 0362 //! Returns a Label which illustrates the content of an Item, 0363 //! given its Ident. This Label is : 0364 //! - for a Text Parameter, "Text:<text value>" 0365 //! - for an Integer Parameter, "Integer:<integer value>" 0366 //! - for a Selection, a Dispatch or a Modifier, its Label 0367 //! (see these classes) 0368 //! - for any other kind of Variable, its cdl type 0369 Standard_EXPORT Handle(TCollection_HAsciiString) ItemLabel (const Standard_Integer id) const; 0370 0371 //! Fills a Sequence with the List of Idents attached to the Items 0372 //! of which Type complies with (IsKind) <type> (alphabetic order) 0373 //! Remark : <type> = TYPE(Standard_Transient) gives all the 0374 //! Idents which are suitable in the WorkSession 0375 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) ItemIdents (const Handle(Standard_Type)& type) const; 0376 0377 //! Fills a Sequence with the list of the Names attached to Items 0378 //! of which Type complies with (IsKind) <type> (alphabetic order) 0379 //! Remark : <type> = TYPE(Standard_Transient) gives all the Names 0380 Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) ItemNames (const Handle(Standard_Type)& type) const; 0381 0382 //! Fills a Sequence with the NAMES of the control items, of which 0383 //! the label matches <label> (contain it) : see NextIdentForLabel 0384 //! Search mode is fixed to "contained" 0385 //! If <label> is empty, returns all Names 0386 Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) ItemNamesForLabel (const Standard_CString label) const; 0387 0388 //! For query by Label with possible iterations 0389 //! Searches the Ident of which Item has a Label which matches a 0390 //! given one, the search starts from an initial Ident. 0391 //! Returns the first found Ident which follows <id>, or ZERO 0392 //! 0393 //! The search must start with <id> = 0, it returns the next Ident 0394 //! which matches. To iterate, call again this method which this 0395 //! returned value as <id>. Once an Ident has been returned, the 0396 //! Item can be obtained by the method Item 0397 //! 0398 //! <mode> precises the required matching mode : 0399 //! - 0 (Default) : <label> must match exactly with the Item Label 0400 //! - 1 : <label> must match the exact beginning (the end is free) 0401 //! - 2 : <label> must be at least once wherever in the Item Label 0402 //! - other values are ignored 0403 Standard_EXPORT Standard_Integer NextIdentForLabel (const Standard_CString label, const Standard_Integer id, const Standard_Integer mode = 0) const; 0404 0405 //! Creates a parameter as being bound to a Static 0406 //! If the Static is Integer, this creates an IntParam bound to 0407 //! it by its name. Else this creates a String which is the value 0408 //! of the Static. 0409 //! Returns a null handle if <statname> is unknown as a Static 0410 Standard_EXPORT Handle(Standard_Transient) NewParamFromStatic (const Standard_CString statname, const Standard_CString name = ""); 0411 0412 //! Returns an IntParam, given its Ident in the Session 0413 //! Null result if <id> is not suitable for an IntParam 0414 //! (undefined, or defined for another kind of variable) 0415 Standard_EXPORT Handle(IFSelect_IntParam) IntParam (const Standard_Integer id) const; 0416 0417 //! Returns Integer Value of an IntParam 0418 Standard_EXPORT Standard_Integer IntValue (const Handle(IFSelect_IntParam)& it) const; 0419 0420 //! Creates a new IntParam. A Name can be set (Optional) 0421 //! Returns the created IntParam, or a Null Handle in case of 0422 //! Failure (see AddItem/AddNamedItem) 0423 Standard_EXPORT Handle(IFSelect_IntParam) NewIntParam (const Standard_CString name = ""); 0424 0425 //! Changes the Integer Value of an IntParam 0426 //! Returns True if Done, False if <it> is not in the WorkSession 0427 Standard_EXPORT Standard_Boolean SetIntValue (const Handle(IFSelect_IntParam)& it, const Standard_Integer val); 0428 0429 //! Returns a TextParam, given its Ident in the Session 0430 //! Null result if <id> is not suitable for a TextParam 0431 //! (undefined, or defined for another kind of variable) 0432 Standard_EXPORT Handle(TCollection_HAsciiString) TextParam (const Standard_Integer id) const; 0433 0434 //! Returns Text Value of a TextParam (a String) 0435 //! or an empty string if <it> is not in the WorkSession 0436 Standard_EXPORT TCollection_AsciiString TextValue (const Handle(TCollection_HAsciiString)& par) const; 0437 0438 //! Creates a new (empty) TextParam. A Name can be set (Optional) 0439 //! Returns the created TextParam (as an HAsciiString), or a Null 0440 //! Handle in case of Failure (see AddItem/AddNamedItem) 0441 Standard_EXPORT Handle(TCollection_HAsciiString) NewTextParam (const Standard_CString name = ""); 0442 0443 //! Changes the Text Value of a TextParam (an HAsciiString) 0444 //! Returns True if Done, False if <it> is not in the WorkSession 0445 Standard_EXPORT Standard_Boolean SetTextValue (const Handle(TCollection_HAsciiString)& par, const Standard_CString val); 0446 0447 //! Returns a Signature, given its Ident in the Session 0448 //! Null result if <id> is not suitable for a Signature 0449 //! (undefined, or defined for another kind of variable) 0450 Standard_EXPORT Handle(IFSelect_Signature) Signature (const Standard_Integer id) const; 0451 0452 //! Returns the Value computed by a Signature for an Entity 0453 //! Returns an empty string if the entity does not belong to the 0454 //! loaded model 0455 Standard_EXPORT Standard_CString SignValue (const Handle(IFSelect_Signature)& sign, const Handle(Standard_Transient)& ent) const; 0456 0457 //! Returns a Selection, given its Ident in the Session 0458 //! Null result if <id> is not suitable for a Selection 0459 //! (undefined, or defined for another kind of variable) 0460 Standard_EXPORT Handle(IFSelect_Selection) Selection (const Standard_Integer id) const; 0461 0462 //! Evaluates the effect of a Selection applied on the input Model 0463 //! Returned Result remains empty if no input Model has been set 0464 Standard_EXPORT Interface_EntityIterator EvalSelection (const Handle(IFSelect_Selection)& sel) const; 0465 0466 //! Returns the Selections which are source of Selection, given 0467 //! its rank in the List of Selections (see SelectionIterator) 0468 //! Returned value is empty if <num> is out of range or if 0469 //! <sel> is not in the WorkSession 0470 Standard_EXPORT IFSelect_SelectionIterator Sources (const Handle(IFSelect_Selection)& sel) const; 0471 0472 //! Returns the result of a Selection, computed by EvalSelection 0473 //! (see above) under the form of a HSequence (hence, it can be 0474 //! used by a frontal-engine logic). It can be empty 0475 //! Returns a Null Handle if <sel> is not in the WorkSession 0476 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SelectionResult (const Handle(IFSelect_Selection)& sel) const; 0477 0478 //! Returns the result of a Selection, by forcing its input with 0479 //! a given list <list> (unless <list> is Null). 0480 //! RULES : 0481 //! <list> applies only for a SelectDeduct kind Selection : 0482 //! its Input is considered : if it is a SelectDeduct kind 0483 //! Selection, its Input is considered, etc... until an Input 0484 //! is not a Deduct/Extract : its result is replaced by <list> 0485 //! and all the chain of deductions is applied 0486 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SelectionResultFromList (const Handle(IFSelect_Selection)& sel, const Handle(TColStd_HSequenceOfTransient)& list) const; 0487 0488 //! Sets a Selection as input for an item, according its type : 0489 //! if <item> is a Dispatch : as Final Selection 0490 //! if <item> is a GeneralModifier (i.e. any kind of Modifier) : 0491 //! as Selection used to filter entities to modify 0492 //! <sel> Null causes this Selection to be nullified 0493 //! Returns False if <item> is not of a suitable type, or 0494 //! <item> or <sel> is not in the WorkSession 0495 Standard_EXPORT Standard_Boolean SetItemSelection (const Handle(Standard_Transient)& item, const Handle(IFSelect_Selection)& sel); 0496 0497 //! Resets input Selection which was set by SetItemSelection 0498 //! Same conditions as for SetItemSelection 0499 //! Returns True if done, False if <item> is not in the WorkSession 0500 Standard_EXPORT Standard_Boolean ResetItemSelection (const Handle(Standard_Transient)& item); 0501 0502 //! Returns the Selection of a Dispatch or a GeneralModifier. 0503 //! Returns a Null Handle if none is defined or <item> not good type 0504 Standard_EXPORT Handle(IFSelect_Selection) ItemSelection (const Handle(Standard_Transient)& item) const; 0505 0506 //! Returns a SignCounter from its ident in the Session 0507 //! Null result if <id> is not suitable for a SignCounter 0508 //! (undefined, or defined for another kind of variable) 0509 Standard_EXPORT Handle(IFSelect_SignCounter) SignCounter (const Standard_Integer id) const; 0510 0511 //! Computes the content of a SignCounter when it is defined with 0512 //! a Selection, then returns True 0513 //! Returns False if the SignCounter is not defined with a 0514 //! Selection, or if its Selection Mode is inhibited 0515 //! <forced> to work around optimisations 0516 Standard_EXPORT Standard_Boolean ComputeCounter (const Handle(IFSelect_SignCounter)& counter, const Standard_Boolean forced = Standard_False); 0517 0518 //! Computes the content of a SignCounter from an input list 0519 //! If <list> is Null, uses internal definition of the Counter : 0520 //! a Selection, else the whole Model (recomputation forced) 0521 //! If <clear> is True (D), starts from scratch 0522 //! Else, cumulates computations 0523 Standard_EXPORT Standard_Boolean ComputeCounterFromList (const Handle(IFSelect_SignCounter)& counter, const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Boolean clear = Standard_True); 0524 0525 //! Returns the ordered list of dispatches stored by the ShareOut 0526 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) AppliedDispatches() const; 0527 0528 //! Clears the list of Dispatches recorded by the ShareOut 0529 //! if <only> disp is True, tha's all. Else, clears also the lists 0530 //! of Modifiers recorded by the ShareOut 0531 Standard_EXPORT void ClearShareOut (const Standard_Boolean onlydisp); 0532 0533 //! Returns a Dispatch, given its Ident in the Session 0534 //! Null result if <id> is not suitable for a Dispatch 0535 //! (undefined, or defined for another kind of variable) 0536 Standard_EXPORT Handle(IFSelect_Dispatch) Dispatch (const Standard_Integer id) const; 0537 0538 //! Returns the rank of a Dispatch in the ShareOut, or 0 if <disp> 0539 //! is not in the ShareOut or not in the WorkSession 0540 Standard_EXPORT Standard_Integer DispatchRank (const Handle(IFSelect_Dispatch)& disp) const; 0541 0542 //! Gives access to the complete ModelCopier 0543 const Handle(IFSelect_ModelCopier) & ModelCopier() const 0544 { return thecopier; } 0545 0546 //! Sets a new ModelCopier. Fills Items which its content 0547 Standard_EXPORT void SetModelCopier (const Handle(IFSelect_ModelCopier)& copier); 0548 0549 //! Returns the count of Modifiers applied to final sending 0550 //! Model Modifiers if <formodel> is True, File Modifiers else 0551 //! (i.e. Modifiers which apply once the Models have been filled) 0552 Standard_EXPORT Standard_Integer NbFinalModifiers (const Standard_Boolean formodel) const; 0553 0554 //! Fills a Sequence with a list of Idents, those attached to 0555 //! the Modifiers applied to final sending. 0556 //! Model Modifiers if <formodel> is True, File Modifiers else 0557 //! This list is given in the order in which they will be applied 0558 //! (which takes into account the Changes to Modifier Ranks) 0559 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) FinalModifierIdents (const Standard_Boolean formodel) const; 0560 0561 //! Returns a Modifier, given its Ident in the Session 0562 //! Null result if <id> is not suitable for a Modifier 0563 //! (undefined, or defined for another kind of variable) 0564 Standard_EXPORT Handle(IFSelect_GeneralModifier) GeneralModifier (const Standard_Integer id) const; 0565 0566 //! Returns a Model Modifier, given its Ident in the Session, 0567 //! i.e. typed as a Modifier (not simply a GeneralModifier) 0568 //! Null result if <id> is not suitable for a Modifier 0569 //! (undefined, or defined for another kind of variable) 0570 Standard_EXPORT Handle(IFSelect_Modifier) ModelModifier (const Standard_Integer id) const; 0571 0572 //! Returns the Rank of a Modifier given its Ident. Model or File 0573 //! Modifier according its type (ModelModifier or not) 0574 //! Remember that Modifiers are applied sequentially following 0575 //! their Rank : first Model Modifiers then File Modifiers 0576 //! Rank is given by rank of call to AddItem and can be 0577 //! changed by ChangeModifierRank 0578 Standard_EXPORT Standard_Integer ModifierRank (const Handle(IFSelect_GeneralModifier)& item) const; 0579 0580 //! Changes the Rank of a Modifier in the Session : 0581 //! Model Modifiers if <formodel> is True, File Modifiers else 0582 //! the Modifier n0 <before> is put to n0 <after> 0583 //! Return True if Done, False if <before> or <after> out of range 0584 Standard_EXPORT Standard_Boolean ChangeModifierRank (const Standard_Boolean formodel, const Standard_Integer before, const Standard_Integer after); 0585 0586 //! Removes all the Modifiers active in the ModelCopier : they 0587 //! become inactive and they are removed from the Session 0588 Standard_EXPORT void ClearFinalModifiers(); 0589 0590 //! Sets a GeneralModifier to be applied to an item : 0591 //! - item = ShareOut : applies for final sending (all dispatches) 0592 //! - item is a Dispatch : applies for this dispatch only 0593 //! Returns True if done, False if <modif> or <item> not in <me> 0594 Standard_EXPORT Standard_Boolean SetAppliedModifier (const Handle(IFSelect_GeneralModifier)& modif, const Handle(Standard_Transient)& item); 0595 0596 //! Resets a GeneralModifier to be applied 0597 //! Returns True if done, False if <modif> was not applied 0598 Standard_EXPORT Standard_Boolean ResetAppliedModifier (const Handle(IFSelect_GeneralModifier)& modif); 0599 0600 //! Returns the item on which a GeneralModifier is applied : 0601 //! the ShareOut, or a given Dispatch 0602 //! Returns a Null Handle if <modif> is not applied 0603 Standard_EXPORT Handle(Standard_Transient) UsesAppliedModifier (const Handle(IFSelect_GeneralModifier)& modif) const; 0604 0605 //! Returns a Transformer, given its Ident in the Session 0606 //! Null result if <id> is not suitable for a Transformer 0607 //! (undefined, or defined for another kind of variable) 0608 Standard_EXPORT Handle(IFSelect_Transformer) Transformer (const Standard_Integer id) const; 0609 0610 //! Runs a Transformer on starting Model, which can then be edited 0611 //! or replaced by a new one. The Protocol can also be changed. 0612 //! Fills LastRunCheckList 0613 //! 0614 //! Returned status is 0 if nothing done (<transf> or model 0615 //! undefined), positive if OK, negative else : 0616 //! 0 : Nothing done 0617 //! 1 : OK, edition on the spot with no change to the graph 0618 //! of dependances (purely local) 0619 //! 2 : OK, model edited on the spot (graph recomputed, may 0620 //! have changed), protocol unchanged 0621 //! 3 : OK, new model produced, same protocol 0622 //! 4 : OK, model edited on the spot (graph recomputed), 0623 //! but protocol has changed 0624 //! 5 : OK, new model produced, protocol has changed 0625 //! -1 : Error on the spot (slight changes), data may be corrupted 0626 //! (remark : corruption should not be profound) 0627 //! -2 : Error on edition the spot, data may be corrupted 0628 //! (checking them is recommended) 0629 //! -3 : Error with a new data set, transformation ignored 0630 //! -4 : OK as 4, but graph of dependances count not be recomputed 0631 //! (the former one is kept) : check the protocol 0632 Standard_EXPORT Standard_Integer RunTransformer (const Handle(IFSelect_Transformer)& transf); 0633 0634 //! Runs a Modifier on Starting Model. It can modify entities, or 0635 //! add new ones. But the Model or the Protocol is unchanged. 0636 //! The Modifier is applied on each entity of the Model. See also 0637 //! RunModifierSelected 0638 //! Fills LastRunCheckList 0639 //! 0640 //! <copy> : if True, a new data set is produced which brings 0641 //! the modifications (Model + its Entities) 0642 //! if False, data are modified on the spot 0643 //! 0644 //! It works through a TransformStandard defined with <modif> 0645 //! Returned status as RunTransformer : 0 nothing done, >0 OK, 0646 //! <0 problem, but only between -3 and 3 (protocol unchanged) 0647 //! Remark : <copy> True will give <effect> = 3 or -3 0648 Standard_EXPORT Standard_Integer RunModifier (const Handle(IFSelect_Modifier)& modif, const Standard_Boolean copy); 0649 0650 //! Acts as RunModifier, but the Modifier is applied on the list 0651 //! determined by a Selection, rather than on the whole Model 0652 //! If the selection is a null handle, the whole model is taken 0653 Standard_EXPORT Standard_Integer RunModifierSelected (const Handle(IFSelect_Modifier)& modif, const Handle(IFSelect_Selection)& sel, const Standard_Boolean copy); 0654 0655 //! Creates and returns a TransformStandard, empty, with its 0656 //! Copy Option (True = Copy, False = On the Spot) and an 0657 //! optional name. 0658 //! To a TransformStandard, the method SetAppliedModifier applies 0659 Standard_EXPORT Handle(IFSelect_Transformer) NewTransformStandard (const Standard_Boolean copy, const Standard_CString name = ""); 0660 0661 //! Defines a new content from the former one 0662 //! If <keep> is True, it is given by entities selected by 0663 //! Selection <sel> (and all shared entities) 0664 //! Else, it is given by all the former content but entities 0665 //! selected by the Selection <sel> (and properly shared ones) 0666 //! Returns True if done. Returns False if the selected list 0667 //! (from <sel>) is empty, hence nothing is done 0668 Standard_EXPORT Standard_Boolean SetModelContent (const Handle(IFSelect_Selection)& sel, const Standard_Boolean keep); 0669 0670 //! Returns the defined File Prefix. Null Handle if not defined 0671 Standard_EXPORT Handle(TCollection_HAsciiString) FilePrefix() const; 0672 0673 //! Returns the defined Default File Root. It is used for 0674 //! Dispatches which have no specific root attached. 0675 //! Null Handle if not defined 0676 Standard_EXPORT Handle(TCollection_HAsciiString) DefaultFileRoot() const; 0677 0678 //! Returns the defined File Extension. Null Handle if not defined 0679 Standard_EXPORT Handle(TCollection_HAsciiString) FileExtension() const; 0680 0681 //! Returns the File Root defined for a Dispatch. Null if no 0682 //! Root Name is defined for it (hence, no File will be produced) 0683 Standard_EXPORT Handle(TCollection_HAsciiString) FileRoot (const Handle(IFSelect_Dispatch)& disp) const; 0684 0685 //! Defines a File Prefix 0686 Standard_EXPORT void SetFilePrefix (const Standard_CString name); 0687 0688 //! Defines a Default File Root Name. Clears it is <name> = "" 0689 //! Returns True if OK, False if <name> already set for a Dispatch 0690 Standard_EXPORT Standard_Boolean SetDefaultFileRoot (const Standard_CString name); 0691 0692 //! Defines a File Extension 0693 Standard_EXPORT void SetFileExtension (const Standard_CString name); 0694 0695 //! Defines a Root for a Dispatch 0696 //! If <name> is empty, clears Root Name 0697 //! This has as effect to inhibit the production of File by <disp> 0698 //! Returns False if <disp> is not in the WorkSession or if a 0699 //! root name is already defined for it 0700 Standard_EXPORT Standard_Boolean SetFileRoot (const Handle(IFSelect_Dispatch)& disp, const Standard_CString name); 0701 0702 //! Extracts File Root Name from a given complete file name 0703 //! (uses OSD_Path) 0704 Standard_EXPORT Standard_CString GiveFileRoot (const Standard_CString file) const; 0705 0706 //! Completes a file name as required, with Prefix and Extension 0707 //! (if defined; for a non-defined item, completes nothing) 0708 Standard_EXPORT Standard_CString GiveFileComplete (const Standard_CString file) const; 0709 0710 //! Erases all stored data from the File Evaluation 0711 //! (i.e. ALL former naming information are lost) 0712 Standard_EXPORT void ClearFile(); 0713 0714 //! Performs and stores a File Evaluation. The Results are a List 0715 //! of produced Models and a List of names (Strings), in parallel 0716 //! Fills LastRunCheckList 0717 Standard_EXPORT void EvaluateFile(); 0718 0719 //! Returns the count of produced Models 0720 Standard_EXPORT Standard_Integer NbFiles() const; 0721 0722 //! Returns a Model, given its rank in the Evaluation List 0723 Standard_EXPORT Handle(Interface_InterfaceModel) FileModel (const Standard_Integer num) const; 0724 0725 //! Returns the name of a file corresponding to a produced Model, 0726 //! given its rank in the Evaluation List 0727 Standard_EXPORT TCollection_AsciiString FileName (const Standard_Integer num) const; 0728 0729 //! Commands file sending to clear the list of already sent files, 0730 //! commands to record a new one if <record> is True 0731 //! This list is managed by the ModelCopier when SendSplit is called 0732 //! It allows a global exploitation of the set of sent files 0733 Standard_EXPORT void BeginSentFiles (const Standard_Boolean record); 0734 0735 //! Returns the list of recorded sent files, or a Null Handle is 0736 //! recording has not been enabled 0737 Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) SentFiles() const; 0738 0739 //! Performs creation of derived files from the input Model 0740 //! Takes its data (sub-models and names), from result EvaluateFile 0741 //! if active, else by dynamic Evaluation (not stored) 0742 //! After SendSplit, result of EvaluateFile is Cleared 0743 //! Fills LastRunCheckList 0744 //! 0745 //! Works with the WorkLibrary which acts on specific type of Model 0746 //! and can work with File Modifiers (managed by the Model Copier) 0747 //! and a ModelCopier, which can work with Model Modifiers 0748 //! Returns False if, either WorkLibrary has failed on at least 0749 //! one sub-file, or the Work Session is badly conditioned 0750 //! (no Model defined, or FileNaming not in phase with ShareOut) 0751 Standard_EXPORT Standard_Boolean SendSplit(); 0752 0753 //! Returns an Evaluation of the whole ShareOut definition : i.e. 0754 //! how the entities of the starting model are forecast to be sent 0755 //! to various files : list of packets according the dispatches, 0756 //! effective lists of roots for each packet (which determine the 0757 //! content of the corresponding file); plus evaluation of which 0758 //! entities are : forgotten (sent into no file), duplicated (sent 0759 //! into more than one file), sent into a given file. 0760 //! See the class PacketList for more details. 0761 Standard_EXPORT Handle(IFSelect_PacketList) EvalSplit() const; 0762 0763 //! Returns the list of Entities sent in files, accourding the 0764 //! count of files each one has been sent (these counts are reset 0765 //! by SetModel or SetRemaining(Forget) ) stored in Graph Status 0766 //! <count> = -1 (default) is for ENtities sent at least once 0767 //! <count> = 0 is for the Remaining List (entities not yet sent) 0768 //! <count> = 1 is for entities sent in one and only one file 0769 //! (the ideal case) 0770 //! Remaining Data are computed on each Sending/Copying output 0771 //! files (see methods EvaluateFile and SendSplit) 0772 //! Graph Status is 0 for Remaining Entity, <count> for Sent into 0773 //! <count> files 0774 //! This status is set to 0 (not yet sent) for all by SetModel 0775 //! and by SetRemaining(mode=Forget,Display) 0776 Standard_EXPORT Interface_EntityIterator SentList (const Standard_Integer count = -1) const; 0777 0778 //! Returns the greater count of different files in which any of 0779 //! the starting entities could be sent. 0780 //! Before any file output, this count is 0. 0781 //! Ideal count is 1. More than 1 means that duplications occur. 0782 Standard_EXPORT Standard_Integer MaxSendingCount() const; 0783 0784 //! Processes Remaining data (after having sent files), mode : 0785 //! Forget : forget remaining info (i.e. clear all "Sent" status) 0786 //! Compute : compute and keep remaining (does nothing if : 0787 //! remaining is empty or if no files has been sent) 0788 //! Display : display entities recorded as remaining 0789 //! Undo : restore former state of data (after Remaining(1) ) 0790 //! Returns True if OK, False else (i.e. mode = 2 and Remaining 0791 //! List is either empty or takes all the entities, or mode = 3 0792 //! and no former computation of remaining data was done) 0793 Standard_EXPORT Standard_Boolean SetRemaining (const IFSelect_RemainMode mode); 0794 0795 //! Sends the starting Model into one file, without splitting, 0796 //! managing remaining data or anything else. 0797 //! <computegraph> true commands the Graph to be recomputed before 0798 //! sending : required when a Model is filled in several steps 0799 //! 0800 //! The Model and File Modifiers recorded to be applied on sending 0801 //! files are. 0802 //! Returns a status of execution : 0803 //! Done if OK, 0804 //! Void if no data available, 0805 //! Error if errors occurred (work library is not defined), errors during translation 0806 //! Fail if exception during translation is raised 0807 //! Stop if no disk space or disk, file is write protected 0808 //! Fills LastRunCheckList 0809 Standard_EXPORT IFSelect_ReturnStatus SendAll (const Standard_CString filename, const Standard_Boolean computegraph = Standard_False); 0810 0811 //! Sends a part of the starting Model into one file, without 0812 //! splitting. But remaining data are managed. 0813 //! <computegraph> true commands the Graph to be recomputed before 0814 //! sending : required when a Model is filled in several steps 0815 //! 0816 //! The Model and File Modifiers recorded to be applied on sending 0817 //! files are. 0818 //! Returns a status : Done if OK, Fail if error during send, 0819 //! Error : WorkLibrary not defined, Void : selection list empty 0820 //! Fills LastRunCheckList 0821 Standard_EXPORT IFSelect_ReturnStatus SendSelected (const Standard_CString filename, const Handle(IFSelect_Selection)& sel, const Standard_Boolean computegraph = Standard_False); 0822 0823 //! Writes the current Interface Model globally to a File, and 0824 //! returns a write status which can be : 0825 //! Done OK, Fail file could not be written, Error no norm is selected 0826 //! Remark : It is a simple, one-file writing, other operations are 0827 //! available (such as splitting ...) which calls SendAll 0828 Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename); 0829 0830 //! Writes a sub-part of the current Interface Model to a File, 0831 //! as defined by a Selection <sel>, recomputes the Graph, and 0832 //! returns a write status which can be : 0833 //! Done OK, Fail file could not be written, Error no norm is selected 0834 //! Remark : It is a simple, one-file writing, other operations are 0835 //! available (such as splitting ...) which calls SendSelected 0836 Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename, const Handle(IFSelect_Selection)& sel); 0837 0838 //! Returns the count of Input Selections known for a Selection, 0839 //! or 0 if <sel> not in the WorkSession. This count is one for a 0840 //! SelectDeduct / SelectExtract kind, two for SelectControl kind, 0841 //! variable for a SelectCombine (Union/Intersection), zero else 0842 Standard_EXPORT Standard_Integer NbSources (const Handle(IFSelect_Selection)& sel) const; 0843 0844 //! Returns the <num>th Input Selection of a Selection 0845 //! (see NbSources). 0846 //! Returns a Null Handle if <sel> is not in the WorkSession or if 0847 //! <num> is out of the range <1-NbSources> 0848 //! To obtain more details, see the method Sources 0849 Standard_EXPORT Handle(IFSelect_Selection) Source (const Handle(IFSelect_Selection)& sel, const Standard_Integer num = 1) const; 0850 0851 //! Returns True if <sel> a Reversed SelectExtract, False else 0852 Standard_EXPORT Standard_Boolean IsReversedSelectExtract (const Handle(IFSelect_Selection)& sel) const; 0853 0854 //! Toggles the Sense (Direct <-> Reversed) of a SelectExtract 0855 //! Returns True if Done, False if <sel> is not a SelectExtract or 0856 //! is not in the WorkSession 0857 Standard_EXPORT Standard_Boolean ToggleSelectExtract (const Handle(IFSelect_Selection)& sel); 0858 0859 //! Sets an Input Selection (as <input>) to a SelectExtract or 0860 //! a SelectDeduct (as <sel>). 0861 //! Returns True if Done, False if <sel> is neither a 0862 //! SelectExtract nor a SelectDeduct, or not in the WorkSession 0863 Standard_EXPORT Standard_Boolean SetInputSelection (const Handle(IFSelect_Selection)& sel, const Handle(IFSelect_Selection)& input); 0864 0865 //! Sets an Input Selection, Main if <formain> is True, Second else 0866 //! (as <sc>) to a SelectControl (as <sel>). Returns True if Done, 0867 //! False if <sel> is not a SelectControl, or <sc> or <sel> is not 0868 //! in the WorkSession 0869 Standard_EXPORT Standard_Boolean SetControl (const Handle(IFSelect_Selection)& sel, const Handle(IFSelect_Selection)& sc, const Standard_Boolean formain = Standard_True); 0870 0871 //! Adds an input selection to a SelectCombine (Union or Inters.). 0872 //! Returns new count of inputs for this SelectCombine if Done or 0873 //! 0 if <sel> is not kind of SelectCombine, or if <seladd> or 0874 //! <sel> is not in the WorkSession 0875 //! By default, adding is done at the end of the list 0876 //! Else, it is an insertion to rank <atnum> (useful for Un-ReDo) 0877 Standard_EXPORT Standard_Integer CombineAdd (const Handle(IFSelect_Selection)& selcomb, const Handle(IFSelect_Selection)& seladd, const Standard_Integer atnum = 0); 0878 0879 //! Removes an input selection from a SelectCombine (Union or 0880 //! Intersection). Returns True if done, False if <selcomb> is not 0881 //! kind of SelectCombine or <selrem> is not source of <selcomb> 0882 Standard_EXPORT Standard_Boolean CombineRemove (const Handle(IFSelect_Selection)& selcomb, const Handle(IFSelect_Selection)& selrem); 0883 0884 //! Creates a new Selection, of type SelectPointed, its content 0885 //! starts with <list>. A name must be given (can be empty) 0886 Standard_EXPORT Handle(IFSelect_Selection) NewSelectPointed (const Handle(TColStd_HSequenceOfTransient)& list, const Standard_CString name); 0887 0888 //! Changes the content of a Selection of type SelectPointed 0889 //! According <mode> : 0 set <list> as new content (clear former) 0890 //! 1 : adds <list> to actual content 0891 //! -1 : removes <list> from actual content 0892 //! Returns True if done, False if <sel> is not a SelectPointed 0893 Standard_EXPORT Standard_Boolean SetSelectPointed (const Handle(IFSelect_Selection)& sel, const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Integer mode) const; 0894 0895 //! Returns a Selection from a Name : 0896 //! - the name of a Selection : this Selection 0897 //! - the name of a Signature + criteria between (..) : a new 0898 //! Selection from this Signature 0899 //! - an entity or a list of entities : a new SelectPointed 0900 //! Else, returns a Null Handle 0901 Standard_EXPORT Handle(IFSelect_Selection) GiveSelection (const Standard_CString selname) const; 0902 0903 //! Determines a list of entities from an object : 0904 //! <obj> already HSequenceOfTransient : returned itself 0905 //! <obj> Selection : its Result of Evaluation is returned 0906 //! <obj> an entity of the Model : a HSequence which contains it 0907 //! else, an empty HSequence 0908 //! <obj> the Model it self : ALL its content (not only the roots) 0909 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GiveList (const Handle(Standard_Transient)& obj) const; 0910 0911 //! Computes a List of entities from two alphanums, 0912 //! first and second, as follows : 0913 //! if <first> is a Number or Label of an entity : this entity 0914 //! if <first> is a list of Numbers/Labels : the list of entities 0915 //! if <first> is the name of a Selection in <WS>, and <second> 0916 //! not defined, the standard result of this Selection 0917 //! else, let's consider "first second" : this whole phrase is 0918 //! split by blanks, as follows (RECURSIVE CALL) : 0919 //! - the leftest term is the final selection 0920 //! - the other terms define the result of the selection 0921 //! - and so on (the "leftest minus one" is a selection, of which 0922 //! the input is given by the remaining ...) 0923 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GiveList (const Standard_CString first, const Standard_CString second = "") const; 0924 0925 //! Computes a List of entities from the model as follows 0926 //! <first> being a Selection or a combination of Selections, 0927 //! <ent> being an entity or a list 0928 //! of entities (as a HSequenceOfTransient) : 0929 //! the standard result of this selection applied to this list 0930 //! if <ent> is Null, the standard definition of the selection is 0931 //! used (which contains a default input selection) 0932 //! if <selname> is erroneous, a null handle is returned 0933 //! 0934 //! REMARK : selname is processed as <first second> of preceding 0935 //! GiveList 0936 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GiveListFromList (const Standard_CString selname, const Handle(Standard_Transient)& ent) const; 0937 0938 //! Combines two lists and returns the result, according to mode : 0939 //! <mode> < 0 : entities in <l1> AND NOT in <l2> 0940 //! <mode> = 0 : entities in <l1> AND in <l2> 0941 //! <mode> > 0 : entities in <l1> OR in <l2> 0942 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GiveListCombined (const Handle(TColStd_HSequenceOfTransient)& l1, const Handle(TColStd_HSequenceOfTransient)& l2, const Standard_Integer mode) const; 0943 0944 //! Loads data from a check iterator to query status on it 0945 Standard_EXPORT void QueryCheckList (const Interface_CheckIterator& chl); 0946 0947 //! Determines check status for an entity regarding last call to 0948 //! QueryCheckList : 0949 //! -1 : <ent> unknown in the model, ignored 0950 //! 0 : no check at all, immediate or inherited thru Graph 0951 //! 1 : immediate warning (no fail), no inherited check 0952 //! 2 : immediate fail, no inherited check 0953 //! +10 : idem but some inherited warning (no fail) 0954 //! +20 : idem but some inherited fail 0955 Standard_EXPORT Standard_Integer QueryCheckStatus (const Handle(Standard_Transient)& ent) const; 0956 0957 //! Determines if <entdad> is parent of <entson> (in the graph), 0958 //! returns : -1 if no; 0 if <entdad> = <entson> 0959 //! 1 if immediate parent, > 1 if parent, gives count of steps 0960 Standard_EXPORT Standard_Integer QueryParent (const Handle(Standard_Transient)& entdad, const Handle(Standard_Transient)& entson) const; 0961 0962 //! Sets a list of Parameters, i.e. TypedValue, to be handled 0963 //! through an Editor 0964 //! The two lists are parallel, if <params> is longer than <uses>, 0965 //! surnumeral parameters are for general use 0966 //! 0967 //! EditForms are created to handle these parameters (list, edit) 0968 //! on the basis of a ParamEditor xst-params-edit 0969 //! 0970 //! A use number dispatches the parameter to a given EditForm 0971 //! EditForms are defined as follows 0972 //! Name Use Means 0973 //! xst-params all All Parameters (complete list) 0974 //! xst-params-general 1 Generals 0975 //! xst-params-load 2 LoadFile (no Transfer) 0976 //! xst-params-send 3 SendFile (Write, no Transfer) 0977 //! xst-params-split 4 Split 0978 //! xst-param-read 5 Transfer on Reading 0979 //! xst-param-write 6 Transfer on Writing 0980 Standard_EXPORT void SetParams (const NCollection_Vector<Handle(Standard_Transient)>& params, const NCollection_Vector<Standard_Integer>& uselist); 0981 0982 //! Traces the Statics attached to a given use number 0983 //! If <use> is given positive (normal), the trace is embedded 0984 //! with a header and a trailer 0985 //! If <use> is negative, just values are printed 0986 //! (this allows to make compositions) 0987 //! Remark : use number 5 commands use -2 to be traced 0988 //! Remark : use numbers 4 and 6 command use -3 to be traced 0989 Standard_EXPORT void TraceStatics (const Standard_Integer use, const Standard_Integer mode = 0) const; 0990 0991 //! Dumps contents of the ShareOut (on "cout") 0992 Standard_EXPORT void DumpShare() const; 0993 0994 //! Lists the Labels of all Items of the WorkSession 0995 //! If <label> is defined, lists labels which contain it 0996 Standard_EXPORT void ListItems (const Standard_CString label = "") const; 0997 0998 //! Lists the Modifiers of the session (for each one, displays 0999 //! its Label). Listing is done following Ranks (Modifiers are 1000 //! invoked following their ranks) 1001 //! Model Modifiers if <formodel> is True, File Modifiers else 1002 Standard_EXPORT void ListFinalModifiers (const Standard_Boolean formodel) const; 1003 1004 //! Lists a Selection and its Sources (see SelectionIterator), 1005 //! given its rank in the list 1006 Standard_EXPORT void DumpSelection (const Handle(IFSelect_Selection)& sel) const; 1007 1008 //! Lists the content of the Input Model (if there is one) 1009 //! According level : 0 -> gives only count of Entities and Roots 1010 //! 1 -> Lists also Roots; 2 -> Lists all Entities (by TraceType) 1011 //! 3 -> Performs a call to CheckList (Fails) and lists the result 1012 //! 4 -> as 3 but all CheckList (Fails + Warnings) 1013 //! 5,6,7 : as 3 but resp. Count,List,Labels by Fail 1014 //! 8,9,10 : as 4 but resp. Count,List,Labels by message 1015 Standard_EXPORT void DumpModel (const Standard_Integer level, Standard_OStream& S); 1016 1017 //! Dumps the current Model (as inherited DumpModel), on currently 1018 //! defined Default Trace File (default is standard output) 1019 Standard_EXPORT void TraceDumpModel (const Standard_Integer mode); 1020 1021 //! Dumps a starting entity according to the current norm. 1022 //! To do this, it calls DumpEntity from WorkLibrary. 1023 //! <level> is to be interpreted for each norm : see specific 1024 //! classes of WorkLibrary for it. Generally, 0 if for very basic 1025 //! (only type ...), greater values give more and more details. 1026 Standard_EXPORT void DumpEntity (const Handle(Standard_Transient)& ent, const Standard_Integer level, Standard_OStream& S) const; 1027 1028 //! Prints main information about an entity : its number, type, 1029 //! validity (and checks if any), category, shareds and sharings.. 1030 //! mutable because it can recompute checks as necessary 1031 Standard_EXPORT void PrintEntityStatus (const Handle(Standard_Transient)& ent, Standard_OStream& S); 1032 1033 //! Dumps an entity from the current Model as inherited DumpEntity 1034 //! on currently defined Default Trace File 1035 //! (<level> interpreted according to the Norm, see WorkLibrary) 1036 Standard_EXPORT void TraceDumpEntity (const Handle(Standard_Transient)& ent, const Standard_Integer level) const; 1037 1038 //! Prints a CheckIterator to the current Trace File, controlled 1039 //! with the current Model 1040 //! complete or fails only, according to <failsonly> 1041 //! <mode> defines the mode of printing 1042 //! 0 : sequential, according entities; else with a CheckCounter 1043 //! 1 : according messages, count of entities 1044 //! 2 : id but with list of entities, designated by their numbers 1045 //! 3 : as 2 but with labels of entities 1046 Standard_EXPORT void PrintCheckList (Standard_OStream& S, 1047 const Interface_CheckIterator& checklist, 1048 const Standard_Boolean failsonly, 1049 const IFSelect_PrintCount mode) const; 1050 1051 //! Prints a SignatureList to the current Trace File, controlled 1052 //! with the current Model 1053 //! <mode> defines the mode of printing (see SignatureList) 1054 Standard_EXPORT void PrintSignatureList (Standard_OStream& S, 1055 const Handle(IFSelect_SignatureList)& signlist, 1056 const IFSelect_PrintCount mode) const; 1057 1058 //! Displays the list of Entities selected by a Selection (i.e. 1059 //! the result of EvalSelection). 1060 Standard_EXPORT void EvaluateSelection (const Handle(IFSelect_Selection)& sel) const; 1061 1062 //! Displays the result of applying a Dispatch on the input Model 1063 //! (also shows Remainder if there is) 1064 //! <mode> = 0 (default), displays nothing else 1065 //! <mode> = 1 : displays also duplicated entities (because of 1066 //! this dispatch) 1067 //! <mode> = 2 : displays the entities of the starting Model 1068 //! which are not taken by this dispatch (forgotten entities) 1069 //! <mode> = 3 : displays both duplicated and forgotten entities 1070 //! Remark : EvaluateComplete displays these data evaluated for 1071 //! for all the dispatches, if there are several 1072 Standard_EXPORT void EvaluateDispatch (const Handle(IFSelect_Dispatch)& disp, const Standard_Integer mode = 0) const; 1073 1074 //! Displays the effect of applying the ShareOut on the input 1075 //! Model. 1076 //! <mode> = 0 (default) : displays only roots for each packet, 1077 //! <mode> = 1 : displays all entities for each packet, plus 1078 //! duplicated entities 1079 //! <mode> = 2 : same as <mode> = 1, plus displays forgotten 1080 //! entities (which are in no packet at all) 1081 Standard_EXPORT void EvaluateComplete (const Standard_Integer mode = 0) const; 1082 1083 //! Internal method which displays an EntityIterator 1084 //! <mode> 0 gives short display (only entity numbers) 1085 //! 1 gives a more complete trace (1 line per Entity) 1086 //! (can be used each time a trace has to be output from a list) 1087 //! 2 gives a form suitable for givelist : (n1,n2,n3...) 1088 Standard_EXPORT void ListEntities (const Interface_EntityIterator& iter, const Standard_Integer mode, Standard_OStream& S) const; 1089 1090 DEFINE_STANDARD_RTTIEXT(IFSelect_WorkSession,Standard_Transient) 1091 1092 protected: 1093 1094 Handle(Interface_HGraph) thegraph; 1095 Interface_CheckIterator thecheckrun; 1096 TColStd_IndexedDataMapOfTransientTransient theitems; 1097 NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thenames; 1098 1099 private: 1100 1101 Standard_Boolean theerrhand; 1102 Handle(IFSelect_ShareOut) theshareout; 1103 Handle(IFSelect_WorkLibrary) thelibrary; 1104 Handle(Interface_Protocol) theprotocol; 1105 Handle(Interface_InterfaceModel) myModel; 1106 TCollection_AsciiString theloaded; 1107 Handle(Interface_GTool) thegtool; 1108 Standard_Boolean thecheckdone; 1109 Interface_CheckIterator thechecklist; 1110 TCollection_AsciiString thecheckana; 1111 Handle(IFSelect_ModelCopier) thecopier; 1112 Handle(Interface_InterfaceModel) theoldel; 1113 Standard_Boolean themodelstat; 1114 }; 1115 1116 #endif // _IFSelect_WorkSession_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |