Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/ShapeCustom_Curve2d.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 2001-12-20
0002 // Created by: Pavel TELKOV
0003 // Copyright (c) 2001-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 _ShapeCustom_Curve2d_HeaderFile
0017 #define _ShapeCustom_Curve2d_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TColgp_Array1OfPnt2d.hxx>
0024 class Geom2d_Line;
0025 class Geom2d_Curve;
0026 class Geom2d_BSplineCurve;
0027 
0028 //! Converts curve2d to analytical form with given
0029 //! precision or simplify curve2d.
0030 class ShapeCustom_Curve2d
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! Check if poleses is in the plane with given precision
0036   //! Returns false if no.
0037   Standard_EXPORT static Standard_Boolean IsLinear(const TColgp_Array1OfPnt2d& thePoles,
0038                                                    const Standard_Real         theTolerance,
0039                                                    Standard_Real&              theDeviation);
0040 
0041   //! Try to convert BSpline2d or Bezier2d to line 2d
0042   //! only if it is linear. Recalculate first and last parameters.
0043   //! Returns line2d or null curve2d.
0044   Standard_EXPORT static Handle(Geom2d_Line) ConvertToLine2d(const Handle(Geom2d_Curve)& theCurve,
0045                                                              const Standard_Real         theFirstIn,
0046                                                              const Standard_Real         theLastIn,
0047                                                              const Standard_Real theTolerance,
0048                                                              Standard_Real&      theNewFirst,
0049                                                              Standard_Real&      theNewLast,
0050                                                              Standard_Real&      theDeviation);
0051 
0052   //! Try to remove knots from bspline where local derivatives are the same.
0053   //! Remove knots with given precision.
0054   //! Returns false if Bsplien was not modified
0055   Standard_EXPORT static Standard_Boolean SimplifyBSpline2d(
0056     Handle(Geom2d_BSplineCurve)& theBSpline2d,
0057     const Standard_Real          theTolerance);
0058 
0059 protected:
0060 private:
0061 };
0062 
0063 #endif // _ShapeCustom_Curve2d_HeaderFile