Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:16:51

0001 // Created on: 2004-05-18
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_Curve2dSet_HeaderFile
0017 #define _BinTools_Curve2dSet_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_IndexedMap.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_OStream.hxx>
0027 #include <Standard_IStream.hxx>
0028 
0029 #include <Message_ProgressRange.hxx>
0030 #include <BinTools_OStream.hxx>
0031 
0032 class Geom2d_Curve;
0033 
0034 //! Stores a set of Curves from Geom2d in binary format
0035 class BinTools_Curve2dSet
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! Returns an empty set of Curves.
0041   Standard_EXPORT BinTools_Curve2dSet();
0042 
0043   //! Clears the content of the set.
0044   Standard_EXPORT void Clear();
0045 
0046   //! Incorporate a new Curve in the set and returns
0047   //! its index.
0048   Standard_EXPORT int Add(const occ::handle<Geom2d_Curve>& C);
0049 
0050   //! Returns the Curve of index <I>.
0051   Standard_EXPORT occ::handle<Geom2d_Curve> Curve2d(const int I) const;
0052 
0053   //! Returns the index of <L>.
0054   Standard_EXPORT int Index(const occ::handle<Geom2d_Curve>& C) const;
0055 
0056   //! Dumps the content of me on the stream <OS>.
0057   Standard_EXPORT void Dump(Standard_OStream& OS) const;
0058 
0059   //! Writes the content of me on the stream <OS> in a
0060   //! format that can be read back by Read.
0061   Standard_EXPORT void Write(Standard_OStream&            OS,
0062                              const Message_ProgressRange& theRange = Message_ProgressRange()) const;
0063 
0064   //! Reads the content of me from the stream <IS>. me
0065   //! is first cleared.
0066   Standard_EXPORT void Read(Standard_IStream&            IS,
0067                             const Message_ProgressRange& theRange = Message_ProgressRange());
0068 
0069   //! Dumps the curve on the binary stream, that can be read back.
0070   Standard_EXPORT static void WriteCurve2d(const occ::handle<Geom2d_Curve>& C,
0071                                            BinTools_OStream&                OS);
0072 
0073   //! Reads the curve from the stream. The curve is
0074   //! assumed to have been written with the Write
0075   //! method.
0076   Standard_EXPORT static Standard_IStream& ReadCurve2d(Standard_IStream&          IS,
0077                                                        occ::handle<Geom2d_Curve>& C);
0078 
0079 private:
0080   NCollection_IndexedMap<occ::handle<Standard_Transient>> myMap;
0081 };
0082 
0083 #endif // _BinTools_Curve2dSet_HeaderFile