-// File: BRep_Tool.cxx
-// Created: Wed Jul 7 15:35:57 1993
-// Author: Remi LEQUETTE
-// <rle@phylox>
+// File: BRep_Tool.cxx
+// Created: Wed Jul 7 15:35:57 1993
+// Author: Remi LEQUETTE
+// <rle@phylox>
#include <BRep_Tool.ixx>
//=======================================================================
const Handle(Geom_Surface)& BRep_Tool::Surface(const TopoDS_Face& F,
- TopLoc_Location& L)
+ TopLoc_Location& L)
{
Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &F.TShape());
L = F.Location() * TF->Location();
const Handle(Poly_Triangulation)&
BRep_Tool::Triangulation(const TopoDS_Face& F,
- TopLoc_Location& L)
+ TopLoc_Location& L)
{
L = F.Location();
return (*((Handle(BRep_TFace)*)&F.TShape()))->Triangulation();
static Handle(Poly_Polygon3D) nullPolygon3D;
const Handle(Geom_Curve)& BRep_Tool::Curve(const TopoDS_Edge& E,
- TopLoc_Location& L,
- Standard_Real& First,
- Standard_Real& Last)
+ TopLoc_Location& L,
+ Standard_Real& First,
+ Standard_Real& Last)
{
// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
//=======================================================================
Handle(Geom_Curve) BRep_Tool::Curve(const TopoDS_Edge& E,
- Standard_Real& First,
- Standard_Real& Last)
+ Standard_Real& First,
+ Standard_Real& Last)
{
TopLoc_Location L;
Handle(Geom_Curve) C = Curve(E,L,First,Last);
//=======================================================================
const Handle(Poly_Polygon3D)& BRep_Tool::Polygon3D(const TopoDS_Edge& E,
- TopLoc_Location& L)
+ TopLoc_Location& L)
{
// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
//=======================================================================
Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
- const TopoDS_Face& F,
- Standard_Real& First,
- Standard_Real& Last)
+ const TopoDS_Face& F,
+ Standard_Real& First,
+ Standard_Real& Last)
{
TopLoc_Location l;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,l);
static Handle(Geom2d_Curve) nullPCurve;
Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L,
- Standard_Real& First,
- Standard_Real& Last)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L,
+ Standard_Real& First,
+ Standard_Real& Last)
{
TopLoc_Location loc = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
GC->Range(First,Last);
if (GC->IsCurveOnClosedSurface() && Eisreversed)
- return GC->PCurve2();
+ return GC->PCurve2();
else
- return GC->PCurve();
+ return GC->PCurve();
}
itcr.Next();
}
if (!GP.IsNull()) {
- static Handle(GeomAdaptor_HCurve) HC;
- static Handle(GeomAdaptor_HSurface) HS;
- if (HC.IsNull()) {
- HC = new GeomAdaptor_HCurve();
- HS = new GeomAdaptor_HSurface();
- }
+ Handle(GeomAdaptor_HCurve) HC;
+ Handle(GeomAdaptor_HSurface) HS;
+
+ HC = new GeomAdaptor_HCurve();
+ HS = new GeomAdaptor_HSurface();
TopLoc_Location LC;
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l),
- Plane,
- Plane->Position().Direction(),
- Standard_True);
+ Plane,
+ Plane->Position().Direction(),
+ Standard_True);
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
GAC.Load(ProjOnPlane);
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Handle(Geom2d_TrimmedCurve) TC =
- (*((Handle(Geom2d_TrimmedCurve)*)&pc));
+ (*((Handle(Geom2d_TrimmedCurve)*)&pc));
pc = TC->BasisCurve();
}
First = f; Last = l;
//=======================================================================
void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
- Handle(Geom2d_Curve)& C,
- Handle(Geom_Surface)& S,
- TopLoc_Location& L,
- Standard_Real& First,
- Standard_Real& Last)
+ Handle(Geom2d_Curve)& C,
+ Handle(Geom_Surface)& S,
+ TopLoc_Location& L,
+ Standard_Real& First,
+ Standard_Real& Last)
{
// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
//=======================================================================
void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
- Handle(Geom2d_Curve)& C,
- Handle(Geom_Surface)& S,
- TopLoc_Location& L,
- Standard_Real& First,
- Standard_Real& Last,
- const Standard_Integer Index)
+ Handle(Geom2d_Curve)& C,
+ Handle(Geom_Surface)& S,
+ TopLoc_Location& L,
+ Standard_Real& First,
+ Standard_Real& Last,
+ const Standard_Integer Index)
{
Standard_Integer i = 0;
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
i++;
if (i > Index) break;
if (i == Index) {
- // JMB le 21 Mai 1999
- // on fait comme dans les autres methodes CurveOnSurface. c.a.d on tient
- // compte de l'orientation dans le cas des aretes de coutures (renvoi de PCurve2)
- // sinon on risque de louper des curves ou de ne pas obtenir la bonne.
- if (GC->IsCurveOnClosedSurface() && Eisreversed)
- C = GC->PCurve2();
- else
- C = GC->PCurve();
- S = GC->Surface();
- L = E.Location() * GC->Location();
- GC->Range(First,Last);
- return;
+ // JMB le 21 Mai 1999
+ // on fait comme dans les autres methodes CurveOnSurface. c.a.d on tient
+ // compte de l'orientation dans le cas des aretes de coutures (renvoi de PCurve2)
+ // sinon on risque de louper des curves ou de ne pas obtenir la bonne.
+ if (GC->IsCurveOnClosedSurface() && Eisreversed)
+ C = GC->PCurve2();
+ else
+ C = GC->PCurve();
+ S = GC->Surface();
+ L = E.Location() * GC->Location();
+ GC->Range(First,Last);
+ return;
}
}
itcr.Next();
//=======================================================================
Handle(Poly_Polygon2D) BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
TopLoc_Location l;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,l);
Handle(Poly_Polygon2D)
BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L)
{
TopLoc_Location l = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnSurface(S,l)) {
if (cr->IsPolygonOnClosedSurface() && Eisreversed )
- return cr->Polygon2();
+ return cr->Polygon2();
else
- return cr->Polygon();
+ return cr->Polygon();
}
itcr.Next();
}
//=======================================================================
void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
- Handle(Poly_Polygon2D)& P,
- Handle(Geom_Surface)& S,
- TopLoc_Location& L)
+ Handle(Poly_Polygon2D)& P,
+ Handle(Geom_Surface)& S,
+ TopLoc_Location& L)
{
// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnSurface()) {
const Handle(BRep_PolygonOnSurface)& PS =
- *((Handle(BRep_PolygonOnSurface)*)&cr);
+ *((Handle(BRep_PolygonOnSurface)*)&cr);
P = PS->Polygon();
S = PS->Surface();
L = E.Location() * PS->Location();
//=======================================================================
void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E,
- Handle(Poly_Polygon2D)& P,
- Handle(Geom_Surface)& S,
- TopLoc_Location& L,
- const Standard_Integer Index)
+ Handle(Poly_Polygon2D)& P,
+ Handle(Geom_Surface)& S,
+ TopLoc_Location& L,
+ const Standard_Integer Index)
{
Standard_Integer i = 0;
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnSurface()) {
const Handle(BRep_PolygonOnSurface)& PS =
- *((Handle(BRep_PolygonOnSurface)*)&cr);
+ *((Handle(BRep_PolygonOnSurface)*)&cr);
i++;
if (i > Index) break;
if (i == Index) {
- P = PS->Polygon();
- S = PS->Surface();
- L = E.Location() * PS->Location();
- return;
+ P = PS->Polygon();
+ S = PS->Surface();
+ L = E.Location() * PS->Location();
+ return;
}
}
itcr.Next();
const Handle(Poly_PolygonOnTriangulation)&
BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
- const Handle(Poly_Triangulation)& T,
- const TopLoc_Location& L)
+ const Handle(Poly_Triangulation)& T,
+ const TopLoc_Location& L)
{
TopLoc_Location l = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if ( cr->IsPolygonOnTriangulation(T,l)) {
if ( cr->IsPolygonOnClosedTriangulation() && Eisreversed )
- return cr->PolygonOnTriangulation2();
+ return cr->PolygonOnTriangulation2();
else
- return cr->PolygonOnTriangulation();
+ return cr->PolygonOnTriangulation();
}
itcr.Next();
}
void
BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
- Handle(Poly_PolygonOnTriangulation)& P,
- Handle(Poly_Triangulation)& T,
- TopLoc_Location& L)
+ Handle(Poly_PolygonOnTriangulation)& P,
+ Handle(Poly_Triangulation)& T,
+ TopLoc_Location& L)
{
// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnTriangulation()) {
const Handle(BRep_PolygonOnTriangulation)& PT =
- *((Handle(BRep_PolygonOnTriangulation)*)&cr);
+ *((Handle(BRep_PolygonOnTriangulation)*)&cr);
P = PT->PolygonOnTriangulation();
T = PT->Triangulation();
L = E.Location() * PT->Location();
void
BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E,
- Handle(Poly_PolygonOnTriangulation)& P,
- Handle(Poly_Triangulation)& T,
- TopLoc_Location& L,
- const Standard_Integer Index)
+ Handle(Poly_PolygonOnTriangulation)& P,
+ Handle(Poly_Triangulation)& T,
+ TopLoc_Location& L,
+ const Standard_Integer Index)
{
Standard_Integer i = 0;
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnTriangulation()) {
const Handle(BRep_PolygonOnTriangulation)& PT =
- *((Handle(BRep_PolygonOnTriangulation)*)&cr);
+ *((Handle(BRep_PolygonOnTriangulation)*)&cr);
i++;
if (i > Index) break;
if (i == Index) {
- T = PT->Triangulation();
- P = PT->PolygonOnTriangulation();
- L = E.Location() * PT->Location();
- return;
+ T = PT->Triangulation();
+ P = PT->PolygonOnTriangulation();
+ L = E.Location() * PT->Location();
+ return;
}
}
itcr.Next();
//=======================================================================
Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
TopLoc_Location l;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,l);
//=======================================================================
Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L)
{
//modified by NIZNHY-PKV Fri Oct 17 12:16:58 2008f
if (IsPlane(S)) {
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l) &&
- cr->IsCurveOnClosedSurface())
+ cr->IsCurveOnClosedSurface())
return Standard_True;
itcr.Next();
}
//=======================================================================
Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E,
- const Handle(Poly_Triangulation)& T)
+ const Handle(Poly_Triangulation)& T)
{
TopLoc_Location l = E.Location();
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsPolygonOnTriangulation(T,l) &&
- cr->IsPolygonOnClosedTriangulation())
+ cr->IsPolygonOnClosedTriangulation())
return Standard_True;
itcr.Next();
}
//=======================================================================
void BRep_Tool::Range(const TopoDS_Edge& E,
- Standard_Real& First,
- Standard_Real& Last)
+ Standard_Real& First,
+ Standard_Real& Last)
{
// set the range to all the representations
BRep_ListIteratorOfListOfCurveRepresentation itcr
if (cr->IsCurve3D()) {
const Handle(BRep_Curve3D)& CR = *((Handle(BRep_Curve3D)*)&cr);
if (!CR->Curve3D().IsNull()) {
- First = CR->First();
- Last = CR->Last();
- break;
+ First = CR->First();
+ Last = CR->Last();
+ break;
}
}
else if (cr->IsCurveOnSurface()) {
//=======================================================================
void BRep_Tool::Range(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L,
- Standard_Real& First,
- Standard_Real& Last)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L,
+ Standard_Real& First,
+ Standard_Real& Last)
{
TopLoc_Location l = L.Predivided(E.Location());
//=======================================================================
void BRep_Tool::Range(const TopoDS_Edge& E,
- const TopoDS_Face& F,
- Standard_Real& First,
- Standard_Real& Last)
+ const TopoDS_Face& F,
+ Standard_Real& First,
+ Standard_Real& Last)
{
TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L);
//=======================================================================
void BRep_Tool::UVPoints(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L,
- gp_Pnt2d& PFirst,
- gp_Pnt2d& PLast)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L,
+ gp_Pnt2d& PFirst,
+ gp_Pnt2d& PLast)
{
TopLoc_Location l = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed)
- (*((Handle(BRep_CurveOnClosedSurface)*)&cr))->UVPoints2(PFirst,PLast);
+ (*((Handle(BRep_CurveOnClosedSurface)*)&cr))->UVPoints2(PFirst,PLast);
else
- (*((Handle(BRep_CurveOnSurface)*)&cr))->UVPoints(PFirst,PLast);
+ (*((Handle(BRep_CurveOnSurface)*)&cr))->UVPoints(PFirst,PLast);
return;
}
itcr.Next();
//=======================================================================
void BRep_Tool::UVPoints(const TopoDS_Edge& E,
- const TopoDS_Face& F,
- gp_Pnt2d& PFirst,
- gp_Pnt2d& PLast)
+ const TopoDS_Face& F,
+ gp_Pnt2d& PFirst,
+ gp_Pnt2d& PLast)
{
TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L);
//=======================================================================
void BRep_Tool::SetUVPoints(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L,
- const gp_Pnt2d& PFirst,
- const gp_Pnt2d& PLast)
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L,
+ const gp_Pnt2d& PFirst,
+ const gp_Pnt2d& PLast)
{
TopLoc_Location l = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed)
- (*((Handle(BRep_CurveOnClosedSurface)*) &cr))->
- SetUVPoints2(PFirst,PLast);
+ (*((Handle(BRep_CurveOnClosedSurface)*) &cr))->
+ SetUVPoints2(PFirst,PLast);
else
- (*((Handle(BRep_CurveOnSurface)*) &cr))->
- SetUVPoints(PFirst,PLast);
+ (*((Handle(BRep_CurveOnSurface)*) &cr))->
+ SetUVPoints(PFirst,PLast);
}
itcr.Next();
}
//=======================================================================
void BRep_Tool::SetUVPoints(const TopoDS_Edge& E,
- const TopoDS_Face& F,
- const gp_Pnt2d& PFirst,
- const gp_Pnt2d& PLast)
+ const TopoDS_Face& F,
+ const gp_Pnt2d& PFirst,
+ const gp_Pnt2d& PLast)
{
TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L);
//=======================================================================
Standard_Boolean BRep_Tool::HasContinuity(const TopoDS_Edge& E,
- const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+ const TopoDS_Face& F1,
+ const TopoDS_Face& F2)
{
TopLoc_Location l1,l2;
const Handle(Geom_Surface)& S1 = BRep_Tool::Surface(F1,l1);
//=======================================================================
GeomAbs_Shape BRep_Tool::Continuity(const TopoDS_Edge& E,
- const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+ const TopoDS_Face& F1,
+ const TopoDS_Face& F2)
{
TopLoc_Location l1,l2;
const Handle(Geom_Surface)& S1 = BRep_Tool::Surface(F1,l1);
//=======================================================================
Standard_Boolean BRep_Tool::HasContinuity(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S1,
- const Handle(Geom_Surface)& S2,
- const TopLoc_Location& L1,
- const TopLoc_Location& L2)
+ const Handle(Geom_Surface)& S1,
+ const Handle(Geom_Surface)& S2,
+ const TopLoc_Location& L1,
+ const TopLoc_Location& L2)
{
const TopLoc_Location& Eloc = E.Location();
TopLoc_Location l1 = L1.Predivided(Eloc);
//=======================================================================
GeomAbs_Shape BRep_Tool::Continuity(const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S1,
- const Handle(Geom_Surface)& S2,
- const TopLoc_Location& L1,
- const TopLoc_Location& L2)
+ const Handle(Geom_Surface)& S1,
+ const Handle(Geom_Surface)& S2,
+ const TopLoc_Location& L1,
+ const TopLoc_Location& L2)
{
TopLoc_Location l1 = L1.Predivided(E.Location());
TopLoc_Location l2 = L2.Predivided(E.Location());
//=======================================================================
Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V,
- const TopoDS_Edge& E)
+ const TopoDS_Edge& E)
{
// Search the vertex in the edge
const TopoDS_Shape& Vcur = itv.Value();
if (V.IsSame(Vcur)) {
if (VF.IsNull()) {
- VF = Vcur;
+ VF = Vcur;
}
else {
- rev = E.Orientation() == TopAbs_REVERSED;
- if (Vcur.Orientation() == V.Orientation()) {
- VF = Vcur;
- }
+ rev = E.Orientation() == TopAbs_REVERSED;
+ if (Vcur.Orientation() == V.Orientation()) {
+ VF = Vcur;
+ }
}
}
itv.Next();
L = L.Predivided(V.Location());
if (!C.IsNull() || Degenerated(E)) {
BRep_ListIteratorOfListOfPointRepresentation itpr
- ((*((Handle(BRep_TVertex)*) &V.TShape()))->Points());
+ ((*((Handle(BRep_TVertex)*) &V.TShape()))->Points());
while (itpr.More()) {
- const Handle(BRep_PointRepresentation)& pr = itpr.Value();
- if (pr->IsPointOnCurve(C,L)) {
- Standard_Real p = pr->Parameter();
- Standard_Real res = p;// SVV 4 nov 99 - to avoid warnings on Linux
- if (!C.IsNull()) {
- // Closed curves RLE 16 june 94
- if (Precision::IsNegativeInfinite(f)) return pr->Parameter();//p;
- if (Precision::IsPositiveInfinite(l)) return pr->Parameter();//p;
- gp_Pnt Pf = C->Value(f).Transformed(L.Transformation());
- gp_Pnt Pl = C->Value(l).Transformed(L.Transformation());
- Standard_Real tol = BRep_Tool::Tolerance(V);
- if (Pf.Distance(Pl) < tol) {
- if (Pf.Distance(BRep_Tool::Pnt(V)) < tol) {
- if (V.Orientation() == TopAbs_FORWARD) res = f;//p = f;
- else res = l;//p = l;
- }
- }
- }
- return res;//p;
- }
- itpr.Next();
+ const Handle(BRep_PointRepresentation)& pr = itpr.Value();
+ if (pr->IsPointOnCurve(C,L)) {
+ Standard_Real p = pr->Parameter();
+ Standard_Real res = p;// SVV 4 nov 99 - to avoid warnings on Linux
+ if (!C.IsNull()) {
+ // Closed curves RLE 16 june 94
+ if (Precision::IsNegativeInfinite(f)) return pr->Parameter();//p;
+ if (Precision::IsPositiveInfinite(l)) return pr->Parameter();//p;
+ gp_Pnt Pf = C->Value(f).Transformed(L.Transformation());
+ gp_Pnt Pl = C->Value(l).Transformed(L.Transformation());
+ Standard_Real tol = BRep_Tool::Tolerance(V);
+ if (Pf.Distance(Pl) < tol) {
+ if (Pf.Distance(BRep_Tool::Pnt(V)) < tol) {
+ if (V.Orientation() == TopAbs_FORWARD) res = f;//p = f;
+ else res = l;//p = l;
+ }
+ }
+ }
+ return res;//p;
+ }
+ itpr.Next();
}
}
else {
BRep_Tool::CurveOnSurface(E,PC,S,L,f,l);
L = L.Predivided(V.Location());
BRep_ListIteratorOfListOfPointRepresentation itpr
- ((*((Handle(BRep_TVertex)*) &V.TShape()))->Points());
+ ((*((Handle(BRep_TVertex)*) &V.TShape()))->Points());
while (itpr.More()) {
- const Handle(BRep_PointRepresentation)& pr = itpr.Value();
- if (pr->IsPointOnCurveOnSurface(PC,S,L)) {
- Standard_Real p = pr->Parameter();
- // Closed curves RLE 16 june 94
- if (PC->IsClosed()) {
- if ((p == PC->FirstParameter()) ||
- (p == PC->LastParameter())) {
- if (V.Orientation() == TopAbs_FORWARD) p = PC->FirstParameter();
- else p = PC->LastParameter();
- }
- }
- return p;
- }
- itpr.Next();
+ const Handle(BRep_PointRepresentation)& pr = itpr.Value();
+ if (pr->IsPointOnCurveOnSurface(PC,S,L)) {
+ Standard_Real p = pr->Parameter();
+ // Closed curves RLE 16 june 94
+ if (PC->IsClosed()) {
+ if ((p == PC->FirstParameter()) ||
+ (p == PC->LastParameter())) {
+ if (V.Orientation() == TopAbs_FORWARD) p = PC->FirstParameter();
+ else p = PC->LastParameter();
+ }
+ }
+ return p;
+ }
+ itpr.Next();
}
}
}
//=======================================================================
Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V,
- const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Edge& E,
+ const TopoDS_Face& F)
{
TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L);
//=======================================================================
Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V,
- const TopoDS_Edge& E,
- const Handle(Geom_Surface)& S,
- const TopLoc_Location& L)
+ const TopoDS_Edge& E,
+ const Handle(Geom_Surface)& S,
+ const TopLoc_Location& L)
{
// Search the vertex in the edge
if (V.IsSame(itv.Value())) {
if (VF.IsNull()) VF = itv.Value();
else {
- rev = E.Orientation() == TopAbs_REVERSED;
- if (itv.Value().Orientation() == V.Orientation())
- VF = itv.Value();
+ rev = E.Orientation() == TopAbs_REVERSED;
+ if (itv.Value().Orientation() == V.Orientation())
+ VF = itv.Value();
}
}
itv.Next();
while (itpr.More()) {
const Handle(BRep_PointRepresentation)& pr = itpr.Value();
if (pr->IsPointOnCurve(C,L1)) {
- Standard_Real p = pr->Parameter();
- Standard_Real res = p;
- if (!C.IsNull()) {
- // Closed curves RLE 16 june 94
- if (Precision::IsNegativeInfinite(f)) return res;
- if (Precision::IsPositiveInfinite(l)) return res;
- gp_Pnt Pf = C->Value(f).Transformed(L1.Transformation());
- gp_Pnt Pl = C->Value(l).Transformed(L1.Transformation());
- Standard_Real tol = BRep_Tool::Tolerance(V);
- if (Pf.Distance(Pl) < tol) {
- if (Pf.Distance(BRep_Tool::Pnt(V)) < tol) {
- if (V.Orientation() == TopAbs_FORWARD) res = f;
- else res = l;
- }
- }
- }
- return res;
+ Standard_Real p = pr->Parameter();
+ Standard_Real res = p;
+ if (!C.IsNull()) {
+ // Closed curves RLE 16 june 94
+ if (Precision::IsNegativeInfinite(f)) return res;
+ if (Precision::IsPositiveInfinite(l)) return res;
+ gp_Pnt Pf = C->Value(f).Transformed(L1.Transformation());
+ gp_Pnt Pl = C->Value(l).Transformed(L1.Transformation());
+ Standard_Real tol = BRep_Tool::Tolerance(V);
+ if (Pf.Distance(Pl) < tol) {
+ if (Pf.Distance(BRep_Tool::Pnt(V)) < tol) {
+ if (V.Orientation() == TopAbs_FORWARD) res = f;
+ else res = l;
+ }
+ }
+ }
+ return res;
}
itpr.Next();
}
//=======================================================================
gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L);
while (itpr.More()) {
if (itpr.Value()->IsPointOnSurface(S,L)) {
return gp_Pnt2d(itpr.Value()->Parameter(),
- itpr.Value()->Parameter2());
+ itpr.Value()->Parameter2());
}
itpr.Next();
}