Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:16:21

0001 // Created on: 1994-09-02
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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 _IFSelect_PacketList_HeaderFile
0018 #define _IFSelect_PacketList_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Interface_IntList.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <TCollection_AsciiString.hxx>
0025 #include <Standard_Transient.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <NCollection_HSequence.hxx>
0028 class Interface_InterfaceModel;
0029 class Interface_EntityIterator;
0030 
0031 //! This class gives a simple way to return then consult a
0032 //! list of packets, determined from the content of a Model,
0033 //! by various criteria.
0034 //!
0035 //! It allows to describe several lists with entities from a
0036 //! given model, possibly more than one list knowing every entity,
0037 //! and to determine the remaining list (entities in no lists) and
0038 //! the duplications (with their count).
0039 class IFSelect_PacketList : public Standard_Transient
0040 {
0041 
0042 public:
0043   //! Creates a PackList, empty, ready to receive entities from a
0044   //! given Model
0045   Standard_EXPORT IFSelect_PacketList(const occ::handle<Interface_InterfaceModel>& model);
0046 
0047   //! Sets a name to a packet list : this makes easier a general
0048   //! routine to print it. Default is "Packets"
0049   Standard_EXPORT void SetName(const char* const name);
0050 
0051   //! Returns the recorded name for a packet list
0052   Standard_EXPORT const char* Name() const;
0053 
0054   //! Returns the Model of reference
0055   Standard_EXPORT occ::handle<Interface_InterfaceModel> Model() const;
0056 
0057   //! Declares a new Packet, ready to be filled
0058   //! The entities to be added will be added to this Packet
0059   Standard_EXPORT void AddPacket();
0060 
0061   //! Adds an entity from the Model into the current packet for Add
0062   Standard_EXPORT void Add(const occ::handle<Standard_Transient>& ent);
0063 
0064   //! Adds an list of entities into the current packet for Add
0065   Standard_EXPORT void AddList(
0066     const occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>& list);
0067 
0068   //! Returns the count of non-empty packets
0069   Standard_EXPORT int NbPackets() const;
0070 
0071   //! Returns the count of entities in a Packet given its rank, or 0
0072   Standard_EXPORT int NbEntities(const int numpack) const;
0073 
0074   //! Returns the content of a Packet given its rank
0075   //! Null Handle if <numpack> is out of range
0076   Standard_EXPORT Interface_EntityIterator Entities(const int numpack) const;
0077 
0078   //! Returns the highest number of packets which know a same entity
0079   //! For no duplication, should be one
0080   Standard_EXPORT int HighestDuplicationCount() const;
0081 
0082   //! Returns the count of entities duplicated :
0083   //! <count> times, if <andmore> is False, or
0084   //! <count> or more times, if <andmore> is True
0085   //! See Duplicated for more details
0086   Standard_EXPORT int NbDuplicated(const int count, const bool andmore) const;
0087 
0088   //! Returns a list of entities duplicated :
0089   //! <count> times, if <andmore> is False, or
0090   //! <count> or more times, if <andmore> is True
0091   //! Hence, count=2 & andmore=True gives all duplicated entities
0092   //! count=1 gives non-duplicated entities (in only one packet)
0093   //! count=0 gives remaining entities (in no packet at all)
0094   Standard_EXPORT Interface_EntityIterator Duplicated(const int count, const bool andmore) const;
0095 
0096   DEFINE_STANDARD_RTTIEXT(IFSelect_PacketList, Standard_Transient)
0097 
0098 private:
0099   occ::handle<Interface_InterfaceModel> themodel;
0100   NCollection_Array1<int>               thedupls;
0101   Interface_IntList                     thepacks;
0102   NCollection_Array1<int>               theflags;
0103   int                                   thelast;
0104   bool                                  thebegin;
0105   TCollection_AsciiString               thename;
0106 };
0107 
0108 #endif // _IFSelect_PacketList_HeaderFile