Warning, /include/opencascade/HLRBRep_CurveTool.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 <HLRBRep_Curve.hxx>
0018 #include <GeomAbs_CurveType.hxx>
0019 #include <GeomAbs_Shape.hxx>
0020 #include <gp_Vec2d.hxx>
0021 #include <gp_Lin2d.hxx>
0022 #include <gp_Circ2d.hxx>
0023 #include <gp_Elips2d.hxx>
0024 #include <gp_Parab2d.hxx>
0025 #include <gp_Hypr2d.hxx>
0026 #include <Geom2d_BezierCurve.hxx>
0027 #include <Geom2d_BSplineCurve.hxx>
0028 #include <NCollection_Array1.hxx>
0029
0030 #define IS_C2_COMPOSITE 0
0031
0032 //=================================================================================================
0033
0034 inline double HLRBRep_CurveTool::FirstParameter(const HLRBRep_CurvePtr C)
0035 {
0036 return (((HLRBRep_Curve*)C)->FirstParameter());
0037 }
0038
0039 //=================================================================================================
0040
0041 inline double HLRBRep_CurveTool::LastParameter(const HLRBRep_CurvePtr C)
0042 {
0043 return (((HLRBRep_Curve*)C)->LastParameter());
0044 }
0045
0046 //=================================================================================================
0047
0048 inline GeomAbs_Shape HLRBRep_CurveTool::Continuity(const HLRBRep_CurvePtr C)
0049 {
0050 return (((HLRBRep_Curve*)C)->Continuity());
0051 }
0052
0053 //=================================================================================================
0054
0055 inline int HLRBRep_CurveTool::NbIntervals(const HLRBRep_CurvePtr C)
0056 {
0057 #if IS_C2_COMPOSITE
0058 return (((HLRBRep_Curve*)C)->NbIntervals(GeomAbs_C2));
0059 #else
0060 return (((HLRBRep_Curve*)C)->NbIntervals(GeomAbs_C1));
0061 #endif
0062 }
0063
0064 //=================================================================================================
0065
0066 inline void HLRBRep_CurveTool::Intervals(const HLRBRep_CurvePtr C, NCollection_Array1<double>& Tab)
0067 {
0068 #if IS_C2_COMPOSITE
0069 ((HLRBRep_Curve*)C)->Intervals(Tab, GeomAbs_C2);
0070 #else
0071 ((HLRBRep_Curve*)C)->Intervals(Tab, GeomAbs_C1);
0072 #endif
0073 }
0074
0075 //=================================================================================================
0076
0077 inline void HLRBRep_CurveTool::GetInterval(const HLRBRep_CurvePtr /*C*/,
0078 const int i,
0079 const NCollection_Array1<double>& Tab,
0080 double& a,
0081 double& b)
0082 {
0083 a = Tab.Value(i);
0084 b = Tab.Value(i + 1);
0085 }
0086
0087 //=================================================================================================
0088
0089 inline bool HLRBRep_CurveTool::IsClosed(const HLRBRep_CurvePtr C)
0090 {
0091 return (((HLRBRep_Curve*)C)->IsClosed());
0092 }
0093
0094 //=================================================================================================
0095
0096 inline bool HLRBRep_CurveTool::IsPeriodic(const HLRBRep_CurvePtr C)
0097 {
0098 return (((HLRBRep_Curve*)C)->IsPeriodic());
0099 }
0100
0101 //=================================================================================================
0102
0103 inline double HLRBRep_CurveTool::Period(const HLRBRep_CurvePtr C)
0104 {
0105 return (((HLRBRep_Curve*)C)->Period());
0106 }
0107
0108 //=================================================================================================
0109
0110 inline gp_Pnt2d HLRBRep_CurveTool::Value(const HLRBRep_CurvePtr C, const double U)
0111 {
0112 return (((HLRBRep_Curve*)C)->Value(U));
0113 }
0114
0115 //=================================================================================================
0116
0117 inline void HLRBRep_CurveTool::D0(const HLRBRep_CurvePtr C, const double U, gp_Pnt2d& P)
0118 {
0119 ((HLRBRep_Curve*)C)->D0(U, P);
0120 }
0121
0122 //=================================================================================================
0123
0124 inline void HLRBRep_CurveTool::D1(const HLRBRep_CurvePtr C,
0125 const double U,
0126 gp_Pnt2d& P,
0127 gp_Vec2d& T)
0128 {
0129 ((HLRBRep_Curve*)C)->D1(U, P, T);
0130 }
0131
0132 //=================================================================================================
0133
0134 inline void HLRBRep_CurveTool::D2(const HLRBRep_CurvePtr C,
0135 const double U,
0136 gp_Pnt2d& P,
0137 gp_Vec2d& T,
0138 gp_Vec2d& N)
0139 {
0140 ((HLRBRep_Curve*)C)->D2(U, P, T, N);
0141 }
0142
0143 //=================================================================================================
0144
0145 inline void HLRBRep_CurveTool::D3(const HLRBRep_CurvePtr C,
0146 const double U,
0147 gp_Pnt2d& P,
0148 gp_Vec2d& V1,
0149 gp_Vec2d& V2,
0150 gp_Vec2d& V3)
0151 {
0152 ((HLRBRep_Curve*)C)->D3(U, P, V1, V2, V3);
0153 }
0154
0155 //=================================================================================================
0156
0157 inline gp_Vec2d HLRBRep_CurveTool::DN(const HLRBRep_CurvePtr C, const double U, const int N)
0158 {
0159 return (((HLRBRep_Curve*)C)->DN(U, N));
0160 }
0161
0162 //=================================================================================================
0163
0164 inline double HLRBRep_CurveTool::Resolution(const HLRBRep_CurvePtr C, const double R3d)
0165 {
0166 return (((HLRBRep_Curve*)C)->Resolution(R3d));
0167 }
0168
0169 //=================================================================================================
0170
0171 inline GeomAbs_CurveType HLRBRep_CurveTool::GetType(const HLRBRep_CurvePtr C)
0172 {
0173 return (((HLRBRep_Curve*)C)->GetType());
0174 }
0175
0176 //=================================================================================================
0177
0178 inline GeomAbs_CurveType HLRBRep_CurveTool::TheType(const HLRBRep_CurvePtr C)
0179 {
0180 return (((HLRBRep_Curve*)C)->GetType());
0181 }
0182
0183 //=================================================================================================
0184
0185 inline gp_Lin2d HLRBRep_CurveTool::Line(const HLRBRep_CurvePtr C)
0186 {
0187 return (((HLRBRep_Curve*)C)->Line());
0188 }
0189
0190 //=================================================================================================
0191
0192 inline gp_Circ2d HLRBRep_CurveTool::Circle(const HLRBRep_CurvePtr C)
0193 {
0194 return (((HLRBRep_Curve*)C)->Circle());
0195 }
0196
0197 //=================================================================================================
0198
0199 inline gp_Elips2d HLRBRep_CurveTool::Ellipse(const HLRBRep_CurvePtr C)
0200 {
0201 return (((HLRBRep_Curve*)C)->Ellipse());
0202 }
0203
0204 //=================================================================================================
0205
0206 inline gp_Parab2d HLRBRep_CurveTool::Parabola(const HLRBRep_CurvePtr C)
0207 {
0208 return (((HLRBRep_Curve*)C)->Parabola());
0209 }
0210
0211 //=================================================================================================
0212
0213 inline gp_Hypr2d HLRBRep_CurveTool::Hyperbola(const HLRBRep_CurvePtr C)
0214 {
0215 return (((HLRBRep_Curve*)C)->Hyperbola());
0216 }
0217
0218 //=================================================================================================
0219
0220 inline occ::handle<Geom2d_BezierCurve> HLRBRep_CurveTool::Bezier(const HLRBRep_CurvePtr /*C*/)
0221 {
0222 #ifdef OCCT_DEBUG
0223 std::cout << " HLRBRep_CurveTool::Bezier : Not Implemented " << std::endl;
0224 #endif
0225 //-- return(((HLRBRep_Curve *)C)->Bezier());
0226 return (nullptr);
0227 }
0228
0229 //=================================================================================================
0230
0231 inline occ::handle<Geom2d_BSplineCurve> HLRBRep_CurveTool::BSpline(const HLRBRep_CurvePtr /*C*/)
0232 {
0233 #ifdef OCCT_DEBUG
0234 std::cout << " HLRBRep_CurveTool::BSpline : Not Implemented " << std::endl;
0235 #endif
0236 //-- return(((HLRBRep_Curve *)C)->BSpline());
0237 return (nullptr);
0238 }
0239
0240 //=================================================================================================
0241
0242 inline double HLRBRep_CurveTool::EpsX(const HLRBRep_CurvePtr /*C*/)
0243 {
0244 return (1e-10);
0245 }
0246
0247 //=================================================================================================
0248
0249 inline int HLRBRep_CurveTool::Degree(const HLRBRep_CurvePtr C)
0250 {
0251 return (((HLRBRep_Curve*)C)->Degree());
0252 }