Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:21:02

0001 // Created on: 1992-09-22
0002 // Created by: Gilles DEBARBOUILLE
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 _MAT2d_Mat2d_HeaderFile
0018 #define _MAT2d_Mat2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <NCollection_DataMap.hxx>
0027 #include <MAT_Bisector.hxx>
0028 #include <Standard_Real.hxx>
0029 class MAT_ListOfEdge;
0030 class MAT_ListOfBisector;
0031 class MAT2d_Tool2d;
0032 class MAT_Bisector;
0033 
0034 //! this class contains the generic algorithm of
0035 //! computation of the bisecting locus.
0036 class MAT2d_Mat2d
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Empty constructor.
0042   Standard_EXPORT MAT2d_Mat2d(const bool IsOpenResult = false);
0043 
0044   Standard_EXPORT ~MAT2d_Mat2d();
0045 
0046   //! Algorithm of computation of the bisecting locus.
0047   Standard_EXPORT void CreateMat(MAT2d_Tool2d& aTool);
0048 
0049   //! Algorithm of computation of the bisecting locus for
0050   //! open wire.
0051   Standard_EXPORT void CreateMatOpen(MAT2d_Tool2d& aTool);
0052 
0053   //! Returns <TRUE> if CreateMat has succeeded.
0054   Standard_EXPORT bool IsDone() const;
0055 
0056   //! Initialize an iterator on the set of the roots
0057   //! of the trees of bisectors.
0058   Standard_EXPORT void Init();
0059 
0060   //! Return False if there is no more roots.
0061   Standard_EXPORT bool More() const;
0062 
0063   //! Move to the next root.
0064   Standard_EXPORT void Next();
0065 
0066   //! Returns the current root.
0067   Standard_EXPORT occ::handle<MAT_Bisector> Bisector() const;
0068 
0069   //! Returns True if there are semi_infinite bisectors.
0070   //! So there is a tree for each semi_infinte bisector.
0071   Standard_EXPORT bool SemiInfinite() const;
0072 
0073   //! Returns the total number of bisectors.
0074   Standard_EXPORT int NumberOfBisectors() const;
0075 
0076 private:
0077   Standard_EXPORT void LoadBisectorsToRemove(int&                             noofbisectorstoremove,
0078                                              const double                     distance1,
0079                                              const double                     distance2,
0080                                              const occ::handle<MAT_Bisector>& bisector1,
0081                                              const occ::handle<MAT_Bisector>& bisector2,
0082                                              const occ::handle<MAT_Bisector>& bisector3,
0083                                              const occ::handle<MAT_Bisector>& bisector4);
0084 
0085   Standard_EXPORT void Intersect(MAT2d_Tool2d&                    atool,
0086                                  const int                        aside,
0087                                  int&                             noofbisectorstoremove,
0088                                  const occ::handle<MAT_Bisector>& bisector1,
0089                                  const occ::handle<MAT_Bisector>& bisector2);
0090 
0091   bool                                                myIsOpenResult;
0092   int                                                 thenumberofbisectors;
0093   int                                                 thenumberofedges;
0094   bool                                                semiInfinite;
0095   occ::handle<MAT_ListOfEdge>                         theedgelist;
0096   occ::handle<MAT_ListOfEdge>                         RemovedEdgesList;
0097   NCollection_DataMap<int, int>                       typeofbisectortoremove;
0098   NCollection_DataMap<int, occ::handle<MAT_Bisector>> bisectoronetoremove;
0099   NCollection_DataMap<int, occ::handle<MAT_Bisector>> bisectortwotoremove;
0100   NCollection_DataMap<int, occ::handle<MAT_Bisector>> bisectormap;
0101   occ::handle<MAT_ListOfBisector>                     roots;
0102   bool                                                isDone;
0103 };
0104 
0105 #endif // _MAT2d_Mat2d_HeaderFile