Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:18:54

0001 // Created on: 2000-02-07
0002 // Created by: data exchange team
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _ShapeAlgo_AlgoContainer_HeaderFile
0017 #define _ShapeAlgo_AlgoContainer_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <Standard_Transient.hxx>
0023 #include <Geom_Curve.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <Geom2d_Curve.hxx>
0026 #include <Geom_BoundedCurve.hxx>
0027 #include <NCollection_HSequence.hxx>
0028 #include <Geom2d_BoundedCurve.hxx>
0029 #include <GeomAbs_Shape.hxx>
0030 #include <Standard_Integer.hxx>
0031 class ShapeAlgo_ToolContainer;
0032 class ShapeAnalysis_Wire;
0033 class ShapeExtend_WireData;
0034 class Geom_BSplineCurve;
0035 class Geom2d_BSplineCurve;
0036 class TopoDS_Shape;
0037 class Geom_BSplineSurface;
0038 class Geom_Surface;
0039 class TopoDS_Wire;
0040 class TopoDS_Face;
0041 class Geom_Curve;
0042 
0043 class ShapeAlgo_AlgoContainer : public Standard_Transient
0044 {
0045 
0046 public:
0047   //! Empty constructor
0048   Standard_EXPORT ShapeAlgo_AlgoContainer();
0049 
0050   //! Sets ToolContainer
0051   void SetToolContainer(const occ::handle<ShapeAlgo_ToolContainer>& TC);
0052 
0053   //! Returns ToolContainer
0054   occ::handle<ShapeAlgo_ToolContainer> ToolContainer() const;
0055 
0056   //! Finds the best way to connect and connects <nextsewd> to already
0057   //! built <sewd> (in <saw>).
0058   //! Returns False if <nextsewd> cannot be connected, otherwise - True.
0059   //! <maxtol> specifies the maximum tolerance with which <nextsewd> can
0060   //! be added.
0061   //! <distmin> is used to receive the minimum distance between <nextsewd>
0062   //! and <sewd>.
0063   //! <revsewd>   is True if <sewd>     has been reversed before connecting.
0064   //! <revnextwd> is True if <nextsewd> has been reversed before connecting.
0065   //! Uses functionality of ShapeAnalysis_Wire.
0066   Standard_EXPORT virtual bool ConnectNextWire(const occ::handle<ShapeAnalysis_Wire>&   saw,
0067                                                const occ::handle<ShapeExtend_WireData>& nextsewd,
0068                                                const double                             maxtol,
0069                                                double&                                  distmin,
0070                                                bool&                                    revsewd,
0071                                                bool& revnextsewd) const;
0072 
0073   Standard_EXPORT virtual void ApproxBSplineCurve(
0074     const occ::handle<Geom_BSplineCurve>&          bspline,
0075     NCollection_Sequence<occ::handle<Geom_Curve>>& seq) const;
0076 
0077   Standard_EXPORT virtual void ApproxBSplineCurve(
0078     const occ::handle<Geom2d_BSplineCurve>&          bspline,
0079     NCollection_Sequence<occ::handle<Geom2d_Curve>>& seq) const;
0080 
0081   Standard_EXPORT virtual bool C0BSplineToSequenceOfC1BSplineCurve(
0082     const occ::handle<Geom_BSplineCurve>&                               BS,
0083     occ::handle<NCollection_HSequence<occ::handle<Geom_BoundedCurve>>>& seqBS) const;
0084 
0085   //! Converts C0 B-Spline curve into sequence of C1 B-Spline curves.
0086   //! Calls ShapeUpgrade::C0BSplineToSequenceOfC1BSplineCurve.
0087   Standard_EXPORT virtual bool C0BSplineToSequenceOfC1BSplineCurve(
0088     const occ::handle<Geom2d_BSplineCurve>&                               BS,
0089     occ::handle<NCollection_HSequence<occ::handle<Geom2d_BoundedCurve>>>& seqBS) const;
0090 
0091   //! Converts a shape on C0 geometry into the shape on C1 geometry.
0092   Standard_EXPORT virtual TopoDS_Shape C0ShapeToC1Shape(const TopoDS_Shape& shape,
0093                                                         const double        tol) const;
0094 
0095   //! Converts a surface to B-Spline.
0096   //! Uses ShapeConstruct.
0097   Standard_EXPORT virtual occ::handle<Geom_BSplineSurface> ConvertSurfaceToBSpline(
0098     const occ::handle<Geom_Surface>& surf,
0099     const double                     UF,
0100     const double                     UL,
0101     const double                     VF,
0102     const double                     VL) const;
0103 
0104   //! Return 2 wires with the same number of edges. The both Edges
0105   //! number i of these wires have got the same ratio between
0106   //! theirs parameter lengths and their wire parameter lengths.
0107   Standard_EXPORT virtual bool HomoWires(const TopoDS_Wire& wireIn1,
0108                                          const TopoDS_Wire& wireIn2,
0109                                          TopoDS_Wire&       wireOut1,
0110                                          TopoDS_Wire&       wireOut2,
0111                                          const bool         byParam) const;
0112 
0113   //! Returns the outer wire on the face <Face>.
0114   Standard_EXPORT virtual TopoDS_Wire OuterWire(const TopoDS_Face& face) const;
0115 
0116   //! Converts surface to periodic form.
0117   //! Calls ShapeCustom_Surface.
0118   Standard_EXPORT virtual occ::handle<Geom_Surface> ConvertToPeriodic(
0119     const occ::handle<Geom_Surface>& surf) const;
0120 
0121   //! Computes exact UV bounds of all wires on the face
0122   Standard_EXPORT virtual void GetFaceUVBounds(const TopoDS_Face& F,
0123                                                double&            Umin,
0124                                                double&            Umax,
0125                                                double&            Vmin,
0126                                                double&            Vmax) const;
0127 
0128   //! Convert Geom_Curve to Geom_BSplineCurve
0129   Standard_EXPORT virtual occ::handle<Geom_BSplineCurve> ConvertCurveToBSpline(
0130     const occ::handle<Geom_Curve>& C3D,
0131     const double                   First,
0132     const double                   Last,
0133     const double                   Tol3d,
0134     const GeomAbs_Shape            Continuity,
0135     const int                      MaxSegments,
0136     const int                      MaxDegree) const;
0137 
0138   DEFINE_STANDARD_RTTIEXT(ShapeAlgo_AlgoContainer, Standard_Transient)
0139 
0140 private:
0141   occ::handle<ShapeAlgo_ToolContainer> myTC;
0142 };
0143 
0144 #include <ShapeAlgo_AlgoContainer.lxx>
0145 
0146 #endif // _ShapeAlgo_AlgoContainer_HeaderFile