mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR). Used clang-format 18.1.8. New actions to validate code formatting is added. Update .clang-format with disabling of include sorting. It is temporary changes, then include will be sorted. Apply formatting for /src and /tools folder. The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <GCE2d_MakeArcOfCircle.hxx>
|
||||
#include <gce_MakeCirc2d.hxx>
|
||||
@@ -27,94 +26,95 @@
|
||||
#include <IntAna2d_AnaIntersection.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const gp_Pnt2d& P3 )
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const gp_Pnt2d& P3)
|
||||
{
|
||||
gce_MakeCirc2d Cir = gce_MakeCirc2d(P1,P2,P3);
|
||||
TheError = Cir.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gp_Circ2d C(Cir.Value());
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(C,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(C,P3);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(C);
|
||||
TheArc= new Geom2d_TrimmedCurve(Circ,Alpha1,Alpha2,Standard_True);
|
||||
gce_MakeCirc2d Cir = gce_MakeCirc2d(P1, P2, P3);
|
||||
TheError = Cir.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
gp_Circ2d C(Cir.Value());
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(C, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(C, P3);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(C);
|
||||
TheArc = new Geom2d_TrimmedCurve(Circ, Alpha1, Alpha2, Standard_True);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Vec2d& V ,
|
||||
const gp_Pnt2d& P2 )
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1,
|
||||
const gp_Vec2d& V,
|
||||
const gp_Pnt2d& P2)
|
||||
{
|
||||
Standard_Boolean Sense;
|
||||
gp_Circ2d cir;
|
||||
gp_Lin2d corde = gce_MakeLin2d(P1,P2);
|
||||
gp_Dir2d dir(corde.Direction());
|
||||
gp_Lin2d bis(gp_Pnt2d((P1.X()+P2.X())/2.,(P1.Y()+P2.Y())/2.),
|
||||
gp_Dir2d(-dir.Y(),dir.X()));
|
||||
gp_Lin2d norm(P1,gp_Dir2d(-V.Y(),V.X()));
|
||||
gp_Circ2d cir;
|
||||
gp_Lin2d corde = gce_MakeLin2d(P1, P2);
|
||||
gp_Dir2d dir(corde.Direction());
|
||||
gp_Lin2d bis(gp_Pnt2d((P1.X() + P2.X()) / 2., (P1.Y() + P2.Y()) / 2.),
|
||||
gp_Dir2d(-dir.Y(), dir.X()));
|
||||
gp_Lin2d norm(P1, gp_Dir2d(-V.Y(), V.X()));
|
||||
TheError = gce_ConfusedPoints;
|
||||
|
||||
IntAna2d_AnaIntersection Intp(bis,norm);
|
||||
IntAna2d_AnaIntersection Intp(bis, norm);
|
||||
|
||||
if (Intp.IsDone())
|
||||
{
|
||||
if (!Intp.IsEmpty())
|
||||
{
|
||||
if (!Intp.IsEmpty())
|
||||
{
|
||||
gp_Pnt2d center(Intp.Point(1).Value());
|
||||
Standard_Real rad = (center.Distance(P1)+center.Distance(P2))/2.;
|
||||
cir = gce_MakeCirc2d(center,rad);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
gp_Pnt2d center(Intp.Point(1).Value());
|
||||
Standard_Real rad = (center.Distance(P1) + center.Distance(P2)) / 2.;
|
||||
cir = gce_MakeCirc2d(center, rad);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
}
|
||||
|
||||
if (TheError == gce_Done) {
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(cir,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(cir,P2);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(cir);
|
||||
gp_Vec2d vv(dir);
|
||||
Standard_Real cross = V^vv;
|
||||
Sense = cross > 0.;
|
||||
TheArc= new Geom2d_TrimmedCurve(Circ,Alpha1,Alpha2,Sense);
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(cir, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(cir, P2);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(cir);
|
||||
gp_Vec2d vv(dir);
|
||||
Standard_Real cross = V ^ vv;
|
||||
Sense = cross > 0.;
|
||||
TheArc = new Geom2d_TrimmedCurve(Circ, Alpha1, Alpha2, Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Circ,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Circ,P2);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Circ, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Circ, P2);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc = new Geom2d_TrimmedCurve(C, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Circ,P);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Circ, P);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc = new Geom2d_TrimmedCurve(C, Alphafirst, Alpha, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
TheArc = new Geom2d_TrimmedCurve(C, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfCircle::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeArcOfCircle::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeArcOfCircle::Value() - no result");
|
||||
return TheArc;
|
||||
}
|
||||
|
@@ -28,7 +28,6 @@ class gp_Circ2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
|
||||
|
||||
//! Implements construction algorithms for an arc of
|
||||
//! circle in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
//! A MakeArcOfCircle object provides a framework for:
|
||||
@@ -36,43 +35,50 @@ class gp_Vec2d;
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results. In particular, the Value
|
||||
//! function returns the constructed arc of circle.
|
||||
class GCE2d_MakeArcOfCircle : public GCE2d_Root
|
||||
class GCE2d_MakeArcOfCircle : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
//! a circle between two parameters Alpha1 and Alpha2.
|
||||
//! The two parameters are angles. The parameters are
|
||||
//! in radians.
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
//! a circle between point <P> and the parameter
|
||||
//! Alpha. Alpha is given in radians.
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ, const gp_Pnt2d& P, const Standard_Real Alpha, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
//! a circle between two points P1 and P2.
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
//! three points P1,P2,P3 between two points P1 and P3,
|
||||
//! and passing through the point P2.
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3);
|
||||
|
||||
|
||||
//! Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
//! two points P1,P2 and the tangente to the solution at
|
||||
//! the point P1.
|
||||
Standard_EXPORT GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1, const gp_Vec2d& V, const gp_Pnt2d& P2);
|
||||
|
||||
|
||||
//! Returns the constructed arc of circle.
|
||||
//! Exceptions StdFail_NotDone if no arc of circle is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_TrimmedCurve)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_TrimmedCurve)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_TrimmedCurve) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_TrimmedCurve) TheArc;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <GCE2d_MakeArcOfEllipse.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
@@ -23,42 +22,41 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Elips,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Elips,P2);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Elips, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Elips, P2);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Elips,P);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Elips, P);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E, Alphafirst, Alpha, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
TheArc = new Geom2d_TrimmedCurve(E, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfEllipse::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeArcOfEllipse::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeArcOfEllipse::Value() - no result");
|
||||
return TheArc;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@
|
||||
class gp_Elips2d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Implements construction algorithms for an arc of
|
||||
//! ellipse in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
//! A MakeArcOfEllipse object provides a framework for:
|
||||
@@ -35,22 +34,26 @@ class gp_Pnt2d;
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results. In particular, the Value
|
||||
//! function returns the constructed arc of ellipse.
|
||||
class GCE2d_MakeArcOfEllipse : public GCE2d_Root
|
||||
class GCE2d_MakeArcOfEllipse : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
//! a Ellipse between two parameters Alpha1 and Alpha2.
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
//! a Ellipse between point <P> and the parameter
|
||||
//! Alpha.
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips, const gp_Pnt2d& P, const Standard_Real Alpha, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
//! a Ellipse between two points P1 and P2.
|
||||
//! Please, note: The orientation of the arc is:
|
||||
@@ -59,12 +62,15 @@ public:
|
||||
//! - the opposite sense if Sense is false.
|
||||
//! - Alpha1, Alpha2 and Alpha are angle values, given in radians.
|
||||
//! - IsDone always returns true.
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Returns the constructed arc of ellipse.
|
||||
Standard_EXPORT const Handle(Geom2d_TrimmedCurve)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_TrimmedCurve)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_TrimmedCurve) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_TrimmedCurve) TheArc;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <GCE2d_MakeArcOfHyperbola.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
@@ -23,44 +22,41 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense)
|
||||
GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Hypr, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Hypr, P2);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::
|
||||
GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Hypr, P);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H, Alphafirst, Alpha, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::
|
||||
GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
TheArc = new Geom2d_TrimmedCurve(H, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfHyperbola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeArcOfHyperbola::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeArcOfHyperbola::Value() - no result");
|
||||
return TheArc;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@
|
||||
class gp_Hypr2d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Implements construction algorithms for an arc of
|
||||
//! hyperbola in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
//! A MakeArcOfHyperbola object provides a framework for:
|
||||
@@ -35,22 +34,26 @@ class gp_Pnt2d;
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results. In particular, the Value
|
||||
//! function returns the constructed arc of hyperbola.
|
||||
class GCE2d_MakeArcOfHyperbola : public GCE2d_Root
|
||||
class GCE2d_MakeArcOfHyperbola : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
//! a Hyperbola between two parameters Alpha1 and Alpha2.
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
//! a Hyperbola between point <P> and the parameter
|
||||
//! Alpha.
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr, const gp_Pnt2d& P, const Standard_Real Alpha, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
//! a Hyperbola between two points P1 and P2.
|
||||
//! Note: the orientation of the arc of hyperbola is:
|
||||
@@ -58,12 +61,15 @@ public:
|
||||
//! is true (default value), or
|
||||
//! - the opposite sense if Sense is false.
|
||||
//! - IsDone always returns true.
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Returns the constructed arc of hyperbola.
|
||||
Standard_EXPORT const Handle(Geom2d_TrimmedCurve)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_TrimmedCurve)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_TrimmedCurve) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_TrimmedCurve) TheArc;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <GCE2d_MakeArcOfParabola.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
@@ -23,43 +22,41 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense ) {
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Parab,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Parab,P2);
|
||||
Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(P,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
GCE2d_MakeArcOfParabola::GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Parab, P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Parab, P2);
|
||||
Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(P, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense ) {
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Parab,P);
|
||||
Handle(Geom2d_Parabola) Parabola = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(Parabola,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
GCE2d_MakeArcOfParabola::GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Parab, P);
|
||||
Handle(Geom2d_Parabola) Parabola = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(Parabola, Alphafirst, Alpha, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeArcOfParabola::GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(P,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
TheArc = new Geom2d_TrimmedCurve(P, Alpha1, Alpha2, Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfParabola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeArcOfParabola::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeArcOfParabola::Value() - no result");
|
||||
return TheArc;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@
|
||||
class gp_Parab2d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Implements construction algorithms for an arc of
|
||||
//! parabola in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
//! A MakeArcOfParabola object provides a framework for:
|
||||
@@ -35,22 +34,26 @@ class gp_Pnt2d;
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results. In particular, the Value
|
||||
//! function returns the constructed arc of parabola.
|
||||
class GCE2d_MakeArcOfParabola : public GCE2d_Root
|
||||
class GCE2d_MakeArcOfParabola : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
//! a Parabola between two parameters Alpha1 and Alpha2.
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
//! a Parabola between point <P> and the parameter
|
||||
//! Alpha.
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab, const gp_Pnt2d& P, const Standard_Real Alpha, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const gp_Pnt2d& P,
|
||||
const Standard_Real Alpha,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
//! a Parabola between two points P1 and P2.
|
||||
//! Please, note: the orientation of the arc of parabola is:
|
||||
@@ -58,12 +61,15 @@ public:
|
||||
//! or is true (default value), or
|
||||
//! - the opposite sense if Sense is false.
|
||||
//! - IsDone always returns true.
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab,
|
||||
const gp_Pnt2d& P1,
|
||||
const gp_Pnt2d& P2,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Returns the constructed arc of parabola.
|
||||
Standard_EXPORT const Handle(Geom2d_TrimmedCurve)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_TrimmedCurve)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_TrimmedCurve) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_TrimmedCurve) TheArc;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeCircle.hxx>
|
||||
#include <gce_MakeCirc2d.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
@@ -26,86 +25,91 @@
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(C);
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A ,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A,Radius,Sense);
|
||||
if (Radius < 0.0)
|
||||
{
|
||||
TheError = gce_NegativeRadius;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A, Radius, Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A ,
|
||||
const Standard_Real Radius)
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A, const Standard_Real Radius)
|
||||
{
|
||||
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A,Radius);
|
||||
if (Radius < 0.0)
|
||||
{
|
||||
TheError = gce_NegativeRadius;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A, Radius);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& Point )
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ, const gp_Pnt2d& Point)
|
||||
{
|
||||
gp_Circ2d C = gce_MakeCirc2d(Circ,Point);
|
||||
TheCircle = new Geom2d_Circle(C);
|
||||
TheError = gce_Done;
|
||||
gp_Circ2d C = gce_MakeCirc2d(Circ, Point);
|
||||
TheCircle = new Geom2d_Circle(C);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
|
||||
const Standard_Real Dist )
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ, const Standard_Real Dist)
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Circ,Dist);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Circ, Dist);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const gp_Pnt2d& P3 )
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3)
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(P1,P2,P3);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Radius ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Point,Radius,Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(P1, P2, P3);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center ,
|
||||
const gp_Pnt2d& Point ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Center,Point,Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Point, Radius, Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center,
|
||||
const gp_Pnt2d& Point,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Center, Point, Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeCircle::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeCircle::Value() - no result");
|
||||
return TheCircle;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class gp_Ax2d;
|
||||
class gp_Ax22d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements the following algorithms used
|
||||
//! to create Circle from Geom2d.
|
||||
//!
|
||||
@@ -41,48 +40,48 @@ class gp_Pnt2d;
|
||||
//! * Create a Circle with its center and the normal of its
|
||||
//! plane and its radius.
|
||||
//! * Create a Circle with its axis and radius.
|
||||
class GCE2d_MakeCircle : public GCE2d_Root
|
||||
class GCE2d_MakeCircle : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates a circle from a non persistent one.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& C);
|
||||
|
||||
|
||||
//! A is the "XAxis" of the circle which defines the origin
|
||||
//! of parametrization.
|
||||
//! It is not forbidden to create a circle with Radius = 0.0
|
||||
//! The status is "NegativeRadius" if Radius < 0.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Ax2d& A, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Ax2d& A,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! A is the local coordinate system of the circle which defines
|
||||
//! the origin of parametrization.
|
||||
//! It is not forbidden to create a circle with Radius = 0.0
|
||||
//! The status is "NegativeRadius" if Radius < 0.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Ax22d& A, const Standard_Real Radius);
|
||||
|
||||
|
||||
//! Make a Circle from Geom2d <TheCirc> parallel to another
|
||||
//! Circ <Circ> with a distance <Dist>.
|
||||
//! If Dist is greater than zero the result is enclosing
|
||||
//! the circle <Circ>, else the result is enclosed by the
|
||||
//! circle <Circ>.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const Standard_Real Dist);
|
||||
|
||||
|
||||
//! Make a Circle from Geom2d <TheCirc> parallel to another
|
||||
//! Circ <Circ> and passing through a Pnt <Point>.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const gp_Pnt2d& Point);
|
||||
|
||||
|
||||
//! Make a Circ from gp <TheCirc> passing through 3
|
||||
//! Pnt2d <P1>,<P2>,<P3>.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3);
|
||||
|
||||
|
||||
//! Make a Circ from geom2d <TheCirc> by its center an radius.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Makes a Circle from geom2d <TheCirc> with its center
|
||||
//! <Center> and a point giving the radius.
|
||||
//! If Sense is true the local coordinate system of
|
||||
@@ -95,13 +94,15 @@ public:
|
||||
//! - gce_NegativeRadius if Radius is less than 0.0, or
|
||||
//! - gce_IntersectionError if points P1, P2 and P3
|
||||
//! are collinear and the three are not coincident.
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& Center, const gp_Pnt2d& Point, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& Center,
|
||||
const gp_Pnt2d& Point,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Returns the constructed circle.
|
||||
//! Exceptions StdFail_NotDone if no circle is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_Circle)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_Circle)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_Circle) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_Circle) TheCircle;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeEllipse.hxx>
|
||||
#include <gce_MakeElips2d.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
@@ -26,46 +25,47 @@
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheError = gce_Done;
|
||||
TheEllipse = new Geom2d_Ellipse(E);
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis ,
|
||||
const Standard_Real MajorRadius ,
|
||||
const Standard_Real MinorRadius )
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius)
|
||||
{
|
||||
gce_MakeElips2d E = gce_MakeElips2d(Axis,MajorRadius,MinorRadius);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeElips2d E = gce_MakeElips2d(Axis, MajorRadius, MinorRadius);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis ,
|
||||
const Standard_Real MajorRadius ,
|
||||
const Standard_Real MinorRadius ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
gce_MakeElips2d E = gce_MakeElips2d(MajorAxis,MajorRadius,MinorRadius,Sense);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeElips2d E = gce_MakeElips2d(MajorAxis, MajorRadius, MinorRadius, Sense);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& S2 ,
|
||||
const gp_Pnt2d& Center ) {
|
||||
gce_MakeElips2d E = gce_MakeElips2d(S1,S2,Center);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center)
|
||||
{
|
||||
gce_MakeElips2d E = gce_MakeElips2d(S1, S2, Center);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeEllipse::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeEllipse::Value() - no result");
|
||||
return TheEllipse;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class gp_Ax2d;
|
||||
class gp_Ax22d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements the following algorithms used to
|
||||
//! create Ellipse from Geom2d.
|
||||
//! * Create an Ellipse from two apex and the center.
|
||||
@@ -41,17 +40,13 @@ class gp_Pnt2d;
|
||||
//! The "XAxis" of the ellipse defines the origin of the
|
||||
//! parametrization, it is the major axis of the ellipse.
|
||||
//! The YAxis is the minor axis of the ellipse.
|
||||
class GCE2d_MakeEllipse : public GCE2d_Root
|
||||
class GCE2d_MakeEllipse : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Creates an ellipse from a non persistent one from package gp
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Elips2d& E);
|
||||
|
||||
|
||||
//! MajorAxis is the local coordinate system of the ellipse.
|
||||
//! It is the "XAxis". The minor axis is the YAxis of the
|
||||
@@ -61,16 +56,20 @@ public:
|
||||
//! MinorRadius.
|
||||
//! The status is "InvertRadius" if MajorRadius < MinorRadius or
|
||||
//! "NegativeRadius" if MinorRadius < 0.
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Axis is the local coordinate system of the ellipse.
|
||||
//! It is not forbidden to create an ellipse with MajorRadius =
|
||||
//! MinorRadius.
|
||||
//! The status is "InvertRadius" if MajorRadius < MinorRadius or
|
||||
//! "NegativeRadius" if MinorRadius < 0.
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Ax22d& Axis, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Ax22d& Axis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius);
|
||||
|
||||
//! Make an Ellipse centered on the point Center, where
|
||||
//! - the major axis of the ellipse is defined by Center and S1,
|
||||
//! - its major radius is the distance between Center and S1, and
|
||||
@@ -81,12 +80,12 @@ public:
|
||||
//! - the trigonometric sense if Sense is not given or is true, or
|
||||
//! - the opposite sense if Sense is false.
|
||||
Standard_EXPORT GCE2d_MakeEllipse(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center);
|
||||
|
||||
|
||||
//! Returns the constructed ellipse.
|
||||
//! Exceptions StdFail_NotDone if no ellipse is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_Ellipse)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_Ellipse)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_Ellipse) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_Ellipse) TheEllipse;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeHyperbola.hxx>
|
||||
#include <gce_MakeHypr2d.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
@@ -26,46 +25,49 @@
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Hypr2d& H)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheError = gce_Done;
|
||||
TheHyperbola = new Geom2d_Hyperbola(H);
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis ,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(MajorAxis,MajorRadius,MinorRadius,Sense);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(MajorAxis, MajorRadius, MinorRadius, Sense);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax22d& Axis ,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius)
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax22d& Axis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius)
|
||||
{
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(Axis,MajorRadius,MinorRadius);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(Axis, MajorRadius, MinorRadius);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& S2 ,
|
||||
const gp_Pnt2d& Center ) {
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(S1,S2,Center);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Pnt2d& S1,
|
||||
const gp_Pnt2d& S2,
|
||||
const gp_Pnt2d& Center)
|
||||
{
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(S1, S2, Center);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Hyperbola)& GCE2d_MakeHyperbola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeHyperbola::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeHyperbola::Value() - no result");
|
||||
return TheHyperbola;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class gp_Ax2d;
|
||||
class gp_Ax22d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements the following algorithms used to
|
||||
//! create Hyperbola from Geom2d.
|
||||
//! * Create an Hyperbola from two apex and the center.
|
||||
@@ -56,33 +55,33 @@ class gp_Pnt2d;
|
||||
//! of the hyperbola C and the apex of the First (or Second)
|
||||
//! Conjugate branch. The minor axis is the "YAxis".
|
||||
//! The major radius can be lower than the minor radius.
|
||||
class GCE2d_MakeHyperbola : public GCE2d_Root
|
||||
class GCE2d_MakeHyperbola : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Creates an Hyperbola from a non persistent one from package gp
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Hypr2d& H);
|
||||
|
||||
|
||||
//! MajorAxis is the "XAxis" of the hyperbola.
|
||||
//! The major radius of the hyperbola is on this "XAxis" and
|
||||
//! the minor radius is on the "YAxis" of the hyperbola.
|
||||
//! The status is "NegativeRadius" if MajorRadius < 0.0 or if
|
||||
//! MinorRadius < 0.0
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense);
|
||||
|
||||
//! Axis is the local coordinate system of the hyperbola.
|
||||
//! The major radius of the hyperbola is on this "XAxis" and
|
||||
//! the minor radius is on the "YAxis" of the hyperbola.
|
||||
//! The status is "NegativeRadius" if MajorRadius < 0.0 or if
|
||||
//! MinorRadius < 0.0
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax22d& Axis, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax22d& Axis,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius);
|
||||
|
||||
//! Creates a hyperbol centered on the origin of the coordinate system
|
||||
//! Axis, with major and minor radii MajorRadius and
|
||||
//! MinorRadius, where the major axis is the "X Axis"
|
||||
@@ -100,13 +99,15 @@ public:
|
||||
//! - gce_InvertAxis if the major radius defined by
|
||||
//! Center and S1 is less than the minor radius
|
||||
//! defined by Center, S1 and S2.Make an Hyperbola with its center and two apexes.
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeHyperbola(const gp_Pnt2d& S1,
|
||||
const gp_Pnt2d& S2,
|
||||
const gp_Pnt2d& Center);
|
||||
|
||||
//! Returns the constructed hyperbola.
|
||||
//! Exceptions: StdFail_NotDone if no hyperbola is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_Hyperbola)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_Hyperbola)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_Hyperbola) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_Hyperbola) TheHyperbola;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeLine.hxx>
|
||||
#include <gce_MakeLin2d.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
@@ -30,55 +29,53 @@
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Ax2d& A)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(A);
|
||||
TheLine = new Geom2d_Line(A);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& L)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(L);
|
||||
TheLine = new Geom2d_Line(L);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P,
|
||||
const gp_Dir2d& V)
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P, const gp_Dir2d& V)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(P,V);
|
||||
TheLine = new Geom2d_Line(P, V);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P1, const gp_Pnt2d& P2)
|
||||
{
|
||||
gce_MakeLin2d L(P1,P2);
|
||||
gce_MakeLin2d L(P1, P2);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin ,
|
||||
const gp_Pnt2d& Point )
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin, const gp_Pnt2d& Point)
|
||||
{
|
||||
gce_MakeLin2d L(Lin,Point);
|
||||
gce_MakeLin2d L(Lin, Point);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin ,
|
||||
const Standard_Real Dist )
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin, const Standard_Real Dist)
|
||||
{
|
||||
gce_MakeLin2d L(Lin,Dist);
|
||||
gce_MakeLin2d L(Lin, Dist);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Line)& GCE2d_MakeLine::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeLine::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeLine::Value() - no result");
|
||||
return TheLine;
|
||||
}
|
||||
|
@@ -29,40 +29,34 @@ class gp_Lin2d;
|
||||
class gp_Pnt2d;
|
||||
class gp_Dir2d;
|
||||
|
||||
|
||||
//! This class implements the following algorithms used
|
||||
//! to create a Line from Geom2d.
|
||||
//! * Create a Line parallel to another and passing
|
||||
//! through a point.
|
||||
//! * Create a Line passing through 2 points.
|
||||
class GCE2d_MakeLine : public GCE2d_Root
|
||||
class GCE2d_MakeLine : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Creates a line located in 2D space with the axis placement A.
|
||||
//! The Location of A is the origin of the line.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Ax2d& A);
|
||||
|
||||
|
||||
//! Creates a line from a non persistent line from package gp.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& L);
|
||||
|
||||
|
||||
//! P is the origin and V is the direction of the line.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P, const gp_Dir2d& V);
|
||||
|
||||
|
||||
//! Make a Line from Geom2d <TheLin> parallel to another
|
||||
//! Lin <Lin> and passing through a Pnt <Point>.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const gp_Pnt2d& Point);
|
||||
|
||||
|
||||
//! Make a Line from Geom2d <TheLin> parallel to another
|
||||
//! Lin <Lin> at a distance <Dist>.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const Standard_Real Dist);
|
||||
|
||||
|
||||
//! Make a Line from Geom2d <TheLin> passing through 2
|
||||
//! Pnt <P1>,<P2>.
|
||||
//! It returns false if <p1> and <P2> are confused.
|
||||
@@ -70,12 +64,12 @@ public:
|
||||
//! If points P1 and P2 coincident (that is, when IsDone
|
||||
//! returns false), the Status function returns gce_ConfusedPoints.
|
||||
Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
|
||||
//! Returns the constructed line.
|
||||
//! Exceptions StdFail_NotDone if no line is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_Line)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_Line)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_Line) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_Line) TheLine;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeMirror.hxx>
|
||||
#include <Geom2d_Transformation.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
@@ -25,7 +24,8 @@
|
||||
//=========================================================================
|
||||
// Creation d une symetrie de Geom2d par rapport a un point. +
|
||||
//=========================================================================
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) {
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point)
|
||||
{
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(Point);
|
||||
}
|
||||
@@ -34,7 +34,8 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) {
|
||||
// Creation d une symetrie de Geom2d par rapport a une droite. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) {
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis)
|
||||
{
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(Axis);
|
||||
}
|
||||
@@ -43,9 +44,10 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) {
|
||||
// Creation d une symetrie de Geom2d par rapport a une droite. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) {
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line)
|
||||
{
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(gp_Ax2d(Line.Location(),Line.Direction()));
|
||||
TheMirror->SetMirror(gp_Ax2d(Line.Location(), Line.Direction()));
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
@@ -53,13 +55,13 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) {
|
||||
// par un point et une direction. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ,
|
||||
const gp_Dir2d& Direc ) {
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point, const gp_Dir2d& Direc)
|
||||
{
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(gp_Ax2d(Point,Direc));
|
||||
TheMirror->SetMirror(gp_Ax2d(Point, Direc));
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeMirror::Value() const
|
||||
{
|
||||
{
|
||||
return TheMirror;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ class gp_Ax2d;
|
||||
class gp_Lin2d;
|
||||
class gp_Dir2d;
|
||||
|
||||
|
||||
//! This class implements elementary construction algorithms for a
|
||||
//! symmetrical transformation in 2D space about a point
|
||||
//! or axis. The result is a Geom2d_Transformation transformation.
|
||||
@@ -35,49 +34,29 @@ class gp_Dir2d;
|
||||
//! - defining the construction of the transformation,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class GCE2d_MakeMirror
|
||||
class GCE2d_MakeMirror
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GCE2d_MakeMirror(const gp_Pnt2d& Point);
|
||||
|
||||
|
||||
Standard_EXPORT GCE2d_MakeMirror(const gp_Ax2d& Axis);
|
||||
|
||||
|
||||
Standard_EXPORT GCE2d_MakeMirror(const gp_Lin2d& Line);
|
||||
|
||||
|
||||
//! Make a symmetry transformation af axis defined by
|
||||
//! <Point> and <Direc>.
|
||||
Standard_EXPORT GCE2d_MakeMirror(const gp_Pnt2d& Point, const gp_Dir2d& Direc);
|
||||
|
||||
|
||||
//! Returns the constructed transformation.
|
||||
Standard_EXPORT const Handle(Geom2d_Transformation)& Value() const;
|
||||
operator const Handle(Geom2d_Transformation)& () const { return Value(); }
|
||||
|
||||
|
||||
|
||||
operator const Handle(Geom2d_Transformation) & () const { return Value(); }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_Transformation) TheMirror;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GCE2d_MakeMirror_HeaderFile
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeParabola.hxx>
|
||||
#include <gce_MakeParab2d.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
@@ -26,53 +25,59 @@
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Parab2d& Prb)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(Prb);
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis,
|
||||
const Standard_Real Focal ,
|
||||
const Standard_Boolean Sense )
|
||||
const Standard_Real Focal,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
if (Focal <0.0) { TheError = gce_NullFocusLength; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(MirrorAxis,Focal,Sense);
|
||||
if (Focal < 0.0)
|
||||
{
|
||||
TheError = gce_NullFocusLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(MirrorAxis, Focal, Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis ,
|
||||
const Standard_Real Focal)
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis, const Standard_Real Focal)
|
||||
{
|
||||
if (Focal <0.0) { TheError = gce_NullFocusLength; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(Axis,Focal);
|
||||
if (Focal < 0.0)
|
||||
{
|
||||
TheError = gce_NullFocusLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(Axis, Focal);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D ,
|
||||
const gp_Pnt2d& F ,
|
||||
const Standard_Boolean Sense )
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D,
|
||||
const gp_Pnt2d& F,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
gp_Parab2d para(D,F,Sense);
|
||||
gp_Parab2d para(D, F, Sense);
|
||||
TheParabola = new Geom2d_Parabola(para);
|
||||
}
|
||||
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& O ) {
|
||||
gce_MakeParab2d P = gce_MakeParab2d(S1,O);
|
||||
TheError = P.Status();
|
||||
if (TheError == gce_Done) {
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Pnt2d& S1, const gp_Pnt2d& O)
|
||||
{
|
||||
gce_MakeParab2d P = gce_MakeParab2d(S1, O);
|
||||
TheError = P.Status();
|
||||
if (TheError == gce_Done)
|
||||
{
|
||||
TheParabola = new Geom2d_Parabola(P.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Parabola)& GCE2d_MakeParabola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeParabola::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeParabola::Value() - no result");
|
||||
return TheParabola;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class gp_Ax22d;
|
||||
class gp_Ax2d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements the following algorithms used to
|
||||
//! create Parabola from Geom2d.
|
||||
//! * Create an Parabola from two apex and the center.
|
||||
@@ -46,37 +45,39 @@ class gp_Pnt2d;
|
||||
//! parabola called Parameter).
|
||||
//! The focal length F = P/2 is the distance between the vertex
|
||||
//! and the focus of the parabola.
|
||||
class GCE2d_MakeParabola : public GCE2d_Root
|
||||
class GCE2d_MakeParabola : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a parabola from a non persistent one.
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Parab2d& Prb);
|
||||
|
||||
|
||||
//! Creates a parabola with its local coordinate system and it's focal
|
||||
//! length "Focal".
|
||||
//! The "Location" point of "Axis" is the vertex of the parabola
|
||||
//! Status is "NegativeFocusLength" if Focal < 0.0
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Ax22d& Axis, const Standard_Real Focal);
|
||||
|
||||
|
||||
//! Creates a parabola with its "MirrorAxis" and it's focal length "Focal".
|
||||
//! MirrorAxis is the axis of symmetry of the curve, it is the
|
||||
//! "XAxis". The "YAxis" is parallel to the directrix of the
|
||||
//! parabola. The "Location" point of "MirrorAxis" is the vertex of the parabola
|
||||
//! Status is "NegativeFocusLength" if Focal < 0.0
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis, const Standard_Real Focal, const Standard_Boolean Sense);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis,
|
||||
const Standard_Real Focal,
|
||||
const Standard_Boolean Sense);
|
||||
|
||||
//! D is the directrix of the parabola and F the focus point.
|
||||
//! The symmetry axis "XAxis" of the parabola is normal to the
|
||||
//! directrix and pass through the focus point F, but its
|
||||
//! "Location" point is the vertex of the parabola.
|
||||
//! The "YAxis" of the parabola is parallel to D and its "Location"
|
||||
//! point is the vertex of the parabola.
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& D, const gp_Pnt2d& F, const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& D,
|
||||
const gp_Pnt2d& F,
|
||||
const Standard_Boolean Sense = Standard_True);
|
||||
|
||||
//! Make a parabola with focal point S1 and
|
||||
//! center O
|
||||
//! The branch of the parabola returned will have <S1> as
|
||||
@@ -94,12 +95,12 @@ public:
|
||||
//! - gce_NullFocusLength if Focal is less than 0.0, or
|
||||
//! - gce_NullAxis if points S1 and O are coincident.
|
||||
Standard_EXPORT GCE2d_MakeParabola(const gp_Pnt2d& S1, const gp_Pnt2d& O);
|
||||
|
||||
|
||||
//! Returns the constructed parabola.
|
||||
//! Exceptions StdFail_NotDone if no parabola is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_Parabola)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_Parabola)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_Parabola) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_Parabola) TheParabola;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeRotation.hxx>
|
||||
#include <Geom2d_Transformation.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
@@ -23,13 +22,13 @@
|
||||
// Creation d une rotation 3d de gp d angle Angle par rapport a une +
|
||||
// droite Line. +
|
||||
//=========================================================================
|
||||
GCE2d_MakeRotation::GCE2d_MakeRotation(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Angle ) {
|
||||
GCE2d_MakeRotation::GCE2d_MakeRotation(const gp_Pnt2d& Point, const Standard_Real Angle)
|
||||
{
|
||||
TheRotation = new Geom2d_Transformation();
|
||||
TheRotation->SetRotation(Point,Angle);
|
||||
TheRotation->SetRotation(Point, Angle);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeRotation::Value() const
|
||||
{
|
||||
{
|
||||
return TheRotation;
|
||||
}
|
||||
|
@@ -25,49 +25,28 @@
|
||||
class Geom2d_Transformation;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements an elementary construction algorithm for
|
||||
//! a rotation in 2D space. The result is a Geom2d_Transformation transformation.
|
||||
//! A MakeRotation object provides a framework for:
|
||||
//! - defining the construction of the transformation,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class GCE2d_MakeRotation
|
||||
class GCE2d_MakeRotation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs a rotation through angle Angle about the center Point.
|
||||
Standard_EXPORT GCE2d_MakeRotation(const gp_Pnt2d& Point, const Standard_Real Angle);
|
||||
|
||||
|
||||
//! Returns the constructed transformation.
|
||||
Standard_EXPORT const Handle(Geom2d_Transformation)& Value() const;
|
||||
operator const Handle(Geom2d_Transformation)& () const { return Value(); }
|
||||
|
||||
|
||||
|
||||
operator const Handle(Geom2d_Transformation) & () const { return Value(); }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_Transformation) TheRotation;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GCE2d_MakeRotation_HeaderFile
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeScale.hxx>
|
||||
#include <Geom2d_Transformation.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
@@ -22,13 +21,13 @@
|
||||
//=========================================================================
|
||||
// Creation d un homothetie de gp de centre Point et de rapport Scale. +
|
||||
//=========================================================================
|
||||
GCE2d_MakeScale::GCE2d_MakeScale(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Scale ) {
|
||||
GCE2d_MakeScale::GCE2d_MakeScale(const gp_Pnt2d& Point, const Standard_Real Scale)
|
||||
{
|
||||
TheScale = new Geom2d_Transformation();
|
||||
TheScale->SetScale(Point,Scale);
|
||||
TheScale->SetScale(Point, Scale);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeScale::Value() const
|
||||
{
|
||||
{
|
||||
return TheScale;
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@
|
||||
class Geom2d_Transformation;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements an elementary construction algorithm for
|
||||
//! a scaling transformation in 2D space. The result is a
|
||||
//! Geom2d_Transformation transformation.
|
||||
@@ -33,44 +32,24 @@ class gp_Pnt2d;
|
||||
//! - defining the construction of the transformation,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class GCE2d_MakeScale
|
||||
class GCE2d_MakeScale
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs a scaling transformation with
|
||||
//! - Point as the center of the transformation, and
|
||||
//! - Scale as the scale factor.
|
||||
Standard_EXPORT GCE2d_MakeScale(const gp_Pnt2d& Point, const Standard_Real Scale);
|
||||
|
||||
|
||||
//! Returns the constructed transformation.
|
||||
Standard_EXPORT const Handle(Geom2d_Transformation)& Value() const;
|
||||
operator const Handle(Geom2d_Transformation)& () const { return Value(); }
|
||||
|
||||
|
||||
|
||||
operator const Handle(Geom2d_Transformation) & () const { return Value(); }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_Transformation) TheScale;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GCE2d_MakeScale_HeaderFile
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <GCE2d_MakeLine.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
@@ -25,64 +24,67 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 ,
|
||||
const gp_Dir2d& V ,
|
||||
const gp_Pnt2d& P2 )
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1, const gp_Dir2d& V, const gp_Pnt2d& P2)
|
||||
{
|
||||
gp_Lin2d Line(P1,V);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line,P2);
|
||||
if (Ulast != 0.0) {
|
||||
gp_Lin2d Line(P1, V);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line, P2);
|
||||
if (Ulast != 0.0)
|
||||
{
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,0.0,Ulast,Standard_True);
|
||||
TheError = gce_Done;
|
||||
TheSegment = new Geom2d_TrimmedCurve(L, 0.0, Ulast, Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_ConfusedPoints;
|
||||
}
|
||||
else { TheError = gce_ConfusedPoints; }
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1, const gp_Pnt2d& P2)
|
||||
{
|
||||
Standard_Real dist = P1.Distance(P2);
|
||||
if (dist != 0.0) {
|
||||
Handle(Geom2d_Line) L = GCE2d_MakeLine(P1,P2);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,0.,dist,Standard_True);
|
||||
TheError = gce_Done;
|
||||
if (dist != 0.0)
|
||||
{
|
||||
Handle(Geom2d_Line) L = GCE2d_MakeLine(P1, P2);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L, 0., dist, Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
else
|
||||
{
|
||||
TheError = gce_ConfusedPoints;
|
||||
}
|
||||
else { TheError = gce_ConfusedPoints; }
|
||||
}
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const gp_Pnt2d& Point ,
|
||||
const Standard_Real U )
|
||||
{
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line,Point);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment=new Geom2d_TrimmedCurve(L,Ufirst,U,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line,
|
||||
const gp_Pnt2d& Point,
|
||||
const Standard_Real U)
|
||||
{
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line,P1);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line,P2);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,Ufirst,Ulast,Standard_True);
|
||||
TheError = gce_Done;
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line, Point);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L, Ufirst, U, Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const Standard_Real U1 ,
|
||||
const Standard_Real U2 )
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line, const gp_Pnt2d& P1, const gp_Pnt2d& P2)
|
||||
{
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line, P1);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line, P2);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L, Ufirst, Ulast, Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2)
|
||||
{
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,U1,U2,Standard_True);
|
||||
TheError = gce_Done;
|
||||
TheSegment = new Geom2d_TrimmedCurve(L, U1, U2, Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeSegment::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if (TheError != gce_Done,
|
||||
"GCE2d_MakeSegment::Value() - no result");
|
||||
{
|
||||
StdFail_NotDone_Raise_if(TheError != gce_Done, "GCE2d_MakeSegment::Value() - no result");
|
||||
return TheSegment;
|
||||
}
|
||||
|
@@ -28,7 +28,6 @@ class gp_Pnt2d;
|
||||
class gp_Dir2d;
|
||||
class gp_Lin2d;
|
||||
|
||||
|
||||
//! Implements construction algorithms for a line
|
||||
//! segment in the plane. The result is a
|
||||
//! Geom2d_TrimmedCurve curve.
|
||||
@@ -37,33 +36,35 @@ class gp_Lin2d;
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the results. In particular, the Value
|
||||
//! function returns the constructed line segment.
|
||||
class GCE2d_MakeSegment : public GCE2d_Root
|
||||
class GCE2d_MakeSegment : public GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Make a segment of Line from the 2 points <P1> and <P2>.
|
||||
//! Status is "ConfusedPoints" if <P1> and <P2> are confused.
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
|
||||
//! Make a segment of Line from the point <P1> with
|
||||
//! the direction <P> and ended by the projection of
|
||||
//! <P2> on the line <P1,V>.
|
||||
//! Status is "ConfusedPoints" if <P1> and <P2> are confused.
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Pnt2d& P1, const gp_Dir2d& V, const gp_Pnt2d& P2);
|
||||
|
||||
|
||||
//! Make a segment of Line from the line <Line>
|
||||
//! between the two parameters U1 and U2.
|
||||
//! Status is "SameParameters" if <U1> is equal <U2>.
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Lin2d& Line, const Standard_Real U1, const Standard_Real U2);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Lin2d& Line,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2);
|
||||
|
||||
//! Make a segment of Line from the line <Line>
|
||||
//! between the point <Point> and the parameter Ulast.
|
||||
//! It returns NullObject if <U1> is equal <U2>.
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Lin2d& Line, const gp_Pnt2d& Point, const Standard_Real Ulast);
|
||||
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Lin2d& Line,
|
||||
const gp_Pnt2d& Point,
|
||||
const Standard_Real Ulast);
|
||||
|
||||
//! Make a segment of Line from the line <Line>
|
||||
//! between the two points <P1> and <P2>.
|
||||
//! It returns NullObject if <P1> and <P2> are confused.
|
||||
@@ -75,12 +76,12 @@ public:
|
||||
//! returns gce_ConfusedPoints. This warning only
|
||||
//! concerns the first two constructors.
|
||||
Standard_EXPORT GCE2d_MakeSegment(const gp_Lin2d& Line, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
|
||||
//! Returns the constructed line segment.
|
||||
//! Exceptions StdFail_NotDone if no line segment is constructed.
|
||||
Standard_EXPORT const Handle(Geom2d_TrimmedCurve)& Value() const;
|
||||
|
||||
operator const Handle(Geom2d_TrimmedCurve)& () const { return Value(); }
|
||||
operator const Handle(Geom2d_TrimmedCurve) & () const { return Value(); }
|
||||
|
||||
private:
|
||||
Handle(Geom2d_TrimmedCurve) TheSegment;
|
||||
|
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <GCE2d_MakeTranslation.hxx>
|
||||
#include <Geom2d_Transformation.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
@@ -23,7 +22,8 @@
|
||||
//=========================================================================
|
||||
// Creation d une translation 3d de Geom2d de vecteur de translation Vec
|
||||
//=========================================================================
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) {
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec)
|
||||
{
|
||||
TheTranslation = new Geom2d_Transformation();
|
||||
TheTranslation->SetTranslation(Vec);
|
||||
}
|
||||
@@ -33,10 +33,10 @@ GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) {
|
||||
// vecteur reliant Point1 a Point2. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Pnt2d& Point1 ,
|
||||
const gp_Pnt2d& Point2 ) {
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2)
|
||||
{
|
||||
TheTranslation = new Geom2d_Transformation();
|
||||
TheTranslation->SetTranslation(Point1,Point2);
|
||||
TheTranslation->SetTranslation(Point1, Point2);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeTranslation::Value() const
|
||||
|
@@ -25,7 +25,6 @@ class Geom2d_Transformation;
|
||||
class gp_Vec2d;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! This class implements elementary construction algorithms for a
|
||||
//! translation in 2D space. The result is a
|
||||
//! Geom2d_Transformation transformation.
|
||||
@@ -33,46 +32,26 @@ class gp_Pnt2d;
|
||||
//! - defining the construction of the transformation,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class GCE2d_MakeTranslation
|
||||
class GCE2d_MakeTranslation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs a translation along the vector Vect.
|
||||
Standard_EXPORT GCE2d_MakeTranslation(const gp_Vec2d& Vect);
|
||||
|
||||
|
||||
//! Constructs a translation along the vector
|
||||
//! (Point1,Point2) defined from the point Point1 to the point Point2.
|
||||
Standard_EXPORT GCE2d_MakeTranslation(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2);
|
||||
|
||||
|
||||
//! Returns the constructed transformation.
|
||||
Standard_EXPORT const Handle(Geom2d_Transformation)& Value() const;
|
||||
operator const Handle(Geom2d_Transformation)& () const { return Value(); }
|
||||
|
||||
|
||||
|
||||
operator const Handle(Geom2d_Transformation) & () const { return Value(); }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom2d_Transformation) TheTranslation;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GCE2d_MakeTranslation_HeaderFile
|
||||
|
@@ -29,45 +29,26 @@
|
||||
|
||||
//! This class implements the common services for
|
||||
//! all classes of gce which report error.
|
||||
class GCE2d_Root
|
||||
class GCE2d_Root
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns true if the construction is successful.
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns the status of the construction
|
||||
//! - gce_Done, if the construction is successful, or
|
||||
//! - another value of the gce_ErrorType enumeration
|
||||
//! indicating why the construction failed.
|
||||
gce_ErrorType Status() const;
|
||||
|
||||
|
||||
|
||||
gce_ErrorType Status() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
gce_ErrorType TheError;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <GCE2d_Root.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GCE2d_Root_HeaderFile
|
||||
|
@@ -14,24 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Boolean GCE2d_Root::IsDone () const
|
||||
inline Standard_Boolean GCE2d_Root::IsDone() const
|
||||
{
|
||||
return TheError == gce_Done;
|
||||
}
|
||||
|
||||
inline gce_ErrorType GCE2d_Root::Status() const
|
||||
{
|
||||
{
|
||||
return TheError;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user