Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:00

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_CurveSet_HeaderFile
0017 #define _BinTools_CurveSet_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_Curve;
0032 
0033 
0034 //! Stores a set of Curves from Geom in binary format.
0035 class BinTools_CurveSet 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Returns an empty set of Curves.
0043   Standard_EXPORT BinTools_CurveSet();
0044   
0045   //! Clears the content of the set.
0046   Standard_EXPORT void Clear();
0047   
0048   //! Incorporate a new Curve in the  set and returns
0049   //! its index.
0050   Standard_EXPORT Standard_Integer Add (const Handle(Geom_Curve)& C);
0051   
0052   //! Returns the Curve of index <I>.
0053   Standard_EXPORT Handle(Geom_Curve) Curve (const Standard_Integer I) const;
0054   
0055   //! Returns the index of <L>.
0056   Standard_EXPORT Standard_Integer Index (const Handle(Geom_Curve)& C) const;
0057   
0058   //! Writes the content of  me  on the stream <OS> in a
0059   //! format that can be read back by Read.
0060   Standard_EXPORT void Write (Standard_OStream& OS,
0061                               const Message_ProgressRange& theRange = Message_ProgressRange()) const;
0062   
0063   //! Reads the content of me from the  stream  <IS>. me
0064   //! is first cleared.
0065   Standard_EXPORT void Read (Standard_IStream& IS,
0066                              const Message_ProgressRange& theRange = Message_ProgressRange());
0067   
0068   //! Dumps the curve on the stream in binary format
0069   //! that can be read back.
0070   Standard_EXPORT static void WriteCurve (const Handle(Geom_Curve)& C, BinTools_OStream& OS);
0071   
0072   //! Reads the curve  from  the stream.  The  curve  is
0073   //! assumed  to have  been  written  with  the Write
0074   //! method
0075   Standard_EXPORT static Standard_IStream& ReadCurve (Standard_IStream& IS, Handle(Geom_Curve)& C);
0076 
0077 private:
0078 
0079   TColStd_IndexedMapOfTransient myMap;
0080 
0081 };
0082 
0083 #endif // _BinTools_CurveSet_HeaderFile