Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-02 08:33:39

0001 // Created on: 1993-10-19
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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_GeneralModifier_HeaderFile
0018 #define _IFSelect_GeneralModifier_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 class IFSelect_Selection;
0025 class IFSelect_Dispatch;
0026 class TCollection_AsciiString;
0027 
0028 class IFSelect_GeneralModifier;
0029 DEFINE_STANDARD_HANDLE(IFSelect_GeneralModifier, Standard_Transient)
0030 
0031 //! This class gives a frame for Actions which modify the effect
0032 //! of a Dispatch, i.e. :
0033 //! By Selections and Dispatches, an original Model can be
0034 //! split into one or more "target" Models : these Models
0035 //! contain Entities copied from the original one (that is, a
0036 //! part of it). Basically, these dispatched Entities are copied
0037 //! as identical to their original counterparts. Also the copied
0038 //! Models reproduce the Header of the original one.
0039 //!
0040 //! Modifiers allow to change this copied content : this is the
0041 //! way to be used for any kind of alterations, adaptations ...
0042 //! They are exploited by a ModelCopier, which firstly performs
0043 //! the copy operation described by Dispatches, then invokes the
0044 //! Modifiers to work on the result.
0045 //!
0046 //! Each GeneralModifier can be attached to :
0047 //! - all the Models produced
0048 //! - a Dispatch (it will be applied to all the Models obtained
0049 //! from this Dispatch) designated by its Ident in a ShareOut
0050 //! - in addition, to a Selection (facultative) : this adds a
0051 //! criterium, the Modifier is invoked on a produced Model only
0052 //! if this Model contains an Entity copied from one of the
0053 //! Entities designated by this Selection.
0054 //! (for special Modifiers from IFAdapt, while they must work on
0055 //! definite Entities, this Selection is mandatory to run)
0056 //!
0057 //! Remark : this class has no action attached, it only provides
0058 //! a frame to work on criteria. Then, sub-classes will define
0059 //! their kind of action, which can be applied at a precise step
0060 //! of the production of a File : see Modifier, and in the
0061 //! package IFAdapt, EntityModifier and EntityCopier
0062 class IFSelect_GeneralModifier : public Standard_Transient
0063 {
0064 
0065 public:
0066   //! Returns True if this modifier may change the graph of
0067   //! dependences (acknowledged at creation time)
0068   Standard_EXPORT Standard_Boolean MayChangeGraph() const;
0069 
0070   //! Attaches to a Dispatch. If <disp> is Null, Resets it
0071   //! (to apply the Modifier on every Dispatch)
0072   Standard_EXPORT void SetDispatch(const Handle(IFSelect_Dispatch)& disp);
0073 
0074   //! Returns the Dispatch to be matched, Null if not set
0075   Standard_EXPORT Handle(IFSelect_Dispatch) Dispatch() const;
0076 
0077   //! Returns True if a Model obtained from the Dispatch <disp>
0078   //! is to be treated (apart from the Selection criterium)
0079   //! If Dispatch(me) is Null, returns True. Else, checks <disp>
0080   Standard_EXPORT Standard_Boolean Applies(const Handle(IFSelect_Dispatch)& disp) const;
0081 
0082   //! Sets a Selection : a Model is treated if it contains one or
0083   //! more Entities designated by the Selection
0084   Standard_EXPORT void SetSelection(const Handle(IFSelect_Selection)& sel);
0085 
0086   //! Resets the Selection : this criterium is not longer active
0087   Standard_EXPORT void ResetSelection();
0088 
0089   //! Returns True if a Selection is set as an additional criterium
0090   Standard_EXPORT Standard_Boolean HasSelection() const;
0091 
0092   //! Returns the Selection, or a Null Handle if not set
0093   Standard_EXPORT Handle(IFSelect_Selection) Selection() const;
0094 
0095   //! Returns a short text which defines the operation performed
0096   Standard_EXPORT virtual TCollection_AsciiString Label() const = 0;
0097 
0098   DEFINE_STANDARD_RTTIEXT(IFSelect_GeneralModifier, Standard_Transient)
0099 
0100 protected:
0101   //! Sets the Modifier criteria to default Values
0102   //! (i.e. "always applies")
0103   //! <maychangegraph> must be provided at creation time, to :
0104   //! - False if this GeneralModifier surely lets the graph of
0105   //! dependencies unchanged (NO edition of any reference, BUT
0106   //! also NO entity added or replaced or removed)
0107   //! - True if there is a possibility of changing the graph of
0108   //! dependencies when this modifier is applied
0109   Standard_EXPORT IFSelect_GeneralModifier(const Standard_Boolean maychangegraph);
0110 
0111 private:
0112   Handle(IFSelect_Selection) thesel;
0113   Handle(IFSelect_Dispatch)  thedisp;
0114   Standard_Boolean           thechgr;
0115 };
0116 
0117 #endif // _IFSelect_GeneralModifier_HeaderFile