mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR). Used clang-format 18.1.8. New actions to validate code formatting is added. Update .clang-format with disabling of include sorting. It is temporary changes, then include will be sorted. Apply formatting for /src and /tools folder. The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
@@ -49,251 +49,298 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
static Standard_Boolean Affich = Standard_False;
|
||||
static Standard_Integer NBPROJ = 1;
|
||||
#endif
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin,
|
||||
Standard_Real& Tolerance)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin,
|
||||
Standard_Real& Tolerance)
|
||||
{
|
||||
#ifdef DRAW
|
||||
if ( Affich) {
|
||||
if (Affich)
|
||||
{
|
||||
char name[256];
|
||||
Sprintf(name,"PROJCURV_%d",NBPROJ);
|
||||
DrawTrSurf::Set(name,C);
|
||||
Sprintf(name,"PROJSURF_%d",NBPROJ);
|
||||
DrawTrSurf::Set(name,S);
|
||||
Sprintf(name, "PROJCURV_%d", NBPROJ);
|
||||
DrawTrSurf::Set(name, C);
|
||||
Sprintf(name, "PROJSURF_%d", NBPROJ);
|
||||
DrawTrSurf::Set(name, S);
|
||||
NBPROJ++;
|
||||
}
|
||||
#endif
|
||||
|
||||
Tolerance = Max(Precision::PConfusion(),Tolerance);
|
||||
Tolerance = Max(Precision::PConfusion(), Tolerance);
|
||||
|
||||
GeomAdaptor_Curve AC(C, First, Last);
|
||||
GeomAdaptor_Surface AS(S, UDeb, UFin, VDeb, VFin);
|
||||
|
||||
GeomAdaptor_Curve AC(C,First,Last);
|
||||
GeomAdaptor_Surface AS(S,
|
||||
UDeb,
|
||||
UFin,
|
||||
VDeb,
|
||||
VFin);
|
||||
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(AS);
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
|
||||
ProjLib_ProjectedCurve Proj(HS,HC,Tolerance);
|
||||
ProjLib_ProjectedCurve Proj(HS, HC, Tolerance);
|
||||
|
||||
Handle(Geom2d_Curve) G2dC;
|
||||
|
||||
switch ( Proj.GetType()) {
|
||||
switch (Proj.GetType())
|
||||
{
|
||||
|
||||
case GeomAbs_Line:
|
||||
G2dC = new Geom2d_Line(Proj.Line());
|
||||
break;
|
||||
case GeomAbs_Line:
|
||||
G2dC = new Geom2d_Line(Proj.Line());
|
||||
break;
|
||||
|
||||
case GeomAbs_Circle:
|
||||
G2dC = new Geom2d_Circle(Proj.Circle());
|
||||
break;
|
||||
case GeomAbs_Circle:
|
||||
G2dC = new Geom2d_Circle(Proj.Circle());
|
||||
break;
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
G2dC = new Geom2d_Ellipse(Proj.Ellipse());
|
||||
break;
|
||||
case GeomAbs_Ellipse:
|
||||
G2dC = new Geom2d_Ellipse(Proj.Ellipse());
|
||||
break;
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
G2dC = new Geom2d_Parabola(Proj.Parabola());
|
||||
break;
|
||||
case GeomAbs_Parabola:
|
||||
G2dC = new Geom2d_Parabola(Proj.Parabola());
|
||||
break;
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
G2dC = new Geom2d_Hyperbola(Proj.Hyperbola());
|
||||
break;
|
||||
case GeomAbs_Hyperbola:
|
||||
G2dC = new Geom2d_Hyperbola(Proj.Hyperbola());
|
||||
break;
|
||||
|
||||
case GeomAbs_BezierCurve:
|
||||
G2dC = Proj.Bezier();
|
||||
break;
|
||||
case GeomAbs_BezierCurve:
|
||||
G2dC = Proj.Bezier();
|
||||
break;
|
||||
|
||||
case GeomAbs_BSplineCurve:
|
||||
G2dC = Proj.BSpline();
|
||||
break;
|
||||
case GeomAbs_BSplineCurve:
|
||||
G2dC = Proj.BSpline();
|
||||
break;
|
||||
|
||||
default:
|
||||
return G2dC;
|
||||
|
||||
default:
|
||||
return G2dC;
|
||||
}
|
||||
|
||||
if(G2dC.IsNull()) {
|
||||
if (G2dC.IsNull())
|
||||
{
|
||||
Tolerance = Proj.GetTolerance();
|
||||
return G2dC;
|
||||
}
|
||||
|
||||
if ( C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)) ) {
|
||||
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
|
||||
{
|
||||
Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C);
|
||||
Standard_Real U1 = CTrim->FirstParameter();
|
||||
Standard_Real U2 = CTrim->LastParameter();
|
||||
Standard_Real U1 = CTrim->FirstParameter();
|
||||
Standard_Real U2 = CTrim->LastParameter();
|
||||
if (!G2dC->IsPeriodic())
|
||||
{
|
||||
U1 = Max(U1, G2dC->FirstParameter());
|
||||
U2 = Min(U2, G2dC->LastParameter());
|
||||
}
|
||||
G2dC = new Geom2d_TrimmedCurve( G2dC, U1, U2);
|
||||
G2dC = new Geom2d_TrimmedCurve(G2dC, U1, U2);
|
||||
}
|
||||
|
||||
#ifdef DRAW
|
||||
if ( Affich) {
|
||||
static Standard_CString aprojcurv = "projcurv" ;
|
||||
DrawTrSurf::Set(aprojcurv,G2dC);
|
||||
if (Affich)
|
||||
{
|
||||
static Standard_CString aprojcurv = "projcurv";
|
||||
DrawTrSurf::Set(aprojcurv, G2dC);
|
||||
}
|
||||
#endif
|
||||
Tolerance = Proj.GetTolerance();
|
||||
return G2dC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=================================================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
Standard_Real& Tolerance)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
Standard_Real& Tolerance)
|
||||
{
|
||||
Standard_Real UFirst,
|
||||
ULast,
|
||||
VFirst,
|
||||
VLast ;
|
||||
Standard_Real UFirst, ULast, VFirst, VLast;
|
||||
|
||||
S->Bounds(UFirst,
|
||||
ULast,
|
||||
VFirst,
|
||||
VLast) ;
|
||||
return Curve2d(C,
|
||||
First,
|
||||
Last,
|
||||
S,
|
||||
UFirst,
|
||||
ULast,
|
||||
VFirst,
|
||||
VLast,
|
||||
Tolerance) ;
|
||||
S->Bounds(UFirst, ULast, VFirst, VLast);
|
||||
return Curve2d(C, First, Last, S, UFirst, ULast, VFirst, VLast, Tolerance);
|
||||
}
|
||||
|
||||
// Modified by skv - Wed Aug 11 17:26:03 2004 OCC6272 Begin
|
||||
// Add not implemented method.
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=================================================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d( const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin)
|
||||
{
|
||||
Standard_Real First = C->FirstParameter();
|
||||
Standard_Real Last = C->LastParameter();
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
return GeomProjLib::Curve2d(C,First,Last,S,UDeb,UFin,VDeb,VFin,Tol);
|
||||
return GeomProjLib::Curve2d(C, First, Last, S, UDeb, UFin, VDeb, VFin, Tol);
|
||||
}
|
||||
|
||||
// Modified by skv - Wed Aug 11 17:26:03 2004 OCC6272 End
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=================================================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d( const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin,
|
||||
Standard_Real& Tolerance)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin,
|
||||
Standard_Real& Tolerance)
|
||||
{
|
||||
Standard_Real First = C->FirstParameter();
|
||||
Standard_Real Last = C->LastParameter();
|
||||
return GeomProjLib::Curve2d(C,First,Last,S,UDeb,UFin,VDeb,VFin,Tolerance);
|
||||
return GeomProjLib::Curve2d(C, First, Last, S, UDeb, UFin, VDeb, VFin, Tolerance);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d( const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S)
|
||||
{
|
||||
Standard_Real First = C->FirstParameter();
|
||||
Standard_Real Last = C->LastParameter();
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
return GeomProjLib::Curve2d(C,First,Last,S,Tol);
|
||||
return GeomProjLib::Curve2d(C, First, Last, S, Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d( const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S)
|
||||
Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S)
|
||||
{
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
return GeomProjLib::Curve2d(C,First,Last,S,Tol);
|
||||
return GeomProjLib::Curve2d(C, First, Last, S, Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=======================================================================
|
||||
//function : Project
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_Curve) GeomProjLib::Project( const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S)
|
||||
Handle(Geom_Curve) GeomProjLib::Project(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S)
|
||||
{
|
||||
GeomAdaptor_Curve AC(C);
|
||||
GeomAdaptor_Surface AS(S);
|
||||
|
||||
Handle(Geom_Curve) GC;
|
||||
|
||||
if ( AS.GetType() == GeomAbs_Plane) {
|
||||
ProjLib_ProjectOnPlane Proj( AS.Plane().Position());
|
||||
if (AS.GetType() == GeomAbs_Plane)
|
||||
{
|
||||
ProjLib_ProjectOnPlane Proj(AS.Plane().Position());
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
Proj.Load(HC,Precision::PApproximation());
|
||||
Proj.Load(HC, Precision::PApproximation());
|
||||
|
||||
switch ( Proj.GetType()) {
|
||||
switch (Proj.GetType())
|
||||
{
|
||||
case GeomAbs_Line:
|
||||
GC = new Geom_Line(Proj.Line());
|
||||
break;
|
||||
|
||||
case GeomAbs_Circle:
|
||||
GC = new Geom_Circle(Proj.Circle());
|
||||
break;
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
GC = new Geom_Ellipse(Proj.Ellipse());
|
||||
break;
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
GC = new Geom_Parabola(Proj.Parabola());
|
||||
break;
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
GC = new Geom_Hyperbola(Proj.Hyperbola());
|
||||
break;
|
||||
|
||||
case GeomAbs_BezierCurve:
|
||||
GC = Proj.Bezier();
|
||||
break;
|
||||
|
||||
case GeomAbs_BSplineCurve:
|
||||
GC = Proj.BSpline();
|
||||
break;
|
||||
|
||||
default:
|
||||
return GC;
|
||||
}
|
||||
|
||||
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
|
||||
{
|
||||
Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C);
|
||||
Standard_Real U1 = CTrim->FirstParameter();
|
||||
Standard_Real U2 = CTrim->LastParameter();
|
||||
GC = new Geom_TrimmedCurve(GC, U1, U2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(AS);
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
// Standard_Real Tol = Precision::Approximation();
|
||||
// Standard_Real TolU = Precision::PApproximation();
|
||||
// Standard_Real TolV = Precision::PApproximation();
|
||||
Standard_Real Tol = 0.0001;
|
||||
Standard_Real TolU = Pow(Tol, 2. / 3);
|
||||
Standard_Real TolV = Pow(Tol, 2. / 3);
|
||||
ProjLib_CompProjectedCurve Proj(HS, HC, TolU, TolV, -1.);
|
||||
|
||||
Standard_Real f, l;
|
||||
Proj.Bounds(1, f, l);
|
||||
Handle(Adaptor2d_Curve2d) HC2d = Proj.Trim(f, l, TolU);
|
||||
Approx_CurveOnSurface Approx(HC2d, HS, f, l, Tol);
|
||||
Approx.Perform(16, 14, GeomAbs_C2, Standard_True);
|
||||
|
||||
// ici, on a toujours un type BSpline.
|
||||
if (Approx.IsDone() && Approx.HasResult())
|
||||
GC = Approx.Curve3d();
|
||||
}
|
||||
|
||||
return GC;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Handle(Geom_Curve) GeomProjLib::ProjectOnPlane(const Handle(Geom_Curve)& Curve,
|
||||
const Handle(Geom_Plane)& Plane,
|
||||
const gp_Dir& Dir,
|
||||
const Standard_Boolean KeepParametrization)
|
||||
{
|
||||
GeomAdaptor_Curve AC(Curve);
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
|
||||
ProjLib_ProjectOnPlane Proj(Plane->Position(), Dir);
|
||||
Proj.Load(HC, Precision::Approximation(), KeepParametrization);
|
||||
|
||||
Handle(Geom_Curve) GC;
|
||||
|
||||
switch (Proj.GetType())
|
||||
{
|
||||
case GeomAbs_Line:
|
||||
GC = new Geom_Line(Proj.Line());
|
||||
break;
|
||||
|
||||
|
||||
case GeomAbs_Circle:
|
||||
GC = new Geom_Circle(Proj.Circle());
|
||||
break;
|
||||
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
GC = new Geom_Ellipse(Proj.Ellipse());
|
||||
break;
|
||||
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
GC = new Geom_Parabola(Proj.Parabola());
|
||||
break;
|
||||
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
GC = new Geom_Hyperbola(Proj.Hyperbola());
|
||||
break;
|
||||
@@ -305,106 +352,15 @@ Handle(Geom_Curve) GeomProjLib::Project( const Handle(Geom_Curve)& C,
|
||||
case GeomAbs_BSplineCurve:
|
||||
GC = Proj.BSpline();
|
||||
break;
|
||||
|
||||
default:
|
||||
return GC;
|
||||
|
||||
}
|
||||
|
||||
if ( C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||
Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C);
|
||||
Standard_Real U1 = CTrim->FirstParameter();
|
||||
Standard_Real U2 = CTrim->LastParameter();
|
||||
GC = new Geom_TrimmedCurve( GC, U1, U2);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(AS);
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
// Standard_Real Tol = Precision::Approximation();
|
||||
// Standard_Real TolU = Precision::PApproximation();
|
||||
// Standard_Real TolV = Precision::PApproximation();
|
||||
Standard_Real Tol = 0.0001;
|
||||
Standard_Real TolU = Pow(Tol, 2./3);
|
||||
Standard_Real TolV = Pow(Tol, 2./3);
|
||||
ProjLib_CompProjectedCurve Proj(HS,HC,TolU,TolV,-1.);
|
||||
|
||||
Standard_Real f,l;
|
||||
Proj.Bounds(1,f,l);
|
||||
Handle(Adaptor2d_Curve2d) HC2d = Proj.Trim(f,l,TolU);
|
||||
Approx_CurveOnSurface Approx(HC2d, HS, f, l, Tol);
|
||||
Approx.Perform(16, 14, GeomAbs_C2, Standard_True);
|
||||
|
||||
// ici, on a toujours un type BSpline.
|
||||
if (Approx.IsDone() && Approx.HasResult())
|
||||
GC = Approx.Curve3d();
|
||||
if (Curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
|
||||
{
|
||||
Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(Curve);
|
||||
GC = new Geom_TrimmedCurve(GC, Proj.FirstParameter(), Proj.LastParameter());
|
||||
}
|
||||
|
||||
return GC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ProjectOnPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_Curve) GeomProjLib::ProjectOnPlane
|
||||
(const Handle(Geom_Curve)& Curve,
|
||||
const Handle(Geom_Plane)& Plane,
|
||||
const gp_Dir& Dir,
|
||||
const Standard_Boolean KeepParametrization)
|
||||
{
|
||||
GeomAdaptor_Curve AC(Curve);
|
||||
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(AC);
|
||||
|
||||
ProjLib_ProjectOnPlane Proj(Plane->Position(), Dir);
|
||||
Proj.Load(HC,Precision::Approximation(), KeepParametrization);
|
||||
|
||||
Handle(Geom_Curve) GC;
|
||||
|
||||
switch ( Proj.GetType()) {
|
||||
case GeomAbs_Line:
|
||||
GC = new Geom_Line(Proj.Line());
|
||||
break;
|
||||
|
||||
case GeomAbs_Circle:
|
||||
GC = new Geom_Circle(Proj.Circle());
|
||||
break;
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
GC = new Geom_Ellipse(Proj.Ellipse());
|
||||
break;
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
GC = new Geom_Parabola(Proj.Parabola());
|
||||
break;
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
GC = new Geom_Hyperbola(Proj.Hyperbola());
|
||||
break;
|
||||
|
||||
case GeomAbs_BezierCurve:
|
||||
GC = Proj.Bezier();
|
||||
break;
|
||||
|
||||
case GeomAbs_BSplineCurve:
|
||||
GC = Proj.BSpline();
|
||||
break;
|
||||
default:
|
||||
return GC;
|
||||
|
||||
}
|
||||
|
||||
if ( Curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)) ) {
|
||||
Handle(Geom_TrimmedCurve) CTrim
|
||||
= Handle(Geom_TrimmedCurve)::DownCast(Curve);
|
||||
GC = new Geom_TrimmedCurve( GC, Proj.FirstParameter(),
|
||||
Proj.LastParameter());
|
||||
}
|
||||
|
||||
return GC;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -29,15 +29,12 @@ class Geom_Surface;
|
||||
class Geom_Plane;
|
||||
class gp_Dir;
|
||||
|
||||
|
||||
//! Projection of a curve on a surface.
|
||||
class GeomProjLib
|
||||
class GeomProjLib
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve )
|
||||
//! The 3dCurve is taken between the parametrization
|
||||
@@ -47,8 +44,16 @@ public:
|
||||
//! tolerance is set in <Tolerance> as output.
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S, const Standard_Real UFirst, const Standard_Real ULast, const Standard_Real VFirst, const Standard_Real VLast, Standard_Real& Tolerance);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UFirst,
|
||||
const Standard_Real ULast,
|
||||
const Standard_Real VFirst,
|
||||
const Standard_Real VLast,
|
||||
Standard_Real& Tolerance);
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve )
|
||||
//! The 3dCurve is taken between the parametrization
|
||||
@@ -58,8 +63,12 @@ public:
|
||||
//! tolerance is set in <Tolerance> as output.
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S, Standard_Real& Tolerance);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S,
|
||||
Standard_Real& Tolerance);
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve )
|
||||
//! The 3dCurve is taken between the parametrization
|
||||
@@ -68,16 +77,20 @@ public:
|
||||
//! Precision::PApproximation() is used.
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Standard_Real First, const Standard_Real Last, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Handle(Geom_Surface)& S);
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve ).
|
||||
//! If the projection needs an approximation,
|
||||
//! Precision::PApproximation() is used.
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S);
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve ).
|
||||
//! If the projection needs an approximation,
|
||||
@@ -85,8 +98,13 @@ public:
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
//! can expand a little the bounds of surface
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real UDeb, const Standard_Real UFin, const Standard_Real VDeb, const Standard_Real VFin);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin);
|
||||
|
||||
//! gives the 2d-curve of a 3d-curve lying on a
|
||||
//! surface ( uses GeomProjLib_ProjectedCurve ).
|
||||
//! If the projection needs an approximation,
|
||||
@@ -94,14 +112,21 @@ public:
|
||||
//! WARNING : if the projection has failed, this
|
||||
//! method returns a null Handle.
|
||||
//! can expand a little the bounds of surface
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real UDeb, const Standard_Real UFin, const Standard_Real VDeb, const Standard_Real VFin, Standard_Real& Tolerance);
|
||||
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) Curve2d(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real UDeb,
|
||||
const Standard_Real UFin,
|
||||
const Standard_Real VDeb,
|
||||
const Standard_Real VFin,
|
||||
Standard_Real& Tolerance);
|
||||
|
||||
//! Constructs the 3d-curve from the normal
|
||||
//! projection of the Curve <C> on the surface <S>.
|
||||
//! WARNING : if the projection has failed, returns a
|
||||
//! null Handle.
|
||||
Standard_EXPORT static Handle(Geom_Curve) Project (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT static Handle(Geom_Curve) Project(const Handle(Geom_Curve)& C,
|
||||
const Handle(Geom_Surface)& S);
|
||||
|
||||
//! Constructs the 3d-curves from the projection
|
||||
//! of the curve <Curve> on the plane <Plane> along
|
||||
//! the direction <Dir>.
|
||||
@@ -110,29 +135,14 @@ public:
|
||||
//! parametrization of the initial curve <C>.
|
||||
//! It means: proj(C(u)) = PC(u) for each u.
|
||||
//! Otherwise, the parametrization may change.
|
||||
Standard_EXPORT static Handle(Geom_Curve) ProjectOnPlane (const Handle(Geom_Curve)& Curve, const Handle(Geom_Plane)& Plane, const gp_Dir& Dir, const Standard_Boolean KeepParametrization);
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT static Handle(Geom_Curve) ProjectOnPlane(
|
||||
const Handle(Geom_Curve)& Curve,
|
||||
const Handle(Geom_Plane)& Plane,
|
||||
const gp_Dir& Dir,
|
||||
const Standard_Boolean KeepParametrization);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomProjLib_HeaderFile
|
||||
|
Reference in New Issue
Block a user