Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:14

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 
0034 class MAT_Graph;
0035 DEFINE_STANDARD_HANDLE(MAT_Graph, Standard_Transient)
0036 
0037 //! The Class Graph permits the exploration of the
0038 //! Bisector Locus.
0039 class MAT_Graph : public Standard_Transient
0040 {
0041 
0042 public:
0043 
0044   
0045   //! Empty constructor.
0046   Standard_EXPORT MAT_Graph();
0047   
0048   //! Construct <me> from the result of the method
0049   //! <CreateMat> of the class <MAT> from <MAT>.
0050   //!
0051   //! <SemiInfinite> : if some bisector are infinites.
0052   //! <TheRoots>     : Set of the bisectors.
0053   //! <NbBasicElts>  : Number of Basic Elements.
0054   //! <NbArcs>       : Number of Arcs = Number of Bisectors.
0055   Standard_EXPORT void Perform (const Standard_Boolean SemiInfinite, const Handle(MAT_ListOfBisector)& TheRoots, const Standard_Integer NbBasicElts, 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, const Standard_Integer IndexElt2, Standard_Boolean& MergeArc1, Standard_Integer& GeomIndexArc1, Standard_Integer& GeomIndexArc2, Standard_Boolean& MergeArc2, Standard_Integer& GeomIndexArc3, Standard_Integer& GeomIndexArc4);
0095   
0096   Standard_EXPORT void CompactArcs();
0097   
0098   Standard_EXPORT void CompactNodes();
0099   
0100   Standard_EXPORT void ChangeBasicElts (const MAT_DataMapOfIntegerBasicElt& NewMap);
0101   
0102   Standard_EXPORT Handle(MAT_BasicElt) ChangeBasicElt (const Standard_Integer Index);
0103 
0104 
0105 
0106 
0107   DEFINE_STANDARD_RTTIEXT(MAT_Graph,Standard_Transient)
0108 
0109 protected:
0110 
0111 
0112 
0113 
0114 private:
0115 
0116   
0117   //! Merge two Arcs.  the second node of <Arc2> becomes
0118   //! the  first node  of <Arc1>.  Update  of the  first
0119   //! node and the neighbours of <Arc1>.
0120   //! <Arc2> is eliminated.
0121   Standard_EXPORT void FusionOfArcs (const Handle(MAT_Arc)& Arc1, const Handle(MAT_Arc)& Arc2);
0122   
0123   Standard_EXPORT void UpDateNodes (Standard_Integer& Index);
0124 
0125   MAT_DataMapOfIntegerArc theArcs;
0126   MAT_DataMapOfIntegerBasicElt theBasicElts;
0127   MAT_DataMapOfIntegerNode theNodes;
0128   Standard_Integer numberOfArcs;
0129   Standard_Integer numberOfNodes;
0130   Standard_Integer numberOfBasicElts;
0131   Standard_Integer numberOfInfiniteNodes;
0132 
0133 
0134 };
0135 
0136 
0137 
0138 
0139 
0140 
0141 
0142 #endif // _MAT_Graph_HeaderFile