Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:10

0001 // Created on: 1994-10-04
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1994-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 _BRepMAT2d_Explorer_HeaderFile
0018 #define _BRepMAT2d_Explorer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Geom2d_Curve.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <TopTools_ShapeMapHasher.hxx>
0029 #include <NCollection_IndexedDataMap.hxx>
0030 class TopoDS_Face;
0031 class TopoDS_Wire;
0032 class Geom2d_Curve;
0033 
0034 //! Construct an explorer from wires, face, set of curves
0035 //! from Geom2d to compute the bisecting Locus.
0036 class BRepMAT2d_Explorer
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   Standard_EXPORT BRepMAT2d_Explorer();
0042 
0043   Standard_EXPORT BRepMAT2d_Explorer(const TopoDS_Face& aFace);
0044 
0045   //! Clear the contents of <me>.
0046   Standard_EXPORT void Clear();
0047 
0048   Standard_EXPORT void Perform(const TopoDS_Face& aFace);
0049 
0050   //! Returns the Number of contours.
0051   Standard_EXPORT int NumberOfContours() const;
0052 
0053   //! Returns the Number of Curves in the Contour number
0054   //! <IndexContour>.
0055   Standard_EXPORT int NumberOfCurves(const int IndexContour) const;
0056 
0057   //! Initialisation of an Iterator on the curves of
0058   //! the Contour number <IndexContour>.
0059   Standard_EXPORT void Init(const int IndexContour);
0060 
0061   //! Return False if there is no more curves on the Contour
0062   //! initialised by the method Init.
0063   Standard_EXPORT bool More() const;
0064 
0065   //! Move to the next curve of the current Contour.
0066   Standard_EXPORT void Next();
0067 
0068   //! Returns the current curve on the current Contour.
0069   Standard_EXPORT occ::handle<Geom2d_Curve> Value() const;
0070 
0071   Standard_EXPORT TopoDS_Shape Shape() const;
0072 
0073   Standard_EXPORT const NCollection_Sequence<occ::handle<Geom2d_Curve>>& Contour(
0074     const int IndexContour) const;
0075 
0076   Standard_EXPORT bool IsModified(const TopoDS_Shape& aShape) const;
0077 
0078   //! If the shape is not modified, returns the shape itself.
0079   Standard_EXPORT TopoDS_Shape ModifiedShape(const TopoDS_Shape& aShape) const;
0080 
0081   Standard_EXPORT const NCollection_Sequence<bool>& GetIsClosed() const;
0082 
0083 private:
0084   //! Construction from a set of curves from Geom2d.
0085   //! Assume the orientation of the closed lines are
0086   //! compatible. (ie if A is in B, the orientation of A and B
0087   //! has to be different.
0088   //!
0089   //! Assume the explo contains only lines located in the
0090   //! area where the bisecting locus will be computed.
0091   //!
0092   //! Assume a line don't cross itself or an other line.
0093   //!
0094   //! A contour has to be construct in adding each curve in
0095   //! respect to the sense of the contour.
0096   //!
0097   //! afirst point of a curve in a contour is equal to the last
0098   //! point of the precedent curve.
0099   //!
0100   //! No control of this rules is done in the construction
0101   //! of the explorer
0102   Standard_EXPORT void Add(const TopoDS_Wire& Spine,
0103                            const TopoDS_Face& aFace,
0104                            TopoDS_Face&       aNewFace);
0105 
0106   Standard_EXPORT void NewContour();
0107 
0108   //! Add the curve <aCurve> at me.
0109   Standard_EXPORT void Add(const occ::handle<Geom2d_Curve>& aCurve);
0110 
0111   NCollection_Sequence<NCollection_Sequence<occ::handle<Geom2d_Curve>>>           theCurves;
0112   int                                                                             current;
0113   int                                                                             currentContour;
0114   TopoDS_Shape                                                                    myShape;
0115   NCollection_Sequence<bool>                                                      myIsClosed;
0116   NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myModifShapes;
0117 };
0118 
0119 #endif // _BRepMAT2d_Explorer_HeaderFile