42cf5bc1 |
1 | // Created on: 1994-10-04 |
2 | // Created by: Yves FRICAUD |
3 | // Copyright (c) 1994-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 _BRepMAT2d_Explorer_HeaderFile |
18 | #define _BRepMAT2d_Explorer_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <MAT2d_SequenceOfSequenceOfCurve.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <TopoDS_Shape.hxx> |
27 | #include <TColStd_SequenceOfBoolean.hxx> |
28 | #include <TopTools_IndexedDataMapOfShapeShape.hxx> |
42cf5bc1 |
29 | #include <TColGeom2d_SequenceOfCurve.hxx> |
30 | class TopoDS_Face; |
31 | class TopoDS_Wire; |
32 | class Geom2d_Curve; |
42cf5bc1 |
33 | |
34 | |
35 | //! Construct an explorer from wires, face, set of curves |
36 | //! from Geom2d to compute the bisecting Locus. |
37 | class BRepMAT2d_Explorer |
38 | { |
39 | public: |
40 | |
41 | DEFINE_STANDARD_ALLOC |
42 | |
43 | |
44 | Standard_EXPORT BRepMAT2d_Explorer(); |
45 | |
46 | Standard_EXPORT BRepMAT2d_Explorer(const TopoDS_Face& aFace); |
47 | |
48 | //! Clear the contents of <me>. |
49 | Standard_EXPORT void Clear(); |
50 | |
51 | Standard_EXPORT void Perform (const TopoDS_Face& aFace); |
52 | |
53 | //! Returns the Number of contours. |
54 | Standard_EXPORT Standard_Integer NumberOfContours() const; |
55 | |
56 | //! Returns the Number of Curves in the Contour number |
57 | //! <IndexContour>. |
58 | Standard_EXPORT Standard_Integer NumberOfCurves (const Standard_Integer IndexContour) const; |
59 | |
60 | //! Initialisation of an Iterator on the curves of |
61 | //! the Contour number <IndexContour>. |
62 | Standard_EXPORT void Init (const Standard_Integer IndexContour); |
63 | |
64 | //! Return False if there is no more curves on the Contour |
65 | //! initialised by the method Init. |
66 | Standard_EXPORT Standard_Boolean More() const; |
67 | |
68 | //! Move to the next curve of the current Contour. |
69 | Standard_EXPORT void Next(); |
70 | |
71 | //! Returns the current curve on the current Contour. |
72 | Standard_EXPORT Handle(Geom2d_Curve) Value() const; |
73 | |
74 | Standard_EXPORT TopoDS_Shape Shape() const; |
75 | |
76 | Standard_EXPORT const TColGeom2d_SequenceOfCurve& Contour (const Standard_Integer IndexContour) const; |
77 | |
78 | Standard_EXPORT Standard_Boolean IsModified (const TopoDS_Shape& aShape) const; |
79 | |
80 | //! If the shape is not modified, returns the shape itself. |
81 | Standard_EXPORT TopoDS_Shape ModifiedShape (const TopoDS_Shape& aShape) const; |
82 | |
83 | Standard_EXPORT const TColStd_SequenceOfBoolean& GetIsClosed() const; |
84 | |
85 | |
86 | |
87 | |
88 | protected: |
89 | |
90 | |
91 | |
92 | |
93 | |
94 | private: |
95 | |
96 | |
54adc5e9 |
97 | //! Construction from a set of curves from Geom2d. |
42cf5bc1 |
98 | //! Assume the orientation of the closed lines are |
99 | //! compatible. (ie if A is in B, the orientation of A and B |
100 | //! has to be different. |
101 | //! |
102 | //! Assume the explo contains only lines located in the |
103 | //! area where the bisecting locus will be computed. |
104 | //! |
105 | //! Assume a line don't cross itself or an other line. |
106 | //! |
107 | //! A contour has to be construct in adding each curve in |
108 | //! respect to the sense of the contour. |
109 | //! |
110 | //! afirst point of a curve in a contour is equal to the last |
111 | //! point of the precedent curve. |
112 | //! |
113 | //! No control of this rules is done in the construction |
114 | //! of the explorer |
115 | Standard_EXPORT void Add (const TopoDS_Wire& Spine, const TopoDS_Face& aFace, TopoDS_Face& aNewFace); |
116 | |
117 | Standard_EXPORT void NewContour(); |
118 | |
119 | //! Add the curve <aCurve> at me. |
120 | Standard_EXPORT void Add (const Handle(Geom2d_Curve)& aCurve); |
121 | |
122 | |
123 | MAT2d_SequenceOfSequenceOfCurve theCurves; |
124 | Standard_Integer current; |
125 | Standard_Integer currentContour; |
126 | TopoDS_Shape myShape; |
127 | TColStd_SequenceOfBoolean myIsClosed; |
128 | TopTools_IndexedDataMapOfShapeShape myModifShapes; |
129 | |
130 | |
131 | }; |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | #endif // _BRepMAT2d_Explorer_HeaderFile |