b311480e |
1 | // Created on: 2004-11-22 |
2 | // Created by: Pavel TELKOV |
973c2be1 |
3 | // Copyright (c) 2004-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // The original implementation Copyright: (C) RINA S.p.A |
17 | |
18 | #ifndef TObj_Assistant_HeaderFile |
19 | #define TObj_Assistant_HeaderFile |
20 | |
b7c077b9 |
21 | #include <TColStd_SequenceOfTransient.hxx> |
b7c077b9 |
22 | #include <TColStd_IndexedMapOfTransient.hxx> |
7fd59977 |
23 | |
c04c30b3 |
24 | class TObj_Model; |
7fd59977 |
25 | |
26 | //! This class provides interface to the static data |
27 | //! to be used during save or load models. |
28 | //! |
29 | //! Static data: |
30 | //! 1. DataMap of Modeller name - handle to model to be used in loading of references |
31 | //! 2. Indexed map of Standard_Type to be used during save or load of object type |
32 | //! 3. Handle to the current model - model that is loaded at the current moment |
33 | |
34 | class TObj_Assistant |
35 | { |
36 | public: |
37 | /** |
38 | * Interface for DataMap of Modeller name |
39 | */ |
40 | |
41 | //! Finds model by name |
42 | static Standard_EXPORT Handle(TObj_Model) |
43 | FindModel (const Standard_CString theName); |
44 | |
45 | //! Binds model to the map |
46 | static Standard_EXPORT void |
b2fedee6 |
47 | BindModel (const Handle(TObj_Model)& theModel); |
7fd59977 |
48 | |
49 | //! Clears all records from the model map |
50 | static Standard_EXPORT void |
51 | ClearModelMap (); |
52 | |
53 | public: |
54 | /** |
55 | * Interface for Map of Standard Types |
56 | */ |
57 | |
58 | //! Finds Standard_Type by index; |
59 | //! returns NULL handle if not found |
60 | static Standard_EXPORT Handle(Standard_Type) |
61 | FindType (const Standard_Integer theTypeIndex); |
62 | |
63 | //! Rinds index by Standard_Type; |
64 | //! returns 0 if not found |
65 | static Standard_EXPORT Standard_Integer |
66 | FindTypeIndex (const Handle(Standard_Type)& theType); |
67 | |
68 | //! Binds Standard_Type to the map; |
69 | //! returns index of bound type |
70 | static Standard_EXPORT Standard_Integer |
71 | BindType (const Handle(Standard_Type)& theType); |
72 | |
73 | //! Clears map of types |
74 | static Standard_EXPORT void |
75 | ClearTypeMap (); |
76 | |
77 | public: |
78 | /** |
79 | * Interface to the current model |
80 | */ |
81 | |
82 | //! Sets current model |
83 | static Standard_EXPORT void |
84 | SetCurrentModel (const Handle(TObj_Model)& theModel); |
85 | |
86 | //! Returns current model |
87 | static Standard_EXPORT Handle(TObj_Model) |
88 | GetCurrentModel(); |
89 | |
90 | //! Unsets current model |
91 | static Standard_EXPORT void |
92 | UnSetCurrentModel (); |
93 | |
94 | public: |
95 | |
96 | //! Returns the version of application which wrote the currently read document. |
97 | //! Returns 0 if it has not been set yet for the current document. |
98 | static Standard_EXPORT Standard_Integer GetAppVersion(); |
99 | |
100 | private: |
101 | |
102 | //! Method for taking fields for map of models |
103 | static Standard_EXPORT TColStd_SequenceOfTransient& getModels(); |
104 | |
105 | //! Method for taking fields for map types |
106 | static Standard_EXPORT TColStd_IndexedMapOfTransient& getTypes(); |
107 | |
108 | //! Method for taking fields for the Current model |
109 | static Standard_EXPORT Handle(TObj_Model)& getCurrentModel(); |
110 | |
111 | //! Returns application version |
112 | static Standard_EXPORT Standard_Integer& getVersion(); |
113 | }; |
114 | |
115 | #endif |
116 | |
117 | #ifdef _MSC_VER |
118 | #pragma once |
119 | #endif |