Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-06 08:33:34

0001 // Created on: 1993-07-16
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 _TopTools_LocationSet_HeaderFile
0018 #define _TopTools_LocationSet_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopLoc_IndexedMapOfLocation.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_OStream.hxx>
0026 #include <Standard_IStream.hxx>
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class TopLoc_Location;
0030 
0031 //! The class LocationSet stores a set of location in
0032 //! a relocatable state.
0033 //!
0034 //! It can be created from Locations.
0035 //!
0036 //! It can create Locations.
0037 //!
0038 //! It can be write and read from a stream.
0039 class TopTools_LocationSet
0040 {
0041 public:
0042   DEFINE_STANDARD_ALLOC
0043 
0044   //! Returns an empty set of locations.
0045   Standard_EXPORT TopTools_LocationSet();
0046 
0047   //! Clears the content of the set.
0048   Standard_EXPORT void Clear();
0049 
0050   //! Incorporate a new Location in the  set and returns
0051   //! its index.
0052   Standard_EXPORT Standard_Integer Add(const TopLoc_Location& L);
0053 
0054   //! Returns the location of index <I>.
0055   Standard_EXPORT const TopLoc_Location& Location(const Standard_Integer I) const;
0056 
0057   //! Returns the index of <L>.
0058   Standard_EXPORT Standard_Integer Index(const TopLoc_Location& L) const;
0059 
0060   //! Dumps the content of me on the stream <OS>.
0061   Standard_EXPORT void Dump(Standard_OStream& OS) const;
0062 
0063   //! Writes the content of  me  on the stream <OS> in a
0064   //! format that can be read back by Read.
0065   Standard_EXPORT void Write(
0066     Standard_OStream&            OS,
0067     const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
0068 
0069   //! Reads the content of me from the  stream  <IS>. me
0070   //! is first cleared.
0071   Standard_EXPORT void Read(Standard_IStream&            IS,
0072                             const Message_ProgressRange& theProgress = Message_ProgressRange());
0073 
0074 private:
0075   TopLoc_IndexedMapOfLocation myMap;
0076 };
0077 
0078 #endif // _TopTools_LocationSet_HeaderFile