0031120: Memory leak in BRepOffsetAPI_MakeOffset
[occt.git] / src / MAT2d / MAT2d_Mat2d.hxx
1 // Created on: 1992-09-22
2 // Created by: Gilles DEBARBOUILLE
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _MAT2d_Mat2d_HeaderFile
18 #define _MAT2d_Mat2d_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColStd_DataMapOfIntegerInteger.hxx>
27 #include <MAT_DataMapOfIntegerBisector.hxx>
28 #include <Standard_Real.hxx>
29 class MAT_ListOfEdge;
30 class MAT_ListOfBisector;
31 class MAT2d_Tool2d;
32 class MAT_Bisector;
33
34
35 //! this class contains the generic algoritm of
36 //! computation of the bisecting locus.
37 class MAT2d_Mat2d 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   //! Empty construtor.
45   Standard_EXPORT MAT2d_Mat2d(const Standard_Boolean IsOpenResult = Standard_False);
46   
47   Standard_EXPORT ~MAT2d_Mat2d();
48   
49   //! Algoritm of computation of the bisecting locus.
50   Standard_EXPORT void CreateMat (MAT2d_Tool2d& aTool);
51   
52   //! Algoritm of computation of the bisecting locus for
53   //! open wire.
54   Standard_EXPORT void CreateMatOpen (MAT2d_Tool2d& aTool);
55   
56   //! Returns <TRUE> if CreateMat has succeeded.
57   Standard_EXPORT Standard_Boolean IsDone() const;
58   
59   //! Initialize an iterator on the set of the roots
60   //! of the trees of bisectors.
61   Standard_EXPORT void Init();
62   
63   //! Return False if there is no more roots.
64   Standard_EXPORT Standard_Boolean More() const;
65   
66   //! Move to the next root.
67   Standard_EXPORT void Next();
68   
69   //! Returns the current root.
70   Standard_EXPORT Handle(MAT_Bisector) Bisector() const;
71   
72   //! Returns True if there are semi_infinite bisectors.
73   //! So there is a tree for each semi_infinte bisector.
74   Standard_EXPORT Standard_Boolean SemiInfinite() const;
75   
76   //! Returns the total number of bisectors.
77   Standard_EXPORT Standard_Integer NumberOfBisectors() const;
78
79
80
81
82 protected:
83
84
85
86
87
88 private:
89
90   
91   Standard_EXPORT void LoadBisectorsToRemove (Standard_Integer& noofbisectorstoremove, const Standard_Real distance1, const Standard_Real distance2, const Handle(MAT_Bisector)& bisector1, const Handle(MAT_Bisector)& bisector2, const Handle(MAT_Bisector)& bisector3, const Handle(MAT_Bisector)& bisector4);
92   
93   Standard_EXPORT void Intersect (MAT2d_Tool2d& atool, const Standard_Integer aside, Standard_Integer& noofbisectorstoremove, const Handle(MAT_Bisector)& bisector1, const Handle(MAT_Bisector)& bisector2);
94
95
96   Standard_Boolean myIsOpenResult;
97   Standard_Integer thenumberofbisectors;
98   Standard_Integer thenumberofedges;
99   Standard_Boolean semiInfinite;
100   Handle(MAT_ListOfEdge) theedgelist;
101   Handle(MAT_ListOfEdge) RemovedEdgesList;
102   TColStd_DataMapOfIntegerInteger typeofbisectortoremove;
103   MAT_DataMapOfIntegerBisector bisectoronetoremove;
104   MAT_DataMapOfIntegerBisector bisectortwotoremove;
105   MAT_DataMapOfIntegerBisector bisectormap;
106   Handle(MAT_ListOfBisector) roots;
107   Standard_Boolean isDone;
108
109
110 };
111
112
113
114
115
116
117
118 #endif // _MAT2d_Mat2d_HeaderFile