mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028966: Coding Rules - remove Adaptor2d_HCurve2d, Adaptor3d_HCurve and Adaptor3d_HSurface classes
Adaptor2d_Curve2d, Adaptor3d_Curve and Adaptor3d_Surface now inherit Standard_Transient. Interfaces Adaptor2d_HCurve2d, Adaptor3d_HCurve, Adaptor3d_HSurface and their subclasses are now aliases to Adaptor2d_Curve2d, Adaptor3d_Curve and Adaptor3d_Surface. Removed numerous unsafe reinterpret casts. Generic classes Adaptor3d_GenHCurve, Adaptor3d_GenHSurface, Adaptor2d_GenHCurve2d have been removed. Several redundant .lxx files have been merged into .hxx. Removed obsolete adaptor classes with H suffix.
This commit is contained in:
@@ -11,9 +11,7 @@ ProjLib_Cone.hxx
|
||||
ProjLib_Cylinder.cxx
|
||||
ProjLib_Cylinder.hxx
|
||||
ProjLib_HCompProjectedCurve.hxx
|
||||
ProjLib_HCompProjectedCurve_0.cxx
|
||||
ProjLib_HProjectedCurve.hxx
|
||||
ProjLib_HProjectedCurve_0.cxx
|
||||
ProjLib_HSequenceOfHSequenceOfPnt.hxx
|
||||
ProjLib_Plane.cxx
|
||||
ProjLib_Plane.hxx
|
||||
|
@@ -48,7 +48,7 @@
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Project
|
||||
@@ -287,7 +287,7 @@ void ProjLib::MakePCurveOfType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ProjLib::IsAnaSurf
|
||||
(const Handle(Adaptor3d_HSurface)& theAS)
|
||||
(const Handle(Adaptor3d_Surface)& theAS)
|
||||
{
|
||||
switch (theAS->GetType())
|
||||
{
|
||||
|
@@ -17,9 +17,7 @@
|
||||
#ifndef _ProjLib_HeaderFile
|
||||
#define _ProjLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
|
||||
class gp_Pnt2d;
|
||||
@@ -55,7 +53,6 @@ class ProjLib_Cylinder;
|
||||
class ProjLib_Cone;
|
||||
class ProjLib_Sphere;
|
||||
class ProjLib_Torus;
|
||||
class Adaptor3d_HSurface;
|
||||
|
||||
//! The projLib package first provides projection of
|
||||
//! curves on a plane along a given Direction. The
|
||||
@@ -136,7 +133,7 @@ public:
|
||||
//! Plane, Cylinder, Cone, Sphere, Torus.
|
||||
//! For all other types of surface method returns "false".
|
||||
Standard_EXPORT static Standard_Boolean IsAnaSurf
|
||||
(const Handle(Adaptor3d_HSurface)& theAS);
|
||||
(const Handle(Adaptor3d_Surface)& theAS);
|
||||
|
||||
|
||||
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Extrema_ExtCS.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Extrema_GenLocateExtPS.hxx>
|
||||
@@ -42,12 +42,14 @@
|
||||
#include <TColgp_HSequenceOfPnt.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Extrema_ExtCC.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
|
||||
#define FuncTol 1.e-10
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(ProjLib_CompProjectedCurve, Adaptor2d_Curve2d)
|
||||
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
#include <OSD_Timer.hxx>
|
||||
|
||||
@@ -76,8 +78,8 @@ static void ResultChron( OSD_Chronometer & ch, Standard_Real & time)
|
||||
// myPeriodicDir - 0 for U periodicity and 1 for V periodicity.
|
||||
struct SplitDS
|
||||
{
|
||||
SplitDS(const Handle(Adaptor3d_HCurve) &theCurve,
|
||||
const Handle(Adaptor3d_HSurface) &theSurface,
|
||||
SplitDS(const Handle(Adaptor3d_Curve) &theCurve,
|
||||
const Handle(Adaptor3d_Surface) &theSurface,
|
||||
NCollection_Vector<Standard_Real> &theSplits)
|
||||
: myCurve(theCurve),
|
||||
mySurface(theSurface),
|
||||
@@ -92,8 +94,8 @@ struct SplitDS
|
||||
// Assignment operator is forbidden.
|
||||
void operator=(const SplitDS &theSplitDS);
|
||||
|
||||
const Handle(Adaptor3d_HCurve) myCurve;
|
||||
const Handle(Adaptor3d_HSurface) mySurface;
|
||||
const Handle(Adaptor3d_Curve) myCurve;
|
||||
const Handle(Adaptor3d_Surface) mySurface;
|
||||
NCollection_Vector<Standard_Real> &mySplits;
|
||||
|
||||
Standard_Real myPerMinParam;
|
||||
@@ -105,8 +107,8 @@ struct SplitDS
|
||||
};
|
||||
|
||||
//! Compute split points in the parameter space of the curve.
|
||||
static void BuildCurveSplits(const Handle(Adaptor3d_HCurve) &theCurve,
|
||||
const Handle(Adaptor3d_HSurface) &theSurface,
|
||||
static void BuildCurveSplits(const Handle(Adaptor3d_Curve) &theCurve,
|
||||
const Handle(Adaptor3d_Surface) &theSurface,
|
||||
const Standard_Real theTolU,
|
||||
const Standard_Real theTolV,
|
||||
NCollection_Vector<Standard_Real> &theSplits);
|
||||
@@ -139,8 +141,8 @@ static void d1(const Standard_Real t,
|
||||
const Standard_Real u,
|
||||
const Standard_Real v,
|
||||
gp_Vec2d& V,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
gp_Pnt S, C;
|
||||
gp_Vec DS1_u, DS1_v, DS2_u, DS2_uv, DS2_v, DC1_t;
|
||||
@@ -172,8 +174,8 @@ static void d2(const Standard_Real t,
|
||||
const Standard_Real u,
|
||||
const Standard_Real v,
|
||||
gp_Vec2d& V1, gp_Vec2d& V2,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
gp_Pnt S, C;
|
||||
gp_Vec DS1_u, DS1_v, DS2_u, DS2_uv, DS2_v,
|
||||
@@ -247,8 +249,8 @@ static void d1CurvOnSurf(const Standard_Real t,
|
||||
const Standard_Real u,
|
||||
const Standard_Real v,
|
||||
gp_Vec& V,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
gp_Pnt S, C;
|
||||
gp_Vec2d V2d;
|
||||
@@ -285,8 +287,8 @@ static void d2CurvOnSurf(const Standard_Real t,
|
||||
const Standard_Real u,
|
||||
const Standard_Real v,
|
||||
gp_Vec& V1 , gp_Vec& V2 ,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
gp_Pnt S, C;
|
||||
gp_Vec2d V12d,V22d;
|
||||
@@ -369,8 +371,8 @@ static Standard_Boolean ExactBound(gp_Pnt& Sol,
|
||||
const Standard_Real Tol,
|
||||
const Standard_Real TolU,
|
||||
const Standard_Real TolV,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
Standard_Real U0, V0, t, t1, t2, FirstU, LastU, FirstV, LastV;
|
||||
gp_Pnt2d POnS;
|
||||
@@ -442,9 +444,7 @@ static Standard_Boolean ExactBound(gp_Pnt& Sol,
|
||||
gp_Pnt P;
|
||||
P = Seq.Last ();
|
||||
Seq.Remove (Seq.Length ());
|
||||
ProjLib_PrjResolve aPrjPS (Curve->Curve (),
|
||||
Surface->Surface (),
|
||||
Standard_Integer (P.Z ()));
|
||||
ProjLib_PrjResolve aPrjPS (*Curve, *Surface, Standard_Integer (P.Z ()));
|
||||
if (Standard_Integer (P.Z ()) == 2)
|
||||
{
|
||||
aPrjPS.Perform (t, P.X (), V0, gp_Pnt2d (Tol, TolV),
|
||||
@@ -482,8 +482,8 @@ static void DichExactBound(gp_Pnt& Sol,
|
||||
const Standard_Real Tol,
|
||||
const Standard_Real TolU,
|
||||
const Standard_Real TolV,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surface)
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surface)
|
||||
{
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
InitChron(chr_dicho_bound);
|
||||
@@ -493,7 +493,7 @@ static void DichExactBound(gp_Pnt& Sol,
|
||||
gp_Pnt2d POnS;
|
||||
U0 = Sol.Y();
|
||||
V0 = Sol.Z();
|
||||
ProjLib_PrjResolve aPrjPS(Curve->Curve(), Surface->Surface(), 1);
|
||||
ProjLib_PrjResolve aPrjPS (*Curve, *Surface, 1);
|
||||
|
||||
Standard_Real aNotSol = NotSol;
|
||||
while (fabs(Sol.X() - aNotSol) > Tol)
|
||||
@@ -526,18 +526,18 @@ static void DichExactBound(gp_Pnt& Sol,
|
||||
|
||||
static Standard_Boolean InitialPoint(const gp_Pnt& Point,
|
||||
const Standard_Real t,
|
||||
const Handle(Adaptor3d_HCurve)& C,
|
||||
const Handle(Adaptor3d_HSurface)& S,
|
||||
const Handle(Adaptor3d_Curve)& C,
|
||||
const Handle(Adaptor3d_Surface)& S,
|
||||
const Standard_Real TolU,
|
||||
const Standard_Real TolV,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V)
|
||||
{
|
||||
|
||||
ProjLib_PrjResolve aPrjPS(C->Curve(), S->Surface(), 1);
|
||||
ProjLib_PrjResolve aPrjPS (*C, *S, 1);
|
||||
Standard_Real ParU,ParV;
|
||||
Extrema_ExtPS aExtPS;
|
||||
aExtPS.Initialize(S->Surface(), S->FirstUParameter(),
|
||||
aExtPS.Initialize (*S, S->FirstUParameter(),
|
||||
S->LastUParameter(), S->FirstVParameter(),
|
||||
S->LastVParameter(), TolU, TolV);
|
||||
|
||||
@@ -588,8 +588,8 @@ ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve()
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve
|
||||
(const Handle(Adaptor3d_HSurface)& theSurface,
|
||||
const Handle(Adaptor3d_HCurve)& theCurve,
|
||||
(const Handle(Adaptor3d_Surface)& theSurface,
|
||||
const Handle(Adaptor3d_Curve)& theCurve,
|
||||
const Standard_Real theTolU,
|
||||
const Standard_Real theTolV)
|
||||
: mySurface (theSurface),
|
||||
@@ -609,8 +609,8 @@ ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve
|
||||
(const Handle(Adaptor3d_HSurface)& theSurface,
|
||||
const Handle(Adaptor3d_HCurve)& theCurve,
|
||||
(const Handle(Adaptor3d_Surface)& theSurface,
|
||||
const Handle(Adaptor3d_Curve)& theCurve,
|
||||
const Standard_Real theTolU,
|
||||
const Standard_Real theTolV,
|
||||
const Standard_Real theMaxDist)
|
||||
@@ -642,7 +642,7 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
isSplitsComputed = Standard_False;
|
||||
|
||||
const Standard_Real aTolExt = Precision::PConfusion();
|
||||
Extrema_ExtCS CExt(myCurve->Curve(), mySurface->Surface(), aTolExt, aTolExt);
|
||||
Extrema_ExtCS CExt (*myCurve, *mySurface, aTolExt, aTolExt);
|
||||
if (CExt.IsDone() && CExt.NbExt())
|
||||
{
|
||||
// Search for the minimum solution.
|
||||
@@ -680,7 +680,7 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
gp_Pnt2d aLowBorder(mySurface->FirstUParameter(),mySurface->FirstVParameter());
|
||||
gp_Pnt2d aUppBorder(mySurface->LastUParameter(), mySurface->LastVParameter());
|
||||
gp_Pnt2d aTol(myTolU, myTolV);
|
||||
ProjLib_PrjResolve aPrjPS(myCurve->Curve(), mySurface->Surface(), 1);
|
||||
ProjLib_PrjResolve aPrjPS (*myCurve, *mySurface, 1);
|
||||
|
||||
t = FirstU;
|
||||
Standard_Boolean new_part;
|
||||
@@ -1133,7 +1133,7 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_HSurface)& S)
|
||||
void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_Surface)& S)
|
||||
{
|
||||
mySurface = S;
|
||||
}
|
||||
@@ -1143,7 +1143,7 @@ void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_HSurface)& S)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_Curve)& C)
|
||||
{
|
||||
myCurve = C;
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ void ProjLib_CompProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Adaptor3d_HSurface)& ProjLib_CompProjectedCurve::GetSurface() const
|
||||
const Handle(Adaptor3d_Surface)& ProjLib_CompProjectedCurve::GetSurface() const
|
||||
{
|
||||
return mySurface;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ const Handle(Adaptor3d_HSurface)& ProjLib_CompProjectedCurve::GetSurface() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Adaptor3d_HCurve)& ProjLib_CompProjectedCurve::GetCurve() const
|
||||
const Handle(Adaptor3d_Curve)& ProjLib_CompProjectedCurve::GetCurve() const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
@@ -1337,7 +1337,7 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const
|
||||
}
|
||||
//End of cubic interpolation
|
||||
|
||||
ProjLib_PrjResolve aPrjPS(myCurve->Curve(), mySurface->Surface(), 1);
|
||||
ProjLib_PrjResolve aPrjPS (*myCurve, *mySurface, 1);
|
||||
aPrjPS.Perform(U, U0, V0, gp_Pnt2d(myTolU, myTolV),
|
||||
gp_Pnt2d(mySurface->FirstUParameter(), mySurface->FirstVParameter()),
|
||||
gp_Pnt2d(mySurface->LastUParameter(), mySurface->LastVParameter()));
|
||||
@@ -1346,7 +1346,7 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const
|
||||
else
|
||||
{
|
||||
gp_Pnt thePoint = myCurve->Value(U);
|
||||
Extrema_ExtPS aExtPS(thePoint, mySurface->Surface(), myTolU, myTolV);
|
||||
Extrema_ExtPS aExtPS(thePoint, *mySurface, myTolU, myTolV);
|
||||
if (aExtPS.IsDone() && aExtPS.NbExt())
|
||||
{
|
||||
Standard_Integer k, Nend, imin = 1;
|
||||
@@ -1571,7 +1571,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Real V;
|
||||
V = (mySequence->Value(i)->Value(j).Z()
|
||||
+ mySequence->Value(i)->Value(j +1).Z())/2;
|
||||
ProjLib_PrjResolve Solver(myCurve->Curve(), mySurface->Surface(), 2);
|
||||
ProjLib_PrjResolve Solver (*myCurve, *mySurface, 2);
|
||||
|
||||
gp_Vec2d D;
|
||||
gp_Pnt Triple;
|
||||
@@ -1637,7 +1637,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Real U;
|
||||
U = (mySequence->Value(i)->Value(j).Y()
|
||||
+ mySequence->Value(i)->Value(j +1).Y())/2;
|
||||
ProjLib_PrjResolve Solver(myCurve->Curve(), mySurface->Surface(), 3);
|
||||
ProjLib_PrjResolve Solver (*myCurve, *mySurface, 3);
|
||||
|
||||
gp_Vec2d D;
|
||||
gp_Pnt Triple;
|
||||
@@ -1734,15 +1734,15 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_HCurve2d) ProjLib_CompProjectedCurve::Trim
|
||||
Handle(Adaptor2d_Curve2d) ProjLib_CompProjectedCurve::Trim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(ProjLib_HCompProjectedCurve) HCS =
|
||||
new ProjLib_HCompProjectedCurve(*this);
|
||||
HCS->ChangeCurve2d().Load(mySurface);
|
||||
HCS->ChangeCurve2d().Load(myCurve->Trim(First,Last,Tol));
|
||||
HCS->Load(mySurface);
|
||||
HCS->Load(myCurve->Trim(First,Last,Tol));
|
||||
return HCS;
|
||||
}
|
||||
|
||||
@@ -1819,8 +1819,8 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt &thePoint) co
|
||||
//function : BuildCurveSplits
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BuildCurveSplits(const Handle(Adaptor3d_HCurve) &theCurve,
|
||||
const Handle(Adaptor3d_HSurface) &theSurface,
|
||||
void BuildCurveSplits(const Handle(Adaptor3d_Curve) &theCurve,
|
||||
const Handle(Adaptor3d_Surface) &theSurface,
|
||||
const Standard_Real theTolU,
|
||||
const Standard_Real theTolV,
|
||||
NCollection_Vector<Standard_Real> &theSplits)
|
||||
@@ -1828,7 +1828,7 @@ void BuildCurveSplits(const Handle(Adaptor3d_HCurve) &theCurve,
|
||||
SplitDS aDS(theCurve, theSurface, theSplits);
|
||||
|
||||
Extrema_ExtPS anExtPS;
|
||||
anExtPS.Initialize(theSurface->Surface(),
|
||||
anExtPS.Initialize(*theSurface,
|
||||
theSurface->FirstUParameter(), theSurface->LastUParameter(),
|
||||
theSurface->FirstVParameter(), theSurface->LastVParameter(),
|
||||
theTolU, theTolV);
|
||||
@@ -1874,12 +1874,12 @@ void SplitOnDirection(SplitDS & theSplitDS)
|
||||
|
||||
// Create line which is represent periodic border.
|
||||
Handle(Geom2d_Curve) aC2GC = new Geom2d_Line(aStartPnt, aDir);
|
||||
Handle(Geom2dAdaptor_HCurve) aC = new Geom2dAdaptor_HCurve(aC2GC, 0, aLast2DParam);
|
||||
Handle(Geom2dAdaptor_Curve) aC = new Geom2dAdaptor_Curve(aC2GC, 0, aLast2DParam);
|
||||
Adaptor3d_CurveOnSurface aCOnS(aC, theSplitDS.mySurface);
|
||||
|
||||
Extrema_ExtCC anExtCC;
|
||||
anExtCC.SetCurve(1, aCOnS);
|
||||
anExtCC.SetCurve(2, theSplitDS.myCurve->Curve());
|
||||
anExtCC.SetCurve(2, *theSplitDS.myCurve);
|
||||
anExtCC.SetSingleSolutionFlag(Standard_True); // Search only one solution since multiple invocations are needed.
|
||||
anExtCC.SetRange(1, 0, aLast2DParam);
|
||||
theSplitDS.myExtCC = &anExtCC;
|
||||
|
@@ -17,49 +17,33 @@
|
||||
#ifndef _ProjLib_CompProjectedCurve_HeaderFile
|
||||
#define _ProjLib_CompProjectedCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <ProjLib_HSequenceOfHSequenceOfPnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
class Adaptor3d_HSurface;
|
||||
class Adaptor3d_HCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Standard_NotImplemented;
|
||||
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class Adaptor2d_HCurve2d;
|
||||
|
||||
|
||||
|
||||
class ProjLib_CompProjectedCurve : public Adaptor2d_Curve2d
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(ProjLib_CompProjectedCurve, Adaptor2d_Curve2d)
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT ProjLib_CompProjectedCurve();
|
||||
|
||||
//! try to find all solutions
|
||||
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real TolU, const Standard_Real TolV);
|
||||
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real TolU, const Standard_Real TolV);
|
||||
|
||||
//! this constructor tries to optimize the search using the
|
||||
//! assumption that maximum distance between surface and curve less or
|
||||
//! equal then MaxDist.
|
||||
//! if MaxDist < 0 then algorithm works as above.
|
||||
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real TolU, const Standard_Real TolV, const Standard_Real MaxDist);
|
||||
Standard_EXPORT ProjLib_CompProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real TolU, const Standard_Real TolV, const Standard_Real MaxDist);
|
||||
|
||||
//! computes a set of projected point and determine the
|
||||
//! continuous parts of the projected curves. The points
|
||||
@@ -68,14 +52,14 @@ public:
|
||||
Standard_EXPORT void Init();
|
||||
|
||||
//! Changes the surface.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Changes the curve.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C);
|
||||
|
||||
Standard_EXPORT const Handle(Adaptor3d_HSurface)& GetSurface() const;
|
||||
Standard_EXPORT const Handle(Adaptor3d_Surface)& GetSurface() const;
|
||||
|
||||
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
|
||||
Standard_EXPORT const Handle(Adaptor3d_Curve)& GetCurve() const;
|
||||
|
||||
Standard_EXPORT void GetTolerance (Standard_Real& TolU, Standard_Real& TolV) const;
|
||||
|
||||
@@ -136,7 +120,7 @@ public:
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 2d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real FirstParam, const Standard_Real LastParam, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
Standard_EXPORT Handle(Adaptor2d_Curve2d) Trim (const Standard_Real FirstParam, const Standard_Real LastParam, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parameters corresponding to
|
||||
//! S discontinuities.
|
||||
@@ -156,15 +140,6 @@ public:
|
||||
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! This method performs check possibility of optimization traps and tries to go out from them.
|
||||
@@ -173,9 +148,10 @@ private:
|
||||
|
||||
Standard_EXPORT void BuildIntervals (const GeomAbs_Shape S) const;
|
||||
|
||||
private:
|
||||
|
||||
Handle(Adaptor3d_HSurface) mySurface;
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_Surface) mySurface;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
Standard_Integer myNbCurves;
|
||||
Handle(ProjLib_HSequenceOfHSequenceOfPnt) mySequence;
|
||||
Standard_Real myTolU;
|
||||
@@ -188,10 +164,6 @@ private:
|
||||
Handle(TColStd_HArray1OfReal) myTabInt;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(ProjLib_CompProjectedCurve, Adaptor2d_Curve2d)
|
||||
|
||||
#endif // _ProjLib_CompProjectedCurve_HeaderFile
|
||||
|
@@ -33,8 +33,8 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Approx_FitAndDivide2d.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
@@ -70,8 +70,8 @@ static inline Standard_Boolean IsEqual(Standard_Real Check,Standard_Real With,St
|
||||
//=======================================================================
|
||||
|
||||
static gp_Pnt2d Function_Value(const Standard_Real U,
|
||||
const Handle(Adaptor3d_HCurve)& myCurve,
|
||||
const Handle(Adaptor3d_HSurface)& mySurface,
|
||||
const Handle(Adaptor3d_Curve)& myCurve,
|
||||
const Handle(Adaptor3d_Surface)& mySurface,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
@@ -149,8 +149,8 @@ static gp_Pnt2d Function_Value(const Standard_Real U,
|
||||
static Standard_Boolean Function_D1( const Standard_Real U,
|
||||
gp_Pnt2d& P,
|
||||
gp_Vec2d& D,
|
||||
const Handle(Adaptor3d_HCurve)& myCurve,
|
||||
const Handle(Adaptor3d_HSurface)& mySurface,
|
||||
const Handle(Adaptor3d_Curve)& myCurve,
|
||||
const Handle(Adaptor3d_Surface)& mySurface,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Real V1,
|
||||
@@ -202,14 +202,14 @@ static Standard_Boolean Function_D1( const Standard_Real U,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Real Function_ComputeStep(
|
||||
const Handle(Adaptor3d_HCurve)& myCurve,
|
||||
const Handle(Adaptor3d_Curve)& myCurve,
|
||||
const Standard_Real R)
|
||||
{
|
||||
Standard_Real Step0 = .1;
|
||||
Standard_Real W1, W2;
|
||||
W1 = myCurve->FirstParameter();
|
||||
W2 = myCurve->LastParameter();
|
||||
Standard_Real L = GCPnts_AbscissaPoint::Length(myCurve->Curve());
|
||||
Standard_Real L = GCPnts_AbscissaPoint::Length (*myCurve);
|
||||
Standard_Integer nbp = RealToInt(L / (R*M_PI_4)) + 1;
|
||||
nbp = Max(nbp, 3);
|
||||
Standard_Real Step = (W2 - W1) / (nbp - 1);
|
||||
@@ -234,8 +234,8 @@ static void Function_SetUVBounds(Standard_Real& myU1,
|
||||
Standard_Real& myV2,
|
||||
Standard_Boolean& UCouture,
|
||||
Standard_Boolean& VCouture,
|
||||
const Handle(Adaptor3d_HCurve)& myCurve,
|
||||
const Handle(Adaptor3d_HSurface)& mySurface)
|
||||
const Handle(Adaptor3d_Curve)& myCurve,
|
||||
const Handle(Adaptor3d_Surface)& mySurface)
|
||||
{
|
||||
Standard_Real W1, W2, W;
|
||||
gp_Pnt P1, P2, P;
|
||||
@@ -844,8 +844,8 @@ static void Function_SetUVBounds(Standard_Real& myU1,
|
||||
//=======================================================================
|
||||
class ProjLib_Function : public AppCont_Function
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_HSurface) mySurface;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
Handle(Adaptor3d_Surface) mySurface;
|
||||
Standard_Boolean myIsPeriodic[2];
|
||||
Standard_Real myPeriod[2];
|
||||
public :
|
||||
@@ -853,8 +853,8 @@ class ProjLib_Function : public AppCont_Function
|
||||
Standard_Real myU1,myU2,myV1,myV2;
|
||||
Standard_Boolean UCouture,VCouture;
|
||||
|
||||
ProjLib_Function(const Handle(Adaptor3d_HCurve)& C,
|
||||
const Handle(Adaptor3d_HSurface)& S)
|
||||
ProjLib_Function(const Handle(Adaptor3d_Curve)& C,
|
||||
const Handle(Adaptor3d_Surface)& S)
|
||||
: myCurve(C),
|
||||
mySurface(S),
|
||||
myU1(0.0),
|
||||
@@ -929,7 +929,7 @@ class ProjLib_Function : public AppCont_Function
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
static Standard_Real ComputeTolU(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Real theTolerance)
|
||||
{
|
||||
Standard_Real aTolU = theSurf->UResolution(theTolerance);
|
||||
@@ -946,7 +946,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Real ComputeTolV(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
static Standard_Real ComputeTolV(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Real theTolerance)
|
||||
{
|
||||
Standard_Real aTolV = theSurf->VResolution(theTolerance);
|
||||
@@ -976,8 +976,8 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox():
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ComputeApprox::ProjLib_ComputeApprox
|
||||
(const Handle(Adaptor3d_HCurve) & C,
|
||||
const Handle(Adaptor3d_HSurface) & S,
|
||||
(const Handle(Adaptor3d_Curve) & C,
|
||||
const Handle(Adaptor3d_Surface) & S,
|
||||
const Standard_Real Tol):
|
||||
myTolerance(Max(Tol, Precision::PApproximation())),
|
||||
myDegMin(-1), myDegMax(-1),
|
||||
@@ -993,8 +993,8 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_ComputeApprox::Perform
|
||||
(const Handle(Adaptor3d_HCurve) & C,
|
||||
const Handle(Adaptor3d_HSurface) & S )
|
||||
(const Handle(Adaptor3d_Curve) & C,
|
||||
const Handle(Adaptor3d_Surface) & S )
|
||||
{
|
||||
// if the surface is a plane and the curve a BSpline or a BezierCurve,
|
||||
// don`t make an Approx but only the projection of the poles.
|
||||
|
@@ -17,18 +17,12 @@
|
||||
#ifndef _ProjLib_ComputeApprox_HeaderFile
|
||||
#define _ProjLib_ComputeApprox_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
|
||||
class Geom2d_BSplineCurve;
|
||||
class Geom2d_BezierCurve;
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor3d_HSurface;
|
||||
|
||||
|
||||
//! Approximate the projection of a 3d curve on an
|
||||
//! analytic surface and stores the result in Approx.
|
||||
@@ -52,12 +46,12 @@ public:
|
||||
//! <Tol> is the tolerance with which the
|
||||
//! approximation is performed.
|
||||
//! Other parameters for approximation have default values.
|
||||
Standard_EXPORT ProjLib_ComputeApprox(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
Standard_EXPORT ProjLib_ComputeApprox(const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol);
|
||||
|
||||
//! Performs projecting.
|
||||
//! In case of approximation current values of parameters are used:
|
||||
//! default values or set by corresponding methods Set...
|
||||
Standard_EXPORT void Perform(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT void Perform(const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Set tolerance of approximation.
|
||||
//! Default value is Precision::Confusion().
|
||||
|
@@ -54,12 +54,12 @@
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
@@ -92,9 +92,9 @@ struct aFuncStruct
|
||||
memset(myPeriod, 0, sizeof (myPeriod));
|
||||
}
|
||||
|
||||
Handle(Adaptor3d_HSurface) mySurf; // Surface where to project.
|
||||
Handle(Adaptor3d_HCurve) myCurve; // Curve to project.
|
||||
Handle(Adaptor2d_HCurve2d) myInitCurve2d; // Initial 2dcurve projection.
|
||||
Handle(Adaptor3d_Surface) mySurf; // Surface where to project.
|
||||
Handle(Adaptor3d_Curve) myCurve; // Curve to project.
|
||||
Handle(Adaptor2d_Curve2d) myInitCurve2d; // Initial 2dcurve projection.
|
||||
Standard_Real mySqProjOrtTol; // Used to filter non-orthogonal projected point.
|
||||
Standard_Real myTolU;
|
||||
Standard_Real myTolV;
|
||||
@@ -105,7 +105,7 @@ struct aFuncStruct
|
||||
//function : computePeriodicity
|
||||
//purpose : Compute period information on adaptor.
|
||||
//=======================================================================
|
||||
static void computePeriodicity(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
static void computePeriodicity(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
Standard_Real &theUPeriod,
|
||||
Standard_Real &theVPeriod)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ static void computePeriodicity(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
// Param space may be reduced in case of rectangular trimmed surface,
|
||||
// in this case really trimmed bounds should be set as unperiodic.
|
||||
Standard_Real aTrimF, aTrimL, aBaseF, aBaseL, aDummyF, aDummyL;
|
||||
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theSurf->Surface(), Standard_False); // Not trim.
|
||||
Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface (*theSurf, Standard_False); // Not trim.
|
||||
// U param space.
|
||||
if (theSurf->IsUPeriodic())
|
||||
{
|
||||
@@ -165,7 +165,7 @@ static void computePeriodicity(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
//purpose : compute functional value in (theU,theV) point
|
||||
//=======================================================================
|
||||
static Standard_Real anOrthogSqValue(const gp_Pnt& aBasePnt,
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor3d_Surface)& Surf,
|
||||
const Standard_Real theU,
|
||||
const Standard_Real theV)
|
||||
{
|
||||
@@ -204,10 +204,10 @@ static gp_Pnt2d Function_Value(const Standard_Real theU,
|
||||
Standard_Real aSurfPntDist = aSurfPnt.SquareDistance(p);
|
||||
|
||||
Standard_Real Uinf, Usup, Vinf, Vsup;
|
||||
Uinf = theData.mySurf->Surface().FirstUParameter();
|
||||
Usup = theData.mySurf->Surface().LastUParameter();
|
||||
Vinf = theData.mySurf->Surface().FirstVParameter();
|
||||
Vsup = theData.mySurf->Surface().LastVParameter();
|
||||
Uinf = theData.mySurf->FirstUParameter();
|
||||
Usup = theData.mySurf->LastUParameter();
|
||||
Vinf = theData.mySurf->FirstVParameter();
|
||||
Vsup = theData.mySurf->LastVParameter();
|
||||
|
||||
// Check case when curve is close to co-parametrized isoline on surf.
|
||||
if (Abs (p2d.X() - Uinf) < Precision::PConfusion() ||
|
||||
@@ -356,17 +356,17 @@ static gp_Pnt2d Function_Value(const Standard_Real theU,
|
||||
GeomAdaptor_Surface SurfLittle;
|
||||
if (Type == GeomAbs_BSplineSurface)
|
||||
{
|
||||
Handle(Geom_Surface) GBSS(theData.mySurf->Surface().BSpline());
|
||||
Handle(Geom_Surface) GBSS(theData.mySurf->BSpline());
|
||||
SurfLittle.Load(GBSS, uInfLi, uSupLi, vInfLi, vSupLi);
|
||||
}
|
||||
else if (Type == GeomAbs_BezierSurface)
|
||||
{
|
||||
Handle(Geom_Surface) GS(theData.mySurf->Surface().Bezier());
|
||||
Handle(Geom_Surface) GS(theData.mySurf->Bezier());
|
||||
SurfLittle.Load(GS, uInfLi, uSupLi, vInfLi, vSupLi);
|
||||
}
|
||||
else if (Type == GeomAbs_OffsetSurface)
|
||||
{
|
||||
Handle(Geom_Surface) GS = GeomAdaptor::MakeSurface(theData.mySurf->Surface());
|
||||
Handle(Geom_Surface) GS = GeomAdaptor::MakeSurface (*theData.mySurf);
|
||||
SurfLittle.Load(GS, uInfLi, uSupLi, vInfLi, vSupLi);
|
||||
}
|
||||
else
|
||||
@@ -429,9 +429,9 @@ class ProjLib_PolarFunction : public AppCont_Function
|
||||
|
||||
public :
|
||||
|
||||
ProjLib_PolarFunction(const Handle(Adaptor3d_HCurve) & C,
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor2d_HCurve2d)& InitialCurve2d,
|
||||
ProjLib_PolarFunction(const Handle(Adaptor3d_Curve) & C,
|
||||
const Handle(Adaptor3d_Surface)& Surf,
|
||||
const Handle(Adaptor2d_Curve2d)& InitialCurve2d,
|
||||
const Standard_Real Tol3d)
|
||||
{
|
||||
myNbPnt = 0;
|
||||
@@ -501,9 +501,9 @@ ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface()
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
(const Handle(Adaptor2d_HCurve2d)& theInitialCurve2d,
|
||||
const Handle(Adaptor3d_HCurve)& theCurve,
|
||||
const Handle(Adaptor3d_HSurface)& theSurface,
|
||||
(const Handle(Adaptor2d_Curve2d)& theInitialCurve2d,
|
||||
const Handle(Adaptor3d_Curve)& theCurve,
|
||||
const Handle(Adaptor3d_Surface)& theSurface,
|
||||
const Standard_Real theTolerance3D)
|
||||
: myProjIsDone(Standard_False),
|
||||
myTolerance(theTolerance3D),
|
||||
@@ -523,8 +523,8 @@ ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
(const Handle(Adaptor3d_HCurve)& theCurve,
|
||||
const Handle(Adaptor3d_HSurface)& theSurface,
|
||||
(const Handle(Adaptor3d_Curve)& theCurve,
|
||||
const Handle(Adaptor3d_Surface)& theSurface,
|
||||
const Standard_Real theTolerance3D)
|
||||
: myProjIsDone(Standard_False),
|
||||
myTolerance(theTolerance3D),
|
||||
@@ -535,7 +535,7 @@ ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
myBndPnt(AppParCurves_TangencyPoint),
|
||||
myDist(0.)
|
||||
{
|
||||
const Handle(Adaptor2d_HCurve2d) anInitCurve2d;
|
||||
const Handle(Adaptor2d_Curve2d) anInitCurve2d;
|
||||
myBSpline = Perform(anInitCurve2d, theCurve, theSurface);
|
||||
}
|
||||
|
||||
@@ -545,10 +545,10 @@ ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface
|
||||
(const Handle(Adaptor2d_HCurve2d)& theInitialCurve2d,
|
||||
const Handle(Adaptor2d_HCurve2d)& theInitialCurve2dBis,
|
||||
const Handle(Adaptor3d_HCurve)& theCurve,
|
||||
const Handle(Adaptor3d_HSurface)& theSurface,
|
||||
(const Handle(Adaptor2d_Curve2d)& theInitialCurve2d,
|
||||
const Handle(Adaptor2d_Curve2d)& theInitialCurve2dBis,
|
||||
const Handle(Adaptor3d_Curve)& theCurve,
|
||||
const Handle(Adaptor3d_Surface)& theSurface,
|
||||
const Standard_Real theTolerance3D)
|
||||
: myProjIsDone(Standard_False),
|
||||
myTolerance(theTolerance3D),
|
||||
@@ -667,9 +667,9 @@ static Handle(Geom2d_BSplineCurve) Concat(Handle(Geom2d_BSplineCurve) C1,
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
(const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& S)
|
||||
(const Handle(Adaptor3d_Curve)& Curve, const Handle(Adaptor3d_Surface)& S)
|
||||
{
|
||||
const Handle(Adaptor2d_HCurve2d) anInitCurve2d;
|
||||
const Handle(Adaptor2d_Curve2d) anInitCurve2d;
|
||||
myBSpline = Perform(anInitCurve2d, Curve, S);
|
||||
}
|
||||
|
||||
@@ -679,16 +679,16 @@ void ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
(const Handle(Adaptor2d_HCurve2d)& InitialCurve2d,
|
||||
const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& S)
|
||||
(const Handle(Adaptor2d_Curve2d)& InitialCurve2d,
|
||||
const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& S)
|
||||
{
|
||||
//OCC217
|
||||
Standard_Real Tol3d = myTolerance;
|
||||
Standard_Real ParamTol = Precision::PApproximation();
|
||||
|
||||
Handle(Adaptor2d_HCurve2d) AHC2d = InitialCurve2d;
|
||||
Handle(Adaptor3d_HCurve) AHC = Curve;
|
||||
Handle(Adaptor2d_Curve2d) AHC2d = InitialCurve2d;
|
||||
Handle(Adaptor3d_Curve) AHC = Curve;
|
||||
|
||||
// if the curve 3d is a BSpline with degree C0, it is cut into sections with degree C1
|
||||
// -> bug cts18237
|
||||
@@ -706,7 +706,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
Standard_Real firstinter = Inter.Value(1), secondinter = Inter.Value(2);
|
||||
// initialization 3d
|
||||
GTC = new Geom_TrimmedCurve(BSC, firstinter, secondinter);
|
||||
AHC = new GeomAdaptor_HCurve(GTC);
|
||||
AHC = new GeomAdaptor_Curve(GTC);
|
||||
|
||||
// if there is an initialization curve:
|
||||
// - either this is a BSpline C0, with discontinuity at the same parameters of nodes
|
||||
@@ -787,7 +787,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
// (lps.IsEqual(lpc, myTolerance))) {
|
||||
G2dTC = new Geom2d_TrimmedCurve(G2dC, firstinter, secondinter);
|
||||
Geom2dAdaptor_Curve G2dAC(G2dTC);
|
||||
AHC2d = new Geom2dAdaptor_HCurve(G2dAC);
|
||||
AHC2d = new Geom2dAdaptor_Curve(G2dAC);
|
||||
myProjIsDone = Standard_True;
|
||||
}
|
||||
else {
|
||||
@@ -819,7 +819,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
ip1inter = Inter.Value(i+1);
|
||||
// general case 3d
|
||||
GTC->SetTrim(iinter, ip1inter);
|
||||
AHC = new GeomAdaptor_HCurve(GTC);
|
||||
AHC = new GeomAdaptor_Curve(GTC);
|
||||
|
||||
// general case 2d
|
||||
if(C2dIsToCompute) {
|
||||
@@ -839,7 +839,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
// (lps.IsEqual(lpc, myTolerance))) {
|
||||
G2dTC->SetTrim(iinter, ip1inter);
|
||||
Geom2dAdaptor_Curve G2dAC(G2dTC);
|
||||
AHC2d = new Geom2dAdaptor_HCurve(G2dAC);
|
||||
AHC2d = new Geom2dAdaptor_Curve(G2dAC);
|
||||
myProjIsDone = Standard_True;
|
||||
}
|
||||
else {
|
||||
@@ -911,10 +911,10 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_HCurve2d)
|
||||
Handle(Adaptor2d_Curve2d)
|
||||
ProjLib_ComputeApproxOnPolarSurface::
|
||||
BuildInitialCurve2d(const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surf)
|
||||
BuildInitialCurve2d(const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surf)
|
||||
{
|
||||
// discretize the Curve with quasiuniform deflection
|
||||
// density at least NbOfPnts points
|
||||
@@ -937,7 +937,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
//Standard_Real Tol3d = 100*myTolerance; // At random Balthazar.
|
||||
|
||||
Standard_Integer NbOfPnts = 61;
|
||||
GCPnts_QuasiUniformAbscissa QUA(Curve->GetCurve(),NbOfPnts);
|
||||
GCPnts_QuasiUniformAbscissa QUA (*Curve,NbOfPnts);
|
||||
NbOfPnts = QUA.NbPoints();
|
||||
TColgp_Array1OfPnt Pts(1,NbOfPnts);
|
||||
TColStd_Array1OfReal Param(1,NbOfPnts);
|
||||
@@ -953,10 +953,10 @@ Handle(Adaptor2d_HCurve2d)
|
||||
Mult(1) = Mult(NbOfPnts) = 2;
|
||||
|
||||
Standard_Real Uinf, Usup, Vinf, Vsup;
|
||||
Uinf = Surf->Surface().FirstUParameter();
|
||||
Usup = Surf->Surface().LastUParameter();
|
||||
Vinf = Surf->Surface().FirstVParameter();
|
||||
Vsup = Surf->Surface().LastVParameter();
|
||||
Uinf = Surf->FirstUParameter();
|
||||
Usup = Surf->LastUParameter();
|
||||
Vinf = Surf->FirstVParameter();
|
||||
Vsup = Surf->LastVParameter();
|
||||
GeomAbs_SurfaceType Type = Surf->GetType();
|
||||
if((Type != GeomAbs_BSplineSurface) && (Type != GeomAbs_BezierSurface) &&
|
||||
(Type != GeomAbs_OffsetSurface)) {
|
||||
@@ -1098,7 +1098,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
Standard_Boolean areManyZeros = Standard_False;
|
||||
|
||||
Curve->D0(Param.Value(1), pntproj) ;
|
||||
Extrema_ExtPS aExtPS(pntproj, Surf->Surface(), TolU, TolV) ;
|
||||
Extrema_ExtPS aExtPS(pntproj, *Surf, TolU, TolV) ;
|
||||
Standard_Real aMinSqDist = RealLast();
|
||||
if (aExtPS.IsDone())
|
||||
{
|
||||
@@ -1113,9 +1113,9 @@ Handle(Adaptor2d_HCurve2d)
|
||||
{
|
||||
TolU = Min(TolU, Precision::PConfusion());
|
||||
TolV = Min(TolV, Precision::PConfusion());
|
||||
aExtPS.Initialize(Surf->Surface(),
|
||||
Surf->Surface().FirstUParameter(), Surf->Surface().LastUParameter(),
|
||||
Surf->Surface().FirstVParameter(), Surf->Surface().LastVParameter(),
|
||||
aExtPS.Initialize(*Surf,
|
||||
Surf->FirstUParameter(), Surf->LastUParameter(),
|
||||
Surf->FirstVParameter(), Surf->LastVParameter(),
|
||||
TolU, TolV);
|
||||
aExtPS.Perform(pntproj);
|
||||
}
|
||||
@@ -1173,7 +1173,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
Standard_Integer indExt = 0;
|
||||
Standard_Integer iT = 1 + (NbOfPnts - 1)/5*i;
|
||||
Curve->D0( Param.Value(iT), pntproj );
|
||||
Extrema_ExtPS aTPS( pntproj, Surf->Surface(), TolU, TolV );
|
||||
Extrema_ExtPS aTPS( pntproj, *Surf, TolU, TolV );
|
||||
Dist2Min = 1.e+200;
|
||||
if( aTPS.IsDone() && aTPS.NbExt() >= 1 ) {
|
||||
for( j = 1 ; j <= aTPS.NbExt() ; j++ ) {
|
||||
@@ -1200,7 +1200,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
for (j = tPp + 1; j <= NbOfPnts; ++j)
|
||||
{
|
||||
Curve->D0( Param.Value(j), pntproj );
|
||||
Extrema_ExtPS aTPS( pntproj, Surf->Surface(), TolU, TolV );
|
||||
Extrema_ExtPS aTPS( pntproj, *Surf, TolU, TolV );
|
||||
Dist2Min = RealLast();
|
||||
if( aTPS.IsDone() && aTPS.NbExt() >= 1 ) {
|
||||
Standard_Integer indExt = 0;
|
||||
@@ -1272,7 +1272,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
myProjIsDone = Standard_False;
|
||||
Dist2Min = RealLast();
|
||||
Curve->D0(Param.Value(i), pntproj);
|
||||
Extrema_GenLocateExtPS aLocateExtPS(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS aLocateExtPS (*Surf, TolU, TolV);
|
||||
aLocateExtPS.Perform(pntproj, U0, V0);
|
||||
|
||||
if (aLocateExtPS.IsDone())
|
||||
@@ -1292,7 +1292,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
}
|
||||
else
|
||||
{
|
||||
Extrema_ExtPS aGlobalExtr(pntproj, Surf->Surface(), TolU, TolV);
|
||||
Extrema_ExtPS aGlobalExtr(pntproj, *Surf, TolU, TolV);
|
||||
if (aGlobalExtr.IsDone())
|
||||
{
|
||||
Standard_Real LocalMinSqDist = RealLast();
|
||||
@@ -1371,14 +1371,14 @@ Handle(Adaptor2d_HCurve2d)
|
||||
}
|
||||
if(!myProjIsDone && uperiod) {
|
||||
Standard_Real aUinf, aUsup, Uaux;
|
||||
aUinf = Surf->Surface().FirstUParameter();
|
||||
aUsup = Surf->Surface().LastUParameter();
|
||||
aUinf = Surf->FirstUParameter();
|
||||
aUsup = Surf->LastUParameter();
|
||||
if((aUsup - U0) > (U0 - aUinf))
|
||||
Uaux = 2*aUinf - U0 + uperiod;
|
||||
else
|
||||
Uaux = 2*aUsup - U0 - uperiod;
|
||||
|
||||
Extrema_GenLocateExtPS locext(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS locext (*Surf, TolU, TolV);
|
||||
locext.Perform(pntproj, Uaux, V0);
|
||||
|
||||
if (locext.IsDone())
|
||||
@@ -1402,14 +1402,14 @@ Handle(Adaptor2d_HCurve2d)
|
||||
}
|
||||
if(!myProjIsDone && vperiod) {
|
||||
Standard_Real aVinf, aVsup, Vaux;
|
||||
aVinf = Surf->Surface().FirstVParameter();
|
||||
aVsup = Surf->Surface().LastVParameter();
|
||||
aVinf = Surf->FirstVParameter();
|
||||
aVsup = Surf->LastVParameter();
|
||||
if((aVsup - V0) > (V0 - aVinf))
|
||||
Vaux = 2*aVinf - V0 + vperiod;
|
||||
else
|
||||
Vaux = 2*aVsup - V0 - vperiod;
|
||||
|
||||
Extrema_GenLocateExtPS locext(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS locext (*Surf, TolU, TolV);
|
||||
locext.Perform(pntproj, U0, Vaux);
|
||||
|
||||
if (locext.IsDone())
|
||||
@@ -1442,7 +1442,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
else
|
||||
Vaux = 2*Vsup - V0 - vperiod;
|
||||
|
||||
Extrema_GenLocateExtPS locext(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS locext (*Surf, TolU, TolV);
|
||||
locext.Perform(pntproj, Uaux, Vaux);
|
||||
|
||||
if (locext.IsDone())
|
||||
@@ -1469,7 +1469,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
}
|
||||
}
|
||||
if(!myProjIsDone) {
|
||||
Extrema_ExtPS ext(pntproj, Surf->Surface(), TolU, TolV) ;
|
||||
Extrema_ExtPS ext(pntproj, *Surf, TolU, TolV) ;
|
||||
if (ext.IsDone()) {
|
||||
Dist2Min = ext.SquareDistance(1);
|
||||
Standard_Integer aGoodValue = 1;
|
||||
@@ -1547,7 +1547,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
myBSpline->Translate(Offset);
|
||||
//////////////////////////////////////////
|
||||
Geom2dAdaptor_Curve GAC(myBSpline);
|
||||
Handle(Adaptor2d_HCurve2d) IC2d = new Geom2dAdaptor_HCurve(GAC);
|
||||
Handle(Adaptor2d_Curve2d) IC2d = new Geom2dAdaptor_Curve(GAC);
|
||||
#ifdef OCCT_DEBUG
|
||||
// char name [100];
|
||||
// sprintf(name,"%s_%d","build",compteur++);
|
||||
@@ -1559,7 +1559,7 @@ Handle(Adaptor2d_HCurve2d)
|
||||
// Modified by Sergey KHROMOV - Thu Apr 18 10:57:50 2002 Begin
|
||||
// Standard_NoSuchObject_Raise_if(1,"ProjLib_Compu: build echec");
|
||||
// Modified by Sergey KHROMOV - Thu Apr 18 10:57:51 2002 End
|
||||
return Handle(Adaptor2d_HCurve2d)();
|
||||
return Handle(Adaptor2d_Curve2d)();
|
||||
}
|
||||
// myProjIsDone = Standard_False;
|
||||
// Modified by Sergey KHROMOV - Thu Apr 18 10:58:01 2002 Begin
|
||||
@@ -1573,9 +1573,9 @@ Handle(Adaptor2d_HCurve2d)
|
||||
//=======================================================================
|
||||
Handle(Geom2d_BSplineCurve)
|
||||
ProjLib_ComputeApproxOnPolarSurface::
|
||||
ProjectUsingInitialCurve2d(const Handle(Adaptor3d_HCurve)& Curve,
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor2d_HCurve2d)& InitCurve2d)
|
||||
ProjectUsingInitialCurve2d(const Handle(Adaptor3d_Curve)& Curve,
|
||||
const Handle(Adaptor3d_Surface)& Surf,
|
||||
const Handle(Adaptor2d_Curve2d)& InitCurve2d)
|
||||
{
|
||||
//OCC217
|
||||
Standard_Real Tol3d = myTolerance;
|
||||
@@ -1661,7 +1661,7 @@ Handle(Geom2d_BSplineCurve)
|
||||
myProjIsDone = Standard_False;
|
||||
Dist2Min = IntegerLast();
|
||||
|
||||
Extrema_GenLocateExtPS extrloc(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS extrloc (*Surf, TolU, TolV);
|
||||
extrloc.Perform(BSC->Pole(i), (p11.X()+p22.X())/2, (p11.Y()+p22.Y())/2);
|
||||
|
||||
if (extrloc.IsDone()) {
|
||||
@@ -1701,7 +1701,7 @@ Handle(Geom2d_BSplineCurve)
|
||||
for(i = 1;i <= Curve->NbPoles();i++) {
|
||||
Dist2Min = IntegerLast();
|
||||
|
||||
Extrema_GenLocateExtPS extrloc(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS extrloc (*Surf, TolU, TolV);
|
||||
extrloc.Perform(BC->Pole(i), 0.5, 0.5);
|
||||
|
||||
if (extrloc.IsDone()) {
|
||||
@@ -1761,7 +1761,7 @@ Handle(Geom2d_BSplineCurve)
|
||||
myProjIsDone = Standard_False;
|
||||
Dist2Min = IntegerLast();
|
||||
|
||||
Extrema_GenLocateExtPS extrloc(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS extrloc (*Surf, TolU, TolV);
|
||||
extrloc.Perform(BSC->Pole(i), (p11.X()+p22.X())/2, (p11.Y()+p22.Y())/2);
|
||||
|
||||
if (extrloc.IsDone()) {
|
||||
@@ -1801,7 +1801,7 @@ Handle(Geom2d_BSplineCurve)
|
||||
for(i = 1;i <= Curve->NbPoles();i++) {
|
||||
Dist2Min = IntegerLast();
|
||||
|
||||
Extrema_GenLocateExtPS extrloc(Surf->Surface(), TolU, TolV);
|
||||
Extrema_GenLocateExtPS extrloc (*Surf, TolU, TolV);
|
||||
extrloc.Perform(BC->Pole(i), 0.5, 0.5);
|
||||
|
||||
if (extrloc.IsDone()) {
|
||||
@@ -1866,8 +1866,8 @@ Handle(Geom2d_BSplineCurve)
|
||||
DrawTrSurf::Set(Temp,DummyC2d);
|
||||
#endif
|
||||
// DrawTrSurf::Set((Standard_CString ) "bs2d",DummyC2d);
|
||||
Handle(Geom2dAdaptor_HCurve) DDD =
|
||||
Handle(Geom2dAdaptor_HCurve)::DownCast(InitCurve2d);
|
||||
Handle(Geom2dAdaptor_Curve) DDD =
|
||||
Handle(Geom2dAdaptor_Curve)::DownCast(InitCurve2d);
|
||||
|
||||
#ifdef DRAW
|
||||
Temp = "initc2d";
|
||||
|
@@ -17,19 +17,13 @@
|
||||
#ifndef _ProjLib_ComputeApproxOnPolarSurface_HeaderFile
|
||||
#define _ProjLib_ComputeApproxOnPolarSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
|
||||
class Geom2d_BSplineCurve;
|
||||
class Geom2d_Curve;
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor3d_HSurface;
|
||||
class Adaptor2d_HCurve2d;
|
||||
|
||||
|
||||
//! Approximate the projection of a 3d curve on an
|
||||
//! polar surface and stores the result in Approx.
|
||||
@@ -53,18 +47,18 @@ public:
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface();
|
||||
|
||||
//! Constructor, which performs projecting.
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol = 1.0e-4);
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol = 1.0e-4);
|
||||
|
||||
|
||||
//! Constructor, which performs projecting, using initial curve 2d InitCurve2d, which is any rough approximation of result curve.
|
||||
//! Parameter Tol is 3d tolerance of approximation.
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_Curve2d)& InitCurve2d, const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol);
|
||||
|
||||
//! Constructor, which performs projecting, using two initial curves 2d: InitCurve2d and InitCurve2dBis that are any rough approximations of result curves.
|
||||
//! This constructor is used to get two pcurves for seem edge.
|
||||
//! Parameter Tol is 3d tolerance of approximation.
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor2d_HCurve2d)& InitCurve2dBis, const Handle(Adaptor3d_HCurve)& C,
|
||||
const Handle(Adaptor3d_HSurface)& S, const Standard_Real Tol);
|
||||
Standard_EXPORT ProjLib_ComputeApproxOnPolarSurface(const Handle(Adaptor2d_Curve2d)& InitCurve2d, const Handle(Adaptor2d_Curve2d)& InitCurve2dBis, const Handle(Adaptor3d_Curve)& C,
|
||||
const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol);
|
||||
|
||||
|
||||
//! Set min and max possible degree of result BSpline curve2d, which is got by approximation.
|
||||
@@ -94,21 +88,21 @@ public:
|
||||
|
||||
//! Method, which performs projecting, using default values of parameters or
|
||||
//! they must be set by corresponding methods before using.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Method, which performs projecting, using default values of parameters or
|
||||
//! they must be set by corresponding methods before using.
|
||||
//! Parameter InitCurve2d is any rough estimation of 2d result curve.
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Perform (const Handle(Adaptor2d_HCurve2d)& InitCurve2d, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) Perform (const Handle(Adaptor2d_Curve2d)& InitCurve2d, const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Builds initial 2d curve as BSpline with degree = 1 using Extrema algoritm.
|
||||
//! Method is used in method Perform(...).
|
||||
Standard_EXPORT Handle(Adaptor2d_HCurve2d) BuildInitialCurve2d (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT Handle(Adaptor2d_Curve2d) BuildInitialCurve2d (const Handle(Adaptor3d_Curve)& Curve, const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
|
||||
//! Method, which performs projecting.
|
||||
//! Method is used in method Perform(...).
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) ProjectUsingInitialCurve2d (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor2d_HCurve2d)& InitCurve2d);
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) ProjectUsingInitialCurve2d (const Handle(Adaptor3d_Curve)& Curve, const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor2d_Curve2d)& InitCurve2d);
|
||||
|
||||
//! Returns result curve 2d.
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const;
|
||||
|
@@ -17,77 +17,9 @@
|
||||
#ifndef _ProjLib_HCompProjectedCurve_HeaderFile
|
||||
#define _ProjLib_HCompProjectedCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ProjLib_CompProjectedCurve.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class ProjLib_CompProjectedCurve;
|
||||
class Adaptor2d_Curve2d;
|
||||
|
||||
|
||||
class ProjLib_HCompProjectedCurve;
|
||||
DEFINE_STANDARD_HANDLE(ProjLib_HCompProjectedCurve, Adaptor2d_HCurve2d)
|
||||
|
||||
|
||||
class ProjLib_HCompProjectedCurve : public Adaptor2d_HCurve2d
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHCurve2d.
|
||||
Standard_EXPORT ProjLib_HCompProjectedCurve();
|
||||
|
||||
//! Creates a GenHCurve2d from a Curve
|
||||
Standard_EXPORT ProjLib_HCompProjectedCurve(const ProjLib_CompProjectedCurve& C);
|
||||
|
||||
//! Sets the field of the GenHCurve2d.
|
||||
Standard_EXPORT void Set (const ProjLib_CompProjectedCurve& C);
|
||||
|
||||
//! Returns the curve used to create the GenHCurve2d.
|
||||
//! This is redefined from HCurve2d, cannot be inline.
|
||||
Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the curve used to create the GenHCurve.
|
||||
ProjLib_CompProjectedCurve& ChangeCurve2d();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(ProjLib_HCompProjectedCurve,Adaptor2d_HCurve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
ProjLib_CompProjectedCurve myCurve;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheCurve ProjLib_CompProjectedCurve
|
||||
#define TheCurve_hxx <ProjLib_CompProjectedCurve.hxx>
|
||||
#define Adaptor2d_GenHCurve2d ProjLib_HCompProjectedCurve
|
||||
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HCompProjectedCurve.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HCompProjectedCurve)
|
||||
|
||||
#include <Adaptor2d_GenHCurve2d.lxx>
|
||||
|
||||
#undef TheCurve
|
||||
#undef TheCurve_hxx
|
||||
#undef Adaptor2d_GenHCurve2d
|
||||
#undef Adaptor2d_GenHCurve2d_hxx
|
||||
#undef Handle_Adaptor2d_GenHCurve2d
|
||||
|
||||
|
||||
|
||||
// alias for porting old code
|
||||
typedef ProjLib_CompProjectedCurve ProjLib_HCompProjectedCurve;
|
||||
|
||||
#endif // _ProjLib_HCompProjectedCurve_HeaderFile
|
||||
|
@@ -1,42 +0,0 @@
|
||||
// Created on: 1993-08-11
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ProjLib_HCompProjectedCurve.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <ProjLib_CompProjectedCurve.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheCurve ProjLib_CompProjectedCurve
|
||||
#define TheCurve_hxx <ProjLib_CompProjectedCurve.hxx>
|
||||
#define Adaptor2d_GenHCurve2d ProjLib_HCompProjectedCurve
|
||||
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HCompProjectedCurve.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HCompProjectedCurve)
|
||||
#include <Adaptor2d_GenHCurve2d.gxx>
|
||||
|
@@ -17,77 +17,9 @@
|
||||
#ifndef _ProjLib_HProjectedCurve_HeaderFile
|
||||
#define _ProjLib_HProjectedCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class ProjLib_ProjectedCurve;
|
||||
class Adaptor2d_Curve2d;
|
||||
|
||||
|
||||
class ProjLib_HProjectedCurve;
|
||||
DEFINE_STANDARD_HANDLE(ProjLib_HProjectedCurve, Adaptor2d_HCurve2d)
|
||||
|
||||
|
||||
class ProjLib_HProjectedCurve : public Adaptor2d_HCurve2d
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHCurve2d.
|
||||
Standard_EXPORT ProjLib_HProjectedCurve();
|
||||
|
||||
//! Creates a GenHCurve2d from a Curve
|
||||
Standard_EXPORT ProjLib_HProjectedCurve(const ProjLib_ProjectedCurve& C);
|
||||
|
||||
//! Sets the field of the GenHCurve2d.
|
||||
Standard_EXPORT void Set (const ProjLib_ProjectedCurve& C);
|
||||
|
||||
//! Returns the curve used to create the GenHCurve2d.
|
||||
//! This is redefined from HCurve2d, cannot be inline.
|
||||
Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the curve used to create the GenHCurve.
|
||||
ProjLib_ProjectedCurve& ChangeCurve2d();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(ProjLib_HProjectedCurve,Adaptor2d_HCurve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
ProjLib_ProjectedCurve myCurve;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheCurve ProjLib_ProjectedCurve
|
||||
#define TheCurve_hxx <ProjLib_ProjectedCurve.hxx>
|
||||
#define Adaptor2d_GenHCurve2d ProjLib_HProjectedCurve
|
||||
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HProjectedCurve.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HProjectedCurve)
|
||||
|
||||
#include <Adaptor2d_GenHCurve2d.lxx>
|
||||
|
||||
#undef TheCurve
|
||||
#undef TheCurve_hxx
|
||||
#undef Adaptor2d_GenHCurve2d
|
||||
#undef Adaptor2d_GenHCurve2d_hxx
|
||||
#undef Handle_Adaptor2d_GenHCurve2d
|
||||
|
||||
|
||||
|
||||
// alias for porting old code
|
||||
typedef ProjLib_ProjectedCurve ProjLib_HProjectedCurve;
|
||||
|
||||
#endif // _ProjLib_HProjectedCurve_HeaderFile
|
||||
|
@@ -1,42 +0,0 @@
|
||||
// Created on: 1993-08-11
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ProjLib_HProjectedCurve.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheCurve ProjLib_ProjectedCurve
|
||||
#define TheCurve_hxx <ProjLib_ProjectedCurve.hxx>
|
||||
#define Adaptor2d_GenHCurve2d ProjLib_HProjectedCurve
|
||||
#define Adaptor2d_GenHCurve2d_hxx <ProjLib_HProjectedCurve.hxx>
|
||||
#define Handle_Adaptor2d_GenHCurve2d Handle(ProjLib_HProjectedCurve)
|
||||
#include <Adaptor2d_GenHCurve2d.gxx>
|
||||
|
@@ -34,8 +34,8 @@
|
||||
#include <Precision.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
@@ -56,7 +56,7 @@
|
||||
//=======================================================================
|
||||
|
||||
static gp_Pnt OnPlane_Value(const Standard_Real U,
|
||||
const Handle(Adaptor3d_HCurve)& aCurvePtr,
|
||||
const Handle(Adaptor3d_Curve)& aCurvePtr,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ static gp_Pnt OnPlane_Value(const Standard_Real U,
|
||||
|
||||
static gp_Vec OnPlane_DN(const Standard_Real U,
|
||||
const Standard_Integer DerivativeRequest,
|
||||
const Handle(Adaptor3d_HCurve)& aCurvePtr,
|
||||
const Handle(Adaptor3d_Curve)& aCurvePtr,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ static gp_Vec OnPlane_DN(const Standard_Real U,
|
||||
static Standard_Boolean OnPlane_D1(const Standard_Real U,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V,
|
||||
const Handle(Adaptor3d_HCurve)& aCurvePtr,
|
||||
const Handle(Adaptor3d_Curve)& aCurvePtr,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
{
|
||||
@@ -152,7 +152,7 @@ static Standard_Boolean OnPlane_D2(const Standard_Real U,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V1,
|
||||
gp_Vec& V2,
|
||||
const Handle(Adaptor3d_HCurve) & aCurvePtr,
|
||||
const Handle(Adaptor3d_Curve) & aCurvePtr,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ static Standard_Boolean OnPlane_D3(const Standard_Real U,
|
||||
gp_Vec& V1,
|
||||
gp_Vec& V2,
|
||||
gp_Vec& V3,
|
||||
const Handle(Adaptor3d_HCurve)& aCurvePtr,
|
||||
const Handle(Adaptor3d_Curve)& aCurvePtr,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
{
|
||||
@@ -251,13 +251,13 @@ static Standard_Boolean OnPlane_D3(const Standard_Real U,
|
||||
class ProjLib_OnPlane : public AppCont_Function
|
||||
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
gp_Ax3 myPlane;
|
||||
gp_Dir myDirection;
|
||||
|
||||
public :
|
||||
|
||||
ProjLib_OnPlane(const Handle(Adaptor3d_HCurve)& C,
|
||||
ProjLib_OnPlane(const Handle(Adaptor3d_Curve)& C,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D)
|
||||
: myCurve(C),
|
||||
@@ -309,7 +309,7 @@ public :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void PerformApprox (const Handle(Adaptor3d_HCurve)& C,
|
||||
static void PerformApprox (const Handle(Adaptor3d_Curve)& C,
|
||||
const gp_Ax3& Pl,
|
||||
const gp_Dir& D,
|
||||
Handle(Geom_BSplineCurve) &BSplineCurvePtr)
|
||||
@@ -491,7 +491,7 @@ static gp_Vec ProjectVec(const gp_Ax3& ThePlane,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C,
|
||||
const Standard_Real Tolerance,
|
||||
const Standard_Boolean KeepParametrization)
|
||||
|
||||
@@ -502,7 +502,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
myTolerance = Tolerance ;
|
||||
|
||||
Handle(Geom_BSplineCurve) ApproxCurve;
|
||||
Handle(GeomAdaptor_HCurve) aGAHCurve;
|
||||
Handle(GeomAdaptor_Curve) aGAHCurve;
|
||||
|
||||
Handle(Geom_Line) GeomLinePtr;
|
||||
Handle(Geom_Circle) GeomCirclePtr ;
|
||||
@@ -544,7 +544,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(BSP);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else if ( Abs( Xc.Magnitude() - 1.) < Precision::Confusion()) {
|
||||
@@ -559,7 +559,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
GeomAdaptor_Curve aGACurve(GeomLinePtr,
|
||||
myCurve->FirstParameter(),
|
||||
myCurve->LastParameter() );
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else {
|
||||
@@ -583,7 +583,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
GeomAdaptor_Curve aGACurve(GeomLinePtr,
|
||||
myFirstPar,
|
||||
myLastPar) ;
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else {
|
||||
@@ -610,7 +610,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
NewCurvePtr->SetKnots(BsplineKnots) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(NewCurvePtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
}
|
||||
@@ -729,7 +729,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
GeomCirclePtr = new Geom_Circle(Circ);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomCirclePtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else if ( Major > Minor) {
|
||||
@@ -739,7 +739,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
GeomEllipsePtr = new Geom_Ellipse(Elips);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomEllipsePtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else {
|
||||
@@ -755,7 +755,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
PerformApprox(myCurve,myPlane,myDirection,ApproxCurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ApproxCurve);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else if (GeomCirclePtr || GeomEllipsePtr)
|
||||
@@ -799,7 +799,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
GeomLinePtr = new Geom_Line(aLine) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomLinePtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
alocalIsDone = Standard_True;
|
||||
}
|
||||
@@ -811,7 +811,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
new Geom_Parabola(aParab) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomParabolaPtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
alocalIsDone = Standard_True;
|
||||
}
|
||||
@@ -822,7 +822,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
PerformApprox(myCurve,myPlane,myDirection,ApproxCurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ApproxCurve);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
}
|
||||
@@ -851,7 +851,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
new Geom_Hyperbola(Hypr) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomHyperbolaPtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else if ( Yc.Magnitude() < Precision::Confusion()) {
|
||||
@@ -862,7 +862,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
new Geom_Hyperbola(Hypr) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomHyperbolaPtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else if ( Xc.IsNormal(Yc,Precision::Angular())) {
|
||||
@@ -873,7 +873,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
new Geom_Hyperbola(Hypr) ;
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(GeomHyperbolaPtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
else {
|
||||
@@ -882,7 +882,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
PerformApprox(myCurve,myPlane,myDirection,ApproxCurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ApproxCurve);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
}
|
||||
@@ -907,7 +907,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ProjCu);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
break ;
|
||||
@@ -931,7 +931,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ProjectedBSplinePtr);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
break;
|
||||
@@ -943,7 +943,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
PerformApprox(myCurve,myPlane,myDirection,ApproxCurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:29 2002 Begin
|
||||
GeomAdaptor_Curve aGACurve(ApproxCurve);
|
||||
myResult = new GeomAdaptor_HCurve(aGACurve);
|
||||
myResult = new GeomAdaptor_Curve(aGACurve);
|
||||
// Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End
|
||||
}
|
||||
break;
|
||||
@@ -975,7 +975,7 @@ const gp_Dir& ProjLib_ProjectOnPlane::GetDirection() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Adaptor3d_HCurve)& ProjLib_ProjectOnPlane::GetCurve() const
|
||||
const Handle(Adaptor3d_Curve)& ProjLib_ProjectOnPlane::GetCurve() const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
@@ -985,7 +985,7 @@ const Handle(Adaptor3d_HCurve)& ProjLib_ProjectOnPlane::GetCurve() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(GeomAdaptor_HCurve)& ProjLib_ProjectOnPlane::GetResult() const
|
||||
const Handle(GeomAdaptor_Curve)& ProjLib_ProjectOnPlane::GetResult() const
|
||||
{
|
||||
return myResult;
|
||||
}
|
||||
@@ -1057,7 +1057,7 @@ void ProjLib_ProjectOnPlane::Intervals(TColStd_Array1OfReal& T,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve)
|
||||
Handle(Adaptor3d_Curve)
|
||||
ProjLib_ProjectOnPlane::Trim(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tolerance) const
|
||||
|
@@ -17,21 +17,15 @@
|
||||
#ifndef _ProjLib_ProjectOnPlane_HeaderFile
|
||||
#define _ProjLib_ProjectOnPlane_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
class Adaptor3d_HCurve;
|
||||
class GeomAdaptor_HCurve;
|
||||
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
@@ -49,7 +43,6 @@ class gp_Parab;
|
||||
class Geom_BezierCurve;
|
||||
class Geom_BSplineCurve;
|
||||
|
||||
|
||||
//! Class used to project a 3d curve on a plane. The
|
||||
//! result will be a 3d curve.
|
||||
//!
|
||||
@@ -84,15 +77,15 @@ public:
|
||||
//! the parametrization of the initial curve <C>. It
|
||||
//! meens: proj(C(u)) = PC(u) for each u. Otherwize,
|
||||
//! the parametrization may change.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tolerance, const Standard_Boolean KeepParametrization = Standard_True);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C, const Standard_Real Tolerance, const Standard_Boolean KeepParametrization = Standard_True);
|
||||
|
||||
Standard_EXPORT const gp_Ax3& GetPlane() const;
|
||||
|
||||
Standard_EXPORT const gp_Dir& GetDirection() const;
|
||||
|
||||
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
|
||||
Standard_EXPORT const Handle(Adaptor3d_Curve)& GetCurve() const;
|
||||
|
||||
Standard_EXPORT const Handle(GeomAdaptor_HCurve)& GetResult() const;
|
||||
Standard_EXPORT const Handle(GeomAdaptor_Curve)& GetResult() const;
|
||||
|
||||
Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
|
||||
|
||||
@@ -116,7 +109,7 @@ public:
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
Standard_EXPORT Handle(Adaptor3d_Curve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
|
||||
|
||||
@@ -212,7 +205,7 @@ private:
|
||||
|
||||
|
||||
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
gp_Ax3 myPlane;
|
||||
gp_Dir myDirection;
|
||||
Standard_Boolean myKeepParam;
|
||||
@@ -220,7 +213,7 @@ private:
|
||||
Standard_Real myLastPar;
|
||||
Standard_Real myTolerance;
|
||||
GeomAbs_CurveType myType;
|
||||
Handle(GeomAdaptor_HCurve) myResult;
|
||||
Handle(GeomAdaptor_Curve) myResult;
|
||||
Standard_Boolean myIsApprox;
|
||||
|
||||
|
||||
|
@@ -15,8 +15,8 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <AppCont_Function.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <Approx_FitAndDivide.hxx>
|
||||
@@ -37,7 +37,7 @@
|
||||
//purpose : Evaluate current point of the projected curve
|
||||
//=======================================================================
|
||||
static gp_Pnt OnSurface_Value(const Standard_Real U,
|
||||
const Handle(Adaptor3d_HCurve)& myCurve,
|
||||
const Handle(Adaptor3d_Curve)& myCurve,
|
||||
Extrema_ExtPS * myExtPS)
|
||||
{
|
||||
// on essaie de rendre le point solution le plus proche.
|
||||
@@ -69,7 +69,7 @@ static gp_Pnt OnSurface_Value(const Standard_Real U,
|
||||
static Standard_Boolean OnSurface_D1(const Standard_Real , // U,
|
||||
gp_Pnt& , // P,
|
||||
gp_Vec& , // V,
|
||||
const Handle(Adaptor3d_HCurve)& , // myCurve,
|
||||
const Handle(Adaptor3d_Curve)& , // myCurve,
|
||||
Extrema_ExtPS *) // myExtPS)
|
||||
{
|
||||
return Standard_False;
|
||||
@@ -86,8 +86,8 @@ class ProjLib_OnSurface : public AppCont_Function
|
||||
{
|
||||
public:
|
||||
|
||||
ProjLib_OnSurface(const Handle(Adaptor3d_HCurve) & C,
|
||||
const Handle(Adaptor3d_HSurface) & S)
|
||||
ProjLib_OnSurface(const Handle(Adaptor3d_Curve) & C,
|
||||
const Handle(Adaptor3d_Surface) & S)
|
||||
: myCurve(C)
|
||||
{
|
||||
myNbPnt = 1;
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
Standard_Real U = myCurve->FirstParameter();
|
||||
gp_Pnt P = myCurve->Value(U);
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
myExtPS = new Extrema_ExtPS(P,S->Surface(),Tol,Tol);
|
||||
myExtPS = new Extrema_ExtPS (P, *S, Tol, Tol);
|
||||
}
|
||||
|
||||
~ProjLib_OnSurface() { delete myExtPS; }
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
ProjLib_OnSurface& operator= (const ProjLib_OnSurface&);
|
||||
|
||||
private:
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
Extrema_ExtPS* myExtPS;
|
||||
};
|
||||
|
||||
@@ -158,14 +158,14 @@ myIsDone(Standard_False)
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ProjectOnSurface::ProjLib_ProjectOnSurface
|
||||
(const Handle(Adaptor3d_HSurface)& S ) :
|
||||
(const Handle(Adaptor3d_Surface)& S ) :
|
||||
myTolerance(0.0),
|
||||
myIsDone(Standard_False)
|
||||
{
|
||||
mySurface = S;
|
||||
}
|
||||
|
||||
void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_HCurve)& C,
|
||||
void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C,
|
||||
const Standard_Real Tolerance)
|
||||
{
|
||||
myTolerance = Tolerance ;
|
||||
|
@@ -17,17 +17,10 @@
|
||||
#ifndef _ProjLib_ProjectOnSurface_HeaderFile
|
||||
#define _ProjLib_ProjectOnSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Adaptor3d_HCurve;
|
||||
class Adaptor3d_HSurface;
|
||||
class Geom_BSplineCurve;
|
||||
|
||||
|
||||
//! Project a curve on a surface. The result ( a 3D
|
||||
//! Curve) will be an approximation
|
||||
class ProjLib_ProjectOnSurface
|
||||
@@ -41,16 +34,16 @@ public:
|
||||
Standard_EXPORT ProjLib_ProjectOnSurface();
|
||||
|
||||
//! Create a projector normaly to the surface <S>.
|
||||
Standard_EXPORT ProjLib_ProjectOnSurface(const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT ProjLib_ProjectOnSurface(const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
Standard_EXPORT virtual ~ProjLib_ProjectOnSurface();
|
||||
|
||||
//! Set the Surface to <S>.
|
||||
//! To compute the projection, you have to Load the Curve.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Compute the projection of the curve <C> on the Surface.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tolerance);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Curve)& C, const Standard_Real Tolerance);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
@@ -69,8 +62,8 @@ private:
|
||||
|
||||
|
||||
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_HSurface) mySurface;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
Handle(Adaptor3d_Surface) mySurface;
|
||||
Standard_Real myTolerance;
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom_BSplineCurve) myResult;
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#include <ProjLib_ComputeApproxOnPolarSurface.hxx>
|
||||
#include <ProjLib_ComputeApprox.hxx>
|
||||
#include <ProjLib_Projector.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Approx_CurveOnSurface.hxx>
|
||||
#include <ProjLib_Plane.hxx>
|
||||
#include <ProjLib_Cylinder.hxx>
|
||||
@@ -58,12 +58,15 @@
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(ProjLib_ProjectedCurve, Adaptor2d_Curve2d)
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeTolU
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
static Standard_Real ComputeTolU(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Real theTolerance)
|
||||
{
|
||||
Standard_Real aTolU = theSurf->UResolution(theTolerance);
|
||||
@@ -80,7 +83,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Real ComputeTolV(const Handle(Adaptor3d_HSurface)& theSurf,
|
||||
static Standard_Real ComputeTolV(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Real theTolerance)
|
||||
{
|
||||
Standard_Real aTolV = theSurf->VResolution(theTolerance);
|
||||
@@ -148,7 +151,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void TrimC3d(Handle(Adaptor3d_HCurve)& myCurve,
|
||||
static void TrimC3d(Handle(Adaptor3d_Curve)& myCurve,
|
||||
Standard_Boolean* IsTrimmed,
|
||||
const Standard_Real dt,
|
||||
const gp_Pnt& Pole,
|
||||
@@ -269,7 +272,7 @@ static void ExtendC2d (Handle(Geom2d_BSplineCurve)& aRes,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void Project(ProjLib_Projector& P, Handle(Adaptor3d_HCurve)& C)
|
||||
static void Project(ProjLib_Projector& P, Handle(Adaptor3d_Curve)& C)
|
||||
{
|
||||
GeomAbs_CurveType CType = C->GetType();
|
||||
switch (CType) {
|
||||
@@ -319,7 +322,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve() :
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
(const Handle(Adaptor3d_HSurface)& S) :
|
||||
(const Handle(Adaptor3d_Surface)& S) :
|
||||
myTolerance(Precision::Confusion()),
|
||||
myDegMin(-1), myDegMax(-1),
|
||||
myMaxSegments(-1),
|
||||
@@ -336,8 +339,8 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Handle(Adaptor3d_HCurve)& C) :
|
||||
(const Handle(Adaptor3d_Surface)& S,
|
||||
const Handle(Adaptor3d_Curve)& C) :
|
||||
myTolerance(Precision::Confusion()),
|
||||
myDegMin(-1), myDegMax(-1),
|
||||
myMaxSegments(-1),
|
||||
@@ -355,8 +358,8 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
//=======================================================================
|
||||
|
||||
ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Handle(Adaptor3d_HCurve)& C,
|
||||
(const Handle(Adaptor3d_Surface)& S,
|
||||
const Handle(Adaptor3d_Curve)& C,
|
||||
const Standard_Real Tol) :
|
||||
myTolerance(Max(Tol, Precision::Confusion())),
|
||||
myDegMin(-1), myDegMax(-1),
|
||||
@@ -374,7 +377,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HSurface)& S)
|
||||
void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_Surface)& S)
|
||||
{
|
||||
mySurface = S ;
|
||||
}
|
||||
@@ -394,7 +397,7 @@ void ProjLib_ProjectedCurve::Load(const Standard_Real theTol)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C)
|
||||
void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C)
|
||||
{
|
||||
myTolerance = Max(myTolerance, Precision::Confusion());
|
||||
myCurve = C;
|
||||
@@ -493,7 +496,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C)
|
||||
l = myCurve->LastParameter();
|
||||
dt = (l - f) * eps;
|
||||
|
||||
const Adaptor3d_Surface& S = mySurface->Surface();
|
||||
const Adaptor3d_Surface& S = *mySurface;
|
||||
U1 = S.FirstUParameter();
|
||||
U2 = S.LastUParameter();
|
||||
V1 = S.FirstVParameter();
|
||||
@@ -594,7 +597,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C)
|
||||
f = f + dt;
|
||||
myCurve = myCurve->Trim(f, l, Precision::Confusion());
|
||||
// Searching the parameter on the basis curve for surface of revolution
|
||||
Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
|
||||
Extrema_ExtPC anExtr(P, *mySurface->BasisCurve(), myTolerance);
|
||||
if (anExtr.IsDone())
|
||||
{
|
||||
Standard_Real aMinDist = RealLast();
|
||||
@@ -620,7 +623,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C)
|
||||
l = l - dt;
|
||||
myCurve = myCurve->Trim(f, l, Precision::Confusion());
|
||||
// Searching the parameter on the basis curve for surface of revolution
|
||||
Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
|
||||
Extrema_ExtPC anExtr(P, *mySurface->BasisCurve(), myTolerance);
|
||||
if (anExtr.IsDone())
|
||||
{
|
||||
Standard_Real aMinDist = RealLast();
|
||||
@@ -649,18 +652,16 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
aMaxDist = myMaxDist;
|
||||
}
|
||||
ProjLib_CompProjectedCurve Projector(mySurface,myCurve, aTolU, aTolV, aMaxDist);
|
||||
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve();
|
||||
HProjector->Set(Projector);
|
||||
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve (mySurface,myCurve, aTolU, aTolV, aMaxDist);
|
||||
|
||||
// Normalement, dans le cadre de ProjLib, le resultat
|
||||
// doit etre une et une seule courbe !!!
|
||||
// De plus, cette courbe ne doit pas etre Single point
|
||||
Standard_Integer NbCurves = Projector.NbCurves();
|
||||
Standard_Integer NbCurves = HProjector->NbCurves();
|
||||
Standard_Real Udeb = 0.0,Ufin = 0.0;
|
||||
if (NbCurves > 0)
|
||||
{
|
||||
Projector.Bounds(1, Udeb, Ufin);
|
||||
HProjector->Bounds(1, Udeb, Ufin);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -939,7 +940,7 @@ void ProjLib_ProjectedCurve::SetMaxDist(const Standard_Real theMaxDist)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Adaptor3d_HSurface)& ProjLib_ProjectedCurve::GetSurface() const
|
||||
const Handle(Adaptor3d_Surface)& ProjLib_ProjectedCurve::GetSurface() const
|
||||
{
|
||||
return mySurface;
|
||||
}
|
||||
@@ -950,7 +951,7 @@ const Handle(Adaptor3d_HSurface)& ProjLib_ProjectedCurve::GetSurface() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(Adaptor3d_HCurve)& ProjLib_ProjectedCurve::GetCurve() const
|
||||
const Handle(Adaptor3d_Curve)& ProjLib_ProjectedCurve::GetCurve() const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
@@ -1312,7 +1313,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ProjectedCurve::BSpline() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_HCurve2d) ProjLib_ProjectedCurve::Trim
|
||||
Handle(Adaptor2d_Curve2d) ProjLib_ProjectedCurve::Trim
|
||||
//(const Standard_Real First,
|
||||
// const Standard_Real Last,
|
||||
// const Standard_Real Tolerance) const
|
||||
|
@@ -17,26 +17,15 @@
|
||||
#ifndef _ProjLib_ProjectedCurve_HeaderFile
|
||||
#define _ProjLib_ProjectedCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <ProjLib_Projector.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
class Adaptor3d_HSurface;
|
||||
class Adaptor3d_HCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Standard_NotImplemented;
|
||||
class Adaptor2d_HCurve2d;
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <ProjLib_Projector.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
class gp_Lin2d;
|
||||
@@ -47,6 +36,7 @@ class gp_Parab2d;
|
||||
class Geom2d_BezierCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(ProjLib_ProjectedCurve, Adaptor2d_Curve2d)
|
||||
|
||||
//! Compute the 2d-curve. Try to solve the particular
|
||||
//! case if possible. Otherwize, an approximation is
|
||||
@@ -59,37 +49,36 @@ class Geom2d_BSplineCurve;
|
||||
//! and have nothing to do with distance between the projected curve and the surface.
|
||||
class ProjLib_ProjectedCurve : public Adaptor2d_Curve2d
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(ProjLib_ProjectedCurve, Adaptor2d_Curve2d)
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Empty constructor, it only sets some initial values for class fields.
|
||||
Standard_EXPORT ProjLib_ProjectedCurve();
|
||||
|
||||
//! Constructor with initialisation field mySurface
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Constructor, which performs projecting.
|
||||
//! If projecting uses approximation, default parameters are used, in particular, 3d tolerance of approximation
|
||||
//! is Precision::Confusion()
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C);
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C);
|
||||
|
||||
//! Constructor, which performs projecting.
|
||||
//! If projecting uses approximation, 3d tolerance is Tol, default parameters are used,
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Standard_Real Tol);
|
||||
Standard_EXPORT ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real Tol);
|
||||
|
||||
//! Changes the tolerance used to project
|
||||
//! the curve on the surface
|
||||
Standard_EXPORT void Load (const Standard_Real Tolerance);
|
||||
|
||||
//! Changes the Surface.
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HSurface)& S);
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
//! Performs projecting for given curve.
|
||||
//! If projecting uses approximation,
|
||||
//! approximation parameters can be set before by corresponding methods
|
||||
//! SetDegree(...), SetMaxSegmets(...), SetBndPnt(...), SetMaxDist(...)
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& C);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_Curve)& C);
|
||||
|
||||
//! Set min and max possible degree of result BSpline curve2d, which is got by approximation.
|
||||
//! If theDegMin/Max < 0, algorithm uses values that are chosen depending of types curve 3d
|
||||
@@ -112,9 +101,9 @@ public:
|
||||
//! If real distance between curve and surface more then theMaxDist, algorithm stops working.
|
||||
Standard_EXPORT void SetMaxDist(const Standard_Real theMaxDist);
|
||||
|
||||
Standard_EXPORT const Handle(Adaptor3d_HSurface)& GetSurface() const;
|
||||
Standard_EXPORT const Handle(Adaptor3d_Surface)& GetSurface() const;
|
||||
|
||||
Standard_EXPORT const Handle(Adaptor3d_HCurve)& GetCurve() const;
|
||||
Standard_EXPORT const Handle(Adaptor3d_Curve)& GetCurve() const;
|
||||
|
||||
//! returns the tolerance reached if an approximation
|
||||
//! is Done.
|
||||
@@ -142,7 +131,7 @@ public:
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
Standard_EXPORT Handle(Adaptor2d_Curve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
|
||||
|
||||
@@ -223,22 +212,11 @@ public:
|
||||
//! myFirst/Last.
|
||||
Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Real myTolerance;
|
||||
Handle(Adaptor3d_HSurface) mySurface;
|
||||
Handle(Adaptor3d_HCurve) myCurve;
|
||||
Handle(Adaptor3d_Surface) mySurface;
|
||||
Handle(Adaptor3d_Curve) myCurve;
|
||||
ProjLib_Projector myResult;
|
||||
Standard_Integer myDegMin;
|
||||
Standard_Integer myDegMax;
|
||||
@@ -247,10 +225,4 @@ private:
|
||||
AppParCurves_Constraint myBndPnt;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ProjLib_ProjectedCurve_HeaderFile
|
||||
|
Reference in New Issue
Block a user