Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1999-06-17
0002 // Created by: data exchange team
0003 // Copyright (c) 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 _ShapeCustom_ConvertToBSpline_HeaderFile
0018 #define _ShapeCustom_ConvertToBSpline_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <ShapeCustom_Modification.hxx>
0024 #include <GeomAbs_Shape.hxx>
0025 class TopoDS_Face;
0026 class Geom_Surface;
0027 class TopLoc_Location;
0028 class TopoDS_Edge;
0029 class Geom_Curve;
0030 class TopoDS_Vertex;
0031 class gp_Pnt;
0032 class Geom2d_Curve;
0033 
0034 //! implement a modification for BRepTools
0035 //! Modifier algorithm. Converts Surface of
0036 //! Linear Exctrusion, Revolution and Offset
0037 //! surfaces into BSpline Surface according to
0038 //! flags.
0039 class ShapeCustom_ConvertToBSpline : public ShapeCustom_Modification
0040 {
0041 
0042 public:
0043   Standard_EXPORT ShapeCustom_ConvertToBSpline();
0044 
0045   //! Sets mode for conversion of Surfaces of Linear
0046   //! extrusion.
0047   Standard_EXPORT void SetExtrusionMode(const bool extrMode);
0048 
0049   //! Sets mode for conversion of Surfaces of Revolution.
0050   Standard_EXPORT void SetRevolutionMode(const bool revolMode);
0051 
0052   //! Sets mode for conversion of Offset surfaces.
0053   Standard_EXPORT void SetOffsetMode(const bool offsetMode);
0054 
0055   //! Sets mode for conversion of Plane surfaces.
0056   Standard_EXPORT void SetPlaneMode(const bool planeMode);
0057 
0058   //! Returns true if the face <F> has been
0059   //! modified. In this case, <S> is the new geometric
0060   //! support of the face, <L> the new location,
0061   //! <Tol> the new tolerance. Otherwise, returns
0062   //! false, and <S>, <L>, <Tol> are not
0063   //! significant.
0064   Standard_EXPORT bool NewSurface(const TopoDS_Face&         F,
0065                                   occ::handle<Geom_Surface>& S,
0066                                   TopLoc_Location&           L,
0067                                   double&                    Tol,
0068                                   bool&                      RevWires,
0069                                   bool&                      RevFace) override;
0070 
0071   //! Returns true if the edge <E> has been
0072   //! modified. In this case, <C> is the new geometric
0073   //! support of the edge, <L> the new location,
0074   //! <Tol> the new tolerance. Otherwise, returns
0075   //! false, and <C>, <L>, <Tol> are not
0076   //! significant.
0077   Standard_EXPORT bool NewCurve(const TopoDS_Edge&       E,
0078                                 occ::handle<Geom_Curve>& C,
0079                                 TopLoc_Location&         L,
0080                                 double&                  Tol) override;
0081 
0082   //! Returns true if the vertex <V> has been
0083   //! modified. In this case, <P> is the new geometric
0084   //! support of the vertex, <Tol> the new tolerance.
0085   //! Otherwise, returns false, and <P>, <Tol>
0086   //! are not significant.
0087   Standard_EXPORT bool NewPoint(const TopoDS_Vertex& V, gp_Pnt& P, double& Tol) override;
0088 
0089   //! Returns true if the edge <E> has a new
0090   //! curve on surface on the face <F>.In this case, <C>
0091   //! is the new geometric support of the edge, <L> the
0092   //! new location, <Tol> the new tolerance.
0093   //!
0094   //! Otherwise, returns false, and <C>, <L>,
0095   //! <Tol> are not significant.
0096   //!
0097   //! <NewE> is the new edge created from <E>. <NewF>
0098   //! is the new face created from <F>. They may be useful.
0099   Standard_EXPORT bool NewCurve2d(const TopoDS_Edge&         E,
0100                                   const TopoDS_Face&         F,
0101                                   const TopoDS_Edge&         NewE,
0102                                   const TopoDS_Face&         NewF,
0103                                   occ::handle<Geom2d_Curve>& C,
0104                                   double&                    Tol) override;
0105 
0106   //! Returns true if the Vertex <V> has a new
0107   //! parameter on the edge <E>. In this case, <P> is
0108   //! the parameter, <Tol> the new tolerance.
0109   //! Otherwise, returns false, and <P>, <Tol>
0110   //! are not significant.
0111   Standard_EXPORT bool NewParameter(const TopoDS_Vertex& V,
0112                                     const TopoDS_Edge&   E,
0113                                     double&              P,
0114                                     double&              Tol) override;
0115 
0116   //! Returns the continuity of <NewE> between <NewF1>
0117   //! and <NewF2>.
0118   //!
0119   //! <NewE> is the new edge created from <E>. <NewF1>
0120   //! (resp. <NewF2>) is the new face created from <F1>
0121   //! (resp. <F2>).
0122   Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& E,
0123                                            const TopoDS_Face& F1,
0124                                            const TopoDS_Face& F2,
0125                                            const TopoDS_Edge& NewE,
0126                                            const TopoDS_Face& NewF1,
0127                                            const TopoDS_Face& NewF2) override;
0128 
0129   DEFINE_STANDARD_RTTIEXT(ShapeCustom_ConvertToBSpline, ShapeCustom_Modification)
0130 
0131 private:
0132   Standard_EXPORT bool IsToConvert(const occ::handle<Geom_Surface>& S,
0133                                    occ::handle<Geom_Surface>&       SS) const;
0134 
0135   bool myExtrMode;
0136   bool myRevolMode;
0137   bool myOffsetMode;
0138   bool myPlaneMode;
0139 };
0140 
0141 #endif // _ShapeCustom_ConvertToBSpline_HeaderFile