Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:16:41

0001 // Created on: 1992-09-23
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-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 _IFGraph_Compare_HeaderFile
0018 #define _IFGraph_Compare_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Interface_Graph.hxx>
0025 #include <Interface_GraphContent.hxx>
0026 class Standard_Transient;
0027 class Interface_EntityIterator;
0028 
0029 //! this class evaluates effect of two compared sub-parts :
0030 //! cumulation (union), common part (intersection-overlapping)
0031 //! part specific to first sub-part or to the second one
0032 //! Results are kept in a Graph, several question can be set
0033 //! Basic Iteration gives Cumulation (union)
0034 class IFGraph_Compare : public Interface_GraphContent
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! creates empty Compare, ready to work
0040   Standard_EXPORT IFGraph_Compare(const Interface_Graph& agraph);
0041 
0042   //! adds an entity and its shared ones to the list :
0043   //! first True means adds to the first sub-list, else to the 2nd
0044   Standard_EXPORT void GetFromEntity(const occ::handle<Standard_Transient>& ent, const bool first);
0045 
0046   //! adds a list of entities (as an iterator) as such, that is,
0047   //! their shared entities are not considered (use AllShared to
0048   //! have them)
0049   //! first True means adds to the first sub-list, else to the 2nd
0050   Standard_EXPORT void GetFromIter(const Interface_EntityIterator& iter, const bool first);
0051 
0052   //! merges the second list into the first one, hence the second
0053   //! list is empty
0054   Standard_EXPORT void Merge();
0055 
0056   //! Removes the contents of second list
0057   Standard_EXPORT void RemoveSecond();
0058 
0059   //! Keeps only Common part, sets it as First list and clears
0060   //! second list
0061   Standard_EXPORT void KeepCommon();
0062 
0063   //! Allows to restart on a new data set
0064   Standard_EXPORT void ResetData();
0065 
0066   //! Recomputes result of comparing to sub-parts
0067   Standard_EXPORT void Evaluate() override;
0068 
0069   //! returns entities common to the both parts
0070   Standard_EXPORT Interface_EntityIterator Common() const;
0071 
0072   //! returns entities which are exclusively in the first list
0073   Standard_EXPORT Interface_EntityIterator FirstOnly() const;
0074 
0075   //! returns entities which are exclusively in the second part
0076   Standard_EXPORT Interface_EntityIterator SecondOnly() const;
0077 
0078 private:
0079   Interface_Graph thegraph;
0080 };
0081 
0082 #endif // _IFGraph_Compare_HeaderFile