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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepMAT2d_Explorer_HeaderFile
18 #define _BRepMAT2d_Explorer_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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>
37 //! Construct an explorer from wires, face, set of curves
38 //! from Geom2d to compute the bisecting Locus.
39 class BRepMAT2d_Explorer
46 Standard_EXPORT BRepMAT2d_Explorer();
48 Standard_EXPORT BRepMAT2d_Explorer(const TopoDS_Face& aFace);
50 //! Clear the contents of <me>.
51 Standard_EXPORT void Clear();
53 Standard_EXPORT void Perform (const TopoDS_Face& aFace);
55 //! Returns the Number of contours.
56 Standard_EXPORT Standard_Integer NumberOfContours() const;
58 //! Returns the Number of Curves in the Contour number
60 Standard_EXPORT Standard_Integer NumberOfCurves (const Standard_Integer IndexContour) const;
62 //! Initialisation of an Iterator on the curves of
63 //! the Contour number <IndexContour>.
64 Standard_EXPORT void Init (const Standard_Integer IndexContour);
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;
70 //! Move to the next curve of the current Contour.
71 Standard_EXPORT void Next();
73 //! Returns the current curve on the current Contour.
74 Standard_EXPORT Handle(Geom2d_Curve) Value() const;
76 Standard_EXPORT TopoDS_Shape Shape() const;
78 Standard_EXPORT const TColGeom2d_SequenceOfCurve& Contour (const Standard_Integer IndexContour) const;
80 Standard_EXPORT Standard_Boolean IsModified (const TopoDS_Shape& aShape) const;
82 //! If the shape is not modified, returns the shape itself.
83 Standard_EXPORT TopoDS_Shape ModifiedShape (const TopoDS_Shape& aShape) const;
85 Standard_EXPORT const TColStd_SequenceOfBoolean& GetIsClosed() const;
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.
104 //! Assume the explo contains only lines located in the
105 //! area where the bisecting locus will be computed.
107 //! Assume a line don't cross itself or an other line.
109 //! A contour has to be construct in adding each curve in
110 //! respect to the sense of the contour.
112 //! afirst point of a curve in a contour is equal to the last
113 //! point of the precedent curve.
115 //! No control of this rules is done in the construction
117 Standard_EXPORT void Add (const TopoDS_Wire& Spine, const TopoDS_Face& aFace, TopoDS_Face& aNewFace);
119 Standard_EXPORT void NewContour();
121 //! Add the curve <aCurve> at me.
122 Standard_EXPORT void Add (const Handle(Geom2d_Curve)& aCurve);
125 MAT2d_SequenceOfSequenceOfCurve theCurves;
126 Standard_Integer current;
127 Standard_Integer currentContour;
128 TopoDS_Shape myShape;
129 TColStd_SequenceOfBoolean myIsClosed;
130 TopTools_IndexedDataMapOfShapeShape myModifShapes;
141 #endif // _BRepMAT2d_Explorer_HeaderFile