1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

33
src/Geom2dInt/Geom2dInt.cdl Executable file
View File

@@ -0,0 +1,33 @@
-- File: Geom2dInt.cdl
-- Created: Thu Jun 4 16:06:42 1992
-- Author: Jacques GOUSSARD
-- <jag@sdsun1>
---Copyright: Matra Datavision 1992
package Geom2dInt
---Purpose: Intersection between two Curves2 from Geom2dAdaptor
---Level: Public
--
-- All the methods of the classes are public.
--
uses Standard, gp, TColStd, GeomAbs, Geom2d, Adaptor3d,Adaptor2d, IntCurve
is
generic class CurveTool;
class Geom2dCurveTool instantiates CurveTool from Geom2dInt
(Curve2d from Adaptor2d);
class GInter instantiates IntCurveCurveGen from IntCurve
(Curve2d from Adaptor2d,
Geom2dCurveTool from Geom2dInt);
end Geom2dInt;

View File

@@ -0,0 +1,157 @@
-- File: CurveTool.cdl
-- Created: Thu Oct 22 12:09:58 1992
-- Author: Laurent BUCHARD
-- <lbr@sdsun2>
---Copyright: Matra Datavision 1992
generic class CurveTool from Geom2dInt (
IntCurveCurve as any)
---Purpose: This class provides a CurveTool as < CurveTool from IntCurve >
-- from a Tool as < CurveTool from Adaptor3d > .
uses
Pnt2d from gp,
Vec2d from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Parab2d from gp,
Hypr2d from gp,
Array1OfReal from TColStd,
CurveType from GeomAbs
is
TheType(myclass; C: IntCurveCurve)
---C++: inline
returns CurveType from GeomAbs;
IsComposite(myclass; C: IntCurveCurve)
---C++: inline
returns Boolean from Standard;
Line(myclass; C: IntCurveCurve)
---Purpose: Returns the Lin2d from gp corresponding to the curve C.
-- This method is called only when TheType returns
-- GeomAbs_Line.
---C++: inline
returns Lin2d from gp;
Circle(myclass; C: IntCurveCurve)
---Purpose: Returns the Circ2d from gp corresponding to the curve C.
-- This method is called only when TheType returns
-- GeomAbs_Circle.
---C++: inline
returns Circ2d from gp;
Ellipse(myclass; C: IntCurveCurve)
---Purpose: Returns the Elips2d from gp corresponding to the curve C.
-- This method is called only when TheType returns
-- GeomAbs_Ellipse.
---C++: inline
returns Elips2d from gp;
Parabola(myclass; C: IntCurveCurve)
---Purpose: Returns the Parab2d from gp corresponding to the curve C.
-- This method is called only when TheType returns
-- GeomAbs_Parabola.
---C++: inline
returns Parab2d from gp;
Hyperbola(myclass; C: IntCurveCurve)
---Purpose: Returns the Hypr2d from gp corresponding to the curve C.
-- This method is called only when TheType returns
-- GeomAbs_Hyperbola.
---C++: inline
returns Hypr2d from gp;
-- The following method are used only when TheType returns IntCurve_Other.
EpsX (myclass; C: IntCurveCurve)
---C++: inline
returns Real;
EpsX (myclass; C: IntCurveCurve;
Eps_XYZ : Real from Standard)
---C++: inline
returns Real;
NbSamples(myclass; C: IntCurveCurve)
returns Integer;
NbSamples(myclass; C: IntCurveCurve; U0,U1: Real from Standard)
returns Integer;
FirstParameter(myclass; C:IntCurveCurve)
---C++: inline
returns Real;
LastParameter(myclass; C:IntCurveCurve)
---C++: inline
returns Real;
Value (myclass; C: IntCurveCurve; X: Real)
---C++: inline
returns Pnt2d from gp;
D0 (myclass; C: IntCurveCurve; U: Real ;
P: out Pnt2d);
---C++: inline
D1 (myclass; C: IntCurveCurve; U: Real ;
P: out Pnt2d; T: out Vec2d);
---C++: inline
D2 (myclass; C: IntCurveCurve; U: Real ;
P: out Pnt2d; T,N: out Vec2d);
---C++: inline
NbIntervals(myclass ; C: IntCurveCurve)
---Purpose : output the number of interval of continuity C2 of
-- the curve
---C++: inline
returns Integer from Standard;
Intervals (myclass; C: IntCurveCurve
; Tab : out Array1OfReal from TColStd);
---Purpose: compute Tab.
---C++: inline
GetInterval (myclass; C: IntCurveCurve
; Index : Integer from Standard
; Tab : Array1OfReal from TColStd
; U1, U2 : out Real from Standard);
---Purpose : output the bounds of interval of index <Index>
-- used if Type == Composite.
---C++: inline
end CurveTool;

View File

@@ -0,0 +1,72 @@
// File: Geom2dInt_CurveTool.gxx
// Created: Thu Oct 22 12:09:58 1992
// Author: Laurent BUCHARD
// <lbr@sdsun2>
//-Copyright: Matra Datavision 1992
#include <GeomAbs_CurveType.hxx>
#include <Handle_Geom2d_BezierCurve.hxx>
#include <Handle_Geom2d_BSplineCurve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
//============================================================
Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C,
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C.GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C.NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Standard_Real t=C.LastParameter()-C.FirstParameter();
Standard_Real t1=U1-U0;
if(t1<0.0) t1=-t1;
nbs = C.NbKnots();
nbs*= C.Degree();
nbs*= (t1/t);
if(nbs < 4.0) nbs=4;
}
//// modified by jgv, 20.02.02 for bug OCC165 ////
else if (typC == GeomAbs_OtherCurve)
nbs = 20;
//////////////////////////////////////////////////
if(nbs>300)
nbs = 300;
return((Standard_Integer)nbs);
}
//============================================================
Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C) {
GeomAbs_CurveType typC = C.GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C.NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
nbs = C.NbKnots();
nbs*= C.Degree();
if(nbs < 2.0) nbs=2;
}
//// modified by jgv, 20.02.02 for bug OCC165 ////
else if (typC == GeomAbs_OtherCurve)
nbs = 20;
//////////////////////////////////////////////////
if(nbs>300)
nbs = 300;
return((Standard_Integer)nbs);
}

View File

@@ -0,0 +1,121 @@
// File: Geom2dInt_CurveTool.lxx
// Created: Thu Oct 22 12:14:59 1992
// Author: Laurent BUCHARD
// <lbr@sdsun2>
#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);
}
//============================================================