mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
138 lines
4.8 KiB
Plaintext
Executable File
138 lines
4.8 KiB
Plaintext
Executable File
// Created on: 1992-10-22
|
|
// Created by: Laurent BUCHARD
|
|
// Copyright (c) 1992-1999 Matra Datavision
|
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
//
|
|
// The content of this file is subject to the Open CASCADE Technology Public
|
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
// except in compliance with the License. Please obtain a copy of the License
|
|
// at http://www.opencascade.org and read it completely before using this file.
|
|
//
|
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
//
|
|
// The Original Code and all software distributed under the License is
|
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
// Initial Developer hereby disclaims all such warranties, including without
|
|
// limitation, any warranties of merchantability, fitness for a particular
|
|
// purpose or non-infringement. Please see the License for the specific terms
|
|
// and conditions governing the rights and limitations under the License.
|
|
|
|
|
|
|
|
#include IntCurveCurve_hxx
|
|
|
|
#include <GeomAbs_CurveType.hxx>
|
|
#include <GeomAbs_Shape.hxx>
|
|
|
|
#include <gp_Lin2d.hxx>
|
|
#include <gp_Circ2d.hxx>
|
|
#include <gp_Elips2d.hxx>
|
|
#include <gp_Parab2d.hxx>
|
|
#include <gp_Hypr2d.hxx>
|
|
|
|
#include <TColStd_Array1OfReal.hxx>
|
|
|
|
#define IS_C2_COMPOSITE 0
|
|
//============================================================
|
|
inline GeomAbs_CurveType Geom2dInt_CurveTool::TheType(const IntCurveCurve& C) {
|
|
return(C.GetType());
|
|
}
|
|
//============================================================
|
|
inline gp_Lin2d Geom2dInt_CurveTool::Line (const IntCurveCurve& C) {
|
|
return(C.Line());
|
|
}
|
|
//============================================================
|
|
inline gp_Circ2d Geom2dInt_CurveTool::Circle (const IntCurveCurve& C) {
|
|
return(C.Circle());
|
|
}
|
|
//============================================================
|
|
inline gp_Elips2d Geom2dInt_CurveTool::Ellipse (const IntCurveCurve& C) {
|
|
return(C.Ellipse());
|
|
}
|
|
//============================================================
|
|
inline gp_Parab2d Geom2dInt_CurveTool::Parabola (const IntCurveCurve& C) {
|
|
return(C.Parabola());
|
|
}
|
|
//============================================================
|
|
inline gp_Hypr2d Geom2dInt_CurveTool::Hyperbola (const IntCurveCurve& C) {
|
|
return(C.Hyperbola());
|
|
}
|
|
//============================================================
|
|
inline gp_Pnt2d Geom2dInt_CurveTool::Value (const IntCurveCurve& C,
|
|
const Standard_Real U) {
|
|
return(C.Value(U));
|
|
}
|
|
//============================================================
|
|
inline void Geom2dInt_CurveTool::D0(const IntCurveCurve& C,
|
|
const Standard_Real U,
|
|
gp_Pnt2d& P) {
|
|
C.D0(U,P);
|
|
}
|
|
//============================================================
|
|
inline void Geom2dInt_CurveTool::D1 (const IntCurveCurve& C,
|
|
const Standard_Real U,
|
|
gp_Pnt2d& P,
|
|
gp_Vec2d& T) {
|
|
C.D1(U,P,T);
|
|
}
|
|
//============================================================
|
|
inline void Geom2dInt_CurveTool::D2 (const IntCurveCurve& C,
|
|
const Standard_Real U,
|
|
gp_Pnt2d& P,
|
|
gp_Vec2d& T,
|
|
gp_Vec2d& N) {
|
|
|
|
C.D2(U,P,T,N);
|
|
}
|
|
//============================================================
|
|
inline Standard_Real Geom2dInt_CurveTool::FirstParameter (const IntCurveCurve& C) {
|
|
return(C.FirstParameter());
|
|
}
|
|
//============================================================
|
|
inline Standard_Real Geom2dInt_CurveTool::LastParameter (const IntCurveCurve& C) {
|
|
return(C.LastParameter());
|
|
}
|
|
//============================================================
|
|
//== tolerance used by mathemetical algorithms
|
|
//==
|
|
inline Standard_Real Geom2dInt_CurveTool::EpsX (const IntCurveCurve& ) {
|
|
return(1.0e-10);
|
|
}
|
|
//------------------------------------------------------------
|
|
inline Standard_Real Geom2dInt_CurveTool::EpsX (const IntCurveCurve& C,const Standard_Real Eps_XYZ) {
|
|
return(C.Resolution(Eps_XYZ));
|
|
}
|
|
//============================================================
|
|
inline void Geom2dInt_CurveTool::Intervals(const IntCurveCurve& C,
|
|
TColStd_Array1OfReal& Tab) {
|
|
#if IS_C2_COMPOSITE
|
|
C.Intervals(Tab,GeomAbs_C2);
|
|
#else
|
|
C.Intervals(Tab,GeomAbs_C1);
|
|
#endif
|
|
}
|
|
//============================================================
|
|
//inline void Geom2dInt_CurveTool::GetInterval(const IntCurveCurve& C,
|
|
inline void Geom2dInt_CurveTool::GetInterval(const IntCurveCurve& ,
|
|
const Standard_Integer i,
|
|
const TColStd_Array1OfReal& Tab,
|
|
Standard_Real& a,
|
|
Standard_Real& b) {
|
|
a = Tab.Value(i);
|
|
b = Tab.Value(i+1);
|
|
}
|
|
//============================================================
|
|
inline Standard_Integer Geom2dInt_CurveTool::NbIntervals(const IntCurveCurve& C) {
|
|
Standard_Integer N=1;
|
|
#if IS_C2_COMPOSITE
|
|
N = C.NbIntervals(GeomAbs_C2);
|
|
#else
|
|
N = C.NbIntervals(GeomAbs_C1);
|
|
#endif
|
|
return(N);
|
|
}
|
|
//============================================================
|
|
|
|
|