Back to home page

EIC code displayed by LXR

 
 

    


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 <NCollection_Array1.hxx>
0027 #include <NCollection_HArray1.hxx>
0028 
0029 inline double HLRBRep_LineTool::FirstParameter(const gp_Lin&)
0030 {
0031   return RealFirst();
0032 }
0033 
0034 inline double HLRBRep_LineTool::LastParameter(const gp_Lin&)
0035 {
0036   return RealLast();
0037 }
0038 
0039 inline GeomAbs_Shape HLRBRep_LineTool::Continuity(const gp_Lin&)
0040 {
0041   return GeomAbs_CN;
0042 }
0043 
0044 inline int HLRBRep_LineTool::NbIntervals(const gp_Lin&, const GeomAbs_Shape)
0045 {
0046   return 1;
0047 }
0048 
0049 inline void HLRBRep_LineTool::Intervals(const gp_Lin&,
0050                                         NCollection_Array1<double>&,
0051                                         const GeomAbs_Shape)
0052 {
0053 }
0054 
0055 inline double HLRBRep_LineTool::IntervalFirst(const gp_Lin&)
0056 {
0057   return RealFirst();
0058 }
0059 
0060 inline double HLRBRep_LineTool::IntervalLast(const gp_Lin&)
0061 {
0062   return RealLast();
0063 }
0064 
0065 inline GeomAbs_Shape HLRBRep_LineTool::IntervalContinuity(const gp_Lin&)
0066 {
0067   return GeomAbs_CN;
0068 }
0069 
0070 inline bool HLRBRep_LineTool::IsClosed(const gp_Lin&)
0071 {
0072   return false;
0073 }
0074 
0075 inline bool HLRBRep_LineTool::IsPeriodic(const gp_Lin&)
0076 {
0077   return false;
0078 }
0079 
0080 inline double HLRBRep_LineTool::Period(const gp_Lin&)
0081 {
0082   return 0.;
0083 }
0084 
0085 inline gp_Pnt HLRBRep_LineTool::Value(const gp_Lin& C, const double U)
0086 {
0087   return ElCLib::Value(U, C);
0088 }
0089 
0090 inline void HLRBRep_LineTool::D0(const gp_Lin& C, const double U, gp_Pnt& P)
0091 {
0092   P = ElCLib::Value(U, C);
0093 }
0094 
0095 inline void HLRBRep_LineTool::D1(const gp_Lin& C, const double U, gp_Pnt& P, gp_Vec& V)
0096 {
0097   ElCLib::D1(U, C, P, V);
0098 }
0099 
0100 inline void HLRBRep_LineTool::D2(const gp_Lin& C, const double U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2)
0101 {
0102   ElCLib::D1(U, C, P, V1);
0103   V2 = gp_Vec(0, 0, 0);
0104 }
0105 
0106 inline void HLRBRep_LineTool::D3(const gp_Lin& C,
0107                                  const double  U,
0108                                  gp_Pnt&       P,
0109                                  gp_Vec&       V1,
0110                                  gp_Vec&       V2,
0111                                  gp_Vec&       V3)
0112 {
0113   ElCLib::D1(U, C, P, V1);
0114   V2 = V3 = gp_Vec(0, 0, 0);
0115 }
0116 
0117 inline gp_Vec HLRBRep_LineTool::DN(const gp_Lin& C, const double U, const int N)
0118 {
0119   return ElCLib::DN(U, C, N);
0120 }
0121 
0122 inline double HLRBRep_LineTool::Resolution(const gp_Lin&, const double R3D)
0123 {
0124   return R3D;
0125 }
0126 
0127 inline GeomAbs_CurveType HLRBRep_LineTool::GetType(const gp_Lin&)
0128 {
0129   return GeomAbs_Line;
0130 }
0131 
0132 inline gp_Lin HLRBRep_LineTool::Line(const gp_Lin& C)
0133 {
0134   return C;
0135 }
0136 
0137 inline gp_Circ HLRBRep_LineTool::Circle(const gp_Lin&)
0138 {
0139   return gp_Circ();
0140 }
0141 
0142 inline gp_Elips HLRBRep_LineTool::Ellipse(const gp_Lin&)
0143 {
0144   return gp_Elips();
0145 }
0146 
0147 inline gp_Hypr HLRBRep_LineTool::Hyperbola(const gp_Lin&)
0148 {
0149   return gp_Hypr();
0150 }
0151 
0152 inline gp_Parab HLRBRep_LineTool::Parabola(const gp_Lin&)
0153 {
0154   return gp_Parab();
0155 }
0156 
0157 inline occ::handle<Geom_BezierCurve> HLRBRep_LineTool::Bezier(const gp_Lin&)
0158 {
0159   occ::handle<Geom_BezierCurve> NullCurve;
0160   return NullCurve;
0161 }
0162 
0163 inline occ::handle<Geom_BSplineCurve> HLRBRep_LineTool::BSpline(const gp_Lin&)
0164 {
0165   occ::handle<Geom_BSplineCurve> NullCurve;
0166   return NullCurve;
0167 }
0168 
0169 inline int HLRBRep_LineTool::Degree(const gp_Lin&)
0170 {
0171   return 1;
0172 }
0173 
0174 inline int HLRBRep_LineTool::NbPoles(const gp_Lin&)
0175 {
0176   return 0;
0177 }
0178 
0179 inline void HLRBRep_LineTool::Poles(const gp_Lin&, NCollection_Array1<gp_Pnt>&) {}
0180 
0181 inline bool HLRBRep_LineTool::IsRational(const gp_Lin&)
0182 {
0183   return false;
0184 }
0185 
0186 inline void HLRBRep_LineTool::PolesAndWeights(const gp_Lin&,
0187                                               NCollection_Array1<gp_Pnt>&,
0188                                               NCollection_Array1<double>&)
0189 {
0190 }
0191 
0192 inline int HLRBRep_LineTool::NbKnots(const gp_Lin&)
0193 {
0194   return 0;
0195 }
0196 
0197 inline void HLRBRep_LineTool::KnotsAndMultiplicities(const gp_Lin&,
0198                                                      NCollection_Array1<double>&,
0199                                                      NCollection_Array1<int>&)
0200 {
0201 }
0202 
0203 inline int HLRBRep_LineTool::NbSamples(const gp_Lin&, const double, const double)
0204 {
0205   return 3;
0206 }
0207 
0208 inline occ::handle<NCollection_HArray1<double>> HLRBRep_LineTool::SamplePars(const gp_Lin&,
0209                                                                              const double U0,
0210                                                                              const double U1,
0211                                                                              const double,
0212                                                                              const int)
0213 {
0214   occ::handle<NCollection_HArray1<double>> aPars = new NCollection_HArray1<double>(1, 3);
0215   aPars->SetValue(1, U0);
0216   aPars->SetValue(2, (U0 + U1) * 0.5);
0217   aPars->SetValue(3, U1);
0218   return aPars;
0219 }
0220 
0221 inline void HLRBRep_LineTool::SamplePars(const gp_Lin&                             C,
0222                                          const double                              U0,
0223                                          const double                              U1,
0224                                          const double                              Defl,
0225                                          const int                                 NbMin,
0226                                          occ::handle<NCollection_HArray1<double>>& Pars)
0227 {
0228   Pars = SamplePars(C, U0, U1, Defl, NbMin);
0229 }