Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:22

0001 // Created on: 2004-11-22
0002 // Created by: Pavel TELKOV
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 // The original implementation Copyright: (C) RINA S.p.A
0017 
0018 #ifndef TObj_Assistant_HeaderFile
0019 #define TObj_Assistant_HeaderFile
0020 
0021 #include <TColStd_SequenceOfTransient.hxx>
0022 #include <TColStd_IndexedMapOfTransient.hxx>
0023 
0024 class TObj_Model;
0025 
0026 //! This class provides interface to the static data
0027 //! to be used during save or load models.
0028 //!
0029 //! Static data:
0030 //! 1. DataMap of Modeller name - handle to model to be used in loading of references
0031 //! 2. Indexed map of Standard_Type to be used during save or load of object type
0032 //! 3. Handle to the current model - model that is loaded at the current moment
0033 
0034 class TObj_Assistant
0035 {
0036 public:
0037   /**
0038   * Interface for DataMap of Modeller name
0039   */
0040 
0041   //! Finds model by name
0042   static Standard_EXPORT Handle(TObj_Model)
0043     FindModel     (const Standard_CString theName);
0044 
0045   //! Binds model to the map
0046   static Standard_EXPORT void
0047     BindModel     (const Handle(TObj_Model)& theModel);
0048 
0049   //! Clears all records from the model map
0050   static Standard_EXPORT void
0051     ClearModelMap ();
0052 
0053 public:
0054   /**
0055   * Interface for Map of Standard Types
0056   */
0057 
0058   //! Finds Standard_Type by index;
0059   //! returns NULL handle if not found
0060   static Standard_EXPORT Handle(Standard_Type)
0061     FindType      (const Standard_Integer theTypeIndex);
0062 
0063   //! Rinds index by Standard_Type;
0064   //! returns 0 if not found
0065   static Standard_EXPORT Standard_Integer
0066     FindTypeIndex (const Handle(Standard_Type)& theType);
0067 
0068   //! Binds Standard_Type to the map;
0069   //! returns index of bound type
0070   static Standard_EXPORT Standard_Integer
0071     BindType      (const Handle(Standard_Type)& theType);
0072 
0073   //! Clears map of types
0074   static Standard_EXPORT void
0075     ClearTypeMap  ();
0076 
0077 public:
0078   /**
0079   * Interface to the current model
0080   */
0081 
0082   //! Sets current model
0083   static Standard_EXPORT void
0084     SetCurrentModel (const Handle(TObj_Model)& theModel);
0085 
0086   //! Returns current model
0087   static Standard_EXPORT Handle(TObj_Model)
0088     GetCurrentModel();
0089 
0090   //! Unsets current model
0091   static Standard_EXPORT void
0092     UnSetCurrentModel ();
0093 
0094 public:
0095 
0096   //! Returns the version of application which wrote the currently read document.
0097   //! Returns 0 if it has not been set yet for the current document.
0098   static Standard_EXPORT Standard_Integer               GetAppVersion();
0099 
0100 private:
0101 
0102   //! Method for taking fields for map of models
0103   static Standard_EXPORT TColStd_SequenceOfTransient&   getModels();
0104 
0105   //! Method for taking fields for map types
0106   static Standard_EXPORT TColStd_IndexedMapOfTransient& getTypes();
0107 
0108   //! Method for taking fields for the Current model
0109   static Standard_EXPORT Handle(TObj_Model)&            getCurrentModel();
0110 
0111   //! Returns application version
0112   static Standard_EXPORT Standard_Integer&              getVersion();
0113 };
0114 
0115 #endif
0116 
0117 #ifdef _MSC_VER
0118 #pragma once
0119 #endif