0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Transfer / Transfer_FinderProcess.hxx
1 // Created on: 1996-09-04
2 // Created by: Christian CAILLET
3 // Copyright (c) 1996-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_FinderProcess_HeaderFile
18 #define _Transfer_FinderProcess_HeaderFile
19
20 #include <Transfer_ProcessForFinder.hxx>
21 #include <Interface_InterfaceModel.hxx>
22
23 class Interface_InterfaceModel;
24 class Transfer_TransientMapper;
25 class Transfer_Finder;
26
27 class Transfer_FinderProcess;
28 DEFINE_STANDARD_HANDLE(Transfer_FinderProcess, Transfer_ProcessForFinder)
29
30 //! Adds specific features to the generic definition :
31 //! PrintTrace is adapted
32 class Transfer_FinderProcess : public Transfer_ProcessForFinder
33 {
34
35 public:
36
37   
38   //! Sets FinderProcess at initial state, with an initial size
39   Standard_EXPORT Transfer_FinderProcess(const Standard_Integer nb = 10000);
40   
41   //! Sets an InterfaceModel, which can be used during transfer
42   //! for instance if a context must be managed, it is in the Model
43   Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
44   
45   //! Returns the Model which can be used for context
46   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
47   
48   //! In the list of mapped items (between 1 and NbMapped),
49   //! searches for the first mapped item which follows <num0>
50   //! (not included) and which has an attribute named <name>
51   //! The considered Attributes are those brought by Finders,i.e.
52   //! by Input data.
53   //! While NextItemWithAttribute works on Result data (Binders)
54   //!
55   //! Hence, allows such an iteration
56   //!
57   //! for (num = FP->NextMappedWithAttribute(name,0);
58   //! num > 0;
59   //! num = FP->NextMappedWithAttribute(name,num) {
60   //! .. process mapped item <num>
61   //! }
62   Standard_EXPORT Standard_Integer NextMappedWithAttribute (const Standard_CString name, const Standard_Integer num0) const;
63   
64   //! Returns a TransientMapper for a given Transient Object
65   //! Either <obj> is already mapped, then its Mapper is returned
66   //! Or it is not, then a new one is created then returned, BUT
67   //! it is not mapped here (use Bind or FindElseBind to do this)
68   Standard_EXPORT Handle(Transfer_TransientMapper) TransientMapper (const Handle(Standard_Transient)& obj) const;
69   
70   //! Specific printing to trace a Finder (by its method ValueType)
71   Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, Standard_OStream& S) const Standard_OVERRIDE;
72   
73   //! Prints statistics on a given output, according mode
74   Standard_EXPORT void PrintStats (const Standard_Integer mode, Standard_OStream& S) const;
75
76   DEFINE_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_ProcessForFinder)
77
78 private:
79   Handle(Interface_InterfaceModel) themodel;
80 };
81
82 #endif // _Transfer_FinderProcess_HeaderFile