Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:42:36

0001 // Created on: 2004-05-20
0002 // Created by: Sergey ZARITCHNY <szy@opencascade.com>
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 #ifndef _BinTools_SurfaceSet_HeaderFile
0017 #define _BinTools_SurfaceSet_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TColStd_IndexedMapOfTransient.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_OStream.hxx>
0026 #include <Standard_IStream.hxx>
0027 
0028 #include <Message_ProgressRange.hxx>
0029 #include <BinTools_OStream.hxx>
0030 
0031 class Geom_Surface;
0032 
0033 //! Stores a set of Surfaces from Geom in binary format.
0034 class BinTools_SurfaceSet
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Returns an empty set of Surfaces.
0040   Standard_EXPORT BinTools_SurfaceSet();
0041 
0042   //! Clears the content of the set.
0043   Standard_EXPORT void Clear();
0044 
0045   //! Incorporate a new Surface in the  set and returns
0046   //! its index.
0047   Standard_EXPORT Standard_Integer Add(const Handle(Geom_Surface)& S);
0048 
0049   //! Returns the Surface of index <I>.
0050   Standard_EXPORT Handle(Geom_Surface) Surface(const Standard_Integer I) const;
0051 
0052   //! Returns the index of <L>.
0053   Standard_EXPORT Standard_Integer Index(const Handle(Geom_Surface)& S) const;
0054 
0055   //! Writes the content of  me  on the stream <OS> in
0056   //! binary format that can be read back by Read.
0057   Standard_EXPORT void Write(Standard_OStream&            OS,
0058                              const Message_ProgressRange& theRange = Message_ProgressRange()) const;
0059 
0060   //! Reads the content of me from the  stream  <IS>. me
0061   //! is first cleared.
0062   Standard_EXPORT void Read(Standard_IStream&            IS,
0063                             const Message_ProgressRange& therange = Message_ProgressRange());
0064 
0065   //! Dumps the surface on the stream in binary
0066   //! format that can be read back.
0067   Standard_EXPORT static void WriteSurface(const Handle(Geom_Surface)& S, BinTools_OStream& OS);
0068 
0069   //! Reads the surface  from  the stream.  The  surface  is
0070   //! assumed   to have  been  written  with  the Write
0071   //! method.
0072   Standard_EXPORT static Standard_IStream& ReadSurface(Standard_IStream&     IS,
0073                                                        Handle(Geom_Surface)& S);
0074 
0075 private:
0076   TColStd_IndexedMapOfTransient myMap;
0077 };
0078 
0079 #endif // _BinTools_SurfaceSet_HeaderFile