Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-06 09:19:45

0001 // Created on: 1994-06-07
0002 // Created by: Bruno DUMORTIER
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 _BRepFill_Pipe_HeaderFile
0018 #define _BRepFill_Pipe_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Wire.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <gp_Trsf.hxx>
0027 #include <TopTools_ShapeMapHasher.hxx>
0028 #include <NCollection_Map.hxx>
0029 #include <NCollection_Array2.hxx>
0030 #include <NCollection_HArray2.hxx>
0031 #include <NCollection_DataMap.hxx>
0032 #include <NCollection_List.hxx>
0033 #include <Standard_Integer.hxx>
0034 #include <GeomAbs_Shape.hxx>
0035 #include <GeomFill_Trihedron.hxx>
0036 class BRepFill_LocationLaw;
0037 class TopoDS_Face;
0038 class TopoDS_Edge;
0039 class TopoDS_Vertex;
0040 class gp_Pnt;
0041 class BRepFill_Sweep;
0042 
0043 //! Create a shape by sweeping a shape (the profile)
0044 //! along a wire (the spine).
0045 //!
0046 //! For each edge or vertex from the spine the user
0047 //! may ask for the shape generated from each subshape
0048 //! of the profile.
0049 class BRepFill_Pipe
0050 {
0051 public:
0052   DEFINE_STANDARD_ALLOC
0053 
0054   Standard_EXPORT BRepFill_Pipe();
0055 
0056   Standard_EXPORT BRepFill_Pipe(const TopoDS_Wire&       Spine,
0057                                 const TopoDS_Shape&      Profile,
0058                                 const GeomFill_Trihedron aMode         = GeomFill_IsCorrectedFrenet,
0059                                 const bool               ForceApproxC1 = false,
0060                                 const bool               GeneratePartCase = false);
0061 
0062   Standard_EXPORT void Perform(const TopoDS_Wire&  Spine,
0063                                const TopoDS_Shape& Profile,
0064                                const bool          GeneratePartCase = false);
0065 
0066   Standard_EXPORT const TopoDS_Shape& Spine() const;
0067 
0068   Standard_EXPORT const TopoDS_Shape& Profile() const;
0069 
0070   Standard_EXPORT const TopoDS_Shape& Shape() const;
0071 
0072   Standard_EXPORT double ErrorOnSurface() const;
0073 
0074   Standard_EXPORT const TopoDS_Shape& FirstShape() const;
0075 
0076   Standard_EXPORT const TopoDS_Shape& LastShape() const;
0077 
0078   //! Returns the list of shapes generated from the
0079   //! shape <S>.
0080   Standard_EXPORT void Generated(const TopoDS_Shape& S, NCollection_List<TopoDS_Shape>& L);
0081 
0082   //! Returns the face created from an edge of the spine
0083   //! and an edge of the profile.
0084   //! if the edges are not in the spine or the profile
0085   Standard_EXPORT TopoDS_Face Face(const TopoDS_Edge& ESpine, const TopoDS_Edge& EProfile);
0086 
0087   //! Returns the edge created from an edge of the spine
0088   //! and a vertex of the profile.
0089   //! if the edge or the vertex are not in the spine or
0090   //! the profile.
0091   Standard_EXPORT TopoDS_Edge Edge(const TopoDS_Edge& ESpine, const TopoDS_Vertex& VProfile);
0092 
0093   //! Returns the shape created from the profile at the
0094   //! position of the vertex VSpine.
0095   //! if the vertex is not in the Spine
0096   Standard_EXPORT TopoDS_Shape Section(const TopoDS_Vertex& VSpine) const;
0097 
0098   //! Create a Wire by sweeping the Point along the <spine>
0099   //! if the <Spine> is undefined
0100   Standard_EXPORT TopoDS_Wire PipeLine(const gp_Pnt& Point);
0101 
0102 private:
0103   //! Auxiliary recursive method used to build the result.
0104   Standard_EXPORT TopoDS_Shape MakeShape(const TopoDS_Shape& S,
0105                                          const TopoDS_Shape& theOriginalS,
0106                                          const TopoDS_Shape& FirstShape,
0107                                          const TopoDS_Shape& LastShape);
0108 
0109   //! Auxiliary recursive method used to find the edge's index
0110   Standard_EXPORT int FindEdge(const TopoDS_Shape& S, const TopoDS_Edge& E, int& Init) const;
0111 
0112   Standard_EXPORT int FindVertex(const TopoDS_Shape& S, const TopoDS_Vertex& V, int& Init) const;
0113 
0114   Standard_EXPORT void DefineRealSegmax();
0115 
0116   Standard_EXPORT void RebuildTopOrBottomFace(const TopoDS_Shape& aFace, const bool IsTop) const;
0117 
0118   Standard_EXPORT void BuildHistory(const BRepFill_Sweep& theSweep, const TopoDS_Shape& theSection);
0119 
0120   TopoDS_Wire                                            mySpine;
0121   TopoDS_Shape                                           myProfile;
0122   TopoDS_Shape                                           myShape;
0123   gp_Trsf                                                myTrsf;
0124   occ::handle<BRepFill_LocationLaw>                      myLoc;
0125   occ::handle<NCollection_HArray2<TopoDS_Shape>>         mySections;
0126   occ::handle<NCollection_HArray2<TopoDS_Shape>>         myFaces;
0127   occ::handle<NCollection_HArray2<TopoDS_Shape>>         myEdges;
0128   NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> myReversedEdges;
0129   NCollection_DataMap<TopoDS_Shape,
0130                       occ::handle<NCollection_HArray2<TopoDS_Shape>>,
0131                       TopTools_ShapeMapHasher>
0132     myTapes;
0133   NCollection_DataMap<TopoDS_Shape,
0134                       occ::handle<NCollection_HArray2<TopoDS_Shape>>,
0135                       TopTools_ShapeMapHasher>
0136                myRails;
0137   int          myCurIndexOfSectionEdge;
0138   TopoDS_Shape myFirst;
0139   TopoDS_Shape myLast;
0140   NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0141                      myGenMap;
0142   int                myDegmax;
0143   int                mySegmax;
0144   GeomAbs_Shape      myContinuity;
0145   GeomFill_Trihedron myMode;
0146   bool               myForceApproxC1;
0147   double             myErrorOnSurf;
0148 };
0149 
0150 #endif // _BRepFill_Pipe_HeaderFile