Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-08 09:16:48

0001 // Created on: 1993-04-29
0002 // Created by: Yves FRICAUD
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 _MAT_Graph_HeaderFile
0018 #define _MAT_Graph_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <MAT_DataMapOfIntegerArc.hxx>
0024 #include <MAT_DataMapOfIntegerBasicElt.hxx>
0025 #include <MAT_DataMapOfIntegerNode.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_Transient.hxx>
0028 class MAT_ListOfBisector;
0029 class MAT_Arc;
0030 class MAT_BasicElt;
0031 class MAT_Node;
0032 
0033 class MAT_Graph;
0034 DEFINE_STANDARD_HANDLE(MAT_Graph, Standard_Transient)
0035 
0036 //! The Class Graph permits the exploration of the
0037 //! Bisector Locus.
0038 class MAT_Graph : public Standard_Transient
0039 {
0040 
0041 public:
0042   //! Empty constructor.
0043   Standard_EXPORT MAT_Graph();
0044 
0045   //! Construct <me> from the result of the method
0046   //! <CreateMat> of the class <MAT> from <MAT>.
0047   //!
0048   //! <SemiInfinite> : if some bisector are infinites.
0049   //! <TheRoots>     : Set of the bisectors.
0050   //! <NbBasicElts>  : Number of Basic Elements.
0051   //! <NbArcs>       : Number of Arcs = Number of Bisectors.
0052   Standard_EXPORT void Perform(const Standard_Boolean            SemiInfinite,
0053                                const Handle(MAT_ListOfBisector)& TheRoots,
0054                                const Standard_Integer            NbBasicElts,
0055                                const Standard_Integer            NbArcs);
0056 
0057   //! Return the Arc of index <Index> in <theArcs>.
0058   Standard_EXPORT Handle(MAT_Arc) Arc(const Standard_Integer Index) const;
0059 
0060   //! Return the BasicElt of index <Index> in <theBasicElts>.
0061   Standard_EXPORT Handle(MAT_BasicElt) BasicElt(const Standard_Integer Index) const;
0062 
0063   //! Return the Node of index <Index> in <theNodes>.
0064   Standard_EXPORT Handle(MAT_Node) Node(const Standard_Integer Index) const;
0065 
0066   //! Return the number of arcs of <me>.
0067   Standard_EXPORT Standard_Integer NumberOfArcs() const;
0068 
0069   //! Return the number of nodes of <me>.
0070   Standard_EXPORT Standard_Integer NumberOfNodes() const;
0071 
0072   //! Return the number of basic elements of <me>.
0073   Standard_EXPORT Standard_Integer NumberOfBasicElts() const;
0074 
0075   //! Return the number of infinites nodes of <me>.
0076   Standard_EXPORT Standard_Integer NumberOfInfiniteNodes() const;
0077 
0078   //! Merge two BasicElts.  The End of the BasicElt Elt1
0079   //! of  IndexElt1 becomes The End of the BasicElt Elt2
0080   //! of  IndexElt2.   Elt2 is replaced in  the  arcs  by
0081   //! Elt1, Elt2 is eliminated.
0082   //!
0083   //! <MergeArc1> is True  if the fusion  of the BasicElts  =>
0084   //! a fusion  of two Arcs which separated  the same  elements.
0085   //! In this case <GeomIndexArc1> and  <GeomIndexArc2>  are the
0086   //! Geometric  Index of this  arcs.
0087   //!
0088   //! If the  BasicElt corresponds to a close line ,
0089   //! the StartArc and the EndArc of Elt1 can separate the same
0090   //! elements .
0091   //! In this case there is a fusion of this arcs, <MergeArc2>
0092   //! is true and <GeomIndexArc3> and  <GeomIndexArc4>  are the
0093   //! Geometric  Index of this  arcs.
0094   Standard_EXPORT void FusionOfBasicElts(const Standard_Integer IndexElt1,
0095                                          const Standard_Integer IndexElt2,
0096                                          Standard_Boolean&      MergeArc1,
0097                                          Standard_Integer&      GeomIndexArc1,
0098                                          Standard_Integer&      GeomIndexArc2,
0099                                          Standard_Boolean&      MergeArc2,
0100                                          Standard_Integer&      GeomIndexArc3,
0101                                          Standard_Integer&      GeomIndexArc4);
0102 
0103   Standard_EXPORT void CompactArcs();
0104 
0105   Standard_EXPORT void CompactNodes();
0106 
0107   Standard_EXPORT void ChangeBasicElts(const MAT_DataMapOfIntegerBasicElt& NewMap);
0108 
0109   Standard_EXPORT Handle(MAT_BasicElt) ChangeBasicElt(const Standard_Integer Index);
0110 
0111   DEFINE_STANDARD_RTTIEXT(MAT_Graph, Standard_Transient)
0112 
0113 protected:
0114 private:
0115   //! Merge two Arcs.  the second node of <Arc2> becomes
0116   //! the  first node  of <Arc1>.  Update  of the  first
0117   //! node and the neighbours of <Arc1>.
0118   //! <Arc2> is eliminated.
0119   Standard_EXPORT void FusionOfArcs(const Handle(MAT_Arc)& Arc1, const Handle(MAT_Arc)& Arc2);
0120 
0121   Standard_EXPORT void UpDateNodes(Standard_Integer& Index);
0122 
0123   MAT_DataMapOfIntegerArc      theArcs;
0124   MAT_DataMapOfIntegerBasicElt theBasicElts;
0125   MAT_DataMapOfIntegerNode     theNodes;
0126   Standard_Integer             numberOfArcs;
0127   Standard_Integer             numberOfNodes;
0128   Standard_Integer             numberOfBasicElts;
0129   Standard_Integer             numberOfInfiniteNodes;
0130 };
0131 
0132 #endif // _MAT_Graph_HeaderFile