Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:55

0001 // Created on: 1994-05-27
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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_Transformer_HeaderFile
0018 #define _IFSelect_Transformer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 class Interface_Graph;
0025 class Interface_Protocol;
0026 class Interface_CheckIterator;
0027 class Interface_InterfaceModel;
0028 class TCollection_AsciiString;
0029 
0030 class IFSelect_Transformer;
0031 DEFINE_STANDARD_HANDLE(IFSelect_Transformer, Standard_Transient)
0032 
0033 //! A Transformer defines the way an InterfaceModel is transformed
0034 //! (without sending it to a file).
0035 //! In order to work, each type of Transformer defines it method
0036 //! Perform, it can be parametred as needed.
0037 //!
0038 //! It receives a Model (the data set) as input. It then can :
0039 //! - edit this Model on the spot
0040 //!   (i.e. alter its content: by editing entities, or adding/replacing some ...)
0041 //! - produce a copied Model, which detains the needed changes
0042 //!   (typically on the same type, but some or all entities being
0043 //!   rebuilt or converted; or converted from a protocol to another one)
0044 class IFSelect_Transformer : public Standard_Transient
0045 {
0046 
0047 public:
0048 
0049   //! Performs a Transformation (defined by each sub-class) :
0050   //! <G> gives the input data (especially the starting model) and
0051   //! can be used for queries (by Selections, etc...)
0052   //! <protocol> allows to work with General Services as necessary
0053   //! (it applies to input data)
0054   //! If the change corresponds to a conversion to a new protocol,
0055   //! see also the method ChangeProtocol
0056   //! <checks> stores produced checks messages if any
0057   //! <newmod> gives the result of the transformation :
0058   //! - if it is Null (i.e. has not been affected), the transformation
0059   //! has been made on the spot, it is assumed to cause no change
0060   //! to the graph of dependances
0061   //! - if it equates the starting Model, it has been transformed on
0062   //! the spot (possibiliy some entities were replaced inside it)
0063   //! - if it is new, it corresponds to a new data set which replaces
0064   //! the starting one
0065   //!
0066   //! <me> is mutable to allow results for ChangeProtocol to be
0067   //! memorized if needed, and to store information useful for
0068   //! the method Updated
0069   //!
0070   //! Returns True if Done, False if an Error occurred:
0071   //! in this case, if a new data set has been produced, the transformation is ignored,
0072   //! else data may be corrupted.
0073   Standard_EXPORT virtual Standard_Boolean Perform (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, Interface_CheckIterator& checks, Handle(Interface_InterfaceModel)& newmod) = 0;
0074   
0075   //! This methods allows to declare that the Protocol applied to
0076   //! the new Model has changed. It applies to the last call to
0077   //! Perform.
0078   //!
0079   //! Returns True if the Protocol has changed, False else.
0080   //! The provided default keeps the starting Protocol. This method
0081   //! should be redefined as required by the effect of Perform.
0082   Standard_EXPORT virtual Standard_Boolean ChangeProtocol (Handle(Interface_Protocol)& newproto) const;
0083   
0084   //! This method allows to know what happened to a starting
0085   //! entity after the last Perform. If <entfrom> (from starting
0086   //! model) has one and only one known item which corresponds in
0087   //! the new produced model, this method must return True and
0088   //! fill the argument <entto>. Else, it returns False.
0089   Standard_EXPORT virtual Standard_Boolean Updated (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto) const = 0;
0090   
0091   //! Returns a text which defines the way a Transformer works
0092   //! (to identify the transformation it performs)
0093   Standard_EXPORT virtual TCollection_AsciiString Label() const = 0;
0094 
0095   DEFINE_STANDARD_RTTIEXT(IFSelect_Transformer,Standard_Transient)
0096 
0097 
0098 };
0099 
0100 #endif // _IFSelect_Transformer_HeaderFile