Warning, /include/opencascade/Geom2dInt_Geom2dCurveTool.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1992-10-22
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-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 #include <GeomAbs_CurveType.hxx>
0018 #include <GeomAbs_Shape.hxx>
0019
0020 #include <gp_Lin2d.hxx>
0021 #include <gp_Circ2d.hxx>
0022 #include <gp_Elips2d.hxx>
0023 #include <gp_Parab2d.hxx>
0024 #include <gp_Hypr2d.hxx>
0025
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <Adaptor2d_Curve2d.hxx>
0028
0029 #define IS_C2_COMPOSITE 0
0030
0031 //============================================================
0032 inline GeomAbs_CurveType Geom2dInt_Geom2dCurveTool::GetType(const Adaptor2d_Curve2d& C)
0033 {
0034 return (C.GetType());
0035 }
0036
0037 //============================================================
0038 inline gp_Lin2d Geom2dInt_Geom2dCurveTool::Line(const Adaptor2d_Curve2d& C)
0039 {
0040 return (C.Line());
0041 }
0042
0043 //============================================================
0044 inline gp_Circ2d Geom2dInt_Geom2dCurveTool::Circle(const Adaptor2d_Curve2d& C)
0045 {
0046 return (C.Circle());
0047 }
0048
0049 //============================================================
0050 inline gp_Elips2d Geom2dInt_Geom2dCurveTool::Ellipse(const Adaptor2d_Curve2d& C)
0051 {
0052 return (C.Ellipse());
0053 }
0054
0055 //============================================================
0056 inline gp_Parab2d Geom2dInt_Geom2dCurveTool::Parabola(const Adaptor2d_Curve2d& C)
0057 {
0058 return (C.Parabola());
0059 }
0060
0061 //============================================================
0062 inline gp_Hypr2d Geom2dInt_Geom2dCurveTool::Hyperbola(const Adaptor2d_Curve2d& C)
0063 {
0064 return (C.Hyperbola());
0065 }
0066
0067 //============================================================
0068 inline gp_Pnt2d Geom2dInt_Geom2dCurveTool::Value(const Adaptor2d_Curve2d& C, const Standard_Real U)
0069 {
0070 return (C.Value(U));
0071 }
0072
0073 //============================================================
0074 inline void Geom2dInt_Geom2dCurveTool::D0(const Adaptor2d_Curve2d& C,
0075 const Standard_Real U,
0076 gp_Pnt2d& P)
0077 {
0078 C.D0(U, P);
0079 }
0080
0081 //============================================================
0082 inline void Geom2dInt_Geom2dCurveTool::D1(const Adaptor2d_Curve2d& C,
0083 const Standard_Real U,
0084 gp_Pnt2d& P,
0085 gp_Vec2d& T)
0086 {
0087 C.D1(U, P, T);
0088 }
0089
0090 //============================================================
0091 inline void Geom2dInt_Geom2dCurveTool::D2(const Adaptor2d_Curve2d& C,
0092 const Standard_Real U,
0093 gp_Pnt2d& P,
0094 gp_Vec2d& T,
0095 gp_Vec2d& N)
0096 {
0097
0098 C.D2(U, P, T, N);
0099 }
0100
0101 //============================================================
0102 inline void Geom2dInt_Geom2dCurveTool::D3(const Adaptor2d_Curve2d& C,
0103 const Standard_Real U,
0104 gp_Pnt2d& P,
0105 gp_Vec2d& T,
0106 gp_Vec2d& N,
0107 gp_Vec2d& V)
0108 {
0109
0110 C.D3(U, P, T, N, V);
0111 }
0112
0113 //============================================================
0114 inline gp_Vec2d Geom2dInt_Geom2dCurveTool::DN(const Adaptor2d_Curve2d& C,
0115 const Standard_Real U,
0116 const Standard_Integer N)
0117 {
0118 return C.DN(U, N);
0119 }
0120
0121 //============================================================
0122 inline Standard_Real Geom2dInt_Geom2dCurveTool::FirstParameter(const Adaptor2d_Curve2d& C)
0123 {
0124 return (C.FirstParameter());
0125 }
0126
0127 //============================================================
0128 inline Standard_Real Geom2dInt_Geom2dCurveTool::LastParameter(const Adaptor2d_Curve2d& C)
0129 {
0130 return (C.LastParameter());
0131 }
0132
0133 //============================================================
0134 //== tolerance used by mathemetical algorithms
0135 //==
0136 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX(const Adaptor2d_Curve2d&)
0137 {
0138 return (1.0e-10);
0139 }
0140
0141 //------------------------------------------------------------
0142 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX(const Adaptor2d_Curve2d& C,
0143 const Standard_Real Eps_XYZ)
0144 {
0145 return (C.Resolution(Eps_XYZ));
0146 }
0147
0148 //============================================================
0149 inline void Geom2dInt_Geom2dCurveTool::Intervals(const Adaptor2d_Curve2d& C,
0150 TColStd_Array1OfReal& Tab)
0151 {
0152 #if IS_C2_COMPOSITE
0153 C.Intervals(Tab, GeomAbs_C2);
0154 #else
0155 C.Intervals(Tab, GeomAbs_C1);
0156 #endif
0157 }
0158
0159 //============================================================
0160 // inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& C,
0161 inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d&,
0162 const Standard_Integer i,
0163 const TColStd_Array1OfReal& Tab,
0164 Standard_Real& a,
0165 Standard_Real& b)
0166 {
0167 a = Tab.Value(i);
0168 b = Tab.Value(i + 1);
0169 }
0170
0171 //============================================================
0172 inline Standard_Integer Geom2dInt_Geom2dCurveTool::NbIntervals(const Adaptor2d_Curve2d& C)
0173 {
0174 Standard_Integer N = 1;
0175 #if IS_C2_COMPOSITE
0176 N = C.NbIntervals(GeomAbs_C2);
0177 #else
0178 N = C.NbIntervals(GeomAbs_C1);
0179 #endif
0180 return (N);
0181 }
0182
0183 //============================================================
0184
0185 inline Standard_Integer Geom2dInt_Geom2dCurveTool::Degree(const Adaptor2d_Curve2d& C)
0186 {
0187 return C.Degree();
0188 }