1 // Created on: 2004-11-22
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // The original implementation Copyright: (C) RINA S.p.A
18 #ifndef TObj_Assistant_HeaderFile
19 #define TObj_Assistant_HeaderFile
21 #include <TObj_Common.hxx>
22 #include <TColStd_SequenceOfTransient.hxx>
23 #include <TColStd_SequenceOfAsciiString.hxx>
24 #include <TColStd_IndexedMapOfTransient.hxx>
28 //! This class provides interface to the static data
29 //! to be used during save or load models.
32 //! 1. DataMap of Modeller name - handle to model to be used in loading of references
33 //! 2. Indexed map of Standard_Type to be used during save or load of object type
34 //! 3. Handle to the current model - model that is loaded at the current moment
40 * Interface for DataMap of Modeller name
43 //! Finds model by name
44 static Standard_EXPORT Handle(TObj_Model)
45 FindModel (const Standard_CString theName);
47 //! Binds model to the map
48 static Standard_EXPORT void
49 BindModel (const Handle(TObj_Model) theModel);
51 //! Clears all records from the model map
52 static Standard_EXPORT void
57 * Interface for Map of Standard Types
60 //! Finds Standard_Type by index;
61 //! returns NULL handle if not found
62 static Standard_EXPORT Handle(Standard_Type)
63 FindType (const Standard_Integer theTypeIndex);
65 //! Rinds index by Standard_Type;
66 //! returns 0 if not found
67 static Standard_EXPORT Standard_Integer
68 FindTypeIndex (const Handle(Standard_Type)& theType);
70 //! Binds Standard_Type to the map;
71 //! returns index of bound type
72 static Standard_EXPORT Standard_Integer
73 BindType (const Handle(Standard_Type)& theType);
75 //! Clears map of types
76 static Standard_EXPORT void
81 * Interface to the current model
84 //! Sets current model
85 static Standard_EXPORT void
86 SetCurrentModel (const Handle(TObj_Model)& theModel);
88 //! Returns current model
89 static Standard_EXPORT Handle(TObj_Model)
92 //! Unsets current model
93 static Standard_EXPORT void
98 //! Returns the version of application which wrote the currently read document.
99 //! Returns 0 if it has not been set yet for the current document.
100 static Standard_EXPORT Standard_Integer GetAppVersion();
104 //! Method for taking fields for map of models
105 static Standard_EXPORT TColStd_SequenceOfTransient& getModels();
107 //! Method for taking fields for map types
108 static Standard_EXPORT TColStd_IndexedMapOfTransient& getTypes();
110 //! Method for taking fields for the Current model
111 static Standard_EXPORT Handle(TObj_Model)& getCurrentModel();
113 //! Returns application version
114 static Standard_EXPORT Standard_Integer& getVersion();