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:
49
src/BRepLProp/BRepLProp.cdl
Executable file
49
src/BRepLProp/BRepLProp.cdl
Executable file
@@ -0,0 +1,49 @@
|
||||
-- File: BRepLProp.cdl
|
||||
-- Created: Thu Feb 24 10:15:08 1994
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@nonox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
package BRepLProp
|
||||
|
||||
---Purpose: These global functions compute the degree of
|
||||
-- continuity of a curve built by concatenation of two
|
||||
-- edges at their junction point.
|
||||
|
||||
uses Standard, gp, BRepAdaptor, GeomAbs, LProp
|
||||
|
||||
is
|
||||
|
||||
class CurveTool;
|
||||
class SurfaceTool;
|
||||
|
||||
|
||||
class CLProps from BRepLProp
|
||||
instantiates CLProps from LProp(Curve from BRepAdaptor,
|
||||
Vec from gp,
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
CurveTool from BRepLProp);
|
||||
|
||||
class SLProps from BRepLProp
|
||||
instantiates SLProps from LProp(Surface from BRepAdaptor,
|
||||
SurfaceTool from BRepLProp);
|
||||
|
||||
|
||||
Continuity(C1,C2 : Curve from BRepAdaptor;
|
||||
u1,u2 : Real from Standard;
|
||||
tl,ta : Real from Standard)
|
||||
---Purpose: Computes the regularity at the junction between C1 and
|
||||
-- C2. The point u1 on C1 and the point u2 on C2 must be
|
||||
-- confused. tl and ta are the linear and angular
|
||||
-- tolerance used two compare the derivative.
|
||||
returns Shape from GeomAbs;
|
||||
|
||||
|
||||
Continuity(C1,C2 : Curve from BRepAdaptor;
|
||||
u1,u2 : Real from Standard)
|
||||
---Purpose: The same as preciding but using the standard
|
||||
-- tolerances from package Precision.
|
||||
returns Shape from GeomAbs;
|
||||
|
||||
end BRepLProp;
|
93
src/BRepLProp/BRepLProp.cxx
Executable file
93
src/BRepLProp/BRepLProp.cxx
Executable file
@@ -0,0 +1,93 @@
|
||||
// File: BRepLProp.cxx
|
||||
// Created: Thu Feb 24 17:12:04 1994
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@nonox>
|
||||
|
||||
|
||||
#include <BRepLProp.ixx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRepLProp_CLProps.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape BRepLProp::Continuity(const BRepAdaptor_Curve& C1,
|
||||
const BRepAdaptor_Curve& C2,
|
||||
const Standard_Real u1,
|
||||
const Standard_Real u2,
|
||||
const Standard_Real tl,
|
||||
const Standard_Real ta)
|
||||
{
|
||||
GeomAbs_Shape cont = GeomAbs_C0;
|
||||
Standard_Boolean fini = Standard_False;
|
||||
gp_Vec d1,d2;
|
||||
gp_Dir dir1,dir2;
|
||||
GeomAbs_Shape cont1 = C1.Continuity(), cont2 = C2.Continuity();
|
||||
Standard_Integer n1 = 0, n2 = 0;
|
||||
if (cont1 >= 5) n1 = 3;
|
||||
else if(cont1 == 4) n1 = 2;
|
||||
else if(cont1 == 2) n1 = 1;
|
||||
if (cont2 >= 5) n2 = 3;
|
||||
else if(cont2 == 4) n2 = 2;
|
||||
else if(cont2 == 2) n2 = 1;
|
||||
BRepLProp_CLProps clp1(C1,u1,n1,tl);
|
||||
BRepLProp_CLProps clp2(C2,u2,n2,tl);
|
||||
if(!(clp1.Value().IsEqual(clp2.Value(),tl))) {
|
||||
Standard_Failure::Raise("Courbes non jointives");
|
||||
}
|
||||
Standard_Integer min = Min(n1,n2);
|
||||
if ( min >= 1 ) {
|
||||
d1 = clp1.D1();
|
||||
d2 = clp2.D1();
|
||||
if(C1.Edge().Orientation() == TopAbs_REVERSED) d1.Reverse();
|
||||
if(C2.Edge().Orientation() == TopAbs_REVERSED) d2.Reverse();
|
||||
if(d1.IsEqual(d2,tl,ta)) {
|
||||
cont = GeomAbs_C1;
|
||||
}
|
||||
else if(clp1.IsTangentDefined() && clp2.IsTangentDefined()){
|
||||
clp1.Tangent(dir1);
|
||||
clp2.Tangent(dir2);
|
||||
if(C1.Edge().Orientation() == TopAbs_REVERSED) dir1.Reverse();
|
||||
if(C2.Edge().Orientation() == TopAbs_REVERSED) dir2.Reverse();
|
||||
if(dir1.IsEqual(dir2,ta)){
|
||||
cont = GeomAbs_G1;
|
||||
}
|
||||
fini = Standard_True;
|
||||
}
|
||||
else {fini = Standard_True; }
|
||||
}
|
||||
if ( min >= 2 && !fini ) {
|
||||
d1 = clp1.D2();
|
||||
d2 = clp2.D2();
|
||||
if(d1.IsEqual(d2,tl,ta)){
|
||||
cont = GeomAbs_C2;
|
||||
}
|
||||
}
|
||||
const TopoDS_Edge& E1 = C1.Edge();
|
||||
const TopoDS_Edge& E2 = C2.Edge();
|
||||
if (E1.IsSame(E2) && C1.IsPeriodic() && cont >= GeomAbs_G1)
|
||||
cont = GeomAbs_CN;
|
||||
return cont;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape BRepLProp::Continuity(const BRepAdaptor_Curve& C1,
|
||||
const BRepAdaptor_Curve& C2,
|
||||
const Standard_Real u1,
|
||||
const Standard_Real u2)
|
||||
{
|
||||
return Continuity(C1,C2,u1,u2,Precision::Confusion(),Precision::Angular());
|
||||
}
|
||||
|
||||
|
51
src/BRepLProp/BRepLProp_CurveTool.cdl
Executable file
51
src/BRepLProp/BRepLProp_CurveTool.cdl
Executable file
@@ -0,0 +1,51 @@
|
||||
-- File: BRepLProp_CurveTool.cdl
|
||||
-- Created: Thu Feb 24 10:32:36 1994
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@nonox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
class CurveTool from BRepLProp
|
||||
|
||||
uses Vec from gp,
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
Curve from BRepAdaptor
|
||||
|
||||
is
|
||||
|
||||
Value(myclass; C : Curve from BRepAdaptor; U : Real; P : out Pnt);
|
||||
---Purpose: Computes the point <P> of parameter <U> on the curve <C>.
|
||||
|
||||
D1 (myclass; C : Curve from BRepAdaptor;
|
||||
U : Real; P : out Pnt; V1 : out Vec);
|
||||
---Purpose: Computes the point <P> and first derivative <V1> of
|
||||
-- parameter <U> on the curve <C>.
|
||||
|
||||
D2 (myclass; C : Curve from BRepAdaptor;
|
||||
U : Real; P : out Pnt; V1, V2 : out Vec);
|
||||
---Purpose: Computes the point <P>, the first derivative <V1> and second
|
||||
-- derivative <V2> of parameter <U> on the curve <C>.
|
||||
|
||||
D3 (myclass; C : Curve from BRepAdaptor;
|
||||
U : Real; P : out Pnt; V1, V2, V3 : out Vec);
|
||||
---Purpose: Computes the point <P>, the first derivative <V1>, the
|
||||
-- second derivative <V2> and third derivative <V3> of
|
||||
-- parameter <U> on the curve <C>.
|
||||
|
||||
Continuity(myclass; C : Curve from BRepAdaptor) returns Integer;
|
||||
---Purpose: returns the order of continuity of the curve <C>.
|
||||
-- returns 1 : first derivative only is computable
|
||||
-- returns 2 : first and second derivative only are computable.
|
||||
-- returns 3 : first, second and third are computable.
|
||||
|
||||
FirstParameter(myclass; C : Curve from BRepAdaptor) returns Real;
|
||||
---Purpose: returns the first parameter bound of the curve.
|
||||
--
|
||||
|
||||
LastParameter(myclass; C : Curve from BRepAdaptor) returns Real;
|
||||
---Purpose: returns the last parameter bound of the curve.
|
||||
-- FirstParameter must be less than LastParamenter.
|
||||
|
||||
end CurveTool;
|
||||
|
||||
|
116
src/BRepLProp/BRepLProp_CurveTool.cxx
Executable file
116
src/BRepLProp/BRepLProp_CurveTool.cxx
Executable file
@@ -0,0 +1,116 @@
|
||||
// File: BRepLProp_CurveTool.cxx
|
||||
// Created: Thu Feb 24 11:09:42 1994
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@nonox>
|
||||
|
||||
|
||||
#include <BRepLProp_CurveTool.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_CurveTool::Value(const BRepAdaptor_Curve& C,
|
||||
const Standard_Real U,
|
||||
gp_Pnt& P)
|
||||
{
|
||||
P = C.Value(U);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_CurveTool::D1(const BRepAdaptor_Curve& C,
|
||||
const Standard_Real U,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1)
|
||||
{
|
||||
C.D1(U,P,V1);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_CurveTool::D2(const BRepAdaptor_Curve& C,
|
||||
const Standard_Real U,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1,
|
||||
gp_Vec& V2)
|
||||
{
|
||||
C.D2(U,P,V1,V2);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_CurveTool::D3(const BRepAdaptor_Curve& C,
|
||||
const Standard_Real U,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1,
|
||||
gp_Vec& V2,
|
||||
gp_Vec& V3)
|
||||
{
|
||||
C.D3(U,P,V1,V2,V3);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer BRepLProp_CurveTool::Continuity(const BRepAdaptor_Curve& C)
|
||||
{
|
||||
GeomAbs_Shape s = C.Continuity();
|
||||
switch (s) {
|
||||
case GeomAbs_C0:
|
||||
return 0;
|
||||
case GeomAbs_C1:
|
||||
return 1;
|
||||
case GeomAbs_C2:
|
||||
return 2;
|
||||
case GeomAbs_C3:
|
||||
return 3;
|
||||
case GeomAbs_G1:
|
||||
return 0;
|
||||
case GeomAbs_G2:
|
||||
return 0;
|
||||
case GeomAbs_CN:
|
||||
return 3;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real BRepLProp_CurveTool::FirstParameter(const BRepAdaptor_Curve& C)
|
||||
{
|
||||
return C.FirstParameter();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real BRepLProp_CurveTool::LastParameter(const BRepAdaptor_Curve& C)
|
||||
{
|
||||
return C.LastParameter();
|
||||
}
|
||||
|
||||
|
41
src/BRepLProp/BRepLProp_SurfaceTool.cdl
Executable file
41
src/BRepLProp/BRepLProp_SurfaceTool.cdl
Executable file
@@ -0,0 +1,41 @@
|
||||
-- File: BRepLProp_SurfaceTool.cdl
|
||||
-- Created: Thu Feb 24 10:40:20 1994
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@nonox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
class SurfaceTool from BRepLProp
|
||||
|
||||
uses Pnt from gp,
|
||||
Vec from gp,
|
||||
Surface from BRepAdaptor
|
||||
|
||||
is
|
||||
|
||||
Value(myclass; S : Surface; U, V : Real; P : out Pnt);
|
||||
---Purpose: Computes the point <P> of parameter <U> and <V> on the
|
||||
-- Surface <S>.
|
||||
|
||||
D1 (myclass; S : Surface; U, V : Real; P : out Pnt; D1U, D1V : out Vec);
|
||||
---Purpose: Computes the point <P> and first derivative <D1*> of
|
||||
-- parameter <U> and <V> on the Surface <S>.
|
||||
|
||||
D2 (myclass; S : Surface; U, V : Real;
|
||||
P : out Pnt; D1U, D1V, D2U, D2V, DUV : out Vec);
|
||||
---Purpose: Computes the point <P>, the first derivative <D1*> and second
|
||||
-- derivative <D2*> of parameter <U> and <V> on the Surface <S>.
|
||||
|
||||
DN (myclass; S : Surface; U, V : Real; IU, IV : Integer)
|
||||
returns Vec;
|
||||
|
||||
Continuity(myclass; S : Surface) returns Integer;
|
||||
---Purpose: returns the order of continuity of the Surface <S>.
|
||||
-- returns 1 : first derivative only is computable
|
||||
-- returns 2 : first and second derivative only are computable.
|
||||
|
||||
Bounds(myclass; S : Surface; U1, V1, U2, V2 : out Real);
|
||||
---Purpose: returns the bounds of the Surface.
|
||||
|
||||
end SurfaceTool;
|
||||
|
||||
|
123
src/BRepLProp/BRepLProp_SurfaceTool.cxx
Executable file
123
src/BRepLProp/BRepLProp_SurfaceTool.cxx
Executable file
@@ -0,0 +1,123 @@
|
||||
// File: BRepLProp_SurfaceTool.cxx
|
||||
// Created: Thu Feb 24 16:44:32 1994
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@nonox>
|
||||
|
||||
|
||||
#include <BRepLProp_SurfaceTool.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_SurfaceTool::Value(const BRepAdaptor_Surface& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P)
|
||||
{
|
||||
P = S.Value(U, V);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_SurfaceTool::D1(const BRepAdaptor_Surface& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V)
|
||||
{
|
||||
S.D1(U, V, P, D1U, D1V);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_SurfaceTool::D2(const BRepAdaptor_Surface& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V,
|
||||
gp_Vec& D2U,
|
||||
gp_Vec& D2V,
|
||||
gp_Vec& DUV)
|
||||
{
|
||||
S.D2(U, V, P, D1U, D1V, D2U, D2V, DUV);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
gp_Vec BRepLProp_SurfaceTool::DN(const BRepAdaptor_Surface& S,
|
||||
const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
const Standard_Integer IU,
|
||||
const Standard_Integer IV)
|
||||
{
|
||||
return S.DN(U, V, IU, IV);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer BRepLProp_SurfaceTool::Continuity
|
||||
(const BRepAdaptor_Surface& S)
|
||||
{
|
||||
GeomAbs_Shape s = (GeomAbs_Shape) Min(S.UContinuity(),S.VContinuity());
|
||||
switch (s) {
|
||||
case GeomAbs_C0:
|
||||
return 0;
|
||||
case GeomAbs_C1:
|
||||
return 1;
|
||||
case GeomAbs_C2:
|
||||
return 2;
|
||||
case GeomAbs_C3:
|
||||
return 3;
|
||||
case GeomAbs_G1:
|
||||
return 0;
|
||||
case GeomAbs_G2:
|
||||
return 0;
|
||||
case GeomAbs_CN:
|
||||
return 3;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bounds
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepLProp_SurfaceTool::Bounds(const BRepAdaptor_Surface& S,
|
||||
Standard_Real& U1,
|
||||
Standard_Real& V1,
|
||||
Standard_Real& U2,
|
||||
Standard_Real& V2)
|
||||
{
|
||||
U1 = S.FirstUParameter();
|
||||
V1 = S.FirstVParameter();
|
||||
U2 = S.LastUParameter();
|
||||
V2 = S.LastVParameter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user