Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-11-21
0002 // Created by: Philippe MANGIN
0003 // Copyright (c) 1997-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_Sweep_HeaderFile
0018 #define _BRepFill_Sweep_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomFill_ApproxStyle.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <TopTools_DataMapOfShapeShape.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 #include <TopoDS_Wire.hxx>
0031 #include <TopTools_MapOfShape.hxx>
0032 #include <BRepFill_DataMapOfShapeHArray2OfShape.hxx>
0033 #include <BRepFill_TransitionStyle.hxx>
0034 class BRepFill_LocationLaw;
0035 class BRepFill_SectionLaw;
0036 class TopoDS_Edge;
0037 
0038 
0039 //! Topological Sweep Algorithm
0040 //! Computes an  Sweep  shell using a  generating
0041 //! wire, an SectionLaw and an LocationLaw.
0042 class BRepFill_Sweep 
0043 {
0044 public:
0045 
0046   DEFINE_STANDARD_ALLOC
0047 
0048   
0049   Standard_EXPORT BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, const Handle(BRepFill_LocationLaw)& Location, const Standard_Boolean WithKPart);
0050   
0051   Standard_EXPORT void SetBounds (const TopoDS_Wire& FirstShape, const TopoDS_Wire& LastShape);
0052   
0053   //! Set Approximation Tolerance
0054   //! Tol3d : Tolerance to surface approximation
0055   //! Tol2d : Tolerance used to perform curve approximation
0056   //! Normally the 2d curve are approximated with a
0057   //! tolerance given by the resolution on support surfaces,
0058   //! but if this tolerance is too large Tol2d is used.
0059   //! TolAngular : Tolerance (in radian) to control the angle
0060   //! between tangents on the section law and
0061   //! tangent of iso-v on approximated surface
0062   Standard_EXPORT void SetTolerance (const Standard_Real Tol3d, const Standard_Real BoundTol = 1.0, const Standard_Real Tol2d = 1.0e-5, const Standard_Real TolAngular = 1.0e-2);
0063   
0064   //! Tolerance  To controle Corner management.
0065   //!
0066   //! If the discontinuity is lesser than <AngleMin> in radian The
0067   //! Transition Performed will be alway "Modified"
0068   Standard_EXPORT void SetAngularControl (const Standard_Real AngleMin = 0.01, const Standard_Real AngleMax = 6.0);
0069   
0070   //! Set the flag that indicates attempt to approximate
0071   //! a C1-continuous surface if a swept surface proved
0072   //! to be C0.
0073   Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
0074   
0075   //! Build the Sweep  Surface
0076   //! Transition define Transition strategy
0077   //! Approx define Approximation Strategy
0078   //! - GeomFill_Section : The composed Function Location X Section
0079   //! is directly approximated.
0080   //! - GeomFill_Location : The location law is approximated, and the
0081   //! SweepSurface is bulid algebric composition
0082   //! of approximated location law and section law
0083   //! This option is Ok, if Section.Surface() methode
0084   //! is effective.
0085   //! Continuity : The continuity in v waiting on the surface
0086   //! Degmax     : The maximum degree in v required on the surface
0087   //! Segmax     : The maximum number of span in v required on
0088   //! the surface.
0089   Standard_EXPORT void Build (TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const BRepFill_TransitionStyle Transition = BRepFill_Modified, const GeomAbs_Shape Continuity = GeomAbs_C2, const GeomFill_ApproxStyle Approx = GeomFill_Location, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 30);
0090   
0091   //! Say if the Shape is Build.
0092   Standard_EXPORT Standard_Boolean IsDone() const;
0093   
0094   //! returns the Sweeping Shape
0095   Standard_EXPORT TopoDS_Shape Shape() const;
0096   
0097   //! Get the Approximation  error.
0098   Standard_EXPORT Standard_Real ErrorOnSurface() const;
0099   
0100   Standard_EXPORT Handle(TopTools_HArray2OfShape) SubShape() const;
0101   
0102   Standard_EXPORT Handle(TopTools_HArray2OfShape) InterFaces() const;
0103   
0104   Standard_EXPORT Handle(TopTools_HArray2OfShape) Sections() const;
0105 
0106   //! returns the Tape corresponding to Index-th edge of section
0107   Standard_EXPORT TopoDS_Shape Tape(const Standard_Integer Index) const;
0108 
0109 
0110 
0111 protected:
0112 
0113   Standard_EXPORT Standard_Boolean CorrectApproxParameters();
0114   
0115   Standard_EXPORT Standard_Boolean BuildWire (const BRepFill_TransitionStyle Transition);
0116   
0117   Standard_EXPORT Standard_Boolean BuildShell (const BRepFill_TransitionStyle Transition, const Standard_Integer Vf, const Standard_Integer Vl, TopTools_MapOfShape& ReversedEdges, BRepFill_DataMapOfShapeHArray2OfShape& Tapes, BRepFill_DataMapOfShapeHArray2OfShape& Rails, const Standard_Real ExtendFirst = 0.0, const Standard_Real ExtendLast = 0.0);
0118   
0119   Standard_EXPORT Standard_Boolean PerformCorner (const Standard_Integer Index, const BRepFill_TransitionStyle Transition, const Handle(TopTools_HArray2OfShape)& Bounds);
0120   
0121   Standard_EXPORT Standard_Real EvalExtrapol (const Standard_Integer Index, const BRepFill_TransitionStyle Transition) const;
0122   
0123   Standard_EXPORT Standard_Boolean MergeVertex (const TopoDS_Shape& V1, TopoDS_Shape& V2) const;
0124   
0125   Standard_EXPORT void UpdateVertex (const Standard_Integer Ipath, const Standard_Integer Isec, const Standard_Real Error, const Standard_Real Param, TopoDS_Shape& V) const;
0126   
0127   Standard_EXPORT void RebuildTopOrBottomEdge (const TopoDS_Edge& aNewEdge, TopoDS_Edge& anEdge, TopTools_MapOfShape& ReversedEdges) const;
0128 
0129 
0130 
0131 
0132 private:
0133 
0134   
0135 
0136 
0137   Standard_Boolean isDone;
0138   Standard_Boolean KPart;
0139   Standard_Real myTol3d;
0140   Standard_Real myBoundTol;
0141   Standard_Real myTol2d;
0142   Standard_Real myTolAngular;
0143   Standard_Real myAngMin;
0144   Standard_Real myAngMax;
0145   GeomFill_ApproxStyle myApproxStyle;
0146   GeomAbs_Shape myContinuity;
0147   Standard_Integer myDegmax;
0148   Standard_Integer mySegmax;
0149   Standard_Boolean myForceApproxC1;
0150   TopoDS_Shape myShape;
0151   Handle(BRepFill_LocationLaw) myLoc;
0152   Handle(BRepFill_SectionLaw) mySec;
0153   Handle(TopTools_HArray2OfShape) myUEdges;
0154   Handle(TopTools_HArray2OfShape) myVEdges;
0155   TopTools_DataMapOfShapeShape myVEdgesModified;
0156   Handle(TopTools_HArray2OfShape) myFaces;
0157   TopTools_ListOfShape myAuxShape;
0158   Handle(TopTools_HArray1OfShape) myTapes;
0159   Standard_Real Error;
0160   TopoDS_Wire FirstShape;
0161   TopoDS_Wire LastShape;
0162 
0163 };
0164 
0165 
0166 
0167 
0168 
0169 
0170 
0171 #endif // _BRepFill_Sweep_HeaderFile