1 // Created on: 1994-05-02
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_AppliedModifiers_HeaderFile
18 #define _IFSelect_AppliedModifiers_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <IFSelect_SequenceOfGeneralModifier.hxx>
24 #include <Interface_IntList.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Transient.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <TColStd_HSequenceOfInteger.hxx>
29 class IFSelect_GeneralModifier;
32 class IFSelect_AppliedModifiers;
33 DEFINE_STANDARD_HANDLE(IFSelect_AppliedModifiers, Standard_Transient)
35 //! This class allows to memorize and access to the modifiers
36 //! which are to be applied to a file. To each modifier, is bound
37 //! a list of integers (optionnal) : if this list is absent, the
38 //! modifier applies to all the file. Else, it applies to the
39 //! entities designated by these numbers in the produced file.
41 //! To record a modifier, and a possible list of entity numbers
42 //! to be applied on :
43 //! AddModif (amodifier);
44 //! loop on AddNum (anumber);
46 //! To query it, Count gives the count of recorded modifiers,
47 //! then for each one :
48 //! Item (numodif, amodifier, entcount);
49 //! IsForAll () -> can be called, if True, applies on the whole file
51 //! for (i = 1; i <= entcount; i ++)
52 //! nument = ItemNum (i); -> return an entity number
53 class IFSelect_AppliedModifiers : public Standard_Transient
59 //! Creates an AppliedModifiers, ready to record up to <nbmax>
60 //! modifiers, on a model of <nbent> entities
61 Standard_EXPORT IFSelect_AppliedModifiers(const Standard_Integer nbmax, const Standard_Integer nbent);
63 //! Records a modifier. By default, it is to apply on all a
64 //! produced file. Further calls to AddNum will restrict this.
65 //! Returns True if done, False if too many modifiers are already
67 Standard_EXPORT Standard_Boolean AddModif (const Handle(IFSelect_GeneralModifier)& modif);
69 //! Adds a number of entity of the output file to be applied on.
70 //! If a sequence of AddNum is called after AddModif, this
71 //! Modifier will be applied on the list of designated entities.
72 //! Else, it will be applied on all the file
73 //! Returns True if done, False if no modifier has yet been added
74 Standard_EXPORT Standard_Boolean AddNum (const Standard_Integer nument);
76 //! Returns the count of recorded modifiers
77 Standard_EXPORT Standard_Integer Count() const;
79 //! Returns the description for applied modifier n0 <num> :
80 //! the modifier itself, and the count of entities to be applied
81 //! on. If no specific list of number has been defined, returns
82 //! the total count of entities of the file
83 //! If this count is zero, then the modifier applies to all
84 //! the file (see below). Else, the numbers are then queried by
85 //! calls to ItemNum between 1 and <entcount>
86 //! Returns True if OK, False if <num> is out of range
87 Standard_EXPORT Standard_Boolean Item (const Standard_Integer num, Handle(IFSelect_GeneralModifier)& modif, Standard_Integer& entcount);
89 //! Returns a numero of entity to be applied on, given its rank
90 //! in the list. If no list is defined (i.e. for all the file),
91 //! returns <nument> itself, to give all the entities of the file
92 //! Returns 0 if <nument> out of range
93 Standard_EXPORT Standard_Integer ItemNum (const Standard_Integer nument) const;
95 //! Returns the list of entities to be applied on (see Item)
96 //! as a HSequence (IsForAll produces the complete list of all
97 //! the entity numbers of the file
98 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) ItemList() const;
100 //! Returns True if the applied modifier queried by last call to
101 //! Item is to be applied to all the produced file.
102 //! Else, <entcount> returned by Item gives the count of entity
103 //! numbers, each one is queried by ItemNum
104 Standard_EXPORT Standard_Boolean IsForAll() const;
109 DEFINE_STANDARD_RTTIEXT(IFSelect_AppliedModifiers,Standard_Transient)
119 IFSelect_SequenceOfGeneralModifier themodifs;
120 Interface_IntList thelists;
121 Standard_Integer thenbent;
122 Standard_Integer theentcnt;
133 #endif // _IFSelect_AppliedModifiers_HeaderFile