|
||||
File indexing completed on 2025-01-18 10:03:54
0001 // Created on: 1992-11-17 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_ShareOut_HeaderFile 0018 #define _IFSelect_ShareOut_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <IFSelect_TSeqOfDispatch.hxx> 0024 #include <IFSelect_SequenceOfGeneralModifier.hxx> 0025 #include <Standard_Integer.hxx> 0026 #include <Standard_Transient.hxx> 0027 class TCollection_HAsciiString; 0028 class IFSelect_Dispatch; 0029 class IFSelect_GeneralModifier; 0030 class IFSelect_Modifier; 0031 class TCollection_AsciiString; 0032 0033 class IFSelect_ShareOut; 0034 DEFINE_STANDARD_HANDLE(IFSelect_ShareOut, Standard_Transient) 0035 0036 //! This class gathers the information required to produce one or 0037 //! several file(s) from the content of an InterfaceModel (passing 0038 //! through the creation of intermediate Models). 0039 //! 0040 //! It can correspond to a complete Divide up of a set of Entities 0041 //! intended to be exhaustive and to limit duplications. Or to a 0042 //! simple Extraction of some Entities, in order to work on them. 0043 //! 0044 //! A ShareOut is composed of a list of Dispatches. 0045 //! To Each Dispatch in the ShareOut, is bound an Id. Number 0046 //! This Id. Number allows to identify a Display inside the 0047 //! ShareOut in a stable way (for instance, to attach file names) 0048 //! 0049 //! ShareOut can be seen as a "passive" description, activated 0050 //! through a ShareOutResult, which gives the InterfaceModel on 0051 //! which to work, as a unique source. Thus it is easy to change 0052 //! it without coherence problems 0053 //! 0054 //! Services about it are provided by the class ShareOutResult 0055 //! which is a service class : simulation (list of files and of 0056 //! entities per file; "forgotten" entities; duplicated entities), 0057 //! exploitation (generation of derivated Models, each of them 0058 //! generating an output file) 0059 class IFSelect_ShareOut : public Standard_Transient 0060 { 0061 0062 public: 0063 0064 //! Creates an empty ShareOut 0065 Standard_EXPORT IFSelect_ShareOut(); 0066 0067 //! Removes in one operation all the Dispatches with their Idents 0068 //! Also clears all information about Names, and all Results but 0069 //! naming information which are : 0070 //! - kept if <onlydisp> is True. 0071 //! - cleared if <onlydisp> is False (complete clearing) 0072 //! If <onlydisp> is True, that's all. Else, clears also Modifiers 0073 Standard_EXPORT void Clear (const Standard_Boolean onlydisp); 0074 0075 //! Clears all data produced (apart from Dispatches, etc...) 0076 //! if <alsoname> is True, all is cleared. Else, information 0077 //! about produced Names are kept (to maintain unicity of naming 0078 //! across clearings) 0079 Standard_EXPORT void ClearResult (const Standard_Boolean alsoname); 0080 0081 //! Removes an item, which can be, either a Dispatch (removed from 0082 //! the list of Dispatches), or a GeneralModifier (removed from 0083 //! the list of Model Modifiers or from the list of File Modifiers 0084 //! according to its type). 0085 //! Returns True if done, False if has not been found or if it is 0086 //! neither a Dispatch, nor a Modifier. 0087 Standard_EXPORT Standard_Boolean RemoveItem (const Handle(Standard_Transient)& item); 0088 0089 //! Returns the rank of last run item (ClearResult resets it to 0) 0090 Standard_EXPORT Standard_Integer LastRun() const; 0091 0092 //! Records a new value for the rank of last run item 0093 Standard_EXPORT void SetLastRun (const Standard_Integer last); 0094 0095 //! Returns the count of Dispatches 0096 Standard_EXPORT Standard_Integer NbDispatches() const; 0097 0098 //! Returns the Rank of a Dispatch, given its Value (Handle). 0099 //! Returns 0 if the Dispatch is unknown in the ShareOut 0100 Standard_EXPORT Standard_Integer DispatchRank (const Handle(IFSelect_Dispatch)& disp) const; 0101 0102 //! Returns a Dispatch, given its rank in the list 0103 Standard_EXPORT const Handle(IFSelect_Dispatch)& Dispatch (const Standard_Integer num) const; 0104 0105 //! Adds a Dispatch to the list 0106 Standard_EXPORT void AddDispatch (const Handle(IFSelect_Dispatch)& disp); 0107 0108 //! Removes a Dispatch, given its rank in the list 0109 //! Returns True if done, False if rank is not between 0110 //! (LastRun + 1) and (NbDispatches) 0111 Standard_EXPORT Standard_Boolean RemoveDispatch (const Standard_Integer rank); 0112 0113 //! Sets a Modifier to be applied on all Dispatches to be run 0114 //! If <modifier> is a ModelModifier, adds it to the list of 0115 //! Model Modifiers; else to the list of File Modifiers 0116 //! By default (atnum = 0) at the end of the list, else at <atnum> 0117 //! Each Modifier is used, after each copy of a packet of Entities 0118 //! into a Model : its criteria are checked and if they are OK, 0119 //! the method Perform of this Modifier is run. 0120 Standard_EXPORT void AddModifier (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Integer atnum); 0121 0122 //! Sets a Modifier to be applied on the Dispatch <dispnum> 0123 //! If <modifier> is a ModelModifier, adds it to the list of 0124 //! Model Modifiers; else to the list of File Modifiers 0125 //! This is the same list as for all Dispatches, but the 0126 //! Modifier is qualified to be applied to one Dispatch only 0127 //! Then, <atnum> refers to the entire list 0128 //! By default (atnum = 0) at the end of the list, else at <atnum> 0129 //! Remark : if the Modifier was already in the list and if 0130 //! <atnum> = 0, the Modifier is not moved, but only qualified 0131 //! for a Dispatch 0132 Standard_EXPORT void AddModifier (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Integer dispnum, const Standard_Integer atnum); 0133 0134 //! Adds a Modifier to the list of Modifiers : Model Modifiers if 0135 //! <formodel> is True, File Modifiers else (internal). 0136 Standard_EXPORT void AddModif (const Handle(IFSelect_GeneralModifier)& modifier, const Standard_Boolean formodel, const Standard_Integer atnum = 0); 0137 0138 //! Returns count of Modifiers (which apply to complete Models) : 0139 //! Model Modifiers if <formodel> is True, File Modifiers else 0140 Standard_EXPORT Standard_Integer NbModifiers (const Standard_Boolean formodel) const; 0141 0142 //! Returns a Modifier of the list, given its rank : 0143 //! Model Modifiers if <formodel> is True, File Modifiers else 0144 Standard_EXPORT Handle(IFSelect_GeneralModifier) GeneralModifier (const Standard_Boolean formodel, const Standard_Integer num) const; 0145 0146 //! Returns a Modifier of the list of Model Modifiers, duely casted 0147 Standard_EXPORT Handle(IFSelect_Modifier) ModelModifier (const Standard_Integer num) const; 0148 0149 //! Gives the rank of a Modifier in the list, 0 if not in the list 0150 //! Model Modifiers if <modifier> is kind of ModelModifer, 0151 //! File Modifiers else 0152 Standard_EXPORT Standard_Integer ModifierRank (const Handle(IFSelect_GeneralModifier)& modifier) const; 0153 0154 //! Removes a Modifier, given it rank in the list : 0155 //! Model Modifiers if <formodel> is True, File Modifiers else 0156 //! Returns True if done, False if <num> is out of range 0157 Standard_EXPORT Standard_Boolean RemoveModifier (const Standard_Boolean formodel, const Standard_Integer num); 0158 0159 //! Changes the rank of a modifier in the list : 0160 //! Model Modifiers if <formodel> is True, File Modifiers else 0161 //! from <before> to <after> 0162 //! Returns True if done, False else (before or after out of range) 0163 Standard_EXPORT Standard_Boolean ChangeModifierRank (const Standard_Boolean formodel, const Standard_Integer befor, const Standard_Integer after); 0164 0165 //! Attaches a Root Name to a Dispatch given its rank, as an 0166 //! HAsciiString (standard form). A Null Handle resets this name. 0167 //! Returns True if OK, False if this Name is already attached, 0168 //! for a Dispatch or for Default, or <num> out of range 0169 Standard_EXPORT Standard_Boolean SetRootName (const Standard_Integer num, const Handle(TCollection_HAsciiString)& name); 0170 0171 //! Returns True if the Dispatch of rank <num> has an attached 0172 //! Root Name. False else, or if num is out of range 0173 Standard_EXPORT Standard_Boolean HasRootName (const Standard_Integer num) const; 0174 0175 //! Returns the Root bound to a Dispatch, given its rank 0176 //! Returns a Null Handle if not defined 0177 Standard_EXPORT Handle(TCollection_HAsciiString) RootName (const Standard_Integer num) const; 0178 0179 //! Returns an integer value about a given root name : 0180 //! - positive : it's the rank of the Dispatch which has this name 0181 //! - null : this root name is unknown 0182 //! - negative (-1) : this root name is the default root name 0183 Standard_EXPORT Standard_Integer RootNumber (const Handle(TCollection_HAsciiString)& name) const; 0184 0185 //! Defines or Changes the general Prefix (which is prepended to 0186 //! complete file name generated). If this method is not call, 0187 //! Prefix remains empty 0188 Standard_EXPORT void SetPrefix (const Handle(TCollection_HAsciiString)& pref); 0189 0190 //! Defines or Changes the Default Root Name to a new value (which 0191 //! is used for dispatches which have no attached root name). 0192 //! If this method is not called, DefaultRootName remains empty 0193 //! Returns True if OK, False if this Name is already attached, 0194 //! for a Dispatch or for Default 0195 Standard_EXPORT Standard_Boolean SetDefaultRootName (const Handle(TCollection_HAsciiString)& defrt); 0196 0197 //! Defines or Changes the general Extension (which is appended to 0198 //! complete file name generated). If this method is not call, 0199 //! Extension remains empty 0200 Standard_EXPORT void SetExtension (const Handle(TCollection_HAsciiString)& ext); 0201 0202 //! Returns the general Prefix. Can be empty. 0203 Standard_EXPORT Handle(TCollection_HAsciiString) Prefix() const; 0204 0205 //! Returns the Default Root Name. Can be empty. 0206 Standard_EXPORT Handle(TCollection_HAsciiString) DefaultRootName() const; 0207 0208 //! Returns the general Extension. Can be empty (not recommended) 0209 Standard_EXPORT Handle(TCollection_HAsciiString) Extension() const; 0210 0211 //! Computes the complete file name for a Packet of a Dispatch, 0212 //! given Dispatch Number (Rank), Packet Number, and Count of 0213 //! Packets generated by this Dispatch (0 if unknown) 0214 //! 0215 //! File Name is made of following strings, concatenated : 0216 //! General Prefix, Root Name for Dispatch, Packet Suffix, and 0217 //! General Extension. If no Root Name is specified for a 0218 //! Dispatch, DefaultRootName is considered (and pnum is not used, 0219 //! but <thenbdefs> is incremented and used 0220 //! Error if no Root is defined for this <idnum> 0221 Standard_EXPORT TCollection_AsciiString FileName (const Standard_Integer dnum, const Standard_Integer pnum, const Standard_Integer nbpack = 0); 0222 0223 DEFINE_STANDARD_RTTIEXT(IFSelect_ShareOut,Standard_Transient) 0224 0225 0226 private: 0227 0228 IFSelect_TSeqOfDispatch thedisps; 0229 IFSelect_SequenceOfGeneralModifier themodelmodifiers; 0230 IFSelect_SequenceOfGeneralModifier thefilemodifiers; 0231 Handle(TCollection_HAsciiString) thepref; 0232 Handle(TCollection_HAsciiString) thedefrt; 0233 Handle(TCollection_HAsciiString) theext; 0234 Standard_Integer thenbdefs; 0235 Standard_Integer thelastrun; 0236 0237 }; 0238 0239 #endif // _IFSelect_ShareOut_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |