Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:03:19

0001 // Created on: 1993-07-19
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GeomTools_Curve2dSet_HeaderFile
0018 #define _GeomTools_Curve2dSet_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Transient.hxx>
0025 #include <NCollection_IndexedMap.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_OStream.hxx>
0028 #include <Standard_IStream.hxx>
0029 #include <Message_ProgressRange.hxx>
0030 
0031 class Geom2d_Curve;
0032 
0033 //! Stores a set of Curves from Geom2d.
0034 class GeomTools_Curve2dSet
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Returns an empty set of Curves.
0040   Standard_EXPORT GeomTools_Curve2dSet();
0041 
0042   //! Clears the content of the set.
0043   Standard_EXPORT void Clear();
0044 
0045   //! Incorporate a new Curve in the set and returns
0046   //! its index.
0047   Standard_EXPORT int Add(const occ::handle<Geom2d_Curve>& C);
0048 
0049   //! Returns the Curve of index <I>.
0050   Standard_EXPORT occ::handle<Geom2d_Curve> Curve2d(const int I) const;
0051 
0052   //! Returns the index of <L>.
0053   Standard_EXPORT int Index(const occ::handle<Geom2d_Curve>& C) const;
0054 
0055   //! Dumps the content of me on the stream <OS>.
0056   Standard_EXPORT void Dump(Standard_OStream& OS) 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(
0061     Standard_OStream&            OS,
0062     const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
0063 
0064   //! Reads the content of me from the stream <IS>.
0065   //! me is first cleared.
0066   Standard_EXPORT void Read(Standard_IStream&            IS,
0067                             const Message_ProgressRange& theProgress = Message_ProgressRange());
0068 
0069   //! Dumps the curve on the stream, if compact is True
0070   //! use the compact format that can be read back.
0071   Standard_EXPORT static void PrintCurve2d(const occ::handle<Geom2d_Curve>& C,
0072                                            Standard_OStream&                OS,
0073                                            const bool                       compact = false);
0074 
0075   //! Reads the curve from the stream. The curve is
0076   //! assumed to have been written with the Print
0077   //! method (compact = True).
0078   Standard_EXPORT static occ::handle<Geom2d_Curve> ReadCurve2d(Standard_IStream& IS);
0079 
0080 private:
0081   NCollection_IndexedMap<occ::handle<Standard_Transient>> myMap;
0082 };
0083 
0084 #endif // _GeomTools_Curve2dSet_HeaderFile