Warning, /include/opencascade/HLRBRep_LineTool.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1993-08-18
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1993-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 <gp_Pnt.hxx>
0018 #include <gp_Vec.hxx>
0019 #include <gp_Lin.hxx>
0020 #include <gp_Circ.hxx>
0021 #include <gp_Elips.hxx>
0022 #include <gp_Hypr.hxx>
0023 #include <gp_Parab.hxx>
0024 #include <ElCLib.hxx>
0025
0026 #include <TColStd_HArray1OfReal.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028
0029
0030 inline Standard_Real HLRBRep_LineTool::FirstParameter(const gp_Lin&)
0031 { return RealFirst(); }
0032
0033 inline Standard_Real HLRBRep_LineTool::LastParameter(const gp_Lin& )
0034 { return RealLast(); }
0035
0036 inline GeomAbs_Shape HLRBRep_LineTool::Continuity( const gp_Lin& )
0037 { return GeomAbs_CN; }
0038
0039 inline Standard_Integer HLRBRep_LineTool::NbIntervals
0040 (const gp_Lin& , const GeomAbs_Shape )
0041 { return 1; }
0042
0043 inline void HLRBRep_LineTool::Intervals
0044 (const gp_Lin& , TColStd_Array1OfReal& , const GeomAbs_Shape)
0045 {}
0046
0047 inline Standard_Real HLRBRep_LineTool::IntervalFirst(const gp_Lin& )
0048 { return RealFirst(); }
0049
0050 inline Standard_Real HLRBRep_LineTool::IntervalLast(const gp_Lin& )
0051 { return RealLast(); }
0052
0053 inline GeomAbs_Shape HLRBRep_LineTool::IntervalContinuity(const gp_Lin& )
0054 { return GeomAbs_CN; }
0055
0056 inline Standard_Boolean HLRBRep_LineTool::IsClosed( const gp_Lin& )
0057 { return Standard_False; }
0058
0059 inline Standard_Boolean HLRBRep_LineTool::IsPeriodic( const gp_Lin& )
0060 { return Standard_False; }
0061
0062 inline Standard_Real HLRBRep_LineTool::Period(const gp_Lin& )
0063 { return 0.; }
0064
0065 inline gp_Pnt HLRBRep_LineTool::Value(const gp_Lin& C,const Standard_Real U)
0066 { return ElCLib::Value(U,C); }
0067
0068 inline void HLRBRep_LineTool::D0
0069 (const gp_Lin& C,const Standard_Real U, gp_Pnt& P)
0070 { P = ElCLib::Value(U,C); }
0071
0072 inline void HLRBRep_LineTool::D1
0073 (const gp_Lin& C,const Standard_Real U,
0074 gp_Pnt& P, gp_Vec& V)
0075 { ElCLib::D1(U,C,P,V); }
0076
0077 inline void HLRBRep_LineTool::D2
0078 (const gp_Lin& C, const Standard_Real U,
0079 gp_Pnt& P, gp_Vec& V1, gp_Vec& V2)
0080 {
0081 ElCLib::D1(U,C,P,V1);
0082 V2 = gp_Vec(0,0,0);
0083 }
0084
0085 inline void HLRBRep_LineTool::D3
0086 (const gp_Lin& C, const Standard_Real U,
0087 gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3)
0088 {
0089 ElCLib::D1(U,C,P,V1);
0090 V2 = V3 = gp_Vec(0,0,0);
0091 }
0092
0093 inline gp_Vec HLRBRep_LineTool::DN
0094 (const gp_Lin& C, const Standard_Real U, const Standard_Integer N)
0095 { return ElCLib::DN(U,C,N); }
0096
0097 inline Standard_Real HLRBRep_LineTool::Resolution
0098 ( const gp_Lin& , const Standard_Real R3D)
0099 { return R3D; }
0100
0101 inline GeomAbs_CurveType HLRBRep_LineTool::GetType(const gp_Lin& )
0102 { return GeomAbs_Line; }
0103
0104 inline gp_Lin HLRBRep_LineTool::Line(const gp_Lin& C)
0105 { return C; }
0106
0107 inline gp_Circ HLRBRep_LineTool::Circle(const gp_Lin&)
0108 { return gp_Circ(); }
0109
0110 inline gp_Elips HLRBRep_LineTool::Ellipse(const gp_Lin&)
0111 { return gp_Elips(); }
0112
0113 inline gp_Hypr HLRBRep_LineTool::Hyperbola(const gp_Lin&)
0114 { return gp_Hypr(); }
0115
0116 inline gp_Parab HLRBRep_LineTool::Parabola(const gp_Lin&)
0117 { return gp_Parab(); }
0118
0119 inline Handle(Geom_BezierCurve) HLRBRep_LineTool::Bezier(const gp_Lin&)
0120 {
0121 Handle(Geom_BezierCurve) NullCurve;
0122 return NullCurve;
0123 }
0124
0125 inline Handle(Geom_BSplineCurve) HLRBRep_LineTool::BSpline(const gp_Lin&)
0126 {
0127 Handle(Geom_BSplineCurve) NullCurve;
0128 return NullCurve;
0129 }
0130
0131 inline Standard_Integer HLRBRep_LineTool::Degree(const gp_Lin& )
0132 { return 1; }
0133
0134 inline Standard_Integer HLRBRep_LineTool::NbPoles(const gp_Lin&)
0135 { return 0; }
0136
0137 inline void HLRBRep_LineTool::Poles(const gp_Lin&, TColgp_Array1OfPnt&)
0138 {}
0139
0140 inline Standard_Boolean HLRBRep_LineTool::IsRational(const gp_Lin&)
0141 { return Standard_False; }
0142
0143 inline void HLRBRep_LineTool::PolesAndWeights
0144 (const gp_Lin&, TColgp_Array1OfPnt&, TColStd_Array1OfReal&)
0145 {}
0146
0147 inline Standard_Integer HLRBRep_LineTool::NbKnots(const gp_Lin&)
0148 { return 0; }
0149
0150 inline void HLRBRep_LineTool::KnotsAndMultiplicities
0151 (const gp_Lin&, TColStd_Array1OfReal&, TColStd_Array1OfInteger&)
0152 {}
0153
0154 inline Standard_Integer HLRBRep_LineTool::NbSamples(const gp_Lin&,
0155 const Standard_Real,
0156 const Standard_Real )
0157 { return 3; }
0158
0159 // modified by NIZHNY-MKK Tue Nov 1 18:49:28 2005
0160 inline void HLRBRep_LineTool::SamplePars (const gp_Lin&,
0161 const Standard_Real U0,
0162 const Standard_Real U1,
0163 const Standard_Real,
0164 const Standard_Integer,
0165 Handle(TColStd_HArray1OfReal)& Pars) {
0166
0167 Pars = new TColStd_HArray1OfReal(1, 3);
0168 Pars->SetValue(1, U0);
0169 Pars->SetValue(2, (U0 + U1) * 0.5);
0170 Pars->SetValue(3, U1);
0171 }