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