Back to home page

EIC code displayed by LXR

 
 

    


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 inline GeomAbs_CurveType Geom2dInt_Geom2dCurveTool::GetType(const Adaptor2d_Curve2d& C) {
0032   return(C.GetType());
0033 }
0034 //============================================================
0035 inline gp_Lin2d Geom2dInt_Geom2dCurveTool::Line (const Adaptor2d_Curve2d& C) {
0036   return(C.Line());
0037 }
0038 //============================================================
0039 inline gp_Circ2d Geom2dInt_Geom2dCurveTool::Circle (const Adaptor2d_Curve2d& C) {
0040   return(C.Circle());
0041 }
0042 //============================================================
0043 inline gp_Elips2d Geom2dInt_Geom2dCurveTool::Ellipse (const Adaptor2d_Curve2d& C) {
0044   return(C.Ellipse());
0045 }
0046 //============================================================
0047 inline gp_Parab2d Geom2dInt_Geom2dCurveTool::Parabola (const Adaptor2d_Curve2d& C) {
0048   return(C.Parabola());
0049 }
0050 //============================================================
0051 inline gp_Hypr2d Geom2dInt_Geom2dCurveTool::Hyperbola (const Adaptor2d_Curve2d& C) {
0052   return(C.Hyperbola());
0053 }
0054 //============================================================
0055 inline gp_Pnt2d Geom2dInt_Geom2dCurveTool::Value (const Adaptor2d_Curve2d& C,
0056                                             const Standard_Real U) {
0057   return(C.Value(U));
0058 }
0059 //============================================================
0060 inline void Geom2dInt_Geom2dCurveTool::D0(const Adaptor2d_Curve2d& C,
0061                                     const Standard_Real U,
0062                                     gp_Pnt2d& P) {
0063   C.D0(U,P);
0064 }
0065 //============================================================
0066 inline void Geom2dInt_Geom2dCurveTool::D1 (const Adaptor2d_Curve2d& C,
0067                                      const Standard_Real U,
0068                                      gp_Pnt2d& P,
0069                                      gp_Vec2d& T) {
0070   C.D1(U,P,T);
0071 }
0072 //============================================================
0073 inline void Geom2dInt_Geom2dCurveTool::D2 (const Adaptor2d_Curve2d& C,
0074                                      const Standard_Real U,
0075                                      gp_Pnt2d& P,
0076                                      gp_Vec2d& T,
0077                                      gp_Vec2d& N) {
0078   
0079  C.D2(U,P,T,N);
0080 }
0081 
0082 //============================================================
0083 inline void Geom2dInt_Geom2dCurveTool::D3 (const Adaptor2d_Curve2d& C,
0084                                      const Standard_Real U,
0085                                      gp_Pnt2d& P,
0086                                      gp_Vec2d& T,
0087                                      gp_Vec2d& N,
0088                                      gp_Vec2d& V) {
0089   
0090  C.D3(U,P,T,N,V);
0091 }
0092 //============================================================
0093 inline gp_Vec2d Geom2dInt_Geom2dCurveTool::DN(const Adaptor2d_Curve2d& C,
0094              const Standard_Real U,
0095              const Standard_Integer N)
0096   {
0097   return C.DN(U,N);  
0098   }
0099 
0100 //============================================================
0101 inline Standard_Real Geom2dInt_Geom2dCurveTool::FirstParameter (const Adaptor2d_Curve2d& C) {
0102   return(C.FirstParameter());
0103 }
0104 //============================================================
0105 inline Standard_Real Geom2dInt_Geom2dCurveTool::LastParameter (const Adaptor2d_Curve2d& C) {
0106   return(C.LastParameter());
0107 }
0108 //============================================================
0109 //== tolerance used by mathemetical algorithms 
0110 //== 
0111 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& ) {
0112   return(1.0e-10);
0113 }
0114 //------------------------------------------------------------
0115 inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& C,const Standard_Real Eps_XYZ) {
0116   return(C.Resolution(Eps_XYZ));
0117 }
0118 //============================================================
0119 inline void Geom2dInt_Geom2dCurveTool::Intervals(const Adaptor2d_Curve2d& C,
0120                                            TColStd_Array1OfReal& Tab) { 
0121 #if IS_C2_COMPOSITE
0122   C.Intervals(Tab,GeomAbs_C2);
0123 #else
0124   C.Intervals(Tab,GeomAbs_C1);
0125 #endif
0126 }
0127 //============================================================
0128 //inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& C,
0129 inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& ,
0130                                              const Standard_Integer i,
0131                                              const TColStd_Array1OfReal& Tab,
0132                                              Standard_Real& a,
0133                                              Standard_Real& b) {
0134   a = Tab.Value(i);
0135   b = Tab.Value(i+1);
0136 }
0137 //============================================================
0138 inline Standard_Integer Geom2dInt_Geom2dCurveTool::NbIntervals(const Adaptor2d_Curve2d& C) {
0139   Standard_Integer N=1;
0140 #if IS_C2_COMPOSITE
0141   N = C.NbIntervals(GeomAbs_C2);
0142 #else
0143   N = C.NbIntervals(GeomAbs_C1);
0144 #endif
0145   return(N);
0146 }
0147 //============================================================
0148 
0149  inline Standard_Integer Geom2dInt_Geom2dCurveTool::Degree(const Adaptor2d_Curve2d& C)
0150 {
0151   return C.Degree();
0152 }