0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Transfer / Transfer_TransferDispatch.hxx
1 // Created on: 1992-02-07
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Transfer_TransferDispatch_HeaderFile
18 #define _Transfer_TransferDispatch_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Interface_CopyTool.hxx>
25 #include <Standard_Boolean.hxx>
26 class Interface_InterfaceError;
27 class Interface_InterfaceModel;
28 class Interface_GeneralLib;
29 class Interface_Protocol;
30 class Transfer_TransientProcess;
31 class Standard_Transient;
32
33
34 //! A TransferDispatch is aimed to dispatch Entities between two
35 //! Interface Models, by default by copying them, as CopyTool, but
36 //! with more capabilities of adapting : Copy is redefined to
37 //! firstly pass the hand to a TransferProcess. If this gives no
38 //! result, standard Copy is called.
39 //!
40 //! This allow, for instance, to modify the copied Entity (such as
41 //! changing a Name for a VDA Entity), or to do a deeper work
42 //! (such as Substituting a kind of Entity to another one).
43 //!
44 //! For these reasons, TransferDispatch is basically a CopyTool,
45 //! but uses a more sophiscated control, which is TransferProcess,
46 //! and its method Copy is redefined
47 class Transfer_TransferDispatch  : public Interface_CopyTool
48 {
49 public:
50
51   DEFINE_STANDARD_ALLOC
52
53   
54   //! Creates a TransferDispatch from a Model. Works with a General
55   //! Service Library, given as an Argument
56   //! A TransferDispatch is created as a CopyTool in which the
57   //! Control is set to TransientProcess
58   Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib);
59   
60   //! Same as above, but Library is defined through a Protocol
61   Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol);
62   
63   //! Same as above, but works with the Active Protocol
64   Standard_EXPORT Transfer_TransferDispatch(const Handle(Interface_InterfaceModel)& amodel);
65   
66   //! Returns the content of Control Object, as a TransientProcess
67   Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
68   
69   //! Copies an Entity by calling the method Transferring from the
70   //! TransferProcess. If this called produces a Null Binder, then
71   //! the standard, inherited Copy is called
72   Standard_EXPORT virtual Standard_Boolean Copy (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto, const Standard_Boolean mapped, const Standard_Boolean errstat) Standard_OVERRIDE;
73
74
75
76
77 protected:
78
79
80
81
82
83 private:
84
85
86
87
88
89 };
90
91
92
93
94
95
96
97 #endif // _Transfer_TransferDispatch_HeaderFile