Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:19

0001 // Created on: 1994-10-03
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_Evolved_HeaderFile
0018 #define _BRepFill_Evolved_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <TopoDS_Wire.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <GeomAbs_JoinType.hxx>
0027 #include <NCollection_List.hxx>
0028 #include <TopTools_ShapeMapHasher.hxx>
0029 #include <NCollection_DataMap.hxx>
0030 class gp_Ax3;
0031 class BRepMAT2d_BisectingLocus;
0032 class BRepMAT2d_LinkTopoBilo;
0033 class BRepTools_Quilt;
0034 class TopLoc_Location;
0035 class TopoDS_Edge;
0036 class TopoDS_Vertex;
0037 
0038 //! Constructs an evolved volume from a spine (wire or face)
0039 //! and a profile ( wire).
0040 class BRepFill_Evolved
0041 {
0042 public:
0043   DEFINE_STANDARD_ALLOC
0044 
0045   Standard_EXPORT BRepFill_Evolved();
0046 
0047   //! Creates an evolved shape by sweeping the <Profile>
0048   //! along the <Spine>. <AxeProf> is used to set the
0049   //! position of <Profile> along <Spine> as follows:
0050   //! <AxeProf> slides on the profile with direction
0051   //! colinear to the normal to <Spine>, and its
0052   //! <XDirection> mixed with the tangent to <Spine>.
0053   Standard_EXPORT BRepFill_Evolved(const TopoDS_Wire&     Spine,
0054                                    const TopoDS_Wire&     Profile,
0055                                    const gp_Ax3&          AxeProf,
0056                                    const GeomAbs_JoinType Join  = GeomAbs_Arc,
0057                                    const bool             Solid = false);
0058 
0059   //! Creates an evolved shape by sweeping the <Profile>
0060   //! along the <Spine>
0061   Standard_EXPORT BRepFill_Evolved(const TopoDS_Face&     Spine,
0062                                    const TopoDS_Wire&     Profile,
0063                                    const gp_Ax3&          AxeProf,
0064                                    const GeomAbs_JoinType Join  = GeomAbs_Arc,
0065                                    const bool             Solid = false);
0066 
0067   //! Performs an evolved shape by sweeping the <Profile>
0068   //! along the <Spine>
0069   Standard_EXPORT void Perform(const TopoDS_Wire&     Spine,
0070                                const TopoDS_Wire&     Profile,
0071                                const gp_Ax3&          AxeProf,
0072                                const GeomAbs_JoinType Join  = GeomAbs_Arc,
0073                                const bool             Solid = false);
0074 
0075   //! Performs an evolved shape by sweeping the <Profile>
0076   //! along the <Spine>
0077   Standard_EXPORT void Perform(const TopoDS_Face&     Spine,
0078                                const TopoDS_Wire&     Profile,
0079                                const gp_Ax3&          AxeProf,
0080                                const GeomAbs_JoinType Join  = GeomAbs_Arc,
0081                                const bool             Solid = false);
0082 
0083   Standard_EXPORT bool IsDone() const;
0084 
0085   //! returns the generated shape.
0086   Standard_EXPORT const TopoDS_Shape& Shape() const;
0087 
0088   //! Returns the shapes created from a subshape
0089   //! <SpineShape> of the spine and a subshape
0090   //! <ProfShape> on the profile.
0091   Standard_EXPORT const NCollection_List<TopoDS_Shape>& GeneratedShapes(
0092     const TopoDS_Shape& SpineShape,
0093     const TopoDS_Shape& ProfShape) const;
0094 
0095   Standard_EXPORT GeomAbs_JoinType JoinType() const;
0096 
0097   //! Return the face Top if <Solid> is True in the constructor.
0098   Standard_EXPORT const TopoDS_Shape& Top() const;
0099 
0100   //! Return the face Bottom if <Solid> is True in the constructor.
0101   Standard_EXPORT const TopoDS_Shape& Bottom() const;
0102 
0103 private:
0104   Standard_EXPORT void PrivatePerform(const TopoDS_Face&     Spine,
0105                                       const TopoDS_Wire&     Profile,
0106                                       const gp_Ax3&          AxeProf,
0107                                       const GeomAbs_JoinType Join  = GeomAbs_Arc,
0108                                       const bool             Solid = false);
0109 
0110   Standard_EXPORT void SetWork(const TopoDS_Face& Spine, const TopoDS_Wire& Profile);
0111 
0112   Standard_EXPORT void ElementaryPerform(const TopoDS_Face&              Spine,
0113                                          const TopoDS_Wire&              Profile,
0114                                          const BRepMAT2d_BisectingLocus& Locus,
0115                                          BRepMAT2d_LinkTopoBilo&         Link,
0116                                          const GeomAbs_JoinType          Join = GeomAbs_Arc);
0117 
0118   Standard_EXPORT void PlanarPerform(const TopoDS_Face&              Spine,
0119                                      const TopoDS_Wire&              Profile,
0120                                      const BRepMAT2d_BisectingLocus& Locus,
0121                                      BRepMAT2d_LinkTopoBilo&         Link,
0122                                      const GeomAbs_JoinType          Join = GeomAbs_Arc);
0123 
0124   Standard_EXPORT void VerticalPerform(const TopoDS_Face&              Spine,
0125                                        const TopoDS_Wire&              Profile,
0126                                        const BRepMAT2d_BisectingLocus& Locus,
0127                                        BRepMAT2d_LinkTopoBilo&         Link,
0128                                        const GeomAbs_JoinType          Join = GeomAbs_Arc);
0129 
0130   Standard_EXPORT NCollection_DataMap<
0131     TopoDS_Shape,
0132     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>,
0133     TopTools_ShapeMapHasher>&
0134     Generated();
0135 
0136   Standard_EXPORT void Add(BRepFill_Evolved& Vevo, const TopoDS_Wire& Prof, BRepTools_Quilt& Glue);
0137 
0138   Standard_EXPORT TopoDS_Shape& ChangeShape();
0139 
0140   Standard_EXPORT void Transfert(
0141     BRepFill_Evolved&                                                               Vevo,
0142     const NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& MapProf,
0143     const NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& MapSpine,
0144     const TopLoc_Location&                                                          LS,
0145     const TopLoc_Location&                                                          InitLS,
0146     const TopLoc_Location&                                                          InitLP);
0147 
0148   //! Prepare the profil as follow
0149   //! - Project the profile in the yOz Plane
0150   //! - Cut the profile at the extrema of distance from the
0151   //! Profile to the Oz Axis.
0152   //! - building the new wires with the cutting edges.
0153   Standard_EXPORT void PrepareProfile(
0154     NCollection_List<TopoDS_Shape>&                                           WorkProf,
0155     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& MapProf) const;
0156 
0157   //! Prepare the spine as follow
0158   //! - Cut the spine-Edges at the extrema of curvature and
0159   //! at the inflexion points.
0160   Standard_EXPORT void PrepareSpine(
0161     TopoDS_Face&                                                              WorkSpine,
0162     NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& SpineProf) const;
0163 
0164   Standard_EXPORT void MakePipe(const TopoDS_Edge& SpineEdge, const gp_Ax3& ProfRef);
0165 
0166   Standard_EXPORT void MakeRevol(const TopoDS_Edge&   SpineEdge,
0167                                  const TopoDS_Vertex& SpineVertex,
0168                                  const gp_Ax3&        ProfRef);
0169 
0170   //! Find the location transforming the planar shape <Shape>
0171   //! in the plane xOy
0172   //! if the Shape is not planar.
0173   Standard_EXPORT TopLoc_Location FindLocation(const TopoDS_Face& Face) const;
0174 
0175   //! Apply the Location <LS> to <mySpine> and <LP> to
0176   //! <myProfil>
0177   //! in order to set the Shapes in the work space.
0178   Standard_EXPORT void TransformInitWork(const TopLoc_Location& LS, const TopLoc_Location& LP);
0179 
0180   Standard_EXPORT void ContinuityOnOffsetEdge(const NCollection_List<TopoDS_Shape>& WorkProf);
0181 
0182   Standard_EXPORT void AddTopAndBottom(BRepTools_Quilt& Glue);
0183 
0184   Standard_EXPORT void MakeSolid();
0185 
0186   TopoDS_Face      mySpine;
0187   TopoDS_Wire      myProfile;
0188   TopoDS_Shape     myShape;
0189   bool             myIsDone;
0190   bool             mySpineType;
0191   GeomAbs_JoinType myJoinType;
0192   NCollection_DataMap<
0193     TopoDS_Shape,
0194     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>,
0195     TopTools_ShapeMapHasher>
0196                myMap;
0197   TopoDS_Shape myTop;
0198   TopoDS_Shape myBottom;
0199 };
0200 
0201 #endif // _BRepFill_Evolved_HeaderFile