Back to home page

EIC code displayed by LXR

 
 

    


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

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