Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:13

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