Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:55

0001 // Created on: 1998-07-14
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-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 _ShapeConstruct_Curve_HeaderFile
0018 #define _ShapeConstruct_Curve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColStd_HArray1OfReal.hxx>
0025 #include <TColStd_Array1OfReal.hxx>
0026 class Geom_Curve;
0027 class gp_Pnt;
0028 class Geom2d_Curve;
0029 class gp_Pnt2d;
0030 class Geom_BSplineCurve;
0031 class Geom2d_BSplineCurve;
0032 
0033 
0034 //! Adjusts curve to have start and end points at the given
0035 //! points (currently works on lines and B-Splines only)
0036 class ShapeConstruct_Curve 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Modifies a curve in order to make its bounds confused with
0044   //! given points.
0045   //! Works only on lines and B-Splines, returns True in this case,
0046   //! else returns False.
0047   //! For line considers both bounding points, for B-Splines only
0048   //! specified.
0049   //!
0050   //! Warning : Does not check if curve should be reversed
0051   Standard_EXPORT Standard_Boolean AdjustCurve (const Handle(Geom_Curve)& C3D, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Boolean take1 = Standard_True, const Standard_Boolean take2 = Standard_True) const;
0052   
0053   //! Modifies a curve in order to make its bounds confused with
0054   //! given points.
0055   //! Works only on lines and B-Splines.
0056   //!
0057   //! For lines works as previous method, B-Splines are segmented
0058   //! at the given values and then are adjusted to the points.
0059   Standard_EXPORT Standard_Boolean AdjustCurveSegment (const Handle(Geom_Curve)& C3D, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real U1, const Standard_Real U2) const;
0060   
0061   //! Modifies a curve in order to make its bounds confused with
0062   //! given points.
0063   //! Works only on lines and B-Splines, returns True in this case,
0064   //! else returns False.
0065   //!
0066   //! For line considers both bounding points, for B-Splines only
0067   //! specified.
0068   //!
0069   //! Warning : Does not check if curve should be reversed
0070   Standard_EXPORT Standard_Boolean AdjustCurve2d (const Handle(Geom2d_Curve)& C2D, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Boolean take1 = Standard_True, const Standard_Boolean take2 = Standard_True) const;
0071   
0072   //! Converts a curve of any type (only part from first to last)
0073   //! to bspline. The method of conversion depends on the type
0074   //! of original curve:
0075   //! BSpline -> C.Segment(first,last)
0076   //! Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last)
0077   //! Conic and Other -> Approx_Curve3d(C[first,last],prec,C1,9,1000)
0078   Standard_EXPORT Handle(Geom_BSplineCurve) ConvertToBSpline (const Handle(Geom_Curve)& C, const Standard_Real first, const Standard_Real last, const Standard_Real prec) const;
0079   
0080   //! Converts a curve of any type (only part from first to last)
0081   //! to bspline. The method of conversion depends on the type
0082   //! of original curve:
0083   //! BSpline -> C.Segment(first,last)
0084   //! Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last)
0085   //! Conic and Other -> Approx_Curve2d(C[first,last],prec,C1,9,1000)
0086   Standard_EXPORT Handle(Geom2d_BSplineCurve) ConvertToBSpline (const Handle(Geom2d_Curve)& C, const Standard_Real first, const Standard_Real last, const Standard_Real prec) const;
0087   
0088   Standard_EXPORT static Standard_Boolean FixKnots (Handle(TColStd_HArray1OfReal)& knots);
0089   
0090   //! Fix bspline knots to ensure that there is enough
0091   //! gap between neighbouring values
0092   //! Returns True if something fixed (by shifting knot)
0093   Standard_EXPORT static Standard_Boolean FixKnots (TColStd_Array1OfReal& knots);
0094 
0095 
0096 
0097 
0098 protected:
0099 
0100 
0101 
0102 
0103 
0104 private:
0105 
0106 
0107 
0108 
0109 
0110 };
0111 
0112 
0113 
0114 
0115 
0116 
0117 
0118 #endif // _ShapeConstruct_Curve_HeaderFile