1
0
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:
dpasukhi
2025-01-25 20:15:22 +00:00
parent dbba6f1289
commit a5a7b3185b
14005 changed files with 1273539 additions and 1195567 deletions

View File

@@ -32,166 +32,176 @@
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
//=======================================================================
//function : MakeEdge
//purpose :
//=======================================================================
TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec,
const Standard_Real U1,
const Standard_Real U2)
//=================================================================================================
TopoDS_Edge HLRBRep::MakeEdge(const HLRBRep_Curve& ec,
const Standard_Real U1,
const Standard_Real U2)
{
TopoDS_Edge Edg;
TopoDS_Edge Edg;
const Standard_Real sta = ec.Parameter2d(U1);
const Standard_Real end = ec.Parameter2d(U2);
switch (ec.GetType())
{
case GeomAbs_Line:
Edg = BRepLib_MakeEdge2d(ec.Line(),sta,end);
break;
case GeomAbs_Circle:
Edg = BRepLib_MakeEdge2d(ec.Circle(),sta,end);
break;
case GeomAbs_Ellipse:
Edg = BRepLib_MakeEdge2d(ec.Ellipse(),sta,end);
break;
case GeomAbs_Hyperbola:
Edg = BRepLib_MakeEdge2d(ec.Hyperbola(),sta,end);
break;
case GeomAbs_Parabola:
Edg = BRepLib_MakeEdge2d(ec.Parabola(),sta,end);
break;
case GeomAbs_BezierCurve: {
TColgp_Array1OfPnt2d Poles(1,ec.NbPoles());
Handle(Geom2d_BezierCurve) ec2d;
if (ec.IsRational()) {
TColStd_Array1OfReal Weights(1,ec.NbPoles());
ec.PolesAndWeights(Poles,Weights);
ec2d = new Geom2d_BezierCurve(Poles,Weights);
}
else {
ec.Poles(Poles);
ec2d = new Geom2d_BezierCurve(Poles);
}
BRepLib_MakeEdge2d mke2d(ec2d,sta,end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
break;
}
case GeomAbs_BSplineCurve: {
Handle(Geom2d_BSplineCurve) ec2d;
GeomAdaptor_Curve GAcurve = ec.GetCurve().Curve();
TopoDS_Edge anEdge = ec.GetCurve().Edge();
Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
Handle(Geom_BSplineCurve) BSplCurve (Handle(Geom_BSplineCurve)::DownCast(aCurve));
Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy());
if (theCurve->IsPeriodic() && !GAcurve.IsClosed())
{
theCurve->Segment(sta, end);
TColgp_Array1OfPnt2d Poles(1, theCurve->NbPoles());
TColStd_Array1OfReal knots(1, theCurve->NbKnots());
TColStd_Array1OfInteger mults(1, theCurve->NbKnots());
//-- ec.KnotsAndMultiplicities(knots,mults);
theCurve->Knots(knots);
theCurve->Multiplicities(mults);
if (theCurve->IsRational()) {
TColStd_Array1OfReal Weights(1, theCurve->NbPoles());
ec.PolesAndWeights(theCurve, Poles, Weights);
ec2d = new Geom2d_BSplineCurve(Poles, Weights, knots, mults,
theCurve->Degree(), theCurve->IsPeriodic());
case GeomAbs_Line:
Edg = BRepLib_MakeEdge2d(ec.Line(), sta, end);
break;
case GeomAbs_Circle:
Edg = BRepLib_MakeEdge2d(ec.Circle(), sta, end);
break;
case GeomAbs_Ellipse:
Edg = BRepLib_MakeEdge2d(ec.Ellipse(), sta, end);
break;
case GeomAbs_Hyperbola:
Edg = BRepLib_MakeEdge2d(ec.Hyperbola(), sta, end);
break;
case GeomAbs_Parabola:
Edg = BRepLib_MakeEdge2d(ec.Parabola(), sta, end);
break;
case GeomAbs_BezierCurve: {
TColgp_Array1OfPnt2d Poles(1, ec.NbPoles());
Handle(Geom2d_BezierCurve) ec2d;
if (ec.IsRational())
{
TColStd_Array1OfReal Weights(1, ec.NbPoles());
ec.PolesAndWeights(Poles, Weights);
ec2d = new Geom2d_BezierCurve(Poles, Weights);
}
else {
ec.Poles(theCurve, Poles);
ec2d = new Geom2d_BSplineCurve(Poles, knots, mults,
theCurve->Degree(), theCurve->IsPeriodic());
}
}
else
{
TColgp_Array1OfPnt2d Poles(1,ec.NbPoles());
TColStd_Array1OfReal knots(1,ec.NbKnots());
TColStd_Array1OfInteger mults(1,ec.NbKnots());
//-- ec.KnotsAndMultiplicities(knots,mults);
ec.Knots(knots);
ec.Multiplicities(mults);
if (ec.IsRational()) {
TColStd_Array1OfReal Weights(1,ec.NbPoles());
ec.PolesAndWeights(Poles,Weights);
ec2d = new Geom2d_BSplineCurve(Poles,Weights,knots,mults,ec.Degree(),ec.IsPeriodic());
}
else {
else
{
ec.Poles(Poles);
ec2d = new Geom2d_BSplineCurve(Poles,knots,mults,ec.Degree(),ec.IsPeriodic());
ec2d = new Geom2d_BezierCurve(Poles);
}
BRepLib_MakeEdge2d mke2d(ec2d, sta, end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
break;
}
BRepLib_MakeEdge2d mke2d(ec2d, sta, end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
break;
}
default: {
const Standard_Integer nbPnt = 15;
TColgp_Array1OfPnt2d Poles(1,nbPnt);
TColStd_Array1OfReal knots(1,nbPnt);
TColStd_Array1OfInteger mults(1,nbPnt);
mults.Init(1);
mults(1 ) = 2;
mults(nbPnt) = 2;
const Standard_Real step = (U2-U1)/(nbPnt-1);
Standard_Real par3d = U1;
for (Standard_Integer i = 1; i < nbPnt; i++) {
Poles(i) = ec.Value(par3d);
knots(i) = par3d;
par3d += step;
case GeomAbs_BSplineCurve: {
Handle(Geom2d_BSplineCurve) ec2d;
GeomAdaptor_Curve GAcurve = ec.GetCurve().Curve();
TopoDS_Edge anEdge = ec.GetCurve().Edge();
Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
Handle(Geom_BSplineCurve) BSplCurve(Handle(Geom_BSplineCurve)::DownCast(aCurve));
Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy());
if (theCurve->IsPeriodic() && !GAcurve.IsClosed())
{
theCurve->Segment(sta, end);
TColgp_Array1OfPnt2d Poles(1, theCurve->NbPoles());
TColStd_Array1OfReal knots(1, theCurve->NbKnots());
TColStd_Array1OfInteger mults(1, theCurve->NbKnots());
//-- ec.KnotsAndMultiplicities(knots,mults);
theCurve->Knots(knots);
theCurve->Multiplicities(mults);
if (theCurve->IsRational())
{
TColStd_Array1OfReal Weights(1, theCurve->NbPoles());
ec.PolesAndWeights(theCurve, Poles, Weights);
ec2d = new Geom2d_BSplineCurve(Poles,
Weights,
knots,
mults,
theCurve->Degree(),
theCurve->IsPeriodic());
}
else
{
ec.Poles(theCurve, Poles);
ec2d = new Geom2d_BSplineCurve(Poles,
knots,
mults,
theCurve->Degree(),
theCurve->IsPeriodic());
}
}
else
{
TColgp_Array1OfPnt2d Poles(1, ec.NbPoles());
TColStd_Array1OfReal knots(1, ec.NbKnots());
TColStd_Array1OfInteger mults(1, ec.NbKnots());
//-- ec.KnotsAndMultiplicities(knots,mults);
ec.Knots(knots);
ec.Multiplicities(mults);
if (ec.IsRational())
{
TColStd_Array1OfReal Weights(1, ec.NbPoles());
ec.PolesAndWeights(Poles, Weights);
ec2d =
new Geom2d_BSplineCurve(Poles, Weights, knots, mults, ec.Degree(), ec.IsPeriodic());
}
else
{
ec.Poles(Poles);
ec2d = new Geom2d_BSplineCurve(Poles, knots, mults, ec.Degree(), ec.IsPeriodic());
}
}
BRepLib_MakeEdge2d mke2d(ec2d, sta, end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
break;
}
default: {
const Standard_Integer nbPnt = 15;
TColgp_Array1OfPnt2d Poles(1, nbPnt);
TColStd_Array1OfReal knots(1, nbPnt);
TColStd_Array1OfInteger mults(1, nbPnt);
mults.Init(1);
mults(1) = 2;
mults(nbPnt) = 2;
const Standard_Real step = (U2 - U1) / (nbPnt - 1);
Standard_Real par3d = U1;
for (Standard_Integer i = 1; i < nbPnt; i++)
{
Poles(i) = ec.Value(par3d);
knots(i) = par3d;
par3d += step;
}
Poles(nbPnt) = ec.Value(U2);
knots(nbPnt) = U2;
Handle(Geom2d_BSplineCurve) ec2d = new Geom2d_BSplineCurve(Poles, knots, mults, 1);
BRepLib_MakeEdge2d mke2d(ec2d, sta, end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
}
Poles(nbPnt) = ec.Value(U2);
knots(nbPnt) = U2;
Handle(Geom2d_BSplineCurve) ec2d = new Geom2d_BSplineCurve(Poles,knots,mults,1);
BRepLib_MakeEdge2d mke2d(ec2d,sta,end);
if (mke2d.IsDone())
Edg = mke2d.Edge();
}
}
return Edg;
}
//=======================================================================
//function : MakeEdge3d
//purpose :
//=======================================================================
//=================================================================================================
TopoDS_Edge HLRBRep::MakeEdge3d(const HLRBRep_Curve& ec,
const Standard_Real U1,
const Standard_Real U2)
const Standard_Real U1,
const Standard_Real U2)
{
TopoDS_Edge Edg;
//const Standard_Real sta = ec.Parameter2d(U1);
//const Standard_Real end = ec.Parameter2d(U2);
// const Standard_Real sta = ec.Parameter2d(U1);
// const Standard_Real end = ec.Parameter2d(U2);
TopoDS_Edge anEdge = ec.GetCurve().Edge();
TopoDS_Edge anEdge = ec.GetCurve().Edge();
Standard_Real fpar, lpar;
//BRep_Tool::Range(anEdge, fpar, lpar);
//Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
// BRep_Tool::Range(anEdge, fpar, lpar);
// Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
BRepAdaptor_Curve BAcurve(anEdge);
fpar = BAcurve.FirstParameter();
lpar = BAcurve.LastParameter();
Edg = TopoDS::Edge(anEdge.EmptyCopied());
Edg.Orientation(TopAbs_FORWARD);
BRep_Builder BB;
BB.Range(Edg, U1, U2);
//Share vertices if possible
// Share vertices if possible
TopoDS_Vertex V1, V2, V1new, V2new;
TopExp::Vertices(anEdge, V1, V2);
@@ -201,14 +211,14 @@ TopoDS_Edge HLRBRep::MakeEdge3d(const HLRBRep_Curve& ec,
else
{
gp_Pnt aPnt = BAcurve.Value(U1);
V1new = BRepLib_MakeVertex(aPnt);
V1new = BRepLib_MakeVertex(aPnt);
}
if (Abs(lpar - U2) <= Tol)
V2new = V2;
else
{
gp_Pnt aPnt = BAcurve.Value(U2);
V2new = BRepLib_MakeVertex(aPnt);
V2new = BRepLib_MakeVertex(aPnt);
}
V1new.Orientation(TopAbs_FORWARD);
@@ -218,24 +228,23 @@ TopoDS_Edge HLRBRep::MakeEdge3d(const HLRBRep_Curve& ec,
return Edg;
}
//=======================================================================
//function : PolyHLRAngleAndDeflection
//purpose :
//=======================================================================
//=================================================================================================
void
HLRBRep::PolyHLRAngleAndDeflection (const Standard_Real InAngl,
Standard_Real& OutAngl,
Standard_Real& OutDefl)
void HLRBRep::PolyHLRAngleAndDeflection(const Standard_Real InAngl,
Standard_Real& OutAngl,
Standard_Real& OutDefl)
{
static Standard_Real HAngMin = 1*M_PI/180;
static Standard_Real HAngLim = 5*M_PI/180;
static Standard_Real HAngMax = 35*M_PI/180;
static Standard_Real HAngMin = 1 * M_PI / 180;
static Standard_Real HAngLim = 5 * M_PI / 180;
static Standard_Real HAngMax = 35 * M_PI / 180;
OutAngl = InAngl;
if (OutAngl < HAngMin) OutAngl = HAngMin;
if (OutAngl > HAngMax) OutAngl = HAngMax;
OutAngl = HAngLim + sqrt((OutAngl - HAngMin) * (HAngMax - HAngLim) *
(HAngMax - HAngLim) / (HAngMax - HAngMin));
if (OutAngl < HAngMin)
OutAngl = HAngMin;
if (OutAngl > HAngMax)
OutAngl = HAngMax;
OutAngl =
HAngLim
+ sqrt((OutAngl - HAngMin) * (HAngMax - HAngLim) * (HAngMax - HAngLim) / (HAngMax - HAngMin));
OutDefl = OutAngl * OutAngl * 0.5;
}

View File

@@ -25,25 +25,27 @@
class TopoDS_Edge;
class HLRBRep_Curve;
//! Hidden Lines Removal
//! algorithms on the BRep DataStructure.
//!
//! The class PolyAlgo is used to remove Hidden lines
//! on Shapes with Triangulations.
class HLRBRep
class HLRBRep
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static TopoDS_Edge MakeEdge (const HLRBRep_Curve& ec, const Standard_Real U1, const Standard_Real U2);
Standard_EXPORT static TopoDS_Edge MakeEdge3d (const HLRBRep_Curve& ec, const Standard_Real U1, const Standard_Real U2);
Standard_EXPORT static void PolyHLRAngleAndDeflection (const Standard_Real InAngl, Standard_Real& OutAngl, Standard_Real& OutDefl);
Standard_EXPORT static TopoDS_Edge MakeEdge(const HLRBRep_Curve& ec,
const Standard_Real U1,
const Standard_Real U2);
Standard_EXPORT static TopoDS_Edge MakeEdge3d(const HLRBRep_Curve& ec,
const Standard_Real U1,
const Standard_Real U2);
Standard_EXPORT static void PolyHLRAngleAndDeflection(const Standard_Real InAngl,
Standard_Real& OutAngl,
Standard_Real& OutDefl);
};
#endif // _HLRBRep_HeaderFile

View File

@@ -16,7 +16,6 @@
#define No_Standard_OutOfRange
#include <HLRBRep_Algo.hxx>
#include <HLRBRep_ShapeBounds.hxx>
#include <HLRTopoBRep_OutLiner.hxx>
@@ -24,74 +23,60 @@
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_Algo,HLRBRep_InternalAlgo)
IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_Algo, HLRBRep_InternalAlgo)
//=======================================================================
//function : HLRBRep_Algo
//purpose :
//=======================================================================
HLRBRep_Algo::HLRBRep_Algo ()
{}
//=================================================================================================
//=======================================================================
//function : HLRBRep_Algo
//purpose :
//=======================================================================
HLRBRep_Algo::HLRBRep_Algo() {}
HLRBRep_Algo::HLRBRep_Algo (const Handle(HLRBRep_Algo)& A) :
HLRBRep_InternalAlgo(A)
{}
//=================================================================================================
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void HLRBRep_Algo::Add (const TopoDS_Shape& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso)
HLRBRep_Algo::HLRBRep_Algo(const Handle(HLRBRep_Algo)& A)
: HLRBRep_InternalAlgo(A)
{
Load(new HLRTopoBRep_OutLiner(S),SData,nbIso);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Algo::Add (const TopoDS_Shape& S,
const Standard_Integer nbIso)
void HLRBRep_Algo::Add(const TopoDS_Shape& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso)
{
Load(new HLRTopoBRep_OutLiner(S),nbIso);
Load(new HLRTopoBRep_OutLiner(S), SData, nbIso);
}
//=======================================================================
//function : Index
//purpose :
//=======================================================================
//=================================================================================================
Standard_Integer HLRBRep_Algo::Index (const TopoDS_Shape& S)
void HLRBRep_Algo::Add(const TopoDS_Shape& S, const Standard_Integer nbIso)
{
Load(new HLRTopoBRep_OutLiner(S), nbIso);
}
//=================================================================================================
Standard_Integer HLRBRep_Algo::Index(const TopoDS_Shape& S)
{
Standard_Integer n = NbShapes();
for (Standard_Integer i = 1; i <= n; i++) {
if (ShapeBounds(i).Shape()->OriginalShape() == S) return i;
if (ShapeBounds(i).Shape()->OutLinedShape() == S) return i;
for (Standard_Integer i = 1; i <= n; i++)
{
if (ShapeBounds(i).Shape()->OriginalShape() == S)
return i;
if (ShapeBounds(i).Shape()->OutLinedShape() == S)
return i;
}
return 0;
}
//=======================================================================
//function : OutLinedShapeNullify
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Algo::OutLinedShapeNullify ()
void HLRBRep_Algo::OutLinedShapeNullify()
{
Standard_Integer n = NbShapes();
for (Standard_Integer i = 1; i <= n; i++) {
for (Standard_Integer i = 1; i <= n; i++)
{
ShapeBounds(i).Shape()->OutLinedShape(TopoDS_Shape());
ShapeBounds(i).Shape()->DataStructure().Clear();
}

View File

@@ -24,7 +24,6 @@
class TopoDS_Shape;
class Standard_Transient;
class HLRBRep_Algo;
DEFINE_STANDARD_HANDLE(HLRBRep_Algo, HLRBRep_InternalAlgo)
@@ -37,8 +36,8 @@ DEFINE_STANDARD_HANDLE(HLRBRep_Algo, HLRBRep_InternalAlgo)
//! the basic entities which will be visualized or hidden), and
//! - faces in these shapes which hide the edges.
//! HLRBRep_Algo is based on the principle of comparing each edge of the shape to be
//! visualized with each of its faces, and calculating the visible and the hidden parts of each edge.
//! For a given projection, HLRBRep_Algo calculates a set of lines characteristic of the
//! visualized with each of its faces, and calculating the visible and the hidden parts of each
//! edge. For a given projection, HLRBRep_Algo calculates a set of lines characteristic of the
//! object being represented. It is also used in conjunction with the
//! HLRBRep_HLRToShape extraction utilities, which reconstruct a new, simplified shape
//! from a selection of calculation results. This new shape is made up of edges, which
@@ -64,8 +63,6 @@ class HLRBRep_Algo : public HLRBRep_InternalAlgo
{
public:
//! Constructs an empty framework for the
//! calculation of visible and hidden lines of a shape in a projection.
//! Use the function:
@@ -74,45 +71,30 @@ public:
//! - Update to compute the outlines of the shape, and
//! - Hide to compute the visible and hidden lines of the shape.
Standard_EXPORT HLRBRep_Algo();
Standard_EXPORT HLRBRep_Algo(const Handle(HLRBRep_Algo)& A);
//! add the Shape <S>.
Standard_EXPORT void Add (const TopoDS_Shape& S, const Handle(Standard_Transient)& SData, const Standard_Integer nbIso = 0);
Standard_EXPORT void Add(const TopoDS_Shape& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso = 0);
//! Adds the shape S to this framework, and
//! specifies the number of isoparameters nbiso desired in visualizing S.
//! You may add as many shapes as you wish. Use the function Add once for each shape.
Standard_EXPORT void Add (const TopoDS_Shape& S, const Standard_Integer nbIso = 0);
Standard_EXPORT void Add(const TopoDS_Shape& S, const Standard_Integer nbIso = 0);
//! return the index of the Shape <S> and
//! return 0 if the Shape <S> is not found.
Standard_EXPORT Standard_Integer Index (const TopoDS_Shape& S);
Standard_EXPORT Standard_Integer Index(const TopoDS_Shape& S);
//! nullify all the results of OutLiner from HLRTopoBRep.
Standard_EXPORT void OutLinedShapeNullify();
DEFINE_STANDARD_RTTIEXT(HLRBRep_Algo,HLRBRep_InternalAlgo)
DEFINE_STANDARD_RTTIEXT(HLRBRep_Algo, HLRBRep_InternalAlgo)
protected:
private:
};
#endif // _HLRBRep_Algo_HeaderFile

View File

@@ -14,189 +14,137 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <HLRAlgo_Intersection.hxx>
#include <HLRBRep_AreaLimit.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_AreaLimit,Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_AreaLimit, Standard_Transient)
//=======================================================================
//function : HLRBRep_AreaLimit
//purpose :
//=======================================================================
HLRBRep_AreaLimit::HLRBRep_AreaLimit(const HLRAlgo_Intersection& V,
const Standard_Boolean Boundary,
const Standard_Boolean Interference,
const TopAbs_State StateBefore,
const TopAbs_State StateAfter,
const TopAbs_State EdgeBefore,
const TopAbs_State EdgeAfter) :
myVertex (V),
myBoundary (Boundary),
myInterference(Interference),
myStateBefore (StateBefore),
myStateAfter (StateAfter),
myEdgeBefore (EdgeBefore),
myEdgeAfter (EdgeAfter)
//=================================================================================================
HLRBRep_AreaLimit::HLRBRep_AreaLimit(const HLRAlgo_Intersection& V,
const Standard_Boolean Boundary,
const Standard_Boolean Interference,
const TopAbs_State StateBefore,
const TopAbs_State StateAfter,
const TopAbs_State EdgeBefore,
const TopAbs_State EdgeAfter)
: myVertex(V),
myBoundary(Boundary),
myInterference(Interference),
myStateBefore(StateBefore),
myStateAfter(StateAfter),
myEdgeBefore(EdgeBefore),
myEdgeAfter(EdgeAfter)
{
}
//=======================================================================
//function : StateBefore
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::StateBefore(const TopAbs_State Stat)
{
myStateBefore = Stat;
}
//=======================================================================
//function : StateAfter
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::StateAfter(const TopAbs_State Stat)
{
myStateAfter = Stat;
}
//=======================================================================
//function : EdgeBefore
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::EdgeBefore(const TopAbs_State Stat)
{
myEdgeBefore = Stat;
}
//=======================================================================
//function : EdgeAfter
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::EdgeAfter(const TopAbs_State Stat)
{
myEdgeAfter = Stat;
}
//=======================================================================
//function : Previous
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::Previous(const Handle(HLRBRep_AreaLimit)& P)
{
myPrevious = P;
}
//=======================================================================
//function : Next
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::Next(const Handle(HLRBRep_AreaLimit)& N)
{
myNext = N;
}
//=======================================================================
//function : Vertex
//purpose :
//=======================================================================
//=================================================================================================
const HLRAlgo_Intersection & HLRBRep_AreaLimit::Vertex() const
const HLRAlgo_Intersection& HLRBRep_AreaLimit::Vertex() const
{
return myVertex;
}
//=================================================================================================
//=======================================================================
//function : IsBoundary
//purpose :
//=======================================================================
Standard_Boolean HLRBRep_AreaLimit::IsBoundary() const
Standard_Boolean HLRBRep_AreaLimit::IsBoundary() const
{
return myBoundary;
}
//=======================================================================
//function : IsInterference
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_AreaLimit::IsInterference() const
Standard_Boolean HLRBRep_AreaLimit::IsInterference() const
{
return myInterference;
}
//=======================================================================
//function : StateBefore
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_AreaLimit::StateBefore() const
TopAbs_State HLRBRep_AreaLimit::StateBefore() const
{
return myStateBefore;
}
//=======================================================================
//function : StateAfter
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_AreaLimit::StateAfter() const
TopAbs_State HLRBRep_AreaLimit::StateAfter() const
{
return myStateAfter;
}
//=======================================================================
//function : EdgeBefore
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_AreaLimit::EdgeBefore() const
TopAbs_State HLRBRep_AreaLimit::EdgeBefore() const
{
return myEdgeBefore;
}
//=======================================================================
//function : EdgeAfter
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_AreaLimit::EdgeAfter() const
TopAbs_State HLRBRep_AreaLimit::EdgeAfter() const
{
return myEdgeAfter;
}
//=======================================================================
//function : Previous
//purpose :
//=======================================================================
//=================================================================================================
Handle(HLRBRep_AreaLimit) HLRBRep_AreaLimit::Previous () const
Handle(HLRBRep_AreaLimit) HLRBRep_AreaLimit::Previous() const
{
return myPrevious;
}
//=======================================================================
//function : Next
//purpose :
//=======================================================================
//=================================================================================================
Handle(HLRBRep_AreaLimit) HLRBRep_AreaLimit::Next () const
Handle(HLRBRep_AreaLimit) HLRBRep_AreaLimit::Next() const
{
return myNext;
}
//=======================================================================
//function : Clear
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_AreaLimit::Clear()
{

View File

@@ -24,7 +24,6 @@
#include <TopAbs_State.hxx>
#include <Standard_Transient.hxx>
class HLRBRep_AreaLimit;
DEFINE_STANDARD_HANDLE(HLRBRep_AreaLimit, Standard_Transient)
@@ -35,73 +34,60 @@ class HLRBRep_AreaLimit : public Standard_Transient
{
public:
//! The previous and next field are set to NULL.
Standard_EXPORT HLRBRep_AreaLimit(const HLRAlgo_Intersection& V, const Standard_Boolean Boundary, const Standard_Boolean Interference, const TopAbs_State StateBefore, const TopAbs_State StateAfter, const TopAbs_State EdgeBefore, const TopAbs_State EdgeAfter);
Standard_EXPORT void StateBefore (const TopAbs_State St);
Standard_EXPORT void StateAfter (const TopAbs_State St);
Standard_EXPORT void EdgeBefore (const TopAbs_State St);
Standard_EXPORT void EdgeAfter (const TopAbs_State St);
Standard_EXPORT void Previous (const Handle(HLRBRep_AreaLimit)& P);
Standard_EXPORT void Next (const Handle(HLRBRep_AreaLimit)& N);
Standard_EXPORT HLRBRep_AreaLimit(const HLRAlgo_Intersection& V,
const Standard_Boolean Boundary,
const Standard_Boolean Interference,
const TopAbs_State StateBefore,
const TopAbs_State StateAfter,
const TopAbs_State EdgeBefore,
const TopAbs_State EdgeAfter);
Standard_EXPORT void StateBefore(const TopAbs_State St);
Standard_EXPORT void StateAfter(const TopAbs_State St);
Standard_EXPORT void EdgeBefore(const TopAbs_State St);
Standard_EXPORT void EdgeAfter(const TopAbs_State St);
Standard_EXPORT void Previous(const Handle(HLRBRep_AreaLimit)& P);
Standard_EXPORT void Next(const Handle(HLRBRep_AreaLimit)& N);
Standard_EXPORT const HLRAlgo_Intersection& Vertex() const;
Standard_EXPORT Standard_Boolean IsBoundary() const;
Standard_EXPORT Standard_Boolean IsInterference() const;
Standard_EXPORT TopAbs_State StateBefore() const;
Standard_EXPORT TopAbs_State StateAfter() const;
Standard_EXPORT TopAbs_State EdgeBefore() const;
Standard_EXPORT TopAbs_State EdgeAfter() const;
Standard_EXPORT Handle(HLRBRep_AreaLimit) Previous() const;
Standard_EXPORT Handle(HLRBRep_AreaLimit) Next() const;
Standard_EXPORT void Clear();
DEFINE_STANDARD_RTTIEXT(HLRBRep_AreaLimit,Standard_Transient)
DEFINE_STANDARD_RTTIEXT(HLRBRep_AreaLimit, Standard_Transient)
protected:
private:
HLRAlgo_Intersection myVertex;
Standard_Boolean myBoundary;
Standard_Boolean myInterference;
TopAbs_State myStateBefore;
TopAbs_State myStateAfter;
TopAbs_State myEdgeBefore;
TopAbs_State myEdgeAfter;
HLRAlgo_Intersection myVertex;
Standard_Boolean myBoundary;
Standard_Boolean myInterference;
TopAbs_State myStateBefore;
TopAbs_State myStateAfter;
TopAbs_State myEdgeBefore;
TopAbs_State myEdgeAfter;
Handle(HLRBRep_AreaLimit) myPrevious;
Handle(HLRBRep_AreaLimit) myNext;
};
#endif // _HLRBRep_AreaLimit_HeaderFile

View File

@@ -22,5 +22,4 @@
typedef NCollection_Array1<HLRBRep_EdgeData> HLRBRep_Array1OfEData;
#endif

View File

@@ -22,5 +22,4 @@
typedef NCollection_Array1<HLRBRep_FaceData> HLRBRep_Array1OfFData;
#endif

View File

@@ -14,91 +14,80 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <HLRBRep_BCurveTool.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
//=======================================================================
//function : NbSamples
//purpose :
//=======================================================================
Standard_Integer
HLRBRep_BCurveTool::NbSamples (const BRepAdaptor_Curve& C,
const Standard_Real U0,
const Standard_Real U1)
//=================================================================================================
Standard_Integer HLRBRep_BCurveTool::NbSamples(const BRepAdaptor_Curve& C,
const Standard_Real U0,
const Standard_Real U1)
{
GeomAbs_CurveType typC = C.GetType();
GeomAbs_CurveType typC = C.GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
Standard_Real nbs = nbsOther;
if (typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
else if (typC == GeomAbs_BezierCurve)
nbs = 3 + C.NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
else if (typC == GeomAbs_BSplineCurve)
{
nbs = C.NbKnots();
nbs*= C.Degree();
nbs*= C.LastParameter()- C.FirstParameter();
nbs/= U1-U0;
if(nbs < 2.0) nbs=2;
nbs *= C.Degree();
nbs *= C.LastParameter() - C.FirstParameter();
nbs /= U1 - U0;
if (nbs < 2.0)
nbs = 2;
}
if(nbs>50)
if (nbs > 50)
nbs = 50;
return((Standard_Integer)nbs);
return ((Standard_Integer)nbs);
}
//=======================================================================
//function : Poles
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_BCurveTool::Poles(const BRepAdaptor_Curve& C,
TColgp_Array1OfPnt& T)
{
if(C.GetType() == GeomAbs_BezierCurve)
void HLRBRep_BCurveTool::Poles(const BRepAdaptor_Curve& C, TColgp_Array1OfPnt& T)
{
if (C.GetType() == GeomAbs_BezierCurve)
C.Bezier()->Poles(T);
else if(C.GetType() == GeomAbs_BSplineCurve)
else if (C.GetType() == GeomAbs_BSplineCurve)
C.BSpline()->Poles(T);
}
//=======================================================================
//function : PolesAndWeights
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_BCurveTool::PolesAndWeights(const BRepAdaptor_Curve& C,
TColgp_Array1OfPnt& T,
TColStd_Array1OfReal& W)
{
if(C.GetType() == GeomAbs_BezierCurve) {
void HLRBRep_BCurveTool::PolesAndWeights(const BRepAdaptor_Curve& C,
TColgp_Array1OfPnt& T,
TColStd_Array1OfReal& W)
{
if (C.GetType() == GeomAbs_BezierCurve)
{
const Handle(Geom_BezierCurve) HB = C.Bezier();
HB->Poles(T);
HB->Weights(W);
}
else if(C.GetType() == GeomAbs_BSplineCurve) {
else if (C.GetType() == GeomAbs_BSplineCurve)
{
const Handle(Geom_BSplineCurve) HB = C.BSpline();
HB->Poles(T);
HB->Weights(W);
}
}
//=======================================================================
//function : Bezier
//purpose :
//=======================================================================
//=================================================================================================
Handle(Geom_BezierCurve)
HLRBRep_BCurveTool::Bezier (const BRepAdaptor_Curve& C)
{ return(C.Bezier()); }
Handle(Geom_BezierCurve) HLRBRep_BCurveTool::Bezier(const BRepAdaptor_Curve& C)
{
return (C.Bezier());
}
//=======================================================================
//function : BSpline
//purpose :
//=======================================================================
//=================================================================================================
Handle(Geom_BSplineCurve)
HLRBRep_BCurveTool::BSpline (const BRepAdaptor_Curve& C)
{ return(C.BSpline()); }
Handle(Geom_BSplineCurve) HLRBRep_BCurveTool::BSpline(const BRepAdaptor_Curve& C)
{
return (C.BSpline());
}

View File

@@ -39,131 +39,119 @@ class gp_Vec;
class Geom_BezierCurve;
class Geom_BSplineCurve;
class HLRBRep_BCurveTool
class HLRBRep_BCurveTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstParameter (const BRepAdaptor_Curve& C);
static Standard_Real LastParameter (const BRepAdaptor_Curve& C);
static GeomAbs_Shape Continuity (const BRepAdaptor_Curve& C);
static Standard_Real FirstParameter(const BRepAdaptor_Curve& C);
static Standard_Real LastParameter(const BRepAdaptor_Curve& C);
static GeomAbs_Shape Continuity(const BRepAdaptor_Curve& C);
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(myclass) >= <S>
static Standard_Integer NbIntervals (const BRepAdaptor_Curve& C, const GeomAbs_Shape S);
static Standard_Integer NbIntervals(const BRepAdaptor_Curve& C, const GeomAbs_Shape S);
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
static void Intervals (const BRepAdaptor_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
static Standard_Boolean IsClosed (const BRepAdaptor_Curve& C);
static Standard_Boolean IsPeriodic (const BRepAdaptor_Curve& C);
static Standard_Real Period (const BRepAdaptor_Curve& C);
static void Intervals(const BRepAdaptor_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
static Standard_Boolean IsClosed(const BRepAdaptor_Curve& C);
static Standard_Boolean IsPeriodic(const BRepAdaptor_Curve& C);
static Standard_Real Period(const BRepAdaptor_Curve& C);
//! Computes the point of parameter U on the curve.
static gp_Pnt Value (const BRepAdaptor_Curve& C, const Standard_Real U);
static gp_Pnt Value(const BRepAdaptor_Curve& C, const Standard_Real U);
//! Computes the point of parameter U on the curve.
static void D0 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P);
static void D0(const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P);
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
static void D1 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
static void D1(const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
static void D2 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
static void D2(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2);
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
static void D3 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
static void D3(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3);
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
static gp_Vec DN (const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N);
static gp_Vec DN(const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N);
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
static Standard_Real Resolution (const BRepAdaptor_Curve& C, const Standard_Real R3d);
static Standard_Real Resolution(const BRepAdaptor_Curve& C, const Standard_Real R3d);
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
static GeomAbs_CurveType GetType (const BRepAdaptor_Curve& C);
static gp_Lin Line (const BRepAdaptor_Curve& C);
static gp_Circ Circle (const BRepAdaptor_Curve& C);
static gp_Elips Ellipse (const BRepAdaptor_Curve& C);
static gp_Hypr Hyperbola (const BRepAdaptor_Curve& C);
static gp_Parab Parabola (const BRepAdaptor_Curve& C);
Standard_EXPORT static Handle(Geom_BezierCurve) Bezier (const BRepAdaptor_Curve& C);
Standard_EXPORT static Handle(Geom_BSplineCurve) BSpline (const BRepAdaptor_Curve& C);
static Standard_Integer Degree (const BRepAdaptor_Curve& C);
static Standard_Boolean IsRational (const BRepAdaptor_Curve& C);
static Standard_Integer NbPoles (const BRepAdaptor_Curve& C);
static Standard_Integer NbKnots (const BRepAdaptor_Curve& C);
Standard_EXPORT static void Poles (const BRepAdaptor_Curve& C, TColgp_Array1OfPnt& T);
Standard_EXPORT static void PolesAndWeights (const BRepAdaptor_Curve& C, TColgp_Array1OfPnt& T, TColStd_Array1OfReal& W);
Standard_EXPORT static Standard_Integer NbSamples (const BRepAdaptor_Curve& C, const Standard_Real U0, const Standard_Real U1);
static GeomAbs_CurveType GetType(const BRepAdaptor_Curve& C);
static gp_Lin Line(const BRepAdaptor_Curve& C);
static gp_Circ Circle(const BRepAdaptor_Curve& C);
static gp_Elips Ellipse(const BRepAdaptor_Curve& C);
static gp_Hypr Hyperbola(const BRepAdaptor_Curve& C);
static gp_Parab Parabola(const BRepAdaptor_Curve& C);
Standard_EXPORT static Handle(Geom_BezierCurve) Bezier(const BRepAdaptor_Curve& C);
Standard_EXPORT static Handle(Geom_BSplineCurve) BSpline(const BRepAdaptor_Curve& C);
static Standard_Integer Degree(const BRepAdaptor_Curve& C);
static Standard_Boolean IsRational(const BRepAdaptor_Curve& C);
static Standard_Integer NbPoles(const BRepAdaptor_Curve& C);
static Standard_Integer NbKnots(const BRepAdaptor_Curve& C);
Standard_EXPORT static void Poles(const BRepAdaptor_Curve& C, TColgp_Array1OfPnt& T);
Standard_EXPORT static void PolesAndWeights(const BRepAdaptor_Curve& C,
TColgp_Array1OfPnt& T,
TColStd_Array1OfReal& W);
Standard_EXPORT static Standard_Integer NbSamples(const BRepAdaptor_Curve& C,
const Standard_Real U0,
const Standard_Real U1);
protected:
private:
};
#include <HLRBRep_BCurveTool.lxx>
#endif // _HLRBRep_BCurveTool_HeaderFile

View File

@@ -25,242 +25,264 @@
#include <BRepAdaptor_Curve.hxx>
//=======================================================================
//function : FirstParameter
//purpose :
// function : FirstParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BCurveTool::FirstParameter (const BRepAdaptor_Curve& C)
{ return(C.FirstParameter()); }
inline Standard_Real HLRBRep_BCurveTool::FirstParameter(const BRepAdaptor_Curve& C)
{
return (C.FirstParameter());
}
//=======================================================================
//function : LastParameter
//purpose :
// function : LastParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BCurveTool::LastParameter (const BRepAdaptor_Curve& C)
{ return(C.LastParameter()); }
inline Standard_Real HLRBRep_BCurveTool::LastParameter(const BRepAdaptor_Curve& C)
{
return (C.LastParameter());
}
//=======================================================================
//function : Continuity
//purpose :
// function : Continuity
// purpose :
//=======================================================================
inline GeomAbs_Shape
HLRBRep_BCurveTool::Continuity (const BRepAdaptor_Curve& C)
{ return(C.Continuity()); }
inline GeomAbs_Shape HLRBRep_BCurveTool::Continuity(const BRepAdaptor_Curve& C)
{
return (C.Continuity());
}
//=======================================================================
//function : NbIntervals
//purpose :
// function : NbIntervals
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BCurveTool::NbIntervals(const BRepAdaptor_Curve& C,
const GeomAbs_Shape Sh)
{ return(C.NbIntervals(Sh)); }
inline Standard_Integer HLRBRep_BCurveTool::NbIntervals(const BRepAdaptor_Curve& C,
const GeomAbs_Shape Sh)
{
return (C.NbIntervals(Sh));
}
//=======================================================================
//function : Intervals
//purpose :
// function : Intervals
// purpose :
//=======================================================================
inline void
HLRBRep_BCurveTool::Intervals(const BRepAdaptor_Curve& C,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh)
{ C.Intervals(Tab,Sh); }
inline void HLRBRep_BCurveTool::Intervals(const BRepAdaptor_Curve& C,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh)
{
C.Intervals(Tab, Sh);
}
//=======================================================================
//function : IsClosed
//purpose :
// function : IsClosed
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BCurveTool::IsClosed(const BRepAdaptor_Curve& C)
{ return(C.IsClosed()); }
inline Standard_Boolean HLRBRep_BCurveTool::IsClosed(const BRepAdaptor_Curve& C)
{
return (C.IsClosed());
}
//=======================================================================
//function : IsPeriodic
//purpose :
// function : IsPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BCurveTool::IsPeriodic(const BRepAdaptor_Curve& C)
{ return(C.IsPeriodic()); }
inline Standard_Boolean HLRBRep_BCurveTool::IsPeriodic(const BRepAdaptor_Curve& C)
{
return (C.IsPeriodic());
}
//=======================================================================
//function : Period
//purpose :
// function : Period
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BCurveTool::Period(const BRepAdaptor_Curve& C)
{ return(C.Period()); }
inline Standard_Real HLRBRep_BCurveTool::Period(const BRepAdaptor_Curve& C)
{
return (C.Period());
}
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline gp_Pnt
HLRBRep_BCurveTool::Value (const BRepAdaptor_Curve& C,
const Standard_Real U)
{ return(C.Value(U)); }
inline gp_Pnt HLRBRep_BCurveTool::Value(const BRepAdaptor_Curve& C, const Standard_Real U)
{
return (C.Value(U));
}
//=======================================================================
//function : D0
//purpose :
// function : D0
// purpose :
//=======================================================================
inline void
HLRBRep_BCurveTool::D0(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P)
{ C.D0(U,P); }
inline void HLRBRep_BCurveTool::D0(const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P)
{
C.D0(U, P);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void
HLRBRep_BCurveTool::D1 (const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T)
{ C.D1(U,P,T); }
inline void HLRBRep_BCurveTool::D1(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T)
{
C.D1(U, P, T);
}
inline void
HLRBRep_BCurveTool::D2 (const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T,
gp_Vec& N)
{ C.D2(U,P,T,N); }
inline void HLRBRep_BCurveTool::D2(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T,
gp_Vec& N)
{
C.D2(U, P, T, N);
}
//=======================================================================
//function : D3
//purpose :
// function : D3
// purpose :
//=======================================================================
inline void
HLRBRep_BCurveTool::D3 (const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3)
{ C.D3(U,P,V1,V2,V3); }
inline void HLRBRep_BCurveTool::D3(const BRepAdaptor_Curve& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3)
{
C.D3(U, P, V1, V2, V3);
}
//=======================================================================
//function : DN
//purpose :
// function : DN
// purpose :
//=======================================================================
inline gp_Vec
HLRBRep_BCurveTool::DN (const BRepAdaptor_Curve& C,
const Standard_Real U,
const Standard_Integer N)
{ return(C.DN(U,N)); }
inline gp_Vec HLRBRep_BCurveTool::DN(const BRepAdaptor_Curve& C,
const Standard_Real U,
const Standard_Integer N)
{
return (C.DN(U, N));
}
//=======================================================================
//function : Resolution
//purpose :
// function : Resolution
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BCurveTool::Resolution(const BRepAdaptor_Curve& C,
const Standard_Real R3d)
{ return(C.Resolution(R3d)); }
inline Standard_Real HLRBRep_BCurveTool::Resolution(const BRepAdaptor_Curve& C,
const Standard_Real R3d)
{
return (C.Resolution(R3d));
}
//=======================================================================
//function : GetType
//purpose :
// function : GetType
// purpose :
//=======================================================================
inline GeomAbs_CurveType
HLRBRep_BCurveTool::GetType(const BRepAdaptor_Curve& C)
{ return(C.GetType()); }
inline GeomAbs_CurveType HLRBRep_BCurveTool::GetType(const BRepAdaptor_Curve& C)
{
return (C.GetType());
}
//=======================================================================
//function : Line
//purpose :
// function : Line
// purpose :
//=======================================================================
inline gp_Lin
HLRBRep_BCurveTool::Line (const BRepAdaptor_Curve& C)
{ return(C.Line()); }
inline gp_Lin HLRBRep_BCurveTool::Line(const BRepAdaptor_Curve& C)
{
return (C.Line());
}
//=======================================================================
//function : Circle
//purpose :
// function : Circle
// purpose :
//=======================================================================
inline gp_Circ
HLRBRep_BCurveTool::Circle (const BRepAdaptor_Curve& C)
{ return(C.Circle()); }
inline gp_Circ HLRBRep_BCurveTool::Circle(const BRepAdaptor_Curve& C)
{
return (C.Circle());
}
//=======================================================================
//function : Ellipse
//purpose :
// function : Ellipse
// purpose :
//=======================================================================
inline gp_Elips
HLRBRep_BCurveTool::Ellipse (const BRepAdaptor_Curve& C)
{ return(C.Ellipse()); }
inline gp_Elips HLRBRep_BCurveTool::Ellipse(const BRepAdaptor_Curve& C)
{
return (C.Ellipse());
}
//=======================================================================
//function : Parabola
//purpose :
// function : Parabola
// purpose :
//=======================================================================
inline gp_Parab
HLRBRep_BCurveTool::Parabola (const BRepAdaptor_Curve& C)
{ return(C.Parabola()); }
inline gp_Parab HLRBRep_BCurveTool::Parabola(const BRepAdaptor_Curve& C)
{
return (C.Parabola());
}
//=======================================================================
//function : Hyperbola
//purpose :
// function : Hyperbola
// purpose :
//=======================================================================
inline gp_Hypr
HLRBRep_BCurveTool::Hyperbola (const BRepAdaptor_Curve& C)
{ return(C.Hyperbola()); }
inline gp_Hypr HLRBRep_BCurveTool::Hyperbola(const BRepAdaptor_Curve& C)
{
return (C.Hyperbola());
}
//=======================================================================
//function : Degree
//purpose :
// function : Degree
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BCurveTool::Degree (const BRepAdaptor_Curve& C)
{ return(C.Degree()); }
inline Standard_Integer HLRBRep_BCurveTool::Degree(const BRepAdaptor_Curve& C)
{
return (C.Degree());
}
//=======================================================================
//function : IsRational
//purpose :
// function : IsRational
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BCurveTool::IsRational (const BRepAdaptor_Curve& C)
{ return(C.IsRational()); }
inline Standard_Boolean HLRBRep_BCurveTool::IsRational(const BRepAdaptor_Curve& C)
{
return (C.IsRational());
}
//=======================================================================
//function : NbPoles
//purpose :
// function : NbPoles
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BCurveTool::NbPoles (const BRepAdaptor_Curve& C)
{ return(C.NbPoles()); }
inline Standard_Integer HLRBRep_BCurveTool::NbPoles(const BRepAdaptor_Curve& C)
{
return (C.NbPoles());
}
//=======================================================================
//function : NbKnots
//purpose :
// function : NbKnots
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BCurveTool::NbKnots(const BRepAdaptor_Curve& C)
{ return(C.NbKnots()); }
inline Standard_Integer HLRBRep_BCurveTool::NbKnots(const BRepAdaptor_Curve& C)
{
return (C.NbKnots());
}

View File

@@ -17,147 +17,129 @@
#include <BRepAdaptor_Surface.hxx>
//=======================================================================
//function : NbSamplesU
//purpose :
//=======================================================================
Standard_Integer
HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S)
{
Standard_Integer nbs;
//=================================================================================================
Standard_Integer HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S)
{
Standard_Integer nbs;
GeomAbs_SurfaceType typS = S.GetType();
switch(typS) {
case GeomAbs_Plane:
{
switch (typS)
{
case GeomAbs_Plane: {
nbs = 2;
}
break;
case GeomAbs_BezierSurface:
{
nbs = 3 + S.NbUPoles();
case GeomAbs_BezierSurface: {
nbs = 3 + S.NbUPoles();
}
break;
case GeomAbs_BSplineSurface:
{
case GeomAbs_BSplineSurface: {
nbs = S.NbUKnots();
nbs*= S.UDegree();
if(nbs < 2) nbs=2;
nbs *= S.UDegree();
if (nbs < 2)
nbs = 2;
}
break;
case GeomAbs_Torus:
{
case GeomAbs_Torus: {
nbs = 20;
}
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion:
{
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion: {
nbs = 10;
}
break;
default:
{
default: {
nbs = 10;
}
break;
}
return(nbs);
return (nbs);
}
//=======================================================================
//function : NbSamplesV
//purpose :
//=======================================================================
//=================================================================================================
Standard_Integer
HLRBRep_BSurfaceTool::NbSamplesV(const BRepAdaptor_Surface& S)
{
Standard_Integer nbs;
Standard_Integer HLRBRep_BSurfaceTool::NbSamplesV(const BRepAdaptor_Surface& S)
{
Standard_Integer nbs;
GeomAbs_SurfaceType typS = S.GetType();
switch(typS) {
case GeomAbs_Plane:
{
switch (typS)
{
case GeomAbs_Plane: {
nbs = 2;
}
break;
case GeomAbs_BezierSurface:
{
nbs = 3 + S.NbVPoles();
case GeomAbs_BezierSurface: {
nbs = 3 + S.NbVPoles();
}
break;
case GeomAbs_BSplineSurface:
{
case GeomAbs_BSplineSurface: {
nbs = S.NbVKnots();
nbs*= S.VDegree();
if(nbs < 2) nbs=2;
nbs *= S.VDegree();
if (nbs < 2)
nbs = 2;
}
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion:
{
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion: {
nbs = 15;
}
break;
default:
{
default: {
nbs = 10;
}
break;
}
return(nbs);
return (nbs);
}
//=======================================================================
//function : NbSamplesU
//purpose :
//=======================================================================
//=================================================================================================
Standard_Integer
HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S,
const Standard_Real u1,
const Standard_Real u2)
{
Standard_Integer HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S,
const Standard_Real u1,
const Standard_Real u2)
{
Standard_Integer nbs = NbSamplesU(S);
Standard_Integer n = nbs;
if(nbs>10) {
Standard_Integer n = nbs;
if (nbs > 10)
{
Standard_Real uf = FirstUParameter(S);
Standard_Real ul = LastUParameter(S);
n*= (Standard_Integer)((u2-u1)/(uf-ul));
if(n>nbs) n = nbs;
if(n<5) n = 5;
n *= (Standard_Integer)((u2 - u1) / (uf - ul));
if (n > nbs)
n = nbs;
if (n < 5)
n = 5;
}
return(n);
return (n);
}
//=======================================================================
//function : NbSamplesV
//purpose :
//=======================================================================
//=================================================================================================
Standard_Integer
HLRBRep_BSurfaceTool::NbSamplesV(const BRepAdaptor_Surface& S,
const Standard_Real v1,
const Standard_Real v2)
{
Standard_Integer HLRBRep_BSurfaceTool::NbSamplesV(const BRepAdaptor_Surface& S,
const Standard_Real v1,
const Standard_Real v2)
{
Standard_Integer nbs = NbSamplesV(S);
Standard_Integer n = nbs;
if(nbs>10) {
Standard_Integer n = nbs;
if (nbs > 10)
{
Standard_Real vf = FirstVParameter(S);
Standard_Real vl = LastVParameter(S);
n*= (Standard_Integer)((v2-v1)/(vf-vl));
if(n>nbs) n = nbs;
if(n<5) n = 5;
n *= (Standard_Integer)((v2 - v1) / (vf - vl));
if (n > nbs)
n = nbs;
if (n < 5)
n = 5;
}
return(n);
return (n);
}

View File

@@ -37,138 +37,163 @@ class gp_Vec;
class Geom_BezierSurface;
class Geom_BSplineSurface;
class HLRBRep_BSurfaceTool
class HLRBRep_BSurfaceTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter (const BRepAdaptor_Surface& S);
static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static Standard_Real FirstUParameter(const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter(const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter(const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter(const BRepAdaptor_Surface& S);
static Standard_Integer NbUIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static void UIntervals(const BRepAdaptor_Surface& S,
TColStd_Array1OfReal& T,
const GeomAbs_Shape Sh);
static void VIntervals(const BRepAdaptor_Surface& S,
TColStd_Array1OfReal& T,
const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) UTrim(const BRepAdaptor_Surface& S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
static Standard_Real VPeriod (const BRepAdaptor_Surface& S);
static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D2 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D3 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static GeomAbs_Shape UContinuity (const BRepAdaptor_Surface& S);
static GeomAbs_Shape VContinuity (const BRepAdaptor_Surface& S);
static Standard_Integer UDegree (const BRepAdaptor_Surface& S);
static Standard_Integer NbUPoles (const BRepAdaptor_Surface& S);
static Standard_Integer NbUKnots (const BRepAdaptor_Surface& S);
static Standard_Boolean IsURational (const BRepAdaptor_Surface& S);
static Standard_Integer VDegree (const BRepAdaptor_Surface& S);
static Standard_Integer NbVPoles (const BRepAdaptor_Surface& S);
static Standard_Integer NbVKnots (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVRational (const BRepAdaptor_Surface& S);
static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S);
static gp_Pln Plane (const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S);
static gp_Cone Cone (const BRepAdaptor_Surface& S);
static gp_Torus Torus (const BRepAdaptor_Surface& S);
static gp_Sphere Sphere (const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S);
static gp_Dir Direction (const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve (const BRepAdaptor_Surface& S);
static gp_Ax1 Axis (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2);
static Handle(Adaptor3d_Surface) VTrim(const BRepAdaptor_Surface& S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
static Standard_Boolean IsUClosed(const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed(const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic(const BRepAdaptor_Surface& S);
static Standard_Real UPeriod(const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic(const BRepAdaptor_Surface& S);
static Standard_Real VPeriod(const BRepAdaptor_Surface& S);
static gp_Pnt Value(const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static void D0(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P);
static void D1(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1u,
gp_Vec& D1v);
static void D2(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV);
static void D3(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV);
static gp_Vec DN(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
const Standard_Integer Nu,
const Standard_Integer Nv);
static GeomAbs_Shape UContinuity(const BRepAdaptor_Surface& S);
static GeomAbs_Shape VContinuity(const BRepAdaptor_Surface& S);
static Standard_Integer UDegree(const BRepAdaptor_Surface& S);
static Standard_Integer NbUPoles(const BRepAdaptor_Surface& S);
static Standard_Integer NbUKnots(const BRepAdaptor_Surface& S);
static Standard_Boolean IsURational(const BRepAdaptor_Surface& S);
static Standard_Integer VDegree(const BRepAdaptor_Surface& S);
static Standard_Integer NbVPoles(const BRepAdaptor_Surface& S);
static Standard_Integer NbVKnots(const BRepAdaptor_Surface& S);
static Standard_Boolean IsVRational(const BRepAdaptor_Surface& S);
static Standard_Real UResolution(const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution(const BRepAdaptor_Surface& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType(const BRepAdaptor_Surface& S);
static gp_Pln Plane(const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder(const BRepAdaptor_Surface& S);
static gp_Cone Cone(const BRepAdaptor_Surface& S);
static gp_Torus Torus(const BRepAdaptor_Surface& S);
static gp_Sphere Sphere(const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier(const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline(const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution(const BRepAdaptor_Surface& S);
static gp_Dir Direction(const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve(const BRepAdaptor_Surface& S);
static gp_Ax1 Axis(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU(const BRepAdaptor_Surface& S,
const Standard_Real u1,
const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV(const BRepAdaptor_Surface& S,
const Standard_Real v1,
const Standard_Real v2);
protected:
private:
};
#include <HLRBRep_BSurfaceTool.lxx>
#endif // _HLRBRep_BSurfaceTool_HeaderFile

View File

@@ -29,455 +29,499 @@
#include <BRepAdaptor_Surface.hxx>
//=======================================================================
//function : FirstUParameter
//purpose :
// function : FirstUParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf)
{ return Surf.FirstUParameter(); }
inline Standard_Real HLRBRep_BSurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.FirstUParameter();
}
//=======================================================================
//function : FirstVParameter
//purpose :
// function : FirstVParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf)
{ return Surf.FirstVParameter(); }
inline Standard_Real HLRBRep_BSurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.FirstVParameter();
}
//=======================================================================
//function : LastUParameter
//purpose :
// function : LastUParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf)
{ return Surf.LastUParameter(); }
inline Standard_Real HLRBRep_BSurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.LastUParameter();
}
//=======================================================================
//function : LastVParameter
//purpose :
// function : LastVParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf)
{ return Surf.LastVParameter(); }
inline Standard_Real HLRBRep_BSurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.LastVParameter();
}
//=======================================================================
//function : NbUIntervals
//purpose :
// function : NbUIntervals
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{ return Surf.NbUIntervals(S); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{
return Surf.NbUIntervals(S);
}
//=======================================================================
//function : NbVIntervals
//purpose :
// function : NbVIntervals
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{ return Surf.NbVIntervals(S); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{
return Surf.NbVIntervals(S);
}
//=======================================================================
//function : UIntervals
//purpose :
// function : UIntervals
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{ Surf.UIntervals(Tab,S); }
inline void HLRBRep_BSurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
Surf.UIntervals(Tab, S);
}
//=======================================================================
//function : VIntervals
//purpose :
// function : VIntervals
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{ Surf.VIntervals(Tab,S); }
inline void HLRBRep_BSurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
Surf.VIntervals(Tab, S);
}
//=======================================================================
//function : UTrim
//purpose :
// function : UTrim
// purpose :
//=======================================================================
inline Handle(Adaptor3d_Surface)
HLRBRep_BSurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{ return Surf.UTrim(F,L,Tol); }
inline Handle(Adaptor3d_Surface) HLRBRep_BSurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return Surf.UTrim(F, L, Tol);
}
//=======================================================================
//function : VTrim
//purpose :
// function : VTrim
// purpose :
//=======================================================================
inline Handle(Adaptor3d_Surface)
HLRBRep_BSurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{ return Surf.VTrim(F,L,Tol); }
inline Handle(Adaptor3d_Surface) HLRBRep_BSurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return Surf.VTrim(F, L, Tol);
}
//=======================================================================
//function : IsUClosed
//purpose :
// function : IsUClosed
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
{ return S.IsUClosed(); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
{
return S.IsUClosed();
}
//=======================================================================
//function : IsVClosed
//purpose :
// function : IsVClosed
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
{ return S.IsVClosed(); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
{
return S.IsVClosed();
}
//=======================================================================
//function : IsUPeriodic
//purpose :
// function : IsUPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
{ return S.IsUPeriodic(); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
{
return S.IsUPeriodic();
}
//=======================================================================
//function : UPeriod
//purpose :
// function : UPeriod
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
{ return S.UPeriod(); }
inline Standard_Real HLRBRep_BSurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
{
return S.UPeriod();
}
//=======================================================================
//function : IsVPeriodic
//purpose :
// function : IsVPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
{ return S.IsVPeriodic(); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
{
return S.IsVPeriodic();
}
//=======================================================================
//function : VPeriod
//purpose :
// function : VPeriod
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
{ return S.VPeriod(); }
inline Standard_Real HLRBRep_BSurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
{
return S.VPeriod();
}
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline gp_Pnt
HLRBRep_BSurfaceTool::Value(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V )
{ return S.Value(U,V); }
inline gp_Pnt HLRBRep_BSurfaceTool::Value(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V)
{
return S.Value(U, V);
}
//=======================================================================
//function : D0
//purpose :
// function : D0
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::D0(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{ S.D0(U,V,P); }
inline void HLRBRep_BSurfaceTool::D0(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
S.D0(U, V, P);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::D1(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{ S.D1(U,V,P,D1U,D1V); }
inline void HLRBRep_BSurfaceTool::D1(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
S.D1(U, V, P, D1U, D1V);
}
//=======================================================================
//function : D2
//purpose :
// function : D2
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::D2(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV)
{ S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV); }
inline void HLRBRep_BSurfaceTool::D2(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV)
{
S.D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
}
//=======================================================================
//function : D3
//purpose :
// function : D3
// purpose :
//=======================================================================
inline void
HLRBRep_BSurfaceTool::D3(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{ S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); }
inline void HLRBRep_BSurfaceTool::D3(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{
S.D3(U, V, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
}
//=======================================================================
//function : DN
//purpose :
// function : DN
// purpose :
//=======================================================================
inline gp_Vec
HLRBRep_BSurfaceTool::DN(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{ return S.DN(U,V,Nu,Nv); }
inline gp_Vec HLRBRep_BSurfaceTool::DN(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return S.DN(U, V, Nu, Nv);
}
//=======================================================================
//function : UResolution
//purpose :
// function : UResolution
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::UResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{ return S.UResolution(R3d); }
inline Standard_Real HLRBRep_BSurfaceTool::UResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{
return S.UResolution(R3d);
}
//=======================================================================
//function : VResolution
//purpose :
// function : VResolution
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_BSurfaceTool::VResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{ return S.VResolution(R3d); }
inline Standard_Real HLRBRep_BSurfaceTool::VResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{
return S.VResolution(R3d);
}
//=======================================================================
//function : GetType
//purpose :
// function : GetType
// purpose :
//=======================================================================
inline GeomAbs_SurfaceType
HLRBRep_BSurfaceTool::GetType(const BRepAdaptor_Surface& S )
{ return S.GetType(); }
inline GeomAbs_SurfaceType HLRBRep_BSurfaceTool::GetType(const BRepAdaptor_Surface& S)
{
return S.GetType();
}
//=======================================================================
//function : Plane
//purpose :
// function : Plane
// purpose :
//=======================================================================
inline gp_Pln
HLRBRep_BSurfaceTool::Plane(const BRepAdaptor_Surface& S)
{ return S.Plane(); }
inline gp_Pln HLRBRep_BSurfaceTool::Plane(const BRepAdaptor_Surface& S)
{
return S.Plane();
}
//=======================================================================
//function : Cylinder
//purpose :
// function : Cylinder
// purpose :
//=======================================================================
inline gp_Cylinder
HLRBRep_BSurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
{ return S.Cylinder(); }
inline gp_Cylinder HLRBRep_BSurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
{
return S.Cylinder();
}
//=======================================================================
//function : Cone
//purpose :
// function : Cone
// purpose :
//=======================================================================
inline gp_Cone
HLRBRep_BSurfaceTool::Cone(const BRepAdaptor_Surface& S)
{ return S.Cone(); }
inline gp_Cone HLRBRep_BSurfaceTool::Cone(const BRepAdaptor_Surface& S)
{
return S.Cone();
}
//=======================================================================
//function : Sphere
//purpose :
// function : Sphere
// purpose :
//=======================================================================
inline gp_Sphere
HLRBRep_BSurfaceTool::Sphere(const BRepAdaptor_Surface& S)
{ return S.Sphere(); }
inline gp_Sphere HLRBRep_BSurfaceTool::Sphere(const BRepAdaptor_Surface& S)
{
return S.Sphere();
}
//=======================================================================
//function : Torus
//purpose :
// function : Torus
// purpose :
//=======================================================================
inline gp_Torus
HLRBRep_BSurfaceTool::Torus(const BRepAdaptor_Surface& S)
{ return S.Torus(); }
inline gp_Torus HLRBRep_BSurfaceTool::Torus(const BRepAdaptor_Surface& S)
{
return S.Torus();
}
//=======================================================================
//function : Bezier
//purpose :
// function : Bezier
// purpose :
//=======================================================================
inline Handle(Geom_BezierSurface)
HLRBRep_BSurfaceTool::Bezier(const BRepAdaptor_Surface& S)
{ return(S.Bezier()); }
inline Handle(Geom_BezierSurface) HLRBRep_BSurfaceTool::Bezier(const BRepAdaptor_Surface& S)
{
return (S.Bezier());
}
//=======================================================================
//function : BSpline
//purpose :
// function : BSpline
// purpose :
//=======================================================================
inline Handle(Geom_BSplineSurface)
HLRBRep_BSurfaceTool::BSpline(const BRepAdaptor_Surface& S)
{ return(S.BSpline()); }
inline Handle(Geom_BSplineSurface) HLRBRep_BSurfaceTool::BSpline(const BRepAdaptor_Surface& S)
{
return (S.BSpline());
}
//=======================================================================
//function : AxeOfRevolution
//purpose :
// function : AxeOfRevolution
// purpose :
//=======================================================================
inline gp_Ax1
HLRBRep_BSurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S)
{ return(S.AxeOfRevolution()); }
inline gp_Ax1 HLRBRep_BSurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S)
{
return (S.AxeOfRevolution());
}
//=======================================================================
//function : Direction
//purpose :
// function : Direction
// purpose :
//=======================================================================
inline gp_Dir
HLRBRep_BSurfaceTool::Direction(const BRepAdaptor_Surface& S)
{ return(S.Direction()); }
inline gp_Dir HLRBRep_BSurfaceTool::Direction(const BRepAdaptor_Surface& S)
{
return (S.Direction());
}
//=======================================================================
//function : BasisCurve
//purpose :
// function : BasisCurve
// purpose :
//=======================================================================
inline Handle(Adaptor3d_Curve)
HLRBRep_BSurfaceTool::BasisCurve(const BRepAdaptor_Surface& S)
{ return(S.BasisCurve()); }
inline Handle(Adaptor3d_Curve) HLRBRep_BSurfaceTool::BasisCurve(const BRepAdaptor_Surface& S)
{
return (S.BasisCurve());
}
//=======================================================================
//function : UContinuity
//purpose :
// function : UContinuity
// purpose :
//=======================================================================
inline GeomAbs_Shape
HLRBRep_BSurfaceTool::UContinuity(const BRepAdaptor_Surface& S)
{ return(S.UContinuity()); }
inline GeomAbs_Shape HLRBRep_BSurfaceTool::UContinuity(const BRepAdaptor_Surface& S)
{
return (S.UContinuity());
}
//=======================================================================
//function : VContinuity
//purpose :
// function : VContinuity
// purpose :
//=======================================================================
inline GeomAbs_Shape
HLRBRep_BSurfaceTool::VContinuity(const BRepAdaptor_Surface& S)
{ return(S.VContinuity()); }
inline GeomAbs_Shape HLRBRep_BSurfaceTool::VContinuity(const BRepAdaptor_Surface& S)
{
return (S.VContinuity());
}
//=======================================================================
//function : UDegree
//purpose :
// function : UDegree
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::UDegree(const BRepAdaptor_Surface& S)
{ return(S.UDegree()); }
inline Standard_Integer HLRBRep_BSurfaceTool::UDegree(const BRepAdaptor_Surface& S)
{
return (S.UDegree());
}
//=======================================================================
//function : NbUPoles
//purpose :
// function : NbUPoles
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbUPoles(const BRepAdaptor_Surface& S)
{ return(S.NbUPoles()); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbUPoles(const BRepAdaptor_Surface& S)
{
return (S.NbUPoles());
}
//=======================================================================
//function : NbUKnots
//purpose :
// function : NbUKnots
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbUKnots(const BRepAdaptor_Surface& S)
{ return(S.NbUKnots()); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbUKnots(const BRepAdaptor_Surface& S)
{
return (S.NbUKnots());
}
//=======================================================================
//function : IsURational
//purpose :
// function : IsURational
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsURational(const BRepAdaptor_Surface& S)
{ return(S.IsURational()); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsURational(const BRepAdaptor_Surface& S)
{
return (S.IsURational());
}
//=======================================================================
//function : VDegree
//purpose :
// function : VDegree
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::VDegree(const BRepAdaptor_Surface& S)
{ return(S.VDegree()); }
inline Standard_Integer HLRBRep_BSurfaceTool::VDegree(const BRepAdaptor_Surface& S)
{
return (S.VDegree());
}
//=======================================================================
//function : NbVPoles
//purpose :
// function : NbVPoles
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbVPoles(const BRepAdaptor_Surface& S)
{ return(S.NbVPoles()); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbVPoles(const BRepAdaptor_Surface& S)
{
return (S.NbVPoles());
}
//=======================================================================
//function : NbVKnots
//purpose :
// function : NbVKnots
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_BSurfaceTool::NbVKnots(const BRepAdaptor_Surface& S)
{ return(S.NbVKnots()); }
inline Standard_Integer HLRBRep_BSurfaceTool::NbVKnots(const BRepAdaptor_Surface& S)
{
return (S.NbVKnots());
}
//=======================================================================
//function : IsVRational
//purpose :
// function : IsVRational
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_BSurfaceTool::IsVRational(const BRepAdaptor_Surface& S)
{ return(S.IsVRational()); }
inline Standard_Boolean HLRBRep_BSurfaceTool::IsVRational(const BRepAdaptor_Surface& S)
{
return (S.IsVRational());
}

View File

@@ -24,46 +24,52 @@
#include <TopoDS_Shape.hxx>
//! Contains the colors of a shape.
class HLRBRep_BiPnt2D
class HLRBRep_BiPnt2D
{
public:
DEFINE_STANDARD_ALLOC
HLRBRep_BiPnt2D()
: myRg1Line (false),
myRgNLine (false),
myOutLine (false),
myIntLine (false)
: myRg1Line(false),
myRgNLine(false),
myOutLine(false),
myIntLine(false)
{
}
HLRBRep_BiPnt2D(const Standard_Real x1, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl)
: myP1(x1,y1),
myP2(x2,y2),
myShape(S),
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl)
HLRBRep_BiPnt2D(const Standard_Real x1,
const Standard_Real y1,
const Standard_Real x2,
const Standard_Real y2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl)
: myP1(x1, y1),
myP2(x2, y2),
myShape(S),
myRg1Line(reg1),
myRgNLine(regn),
myOutLine(outl),
myIntLine(intl)
{
}
HLRBRep_BiPnt2D(
const gp_XY& thePoint1,
const gp_XY& thePoint2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl) :
myP1(thePoint1),
myP2(thePoint2),
myShape(S),
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl)
HLRBRep_BiPnt2D(const gp_XY& thePoint1,
const gp_XY& thePoint2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl)
: myP1(thePoint1),
myP2(thePoint2),
myShape(S),
myRg1Line(reg1),
myRgNLine(regn),
myOutLine(outl),
myIntLine(intl)
{
}
@@ -73,29 +79,28 @@ public:
const TopoDS_Shape& Shape() const { return myShape; }
void Shape (const TopoDS_Shape& S) { myShape = S; }
void Shape(const TopoDS_Shape& S) { myShape = S; }
Standard_Boolean Rg1Line() const { return myRg1Line; }
void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
void Rg1Line(const Standard_Boolean B) { myRg1Line = B; }
Standard_Boolean RgNLine() const { return myRgNLine; }
void RgNLine (const Standard_Boolean B) { myRgNLine = B; }
void RgNLine(const Standard_Boolean B) { myRgNLine = B; }
Standard_Boolean OutLine() const { return myOutLine; }
void OutLine (const Standard_Boolean B) { myOutLine = B; }
void OutLine(const Standard_Boolean B) { myOutLine = B; }
Standard_Boolean IntLine() const { return myIntLine; }
void IntLine (const Standard_Boolean B) { myIntLine = B; }
void IntLine(const Standard_Boolean B) { myIntLine = B; }
private:
gp_Pnt2d myP1;
gp_Pnt2d myP2;
TopoDS_Shape myShape;
gp_Pnt2d myP1;
gp_Pnt2d myP2;
TopoDS_Shape myShape;
Standard_Boolean myRg1Line;
Standard_Boolean myRgNLine;
Standard_Boolean myOutLine;

View File

@@ -26,32 +26,39 @@ class TopoDS_Shape;
class gp_Pnt;
//! Contains the colors of a shape.
class HLRBRep_BiPoint
class HLRBRep_BiPoint
{
public:
DEFINE_STANDARD_ALLOC
HLRBRep_BiPoint()
: myRg1Line (false),
myRgNLine (false),
myOutLine (false),
myIntLine (false) {}
: myRg1Line(false),
myRgNLine(false),
myOutLine(false),
myIntLine(false)
{
}
HLRBRep_BiPoint (const Standard_Real x1, const Standard_Real y1, const Standard_Real z1,
const Standard_Real x2, const Standard_Real y2, const Standard_Real z2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl)
: myP1 (x1, y1, z1),
myP2 (x2, y2, z2),
myShape (S),
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl) {}
HLRBRep_BiPoint(const Standard_Real x1,
const Standard_Real y1,
const Standard_Real z1,
const Standard_Real x2,
const Standard_Real y2,
const Standard_Real z2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl)
: myP1(x1, y1, z1),
myP2(x2, y2, z2),
myShape(S),
myRg1Line(reg1),
myRgNLine(regn),
myOutLine(outl),
myIntLine(intl)
{
}
const gp_Pnt& P1() const { return myP1; }
@@ -59,34 +66,32 @@ public:
const TopoDS_Shape& Shape() const { return myShape; }
void Shape (const TopoDS_Shape& S) { myShape = S; }
void Shape(const TopoDS_Shape& S) { myShape = S; }
Standard_Boolean Rg1Line() const { return myRg1Line; }
void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
void Rg1Line(const Standard_Boolean B) { myRg1Line = B; }
Standard_Boolean RgNLine() const { return myRgNLine; }
void RgNLine (const Standard_Boolean B) { myRgNLine = B; }
void RgNLine(const Standard_Boolean B) { myRgNLine = B; }
Standard_Boolean OutLine() const { return myOutLine; }
void OutLine (const Standard_Boolean B) { myOutLine = B; }
void OutLine(const Standard_Boolean B) { myOutLine = B; }
Standard_Boolean IntLine() const { return myIntLine; }
void IntLine (const Standard_Boolean B) { myIntLine = B; }
void IntLine(const Standard_Boolean B) { myIntLine = B; }
private:
gp_Pnt myP1;
gp_Pnt myP2;
TopoDS_Shape myShape;
gp_Pnt myP1;
gp_Pnt myP2;
TopoDS_Shape myShape;
Standard_Boolean myRg1Line;
Standard_Boolean myRgNLine;
Standard_Boolean myOutLine;
Standard_Boolean myIntLine;
};
#endif // _HLRBRep_BiPoint_HeaderFile

View File

@@ -40,90 +40,145 @@ class HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter;
class HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter;
class IntRes2d_Domain;
class HLRBRep_CInter : public IntRes2d_Intersection
class HLRBRep_CInter : public IntRes2d_Intersection
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
HLRBRep_CInter();
HLRBRep_CInter();
//! Self Intersection of a curve
HLRBRep_CInter(const Standard_Address& C, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C, const Standard_Real TolConf, const Standard_Real Tol);
//! Self Intersection of a curve with a domain.
HLRBRep_CInter(const Standard_Address& C, const IntRes2d_Domain& D, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C,
const IntRes2d_Domain& D,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
HLRBRep_CInter(const Standard_Address& C1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C1,
const Standard_Address& C2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
HLRBRep_CInter(const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Address& C2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
HLRBRep_CInter(const Standard_Address& C1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
HLRBRep_CInter(const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
HLRBRep_CInter(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
Standard_EXPORT void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
void Perform (const Standard_Address& C1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol);
void Perform(const Standard_Address& C1,
const Standard_Address& C2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
Standard_EXPORT void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
Standard_EXPORT void Perform (const Standard_Address& C1, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const Standard_Address& C1,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol);
void Perform(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Address& C2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
void Perform (const Standard_Address& C1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
void Perform(const Standard_Address& C1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Create a domain from a curve
Standard_EXPORT IntRes2d_Domain ComputeDomain (const Standard_Address& C1, const Standard_Real TolDomain) const;
Standard_EXPORT IntRes2d_Domain ComputeDomain(const Standard_Address& C1,
const Standard_Real TolDomain) const;
//! Set / get minimum number of points in polygon intersection.
Standard_EXPORT void SetMinNbSamples (const Standard_Integer theMinNbSamples);
Standard_EXPORT Standard_Integer GetMinNbSamples () const;
Standard_EXPORT void SetMinNbSamples(const Standard_Integer theMinNbSamples);
Standard_EXPORT Standard_Integer GetMinNbSamples() const;
protected:
private:
//! Intersection between 2 curves.
Standard_EXPORT void InternalPerform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
//! Part of InternalCompositePerform function
Standard_EXPORT void InternalCompositePerform_noRecurs (const Standard_Integer NbInterC1, const Standard_Address& C1, const Standard_Integer NumInterC1, const TColStd_Array1OfReal& Tab1, const IntRes2d_Domain& D1, const Standard_Integer NbInterC2, const Standard_Address& C2, const Standard_Integer NumInterC2, const TColStd_Array1OfReal& Tab2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void InternalCompositePerform_noRecurs(const Standard_Integer NbInterC1,
const Standard_Address& C1,
const Standard_Integer NumInterC1,
const TColStd_Array1OfReal& Tab1,
const IntRes2d_Domain& D1,
const Standard_Integer NbInterC2,
const Standard_Address& C2,
const Standard_Integer NumInterC2,
const TColStd_Array1OfReal& Tab2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between 2 curves.
Standard_EXPORT void InternalCompositePerform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Integer N1, const Standard_Integer NB1, const TColStd_Array1OfReal& Tab1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Integer N2, const Standard_Integer NB2, const TColStd_Array1OfReal& Tab2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalCompositePerform(const Standard_Address& C1,
const IntRes2d_Domain& D1,
const Standard_Integer N1,
const Standard_Integer NB1,
const TColStd_Array1OfReal& Tab1,
const Standard_Address& C2,
const IntRes2d_Domain& D2,
const Standard_Integer N2,
const Standard_Integer NB2,
const TColStd_Array1OfReal& Tab2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_Real param1inf;
Standard_Real param1sup;
Standard_Real param2inf;
Standard_Real param2sup;
IntCurve_IntConicConic intconiconi;
HLRBRep_TheIntConicCurveOfCInter intconicurv;
Standard_Real param1inf;
Standard_Real param1sup;
Standard_Real param2inf;
Standard_Real param2sup;
IntCurve_IntConicConic intconiconi;
HLRBRep_TheIntConicCurveOfCInter intconicurv;
HLRBRep_TheIntPCurvePCurveOfCInter intcurvcurv;
};
#define TheCurve Standard_Address
@@ -133,35 +188,49 @@ private:
#define IntCurve_TheProjPCur HLRBRep_TheProjPCurOfCInter
#define IntCurve_TheProjPCur_hxx <HLRBRep_TheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx \
<HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheLocateExtPCOfTheProjPCur HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter
#define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx \
<HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheLocateExtPCOfTheProjPCur HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter
#define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheIntConicCurve HLRBRep_TheIntConicCurveOfCInter
#define IntCurve_TheIntConicCurve_hxx <HLRBRep_TheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx \
<HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx \
<HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_IntConicCurve HLRBRep_IntConicCurveOfCInter
#define IntCurve_IntConicCurve_hxx <HLRBRep_IntConicCurveOfCInter.hxx>
#define IntCurve_TheIntPCurvePCurve HLRBRep_TheIntPCurvePCurveOfCInter
#define IntCurve_TheIntPCurvePCurve_hxx <HLRBRep_TheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx \
<HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve \
HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx \
<HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve \
HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx \
<HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx \
<HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve \
HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx \
<HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve \
HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx \
<HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_IntCurveCurveGen HLRBRep_CInter
#define IntCurve_IntCurveCurveGen_hxx <HLRBRep_CInter.hxx>
@@ -206,7 +275,4 @@ private:
#undef IntCurve_IntCurveCurveGen
#undef IntCurve_IntCurveCurveGen_hxx
#endif // _HLRBRep_CInter_HeaderFile

View File

@@ -29,7 +29,6 @@
#include <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#include <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#include <IntRes2d_Domain.hxx>
#define TheCurve Standard_Address
#define TheCurve_hxx <Standard_Address.hxx>
@@ -38,36 +37,49 @@
#define IntCurve_TheProjPCur HLRBRep_TheProjPCurOfCInter
#define IntCurve_TheProjPCur_hxx <HLRBRep_TheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx \
<HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheLocateExtPCOfTheProjPCur HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter
#define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheCurveLocatorOfTheProjPCur_hxx \
<HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheLocateExtPCOfTheProjPCur HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter
#define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx>
#define IntCurve_TheIntConicCurve HLRBRep_TheIntConicCurveOfCInter
#define IntCurve_TheIntConicCurve_hxx <HLRBRep_TheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx \
<HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_TheIntersectorOfTheIntConicCurve_hxx \
<HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntCurve_IntConicCurve HLRBRep_IntConicCurveOfCInter
#define IntCurve_IntConicCurve_hxx <HLRBRep_IntConicCurveOfCInter.hxx>
#define IntCurve_TheIntPCurvePCurve HLRBRep_TheIntPCurvePCurveOfCInter
#define IntCurve_TheIntPCurvePCurve_hxx <HLRBRep_TheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx \
<HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve \
HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx \
<HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve \
HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx \
<HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx \
<HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve \
HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx \
<HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve \
HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx \
<HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_IntCurveCurveGen HLRBRep_CInter
#define IntCurve_IntCurveCurveGen_hxx <HLRBRep_CInter.hxx>
#include "../IntCurve/IntCurve_IntCurveCurveGen.gxx"

View File

@@ -35,15 +35,11 @@ class gp_Dir2d;
class HLRBRep_CLPropsATool;
class HLRBRep_Curve;
class HLRBRep_CLProps
class HLRBRep_CLProps
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes the local properties of the curve <C>
//! The current point and the derivatives are
//! computed at the same time, which allows an
@@ -53,13 +49,18 @@ public:
//! only the tangent, N should be equal to 1.
//! <Resolution> is the linear tolerance (it is used to test
//! if a vector is null).
Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Integer N, const Standard_Real Resolution);
Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C,
const Standard_Integer N,
const Standard_Real Resolution);
//! Same as previous constructor but here the parameter is
//! set to the value <U>.
//! All the computations done will be related to <C> and <U>.
Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution);
Standard_EXPORT HLRBRep_CLProps(const HLRBRep_Curve*& C,
const Standard_Real U,
const Standard_Integer N,
const Standard_Real Resolution);
//! Same as previous constructor but here the parameter is
//! set to the value <U> and the curve is set
//! with SetCurve.
@@ -67,79 +68,60 @@ public:
//! All the computations done will be related to <C> and <U>
//! when the functions "set" will be done.
Standard_EXPORT HLRBRep_CLProps(const Standard_Integer N, const Standard_Real Resolution);
//! Initializes the local properties of the curve
//! for the parameter value <U>.
Standard_EXPORT void SetParameter (const Standard_Real U);
Standard_EXPORT void SetParameter(const Standard_Real U);
//! Initializes the local properties of the curve
//! for the new curve.
Standard_EXPORT void SetCurve (const HLRBRep_Curve*& C);
Standard_EXPORT void SetCurve(const HLRBRep_Curve*& C);
//! Returns the Point.
Standard_EXPORT const gp_Pnt2d& Value() const;
//! Returns the first derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec2d& D1();
//! Returns the second derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec2d& D2();
//! Returns the third derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec2d& D3();
//! Returns True if the tangent is defined.
//! For example, the tangent is not defined if the
//! three first derivatives are all null.
Standard_EXPORT Standard_Boolean IsTangentDefined();
//! output the tangent direction <D>
Standard_EXPORT void Tangent (gp_Dir2d& D);
Standard_EXPORT void Tangent(gp_Dir2d& D);
//! Returns the curvature.
Standard_EXPORT Standard_Real Curvature();
//! Returns the normal direction <N>.
Standard_EXPORT void Normal (gp_Dir2d& N);
Standard_EXPORT void Normal(gp_Dir2d& N);
//! Returns the centre of curvature <P>.
Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P);
Standard_EXPORT void CentreOfCurvature(gp_Pnt2d& P);
protected:
private:
const HLRBRep_Curve* myCurve;
Standard_Real myU;
Standard_Integer myDerOrder;
Standard_Real myCN;
Standard_Real myLinTol;
gp_Pnt2d myPnt;
gp_Vec2d myDerivArr[3];
gp_Dir2d myTangent;
Standard_Real myCurvature;
LProp_Status myTangentStatus;
Standard_Integer mySignificantFirstDerivativeOrder;
Standard_Real myU;
Standard_Integer myDerOrder;
Standard_Real myCN;
Standard_Real myLinTol;
gp_Pnt2d myPnt;
gp_Vec2d myDerivArr[3];
gp_Dir2d myTangent;
Standard_Real myCurvature;
LProp_Status myTangentStatus;
Standard_Integer mySignificantFirstDerivativeOrder;
};
#endif // _HLRBRep_CLProps_HeaderFile

View File

@@ -25,69 +25,56 @@
class gp_Pnt2d;
class gp_Vec2d;
class HLRBRep_CLPropsATool
class HLRBRep_CLPropsATool
{
public:
DEFINE_STANDARD_ALLOC
//! Computes the point <P> of parameter <U> on the
//! Curve from HLRBRep <C>.
static void Value (const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P);
static void Value(const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P);
//! Computes the point <P> and first derivative <V1>
//! of parameter <U> on the curve <C>.
static void D1 (const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1);
static void D1(const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1);
//! Computes the point <P>, the first derivative <V1>
//! and second derivative <V2> of parameter <U> on the
//! curve <C>.
static void D2 (const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
static void D2(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2);
//! Computes the point <P>, the first derivative <V1>,
//! the second derivative <V2> and third derivative
//! <V3> of parameter <U> on the curve <C>.
static void D3 (const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
static void D3(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3);
//! returns the order of continuity of the curve <C>.
//! returns 1 : first derivative only is computable
//! returns 2 : first and second derivative only are
//! computable. returns 3 : first, second and third
//! are computable.
static Standard_Integer Continuity (const HLRBRep_Curve* A);
static Standard_Integer Continuity(const HLRBRep_Curve* A);
//! returns the first parameter bound of the curve.
static Standard_Real FirstParameter (const HLRBRep_Curve* A);
static Standard_Real FirstParameter(const HLRBRep_Curve* A);
//! returns the last parameter bound of the curve.
//! FirstParameter must be less than LastParamenter.
static Standard_Real LastParameter (const HLRBRep_Curve* A);
static Standard_Real LastParameter(const HLRBRep_Curve* A);
protected:
private:
};
#include <HLRBRep_CLPropsATool.lxx>
#endif // _HLRBRep_CLPropsATool_HeaderFile

View File

@@ -19,78 +19,83 @@
#include <GeomAbs_Shape.hxx>
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline void HLRBRep_CLPropsATool::Value
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P)
{ P = A->Value(U); }
inline void HLRBRep_CLPropsATool::Value(const HLRBRep_Curve* A, const Standard_Real U, gp_Pnt2d& P)
{
P = A->Value(U);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void HLRBRep_CLPropsATool::D1
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1)
{ A->D1(U,P,V1); }
inline void HLRBRep_CLPropsATool::D1(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1)
{
A->D1(U, P, V1);
}
//=======================================================================
//function : D2
//purpose :
// function : D2
// purpose :
//=======================================================================
inline void HLRBRep_CLPropsATool::D2
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2)
{ A->D2(U, P, V1, V2); }
inline void HLRBRep_CLPropsATool::D2(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2)
{
A->D2(U, P, V1, V2);
}
//=======================================================================
//function : D3
//purpose :
// function : D3
// purpose :
//=======================================================================
inline void HLRBRep_CLPropsATool::D3
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{ A->D3(U, P, V1, V2, V3); }
inline void HLRBRep_CLPropsATool::D3(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{
A->D3(U, P, V1, V2, V3);
}
//=======================================================================
//function : Continuity
//purpose :
// function : Continuity
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_CLPropsATool::Continuity
(const HLRBRep_Curve*)
{ return GeomAbs_C2; }
inline Standard_Integer HLRBRep_CLPropsATool::Continuity(const HLRBRep_Curve*)
{
return GeomAbs_C2;
}
//=======================================================================
//function : FirstParameter
//purpose :
// function : FirstParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_CLPropsATool::FirstParameter
(const HLRBRep_Curve* A)
{ return A->FirstParameter(); }
inline Standard_Real HLRBRep_CLPropsATool::FirstParameter(const HLRBRep_Curve* A)
{
return A->FirstParameter();
}
//=======================================================================
//function : LastParameter
//purpose :
// function : LastParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_CLPropsATool::LastParameter
(const HLRBRep_Curve* A)
{ return A->LastParameter(); }
inline Standard_Real HLRBRep_CLPropsATool::LastParameter(const HLRBRep_Curve* A)
{
return A->LastParameter();
}

View File

@@ -24,7 +24,6 @@
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
#include <HLRBRep_CLPropsATool.hxx>
#define Curve HLRBRep_Curve*
#define Curve_hxx <HLRBRep_Curve.hxx>
@@ -39,4 +38,3 @@
#define LProp_CLProps HLRBRep_CLProps
#define LProp_CLProps_hxx <HLRBRep_CLProps.hxx>
#include "../LProp/LProp_CLProps.gxx"

View File

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <gp.hxx>
@@ -34,29 +33,21 @@
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS_Edge.hxx>
//OCC155 // jfa 05.03.2002 // bad vectors projection
//=======================================================================
//function : HLRBRep_Curve
//purpose :
//=======================================================================
HLRBRep_Curve::HLRBRep_Curve ()
{}
// OCC155 // jfa 05.03.2002 // bad vectors projection
//=================================================================================================
//=======================================================================
//function : Curve
//purpose :
//=======================================================================
HLRBRep_Curve::HLRBRep_Curve() {}
void HLRBRep_Curve::Curve (const TopoDS_Edge& E)
{ myCurve.Initialize(E); }
//=================================================================================================
//=======================================================================
//function : Parameter2d
//purpose :
//=======================================================================
void HLRBRep_Curve::Curve(const TopoDS_Edge& E)
{
myCurve.Initialize(E);
}
Standard_Real
HLRBRep_Curve::Parameter2d (const Standard_Real P3d) const
//=================================================================================================
Standard_Real HLRBRep_Curve::Parameter2d(const Standard_Real P3d) const
{
// Mathematical formula for lines
@@ -67,7 +58,8 @@ HLRBRep_Curve::Parameter2d (const Standard_Real P3d) const
switch (myType)
{
case GeomAbs_Line:
if (((HLRAlgo_Projector*) myProj)->Perspective()) {
if (((HLRAlgo_Projector*)myProj)->Perspective())
{
const Standard_Real FmOZ = myOF - myOZ;
return myOF * P3d * (myVX * FmOZ + myOX * myVZ) / (FmOZ * (FmOZ - P3d * myVZ));
}
@@ -82,229 +74,235 @@ HLRBRep_Curve::Parameter2d (const Standard_Real P3d) const
return P3d;
}
//=======================================================================
//function : Parameter3d
//purpose :
//=======================================================================
//=================================================================================================
Standard_Real
HLRBRep_Curve::Parameter3d (const Standard_Real P2d) const
Standard_Real HLRBRep_Curve::Parameter3d(const Standard_Real P2d) const
{
// Mathematical formula for lines
// 2
// 2
// (-myOF + myOZ) P2d
// P3d -> -----------------------------------------------------
// (myOF - myOZ) (myOF myVX + P2d myVZ) + myOF myOX myVZ
if (myType == GeomAbs_Line) {
if (((HLRAlgo_Projector*) myProj)->Perspective()) {
if (myType == GeomAbs_Line)
{
if (((HLRAlgo_Projector*)myProj)->Perspective())
{
const Standard_Real FmOZ = myOF - myOZ;
return P2d * FmOZ * FmOZ / (FmOZ * (myOF * myVX + P2d * myVZ) + myOF * myOX * myVZ);
}
return ((myVX <= gp::Resolution())? P2d : (P2d / myVX));
return ((myVX <= gp::Resolution()) ? P2d : (P2d / myVX));
}
else if (myType == GeomAbs_Ellipse) {
else if (myType == GeomAbs_Ellipse)
{
return P2d - myOX;
}
return P2d;
}
//=======================================================================
//function : Update
//purpose :
//=======================================================================
//=================================================================================================
Standard_Real HLRBRep_Curve::Update(
Standard_Real TotMin[16], Standard_Real TotMax[16])
Standard_Real HLRBRep_Curve::Update(Standard_Real TotMin[16], Standard_Real TotMax[16])
{
GeomAbs_CurveType typ = HLRBRep_BCurveTool::GetType(myCurve);
myType = GeomAbs_OtherCurve;
myType = GeomAbs_OtherCurve;
switch (typ) {
switch (typ)
{
case GeomAbs_Line:
myType = typ;
break;
case GeomAbs_Circle:
if (!((HLRAlgo_Projector*) myProj)->Perspective()) {
gp_Dir D1 = HLRBRep_BCurveTool::Circle(myCurve).Axis().Direction();
D1.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
if (D1.IsParallel(gp::DZ(),Precision::Angular()))
myType = GeomAbs_Circle;
else if (Abs(D1.Dot(gp::DZ())) < Precision::Angular()*10) //*10: The minor radius of ellipse should not be too small.
myType = GeomAbs_OtherCurve;
else {
myType = GeomAbs_Ellipse;
// compute the angle offset
gp_Dir D3 = D1.Crossed(gp::DZ());
gp_Dir D2 = HLRBRep_BCurveTool::Circle(myCurve).XAxis().Direction();
D2.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
myOX = D3.AngleWithRef(D2,D1);
}
}
break;
case GeomAbs_Ellipse:
if (!((HLRAlgo_Projector*) myProj)->Perspective()) {
gp_Dir D1 = HLRBRep_BCurveTool::Ellipse(myCurve).Axis().Direction();
D1.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
if (D1.IsParallel(gp::DZ(),Precision::Angular())) {
myOX = 0.; // no offset on the angle
myType = GeomAbs_Ellipse;
}
}
break;
case GeomAbs_BezierCurve:
if (HLRBRep_BCurveTool::Degree(myCurve) == 1)
myType = GeomAbs_Line;
else if (!((HLRAlgo_Projector*) myProj)->Perspective())
case GeomAbs_Line:
myType = typ;
break;
break;
case GeomAbs_BSplineCurve:
if (!((HLRAlgo_Projector*) myProj)->Perspective())
myType = typ;
break;
case GeomAbs_Circle:
if (!((HLRAlgo_Projector*)myProj)->Perspective())
{
gp_Dir D1 = HLRBRep_BCurveTool::Circle(myCurve).Axis().Direction();
D1.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
if (D1.IsParallel(gp::DZ(), Precision::Angular()))
myType = GeomAbs_Circle;
else if (Abs(D1.Dot(gp::DZ()))
< Precision::Angular()
* 10) //*10: The minor radius of ellipse should not be too small.
myType = GeomAbs_OtherCurve;
else
{
myType = GeomAbs_Ellipse;
// compute the angle offset
gp_Dir D3 = D1.Crossed(gp::DZ());
gp_Dir D2 = HLRBRep_BCurveTool::Circle(myCurve).XAxis().Direction();
D2.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
myOX = D3.AngleWithRef(D2, D1);
}
}
break;
default:
break;
case GeomAbs_Ellipse:
if (!((HLRAlgo_Projector*)myProj)->Perspective())
{
gp_Dir D1 = HLRBRep_BCurveTool::Ellipse(myCurve).Axis().Direction();
D1.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
if (D1.IsParallel(gp::DZ(), Precision::Angular()))
{
myOX = 0.; // no offset on the angle
myType = GeomAbs_Ellipse;
}
}
break;
case GeomAbs_BezierCurve:
if (HLRBRep_BCurveTool::Degree(myCurve) == 1)
myType = GeomAbs_Line;
else if (!((HLRAlgo_Projector*)myProj)->Perspective())
myType = typ;
break;
case GeomAbs_BSplineCurve:
if (!((HLRAlgo_Projector*)myProj)->Perspective())
myType = typ;
break;
default:
break;
}
if (myType == GeomAbs_Line) {
if (myType == GeomAbs_Line)
{
// compute the values for a line
gp_Lin L;
gp_Lin L;
Standard_Real l3d = 1.; // length of the 3d bezier curve
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_Line) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_Line)
{
L = HLRBRep_BCurveTool::Line(myCurve);
}
else { // bezier degree 1
else
{ // bezier degree 1
gp_Pnt PL;
gp_Vec VL;
HLRBRep_BCurveTool::D1(myCurve,0,PL,VL);
L = gp_Lin(PL,VL);
l3d = PL.Distance(HLRBRep_BCurveTool::Value(myCurve,1.));
HLRBRep_BCurveTool::D1(myCurve, 0, PL, VL);
L = gp_Lin(PL, VL);
l3d = PL.Distance(HLRBRep_BCurveTool::Value(myCurve, 1.));
}
gp_Pnt P = L.Location();
gp_Vec V = L.Direction();
P.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
V.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
if (((HLRAlgo_Projector*) myProj)->Perspective()) {
P.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
V.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
if (((HLRAlgo_Projector*)myProj)->Perspective())
{
gp_Pnt2d F;
gp_Vec2d VFX;
D1(0.,F,VFX);
D1(0., F, VFX);
VFX.Normalize();
myVX = (VFX.X()*V.X()+VFX.Y()*V.Y()) * l3d;
Standard_Real l = - (VFX.X()*F.X() + VFX.Y()*F.Y());
F.SetCoord(F.X()+VFX.X()*l,F.Y()+VFX.Y()*l);
myOX = VFX.X()*(P.X()-F.X()) + VFX.Y()*(P.Y()-F.Y());
gp_Vec VFZ(-F.X(),-F.Y(),((HLRAlgo_Projector*) myProj)->Focus());
myVX = (VFX.X() * V.X() + VFX.Y() * V.Y()) * l3d;
Standard_Real l = -(VFX.X() * F.X() + VFX.Y() * F.Y());
F.SetCoord(F.X() + VFX.X() * l, F.Y() + VFX.Y() * l);
myOX = VFX.X() * (P.X() - F.X()) + VFX.Y() * (P.Y() - F.Y());
gp_Vec VFZ(-F.X(), -F.Y(), ((HLRAlgo_Projector*)myProj)->Focus());
myOF = VFZ.Magnitude();
VFZ /= myOF;
myVZ = VFZ * V;
myVZ *= l3d;
myOZ = VFZ * gp_Vec(P.X()-F.X(),P.Y()-F.Y(),P.Z());
myOZ = VFZ * gp_Vec(P.X() - F.X(), P.Y() - F.Y(), P.Z());
}
else myVX = Sqrt(V.X() * V.X() + V.Y() * V.Y()) * l3d;
else
myVX = Sqrt(V.X() * V.X() + V.Y() * V.Y()) * l3d;
}
return(UpdateMinMax(TotMin,TotMax));
return (UpdateMinMax(TotMin, TotMax));
}
//=======================================================================
//function : UpdateMinMax
//purpose :
//=======================================================================
//=================================================================================================
Standard_Real HLRBRep_Curve::UpdateMinMax(
Standard_Real TotMin[16], Standard_Real TotMax[16])
Standard_Real HLRBRep_Curve::UpdateMinMax(Standard_Real TotMin[16], Standard_Real TotMax[16])
{
Standard_Real a = HLRBRep_BCurveTool::FirstParameter(myCurve);
Standard_Real b = HLRBRep_BCurveTool::LastParameter(myCurve);
Standard_Real x,y,z,tolMinMax = 0;
((HLRAlgo_Projector*) myProj)->Project(Value3D(a),x,y,z);
HLRAlgo::UpdateMinMax(x,y,z,TotMin,TotMax);
Standard_Real x, y, z, tolMinMax = 0;
((HLRAlgo_Projector*)myProj)->Project(Value3D(a), x, y, z);
HLRAlgo::UpdateMinMax(x, y, z, TotMin, TotMax);
if (myType != GeomAbs_Line) {
if (myType != GeomAbs_Line)
{
Standard_Integer nbPnt = 30;
Standard_Integer i;
Standard_Real step = (b-a)/(nbPnt+1);
Standard_Real xa,ya,za,xb =0.,yb =0.,zb =0.;
Standard_Real dx1,dy1,dz1,dd1;
Standard_Real dx2,dy2,dz2,dd2;
Standard_Real step = (b - a) / (nbPnt + 1);
Standard_Real xa, ya, za, xb = 0., yb = 0., zb = 0.;
Standard_Real dx1, dy1, dz1, dd1;
Standard_Real dx2, dy2, dz2, dd2;
for (i = 1; i <= nbPnt; i++) {
for (i = 1; i <= nbPnt; i++)
{
a += step;
xa = xb; ya = yb; za = zb;
xb = x ; yb = y ; zb = z ;
((HLRAlgo_Projector*) myProj)->Project(Value3D(a),x,y,z);
HLRAlgo::UpdateMinMax(x,y,z,TotMin,TotMax);
if (i >= 2) {
dx1 = x - xa; dy1 = y - ya; dz1 = z - za;
dd1 = sqrt (dx1 * dx1 + dy1 * dy1 + dz1 * dz1);
if (dd1 > 0) {
dx2 = xb - xa; dy2 = yb - ya; dz2 = zb - za;
dd2 = sqrt (dx2 * dx2 + dy2 * dy2 + dz2 * dz2);
if (dd2 > 0) {
xa = xb;
ya = yb;
za = zb;
xb = x;
yb = y;
zb = z;
((HLRAlgo_Projector*)myProj)->Project(Value3D(a), x, y, z);
HLRAlgo::UpdateMinMax(x, y, z, TotMin, TotMax);
if (i >= 2)
{
dx1 = x - xa;
dy1 = y - ya;
dz1 = z - za;
dd1 = sqrt(dx1 * dx1 + dy1 * dy1 + dz1 * dz1);
if (dd1 > 0)
{
dx2 = xb - xa;
dy2 = yb - ya;
dz2 = zb - za;
dd2 = sqrt(dx2 * dx2 + dy2 * dy2 + dz2 * dz2);
if (dd2 > 0)
{
Standard_Real p = (dx1 * dx2 + dy1 * dy2 + dz1 * dz2) / (dd1 * dd2);
dx1 = xa + p * dx1 - xb;
dy1 = ya + p * dy1 - yb;
dz1 = za + p * dz1 - zb;
dd1 = sqrt (dx1 * dx1 + dy1 * dy1 + dz1 * dz1);
if (dd1 > tolMinMax) tolMinMax = dd1;
dx1 = xa + p * dx1 - xb;
dy1 = ya + p * dy1 - yb;
dz1 = za + p * dz1 - zb;
dd1 = sqrt(dx1 * dx1 + dy1 * dy1 + dz1 * dz1);
if (dd1 > tolMinMax)
tolMinMax = dd1;
}
}
}
}
}
((HLRAlgo_Projector*) myProj)->Project(Value3D(b),x,y,z);
HLRAlgo::UpdateMinMax(x,y,z,TotMin,TotMax);
((HLRAlgo_Projector*)myProj)->Project(Value3D(b), x, y, z);
HLRAlgo::UpdateMinMax(x, y, z, TotMin, TotMax);
return tolMinMax;
}
//=======================================================================
//function : Z
//purpose :
//=======================================================================
//=================================================================================================
Standard_Real HLRBRep_Curve::Z (const Standard_Real U) const
Standard_Real HLRBRep_Curve::Z(const Standard_Real U) const
{
gp_Pnt P3d;
HLRBRep_BCurveTool::D0(myCurve,U,P3d);
P3d.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
HLRBRep_BCurveTool::D0(myCurve, U, P3d);
P3d.Transform(((HLRAlgo_Projector*)myProj)->Transformation());
return P3d.Z();
}
//=======================================================================
//function : Tangent
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::Tangent (const Standard_Boolean AtStart,
gp_Pnt2d& P, gp_Dir2d& D) const
void HLRBRep_Curve::Tangent(const Standard_Boolean AtStart, gp_Pnt2d& P, gp_Dir2d& D) const
{
Standard_Real U = AtStart? HLRBRep_BCurveTool::FirstParameter(myCurve) :
HLRBRep_BCurveTool::LastParameter (myCurve);
Standard_Real U = AtStart ? HLRBRep_BCurveTool::FirstParameter(myCurve)
: HLRBRep_BCurveTool::LastParameter(myCurve);
D0(U,P);
HLRBRep_CLProps CLP(2,Epsilon(1.));
D0(U, P);
HLRBRep_CLProps CLP(2, Epsilon(1.));
const HLRBRep_Curve* aCurve = this;
CLP.SetCurve(aCurve);
CLP.SetParameter(U);
StdFail_UndefinedDerivative_Raise_if
(!CLP.IsTangentDefined(), "HLRBRep_Curve::Tangent");
CLP.Tangent(D);
StdFail_UndefinedDerivative_Raise_if(!CLP.IsTangentDefined(), "HLRBRep_Curve::Tangent");
CLP.Tangent(D);
}
//=======================================================================
//function : D0
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::D0 (const Standard_Real U, gp_Pnt2d& P) const
void HLRBRep_Curve::D0(const Standard_Real U, gp_Pnt2d& P) const
{
/* gp_Pnt P3d;
HLRBRep_BCurveTool::D0(myCurve,U,P3d);
@@ -315,291 +313,260 @@ void HLRBRep_Curve::D0 (const Standard_Real U, gp_Pnt2d& P) const
}
else P.SetCoord(P3d.X(),P3d.Y()); */
gp_Pnt P3d;
HLRBRep_BCurveTool::D0(myCurve,U,P3d);
((HLRAlgo_Projector*) myProj)->Project(P3d,P);
HLRBRep_BCurveTool::D0(myCurve, U, P3d);
((HLRAlgo_Projector*)myProj)->Project(P3d, P);
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::D1 (const Standard_Real U,
gp_Pnt2d& P, gp_Vec2d& V) const
void HLRBRep_Curve::D1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const
{
// Mathematical formula for lines
// X'[t] X[t] Z'[t]
// D1 = -------- + -------------
// Z[t] Z[t] 2
// 1 - ---- f (1 - ----)
// f f
// X'[t] X[t] Z'[t]
// D1 = -------- + -------------
// Z[t] Z[t] 2
// 1 - ---- f (1 - ----)
// f f
gp_Pnt P3D;
gp_Vec V13D;
HLRBRep_BCurveTool::D1(myCurve,U,P3D,V13D);
HLRBRep_BCurveTool::D1(myCurve, U, P3D, V13D);
if (myProj->Perspective())
{
P3D .Transform(myProj->Transformation());
P3D.Transform(myProj->Transformation());
V13D.Transform(myProj->Transformation());
Standard_Real f = myProj->Focus();
Standard_Real R = 1. - P3D.Z()/f;
Standard_Real e = V13D.Z()/(f*R*R);
P.SetCoord(P3D .X()/R , P3D .Y()/R );
V.SetCoord(V13D.X()/R + P3D.X()*e, V13D.Y()/R + P3D.Y()*e);
Standard_Real R = 1. - P3D.Z() / f;
Standard_Real e = V13D.Z() / (f * R * R);
P.SetCoord(P3D.X() / R, P3D.Y() / R);
V.SetCoord(V13D.X() / R + P3D.X() * e, V13D.Y() / R + P3D.Y() * e);
}
else {
//OCC155
myProj->Project(P3D,V13D,P,V);
else
{
// OCC155
myProj->Project(P3D, V13D, P, V);
}
}
//=======================================================================
//function : D2
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::D2 (const Standard_Real U,
gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
void HLRBRep_Curve::D2(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
{
// Mathematical formula for lines
// 2
// 2 X'[t] Z'[t] 2 X[t] Z'[t] X''[t] X[t] Z''[t]
// D2 = ------------- + -------------- + -------- + -------------
// Z[t] 2 2 Z[t] 3 Z[t] Z[t] 2
// f (1 - ----) f (1 - ----) 1 - ---- f (1 - ----)
// f f f f
// 2 X'[t] Z'[t] 2 X[t] Z'[t] X''[t] X[t] Z''[t]
// D2 = ------------- + -------------- + -------- + -------------
// Z[t] 2 2 Z[t] 3 Z[t] Z[t] 2
// f (1 - ----) f (1 - ----) 1 - ---- f (1 - ----)
// f f f f
gp_Pnt P3D;
gp_Vec V13D,V23D;
HLRBRep_BCurveTool::D2(myCurve,U,P3D,V13D,V23D);
P3D .Transform(myProj->Transformation());
gp_Vec V13D, V23D;
HLRBRep_BCurveTool::D2(myCurve, U, P3D, V13D, V23D);
P3D.Transform(myProj->Transformation());
V13D.Transform(myProj->Transformation());
V23D.Transform(myProj->Transformation());
if (myProj->Perspective())
{
Standard_Real f = myProj->Focus();
Standard_Real R = 1. - P3D.Z() / f;
Standard_Real q = f*R*R;
Standard_Real e = V13D.Z()/q;
Standard_Real c = e*V13D.Z()/(f*R);
P .SetCoord(P3D .X()/R , P3D .Y()/R );
V1.SetCoord(V13D.X()/R + P3D.X()*e, V13D.Y()/R + P3D.Y()*e);
V2.SetCoord(V23D.X()/R + 2*V13D.X()*e + P3D.X()*V23D.Z()/q + 2*P3D.X()*c,
V23D.Y()/R + 2*V13D.Y()*e + P3D.Y()*V23D.Z()/q + 2*P3D.Y()*c);
Standard_Real q = f * R * R;
Standard_Real e = V13D.Z() / q;
Standard_Real c = e * V13D.Z() / (f * R);
P.SetCoord(P3D.X() / R, P3D.Y() / R);
V1.SetCoord(V13D.X() / R + P3D.X() * e, V13D.Y() / R + P3D.Y() * e);
V2.SetCoord(V23D.X() / R + 2 * V13D.X() * e + P3D.X() * V23D.Z() / q + 2 * P3D.X() * c,
V23D.Y() / R + 2 * V13D.Y() * e + P3D.Y() * V23D.Z() / q + 2 * P3D.Y() * c);
}
else {
P .SetCoord(P3D .X(),P3D .Y());
V1.SetCoord(V13D.X(),V13D.Y());
V2.SetCoord(V23D.X(),V23D.Y());
else
{
P.SetCoord(P3D.X(), P3D.Y());
V1.SetCoord(V13D.X(), V13D.Y());
V2.SetCoord(V23D.X(), V23D.Y());
}
}
//=======================================================================
//function : D3
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::D3 (const Standard_Real,
gp_Pnt2d&, gp_Vec2d&, gp_Vec2d&, gp_Vec2d&) const
void HLRBRep_Curve::D3(const Standard_Real, gp_Pnt2d&, gp_Vec2d&, gp_Vec2d&, gp_Vec2d&) const {}
//=================================================================================================
gp_Vec2d HLRBRep_Curve::DN(const Standard_Real, const Standard_Integer) const
{
return gp_Vec2d();
}
//=======================================================================
//function : DN
//purpose :
//=======================================================================
//=================================================================================================
gp_Vec2d HLRBRep_Curve::DN (const Standard_Real, const Standard_Integer) const
{ return gp_Vec2d(); }
//=======================================================================
//function : Line
//purpose :
//=======================================================================
gp_Lin2d HLRBRep_Curve::Line () const
gp_Lin2d HLRBRep_Curve::Line() const
{
gp_Pnt2d P;
gp_Vec2d V;
D1(0.,P,V);
return gp_Lin2d(P,V);
D1(0., P, V);
return gp_Lin2d(P, V);
}
//=======================================================================
//function : Circle
//purpose :
//=======================================================================
//=================================================================================================
gp_Circ2d HLRBRep_Curve::Circle () const
gp_Circ2d HLRBRep_Curve::Circle() const
{
gp_Circ C = HLRBRep_BCurveTool::Circle(myCurve);
C.Transform(myProj->Transformation());
return ProjLib::Project(gp_Pln(gp::XOY()),C);
return ProjLib::Project(gp_Pln(gp::XOY()), C);
}
//=======================================================================
//function : Ellipse
//purpose :
//=======================================================================
//=================================================================================================
gp_Elips2d HLRBRep_Curve::Ellipse () const
gp_Elips2d HLRBRep_Curve::Ellipse() const
{
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_Ellipse) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_Ellipse)
{
gp_Elips E = HLRBRep_BCurveTool::Ellipse(myCurve);
E.Transform(myProj->Transformation());
return ProjLib::Project(gp_Pln(gp::XOY()),E);
return ProjLib::Project(gp_Pln(gp::XOY()), E);
}
// this is a circle
gp_Circ C = HLRBRep_BCurveTool::Circle(myCurve);
C.Transform(myProj->Transformation());
const gp_Dir& D1 = C.Axis().Direction();
const gp_Dir& D3 = D1.Crossed(gp::DZ());
const gp_Dir& D2 = D1.Crossed(D3);
Standard_Real rap = sqrt( D2.X()*D2.X() + D2.Y()*D2.Y() );
gp_Dir2d d(D1.Y(),-D1.X());
gp_Pnt2d p(C.Location().X(),C.Location().Y());
gp_Elips2d El(gp_Ax2d(p,d),C.Radius(),C.Radius()*rap);
if ( D1.Z() < 0 ) El.Reverse();
const gp_Dir& D1 = C.Axis().Direction();
const gp_Dir& D3 = D1.Crossed(gp::DZ());
const gp_Dir& D2 = D1.Crossed(D3);
Standard_Real rap = sqrt(D2.X() * D2.X() + D2.Y() * D2.Y());
gp_Dir2d d(D1.Y(), -D1.X());
gp_Pnt2d p(C.Location().X(), C.Location().Y());
gp_Elips2d El(gp_Ax2d(p, d), C.Radius(), C.Radius() * rap);
if (D1.Z() < 0)
El.Reverse();
return El;
}
//=======================================================================
//function : Hyperbola
//purpose :
//=======================================================================
//=================================================================================================
gp_Hypr2d HLRBRep_Curve::Hyperbola () const
{ return gp_Hypr2d(); }
//=======================================================================
//function : Parabola
//purpose :
//=======================================================================
gp_Parab2d HLRBRep_Curve::Parabola () const
{ return gp_Parab2d(); }
//=======================================================================
//function : Poles
//purpose :
//=======================================================================
void HLRBRep_Curve::Poles (TColgp_Array1OfPnt2d& TP) const
gp_Hypr2d HLRBRep_Curve::Hyperbola() const
{
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1,i2);
return gp_Hypr2d();
}
//=================================================================================================
gp_Parab2d HLRBRep_Curve::Parabola() const
{
return gp_Parab2d();
}
//=================================================================================================
void HLRBRep_Curve::Poles(TColgp_Array1OfPnt2d& TP) const
{
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1, i2);
//-- HLRBRep_BCurveTool::Poles(myCurve,TP3);
if(HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve)
{
(HLRBRep_BCurveTool::BSpline(myCurve))->Poles(TP3);
}
else {
else
{
(HLRBRep_BCurveTool::Bezier(myCurve))->Poles(TP3);
}
for (Standard_Integer i = i1; i <= i2; i++) {
for (Standard_Integer i = i1; i <= i2; i++)
{
myProj->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(),TP3(i).Y());
TP(i).SetCoord(TP3(i).X(), TP3(i).Y());
}
}
//=======================================================================
//function : Poles
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::Poles (const Handle(Geom_BSplineCurve)& aCurve,
TColgp_Array1OfPnt2d& TP) const
void HLRBRep_Curve::Poles(const Handle(Geom_BSplineCurve)& aCurve, TColgp_Array1OfPnt2d& TP) const
{
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1,i2);
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1, i2);
//-- HLRBRep_BCurveTool::Poles(myCurve,TP3);
aCurve->Poles(TP3);
for (Standard_Integer i = i1; i <= i2; i++) {
((HLRAlgo_Projector*) myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(),TP3(i).Y());
for (Standard_Integer i = i1; i <= i2; i++)
{
((HLRAlgo_Projector*)myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(), TP3(i).Y());
}
}
//=======================================================================
//function : PolesAndWeights
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::PolesAndWeights (TColgp_Array1OfPnt2d& TP,
TColStd_Array1OfReal& TW) const
void HLRBRep_Curve::PolesAndWeights(TColgp_Array1OfPnt2d& TP, TColStd_Array1OfReal& TW) const
{
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1,i2);
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1, i2);
//-- HLRBRep_BCurveTool::PolesAndWeights(myCurve,TP3,TW);
if(HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve)
{
Handle(Geom_BSplineCurve) HB = (HLRBRep_BCurveTool::BSpline(myCurve));
HB->Poles(TP3);
HB->Weights(TW);
HB->Weights(TW);
//-- (HLRBRep_BCurveTool::BSpline(myCurve))->PolesAndWeights(TP3,TW);
}
else {
else
{
Handle(Geom_BezierCurve) HB = (HLRBRep_BCurveTool::Bezier(myCurve));
HB->Poles(TP3);
HB->Weights(TW);
//-- (HLRBRep_BCurveTool::Bezier(myCurve))->PolesAndWeights(TP3,TW);
}
for (Standard_Integer i = i1; i <= i2; i++) {
((HLRAlgo_Projector*) myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(),TP3(i).Y());
for (Standard_Integer i = i1; i <= i2; i++)
{
((HLRAlgo_Projector*)myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(), TP3(i).Y());
}
}
//=======================================================================
//function : PolesAndWeights
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::PolesAndWeights (const Handle(Geom_BSplineCurve)& aCurve,
TColgp_Array1OfPnt2d& TP,
TColStd_Array1OfReal& TW) const
void HLRBRep_Curve::PolesAndWeights(const Handle(Geom_BSplineCurve)& aCurve,
TColgp_Array1OfPnt2d& TP,
TColStd_Array1OfReal& TW) const
{
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1,i2);
Standard_Integer i1 = TP.Lower();
Standard_Integer i2 = TP.Upper();
TColgp_Array1OfPnt TP3(i1, i2);
//-- HLRBRep_BCurveTool::PolesAndWeights(myCurve,TP3,TW);
aCurve->Poles(TP3);
aCurve->Weights(TW);
//-- (HLRBRep_BCurveTool::BSpline(myCurve))->PolesAndWeights(TP3,TW);
for (Standard_Integer i = i1; i <= i2; i++) {
((HLRAlgo_Projector*) myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(),TP3(i).Y());
aCurve->Poles(TP3);
aCurve->Weights(TW);
//-- (HLRBRep_BCurveTool::BSpline(myCurve))->PolesAndWeights(TP3,TW);
for (Standard_Integer i = i1; i <= i2; i++)
{
((HLRAlgo_Projector*)myProj)->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(), TP3(i).Y());
}
}
//=======================================================================
//function : Knots
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::Knots (TColStd_Array1OfReal& kn) const
void HLRBRep_Curve::Knots(TColStd_Array1OfReal& kn) const
{
if(HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve)
{
Handle(Geom_BSplineCurve) HB = (HLRBRep_BCurveTool::BSpline(myCurve));
HB->Knots(kn);
}
}
//=======================================================================
//function : Multiplicities
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Curve::Multiplicities (TColStd_Array1OfInteger& mu) const
void HLRBRep_Curve::Multiplicities(TColStd_Array1OfInteger& mu) const
{
if(HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve) {
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_BSplineCurve)
{
Handle(Geom_BSplineCurve) HB = (HLRBRep_BCurveTool::BSpline(myCurve));
HB->Multiplicities(mu);
}

View File

@@ -43,192 +43,175 @@ class gp_Parab2d;
class Geom_BSplineCurve;
class HLRAlgo_Projector;
//! Defines a 2d curve by projection of a 3D curve on
//! a plane with an optional perspective
//! transformation.
class HLRBRep_Curve
class HLRBRep_Curve
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an undefined Curve.
Standard_EXPORT HLRBRep_Curve();
void Projector (const HLRAlgo_Projector* Proj)
{myProj = Proj;}
void Projector(const HLRAlgo_Projector* Proj) { myProj = Proj; }
//! Returns the 3D curve.
BRepAdaptor_Curve& Curve();
BRepAdaptor_Curve& Curve();
//! Sets the 3D curve to be projected.
Standard_EXPORT void Curve (const TopoDS_Edge& E);
Standard_EXPORT void Curve(const TopoDS_Edge& E);
//! Returns the 3D curve.
const BRepAdaptor_Curve& GetCurve() const;
const BRepAdaptor_Curve& GetCurve() const;
//! Returns the parameter on the 2d curve from the
//! parameter on the 3d curve.
Standard_EXPORT Standard_Real Parameter2d (const Standard_Real P3d) const;
Standard_EXPORT Standard_Real Parameter2d(const Standard_Real P3d) const;
//! Returns the parameter on the 3d curve from the
//! parameter on the 2d curve.
Standard_EXPORT Standard_Real Parameter3d (const Standard_Real P2d) const;
Standard_EXPORT Standard_Real Parameter3d(const Standard_Real P2d) const;
//! Update the minmax and the internal data
Standard_EXPORT Standard_Real Update (Standard_Real TotMin[16], Standard_Real TotMax[16]);
Standard_EXPORT Standard_Real Update(Standard_Real TotMin[16], Standard_Real TotMax[16]);
//! Update the minmax returns tol for enlarge;
Standard_EXPORT Standard_Real UpdateMinMax (Standard_Real TotMin[16], Standard_Real TotMax[16]);
Standard_EXPORT Standard_Real UpdateMinMax(Standard_Real TotMin[16], Standard_Real TotMax[16]);
//! Computes the Z coordinate of the point of
//! parameter U on the curve in the viewing coordinate system
Standard_EXPORT Standard_Real Z (const Standard_Real U) const;
Standard_EXPORT Standard_Real Z(const Standard_Real U) const;
//! Computes the 3D point of parameter U on the
//! curve.
gp_Pnt Value3D (const Standard_Real U) const;
gp_Pnt Value3D(const Standard_Real U) const;
//! Computes the 3D point of parameter U on the
//! curve.
void D0 (const Standard_Real U, gp_Pnt& P) const;
void D0(const Standard_Real U, gp_Pnt& P) const;
//! Computes the point of parameter U on the curve
//! with its first derivative.
void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V) const;
void D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const;
//! Depending on <AtStart> computes the 2D point and
//! tangent on the curve at sart (or at end). If the first
//! derivative is null look after at start (or before at end)
//! with the second derivative.
Standard_EXPORT void Tangent (const Standard_Boolean AtStart, gp_Pnt2d& P, gp_Dir2d& D) const;
Standard_Real FirstParameter() const;
Standard_Real LastParameter() const;
GeomAbs_Shape Continuity() const;
Standard_EXPORT void Tangent(const Standard_Boolean AtStart, gp_Pnt2d& P, gp_Dir2d& D) const;
Standard_Real FirstParameter() const;
Standard_Real LastParameter() const;
GeomAbs_Shape Continuity() const;
//! If necessary, breaks the curve in intervals of
//! continuity <S>. And returns the number of
//! intervals.
Standard_Integer NbIntervals (const GeomAbs_Shape S) const;
Standard_Integer NbIntervals(const GeomAbs_Shape S) const;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
Standard_Boolean IsClosed() const;
Standard_Boolean IsPeriodic() const;
Standard_Real Period() const;
void Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const;
Standard_Boolean IsClosed() const;
Standard_Boolean IsPeriodic() const;
Standard_Real Period() const;
//! Computes the point of parameter U on the curve.
gp_Pnt2d Value (const Standard_Real U) const;
gp_Pnt2d Value(const Standard_Real U) const;
//! Computes the point of parameter U on the curve.
Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const;
Standard_EXPORT void D0(const Standard_Real U, gp_Pnt2d& P) const;
//! Computes the point of parameter U on the curve
//! with its first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const;
Standard_EXPORT void D1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const;
//! Raised if the continuity of the current interval
//! is not C2.
Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
Standard_EXPORT void D2(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
Standard_EXPORT void D3(const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3) const;
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const;
Standard_EXPORT gp_Vec2d DN(const Standard_Real U, const Standard_Integer N) const;
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
Standard_Real Resolution (const Standard_Real R3d) const;
Standard_Real Resolution(const Standard_Real R3d) const;
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
GeomAbs_CurveType GetType() const;
GeomAbs_CurveType GetType() const;
Standard_EXPORT gp_Lin2d Line() const;
Standard_EXPORT gp_Circ2d Circle() const;
Standard_EXPORT gp_Elips2d Ellipse() const;
Standard_EXPORT gp_Hypr2d Hyperbola() const;
Standard_EXPORT gp_Parab2d Parabola() const;
Standard_Boolean IsRational() const;
Standard_Integer Degree() const;
Standard_Integer NbPoles() const;
Standard_EXPORT void Poles (TColgp_Array1OfPnt2d& TP) const;
Standard_EXPORT void Poles (const Handle(Geom_BSplineCurve)& aCurve, TColgp_Array1OfPnt2d& TP) const;
Standard_EXPORT void PolesAndWeights (TColgp_Array1OfPnt2d& TP, TColStd_Array1OfReal& TW) const;
Standard_EXPORT void PolesAndWeights (const Handle(Geom_BSplineCurve)& aCurve, TColgp_Array1OfPnt2d& TP, TColStd_Array1OfReal& TW) const;
Standard_Integer NbKnots() const;
Standard_EXPORT void Knots (TColStd_Array1OfReal& kn) const;
Standard_EXPORT void Multiplicities (TColStd_Array1OfInteger& mu) const;
Standard_Boolean IsRational() const;
Standard_Integer Degree() const;
Standard_Integer NbPoles() const;
Standard_EXPORT void Poles(TColgp_Array1OfPnt2d& TP) const;
Standard_EXPORT void Poles(const Handle(Geom_BSplineCurve)& aCurve,
TColgp_Array1OfPnt2d& TP) const;
Standard_EXPORT void PolesAndWeights(TColgp_Array1OfPnt2d& TP, TColStd_Array1OfReal& TW) const;
Standard_EXPORT void PolesAndWeights(const Handle(Geom_BSplineCurve)& aCurve,
TColgp_Array1OfPnt2d& TP,
TColStd_Array1OfReal& TW) const;
Standard_Integer NbKnots() const;
Standard_EXPORT void Knots(TColStd_Array1OfReal& kn) const;
Standard_EXPORT void Multiplicities(TColStd_Array1OfInteger& mu) const;
protected:
private:
BRepAdaptor_Curve myCurve;
GeomAbs_CurveType myType;
BRepAdaptor_Curve myCurve;
GeomAbs_CurveType myType;
const HLRAlgo_Projector* myProj;
Standard_Real myOX;
Standard_Real myOZ;
Standard_Real myVX;
Standard_Real myVZ;
Standard_Real myOF;
Standard_Real myOX;
Standard_Real myOZ;
Standard_Real myVX;
Standard_Real myVZ;
Standard_Real myOF;
};
#include <HLRBRep_Curve.lxx>
#endif // _HLRBRep_Curve_HeaderFile

View File

@@ -25,176 +25,202 @@
#include <HLRBRep_BCurveTool.hxx>
//=======================================================================
//function : Curve
//purpose :
// function : Curve
// purpose :
//=======================================================================
inline BRepAdaptor_Curve& HLRBRep_Curve::Curve()
{ return myCurve; }
{
return myCurve;
}
//=======================================================================
//function : GetCurve
//purpose :
// function : GetCurve
// purpose :
//=======================================================================
inline const BRepAdaptor_Curve& HLRBRep_Curve::GetCurve() const
{ return myCurve; }
{
return myCurve;
}
//=======================================================================
//function : Value3D
//purpose :
// function : Value3D
// purpose :
//=======================================================================
inline gp_Pnt HLRBRep_Curve::Value3D(const Standard_Real U) const
inline gp_Pnt HLRBRep_Curve::Value3D(const Standard_Real U) const
{
gp_Pnt P;
D0(U,P);
D0(U, P);
return P;
}
//=======================================================================
//function : D0
//purpose :
// function : D0
// purpose :
//=======================================================================
inline void HLRBRep_Curve::D0(const Standard_Real U, gp_Pnt& P) const
{ HLRBRep_BCurveTool::D0(myCurve,U,P); }
{
HLRBRep_BCurveTool::D0(myCurve, U, P);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void HLRBRep_Curve::D1(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V) const
{ HLRBRep_BCurveTool::D1(myCurve,U,P,V); }
inline void HLRBRep_Curve::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const
{
HLRBRep_BCurveTool::D1(myCurve, U, P, V);
}
//=======================================================================
//function : FirstParameter
//purpose :
// function : FirstParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Curve::FirstParameter() const
{ return Parameter2d(HLRBRep_BCurveTool::FirstParameter(myCurve)); }
inline Standard_Real HLRBRep_Curve::FirstParameter() const
{
return Parameter2d(HLRBRep_BCurveTool::FirstParameter(myCurve));
}
//=======================================================================
//function : LastParameter
//purpose :
// function : LastParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Curve::LastParameter() const
{ return Parameter2d(HLRBRep_BCurveTool::LastParameter(myCurve)); }
inline Standard_Real HLRBRep_Curve::LastParameter() const
{
return Parameter2d(HLRBRep_BCurveTool::LastParameter(myCurve));
}
//=======================================================================
//function : Continuity
//purpose :
// function : Continuity
// purpose :
//=======================================================================
inline GeomAbs_Shape HLRBRep_Curve::Continuity() const
{ return HLRBRep_BCurveTool::Continuity(myCurve); }
inline GeomAbs_Shape HLRBRep_Curve::Continuity() const
{
return HLRBRep_BCurveTool::Continuity(myCurve);
}
//=======================================================================
//function : NbIntervals
//purpose :
// function : NbIntervals
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Curve::NbIntervals (const GeomAbs_Shape S) const
{ return HLRBRep_BCurveTool::NbIntervals(myCurve,S); }
inline Standard_Integer HLRBRep_Curve::NbIntervals(const GeomAbs_Shape S) const
{
return HLRBRep_BCurveTool::NbIntervals(myCurve, S);
}
//=======================================================================
//function : Intervals
//purpose :
// function : Intervals
// purpose :
//=======================================================================
inline void HLRBRep_Curve::Intervals(TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh) const
{ HLRBRep_BCurveTool::Intervals(myCurve,Tab,Sh); }
inline void HLRBRep_Curve::Intervals(TColStd_Array1OfReal& Tab, const GeomAbs_Shape Sh) const
{
HLRBRep_BCurveTool::Intervals(myCurve, Tab, Sh);
}
//=======================================================================
//function : IsClosed
//purpose :
// function : IsClosed
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Curve::IsClosed()const
{ return HLRBRep_BCurveTool::IsClosed(myCurve); }
inline Standard_Boolean HLRBRep_Curve::IsClosed() const
{
return HLRBRep_BCurveTool::IsClosed(myCurve);
}
//=======================================================================
//function : IsPeriodic
//purpose :
// function : IsPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Curve::IsPeriodic()const
{ return HLRBRep_BCurveTool::IsPeriodic(myCurve); }
inline Standard_Boolean HLRBRep_Curve::IsPeriodic() const
{
return HLRBRep_BCurveTool::IsPeriodic(myCurve);
}
//=======================================================================
//function : Period
//purpose :
// function : Period
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Curve::Period()const
{ return HLRBRep_BCurveTool::Period(myCurve); }
inline Standard_Real HLRBRep_Curve::Period() const
{
return HLRBRep_BCurveTool::Period(myCurve);
}
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline gp_Pnt2d HLRBRep_Curve::Value
(const Standard_Real U) const
inline gp_Pnt2d HLRBRep_Curve::Value(const Standard_Real U) const
{
gp_Pnt2d P;
D0(U,P);
D0(U, P);
return P;
}
//=======================================================================
//function : Resolution
//purpose :
// function : Resolution
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Curve::Resolution
(const Standard_Real R3d) const
{ return HLRBRep_BCurveTool::Resolution(myCurve,R3d); }
inline Standard_Real HLRBRep_Curve::Resolution(const Standard_Real R3d) const
{
return HLRBRep_BCurveTool::Resolution(myCurve, R3d);
}
//=======================================================================
//function : GetType
//purpose :
// function : GetType
// purpose :
//=======================================================================
inline GeomAbs_CurveType HLRBRep_Curve::GetType() const
{ return myType; }
inline GeomAbs_CurveType HLRBRep_Curve::GetType() const
{
return myType;
}
//=======================================================================
//function : Degree
//purpose :
// function : Degree
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Curve::Degree() const
{ return HLRBRep_BCurveTool::Degree(myCurve); }
inline Standard_Integer HLRBRep_Curve::Degree() const
{
return HLRBRep_BCurveTool::Degree(myCurve);
}
//=======================================================================
//function : NbPoles
//purpose :
// function : NbPoles
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Curve::NbPoles() const
{ return HLRBRep_BCurveTool::NbPoles(myCurve); }
inline Standard_Integer HLRBRep_Curve::NbPoles() const
{
return HLRBRep_BCurveTool::NbPoles(myCurve);
}
//=======================================================================
//function : NbKnots
//purpose :
// function : NbKnots
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Curve::NbKnots() const
{ return HLRBRep_BCurveTool::NbKnots(myCurve); }
inline Standard_Integer HLRBRep_Curve::NbKnots() const
{
return HLRBRep_BCurveTool::NbKnots(myCurve);
}
//=======================================================================
//function : IsRational
//purpose :
// function : IsRational
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Curve::IsRational() const

View File

@@ -14,60 +14,56 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <HLRBRep_CurveTool.hxx>
//=======================================================================
//function : NbSamples
//purpose :
//=======================================================================
Standard_Integer
HLRBRep_CurveTool::NbSamples (const Standard_Address C)
{
GeomAbs_CurveType typC = ((HLRBRep_Curve *)C)->GetType();
//=================================================================================================
Standard_Integer HLRBRep_CurveTool::NbSamples(const Standard_Address C)
{
GeomAbs_CurveType typC = ((HLRBRep_Curve*)C)->GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
Standard_Real nbs = nbsOther;
if (typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + ((HLRBRep_Curve *)C)->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
nbs = ((HLRBRep_Curve *)C)->NbKnots();
nbs*= ((HLRBRep_Curve *)C)->Degree();
if(nbs < 2.0) nbs=2;
else if (typC == GeomAbs_BezierCurve)
nbs = 3 + ((HLRBRep_Curve*)C)->NbPoles();
else if (typC == GeomAbs_BSplineCurve)
{
nbs = ((HLRBRep_Curve*)C)->NbKnots();
nbs *= ((HLRBRep_Curve*)C)->Degree();
if (nbs < 2.0)
nbs = 2;
}
if(nbs>50)
if (nbs > 50)
nbs = 50;
return((Standard_Integer)nbs);
return ((Standard_Integer)nbs);
}
//=======================================================================
//function : NbSamples
//purpose :
//=======================================================================
//=================================================================================================
Standard_Integer
HLRBRep_CurveTool::NbSamples (const Standard_Address C,
const Standard_Real u1,
const Standard_Real u2)
{
GeomAbs_CurveType typC = ((HLRBRep_Curve *)C)->GetType();
Standard_Integer HLRBRep_CurveTool::NbSamples(const Standard_Address C,
const Standard_Real u1,
const Standard_Real u2)
{
GeomAbs_CurveType typC = ((HLRBRep_Curve*)C)->GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
Standard_Real nbs = nbsOther;
if (typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + ((HLRBRep_Curve *)C)->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Handle(Geom_Curve) aCurve = ((HLRBRep_Curve *)C)->Curve().Curve().Curve();
GeomAdaptor_Curve GAcurve(aCurve, u1, u2);
else if (typC == GeomAbs_BezierCurve)
nbs = 3 + ((HLRBRep_Curve*)C)->NbPoles();
else if (typC == GeomAbs_BSplineCurve)
{
Handle(Geom_Curve) aCurve = ((HLRBRep_Curve*)C)->Curve().Curve().Curve();
GeomAdaptor_Curve GAcurve(aCurve, u1, u2);
nbs = GAcurve.NbIntervals(GeomAbs_CN) + 1;
nbs*= ((HLRBRep_Curve *)C)->Degree();
if(nbs < 2.0) nbs=2;
nbs *= ((HLRBRep_Curve*)C)->Degree();
if (nbs < 2.0)
nbs = 2;
}
if(nbs>50)
if (nbs > 50)
nbs = 50;
return((Standard_Integer)nbs);
return ((Standard_Integer)nbs);
}

View File

@@ -37,134 +37,124 @@ class gp_Vec2d;
class Geom2d_BezierCurve;
class Geom2d_BSplineCurve;
class HLRBRep_CurveTool
class HLRBRep_CurveTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstParameter (const Standard_Address C);
static Standard_Real LastParameter (const Standard_Address C);
static GeomAbs_Shape Continuity (const Standard_Address C);
static Standard_Real FirstParameter(const Standard_Address C);
static Standard_Real LastParameter(const Standard_Address C);
static GeomAbs_Shape Continuity(const Standard_Address C);
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(myclass) >= <S>
static Standard_Integer NbIntervals (const Standard_Address C);
static Standard_Integer NbIntervals(const Standard_Address C);
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
static void Intervals (const Standard_Address C, TColStd_Array1OfReal& T);
static void Intervals(const Standard_Address C, TColStd_Array1OfReal& T);
//! output the bounds of interval of index <Index>
//! used if Type == Composite.
static void GetInterval (const Standard_Address C, const Standard_Integer Index, const TColStd_Array1OfReal& Tab, Standard_Real& U1, Standard_Real& U2);
static Standard_Boolean IsClosed (const Standard_Address C);
static Standard_Boolean IsPeriodic (const Standard_Address C);
static Standard_Real Period (const Standard_Address C);
static void GetInterval(const Standard_Address C,
const Standard_Integer Index,
const TColStd_Array1OfReal& Tab,
Standard_Real& U1,
Standard_Real& U2);
static Standard_Boolean IsClosed(const Standard_Address C);
static Standard_Boolean IsPeriodic(const Standard_Address C);
static Standard_Real Period(const Standard_Address C);
//! Computes the point of parameter U on the curve.
static gp_Pnt2d Value (const Standard_Address C, const Standard_Real U);
static gp_Pnt2d Value(const Standard_Address C, const Standard_Real U);
//! Computes the point of parameter U on the curve.
static void D0 (const Standard_Address C, const Standard_Real U, gp_Pnt2d& P);
static void D0(const Standard_Address C, const Standard_Real U, gp_Pnt2d& P);
//! Computes the point of parameter U on the curve
//! with its first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
static void D1 (const Standard_Address C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V);
static void D1(const Standard_Address C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V);
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
static void D2 (const Standard_Address C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
static void D2(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2);
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
static void D3 (const Standard_Address C, const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
static void D3(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3);
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
static gp_Vec2d DN (const Standard_Address C, const Standard_Real U, const Standard_Integer N);
static gp_Vec2d DN(const Standard_Address C, const Standard_Real U, const Standard_Integer N);
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
static Standard_Real Resolution (const Standard_Address C, const Standard_Real R3d);
static Standard_Real Resolution(const Standard_Address C, const Standard_Real R3d);
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
static GeomAbs_CurveType GetType (const Standard_Address C);
static GeomAbs_CurveType GetType(const Standard_Address C);
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
static GeomAbs_CurveType TheType (const Standard_Address C);
static gp_Lin2d Line (const Standard_Address C);
static gp_Circ2d Circle (const Standard_Address C);
static gp_Elips2d Ellipse (const Standard_Address C);
static gp_Hypr2d Hyperbola (const Standard_Address C);
static gp_Parab2d Parabola (const Standard_Address C);
static Handle(Geom2d_BezierCurve) Bezier (const Standard_Address C);
static Handle(Geom2d_BSplineCurve) BSpline (const Standard_Address C);
static Standard_Real EpsX (const Standard_Address C);
Standard_EXPORT static Standard_Integer NbSamples (const Standard_Address C, const Standard_Real U0, const Standard_Real U1);
Standard_EXPORT static Standard_Integer NbSamples (const Standard_Address C);
static Standard_Integer Degree (const Standard_Address C);
static GeomAbs_CurveType TheType(const Standard_Address C);
static gp_Lin2d Line(const Standard_Address C);
static gp_Circ2d Circle(const Standard_Address C);
static gp_Elips2d Ellipse(const Standard_Address C);
static gp_Hypr2d Hyperbola(const Standard_Address C);
static gp_Parab2d Parabola(const Standard_Address C);
static Handle(Geom2d_BezierCurve) Bezier(const Standard_Address C);
static Handle(Geom2d_BSplineCurve) BSpline(const Standard_Address C);
static Standard_Real EpsX(const Standard_Address C);
Standard_EXPORT static Standard_Integer NbSamples(const Standard_Address C,
const Standard_Real U0,
const Standard_Real U1);
Standard_EXPORT static Standard_Integer NbSamples(const Standard_Address C);
static Standard_Integer Degree(const Standard_Address C);
protected:
private:
};
#include <HLRBRep_CurveTool.lxx>
#endif // _HLRBRep_CurveTool_HeaderFile

View File

@@ -27,300 +27,310 @@
#include <Geom2d_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
#define IS_C2_COMPOSITE 0
#define IS_C2_COMPOSITE 0
//=======================================================================
//function : FirstParameter
//purpose :
// function : FirstParameter
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_CurveTool::FirstParameter (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->FirstParameter()); }
//=======================================================================
//function : LastParameter
//purpose :
//=======================================================================
inline Standard_Real
HLRBRep_CurveTool::LastParameter (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->LastParameter()); }
//=======================================================================
//function : Continuity
//purpose :
//=======================================================================
inline GeomAbs_Shape
HLRBRep_CurveTool::Continuity (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Continuity()); }
//=======================================================================
//function : NbIntervals
//purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_CurveTool::NbIntervals(const Standard_Address C)
inline Standard_Real HLRBRep_CurveTool::FirstParameter(const Standard_Address C)
{
#if IS_C2_COMPOSITE
return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C2));
#else
return(((HLRBRep_Curve *)C)->NbIntervals(GeomAbs_C1));
#endif
return (((HLRBRep_Curve*)C)->FirstParameter());
}
//=======================================================================
//function : Intervals
//purpose :
// function : LastParameter
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::Intervals(const Standard_Address C,
TColStd_Array1OfReal& Tab)
{
inline Standard_Real HLRBRep_CurveTool::LastParameter(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->LastParameter());
}
//=======================================================================
// function : Continuity
// purpose :
//=======================================================================
inline GeomAbs_Shape HLRBRep_CurveTool::Continuity(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Continuity());
}
//=======================================================================
// function : NbIntervals
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_CurveTool::NbIntervals(const Standard_Address C)
{
#if IS_C2_COMPOSITE
((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C2);
#else
((HLRBRep_Curve *)C)->Intervals(Tab,GeomAbs_C1);
return (((HLRBRep_Curve*)C)->NbIntervals(GeomAbs_C2));
#else
return (((HLRBRep_Curve*)C)->NbIntervals(GeomAbs_C1));
#endif
}
//=======================================================================
//function : GetInterval
//purpose :
// function : Intervals
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::GetInterval(const Standard_Address /*C*/,
const Standard_Integer i,
const TColStd_Array1OfReal& Tab,
Standard_Real& a,
Standard_Real& b)
inline void HLRBRep_CurveTool::Intervals(const Standard_Address C, TColStd_Array1OfReal& Tab)
{
#if IS_C2_COMPOSITE
((HLRBRep_Curve*)C)->Intervals(Tab, GeomAbs_C2);
#else
((HLRBRep_Curve*)C)->Intervals(Tab, GeomAbs_C1);
#endif
}
//=======================================================================
// function : GetInterval
// purpose :
//=======================================================================
inline void HLRBRep_CurveTool::GetInterval(const Standard_Address /*C*/,
const Standard_Integer i,
const TColStd_Array1OfReal& Tab,
Standard_Real& a,
Standard_Real& b)
{
a = Tab.Value(i);
b = Tab.Value(i+1);
b = Tab.Value(i + 1);
}
//=======================================================================
//function : IsClosed
//purpose :
// function : IsClosed
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_CurveTool::IsClosed(const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->IsClosed()); }
inline Standard_Boolean HLRBRep_CurveTool::IsClosed(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->IsClosed());
}
//=======================================================================
//function : IsPeriodic
//purpose :
// function : IsPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_CurveTool::IsPeriodic(const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->IsPeriodic()); }
inline Standard_Boolean HLRBRep_CurveTool::IsPeriodic(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->IsPeriodic());
}
//=======================================================================
//function : Period
//purpose :
// function : Period
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_CurveTool::Period(const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Period()); }
inline Standard_Real HLRBRep_CurveTool::Period(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Period());
}
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline gp_Pnt2d
HLRBRep_CurveTool::Value (const Standard_Address C,
const Standard_Real U)
{ return(((HLRBRep_Curve *)C)->Value(U)); }
inline gp_Pnt2d HLRBRep_CurveTool::Value(const Standard_Address C, const Standard_Real U)
{
return (((HLRBRep_Curve*)C)->Value(U));
}
//=======================================================================
//function : D0
//purpose :
// function : D0
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::D0(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P)
{ ((HLRBRep_Curve *)C)->D0(U,P); }
inline void HLRBRep_CurveTool::D0(const Standard_Address C, const Standard_Real U, gp_Pnt2d& P)
{
((HLRBRep_Curve*)C)->D0(U, P);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::D1 (const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T)
{ ((HLRBRep_Curve *)C)->D1(U,P,T); }
inline void HLRBRep_CurveTool::D1(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T)
{
((HLRBRep_Curve*)C)->D1(U, P, T);
}
//=======================================================================
//function : D2
//purpose :
// function : D2
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::D2 (const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T,
gp_Vec2d& N)
{ ((HLRBRep_Curve *)C)->D2(U,P,T,N); }
inline void HLRBRep_CurveTool::D2(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T,
gp_Vec2d& N)
{
((HLRBRep_Curve*)C)->D2(U, P, T, N);
}
//=======================================================================
//function : D3
//purpose :
// function : D3
// purpose :
//=======================================================================
inline void
HLRBRep_CurveTool::D3 (const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{ ((HLRBRep_Curve *)C)->D3(U,P,V1,V2,V3); }
inline void HLRBRep_CurveTool::D3(const Standard_Address C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{
((HLRBRep_Curve*)C)->D3(U, P, V1, V2, V3);
}
//=======================================================================
//function : DN
//purpose :
// function : DN
// purpose :
//=======================================================================
inline gp_Vec2d
HLRBRep_CurveTool::DN (const Standard_Address C,
const Standard_Real U,
const Standard_Integer N)
{ return(((HLRBRep_Curve *)C)->DN(U,N)); }
inline gp_Vec2d HLRBRep_CurveTool::DN(const Standard_Address C,
const Standard_Real U,
const Standard_Integer N)
{
return (((HLRBRep_Curve*)C)->DN(U, N));
}
//=======================================================================
//function : Resolution
//purpose :
// function : Resolution
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_CurveTool::Resolution(const Standard_Address C,
const Standard_Real R3d)
{ return(((HLRBRep_Curve *)C)->Resolution(R3d)); }
inline Standard_Real HLRBRep_CurveTool::Resolution(const Standard_Address C,
const Standard_Real R3d)
{
return (((HLRBRep_Curve*)C)->Resolution(R3d));
}
//=======================================================================
//function : GetType
//purpose :
// function : GetType
// purpose :
//=======================================================================
inline GeomAbs_CurveType
HLRBRep_CurveTool::GetType(const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->GetType()); }
inline GeomAbs_CurveType HLRBRep_CurveTool::GetType(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->GetType());
}
//=======================================================================
//function : TheType
//purpose :
// function : TheType
// purpose :
//=======================================================================
inline GeomAbs_CurveType
HLRBRep_CurveTool::TheType(const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->GetType()); }
inline GeomAbs_CurveType HLRBRep_CurveTool::TheType(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->GetType());
}
//=======================================================================
//function : Line
//purpose :
// function : Line
// purpose :
//=======================================================================
inline gp_Lin2d
HLRBRep_CurveTool::Line (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Line()); }
inline gp_Lin2d HLRBRep_CurveTool::Line(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Line());
}
//=======================================================================
//function : Circle
//purpose :
// function : Circle
// purpose :
//=======================================================================
inline gp_Circ2d
HLRBRep_CurveTool::Circle (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Circle()); }
inline gp_Circ2d HLRBRep_CurveTool::Circle(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Circle());
}
//=======================================================================
//function : Ellipse
//purpose :
// function : Ellipse
// purpose :
//=======================================================================
inline gp_Elips2d
HLRBRep_CurveTool::Ellipse (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Ellipse()); }
inline gp_Elips2d HLRBRep_CurveTool::Ellipse(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Ellipse());
}
//=======================================================================
//function : Parabola
//purpose :
// function : Parabola
// purpose :
//=======================================================================
inline gp_Parab2d
HLRBRep_CurveTool::Parabola (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Parabola()); }
inline gp_Parab2d HLRBRep_CurveTool::Parabola(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Parabola());
}
//=======================================================================
//function : Hyperbola
//purpose :
// function : Hyperbola
// purpose :
//=======================================================================
inline gp_Hypr2d
HLRBRep_CurveTool::Hyperbola (const Standard_Address C)
{ return(((HLRBRep_Curve *)C)->Hyperbola()); }
inline gp_Hypr2d HLRBRep_CurveTool::Hyperbola(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Hyperbola());
}
//=======================================================================
//function : Bezier
//purpose :
// function : Bezier
// purpose :
//=======================================================================
inline Handle(Geom2d_BezierCurve)
HLRBRep_CurveTool::Bezier (const Standard_Address /*C*/)
inline Handle(Geom2d_BezierCurve) HLRBRep_CurveTool::Bezier(const Standard_Address /*C*/)
{
#ifdef OCCT_DEBUG
std::cout<<" HLRBRep_CurveTool::Bezier : Not Implemented "<<std::endl;
std::cout << " HLRBRep_CurveTool::Bezier : Not Implemented " << std::endl;
#endif
//-- return(((HLRBRep_Curve *)C)->Bezier());
return(0);
return (0);
}
//=======================================================================
//function : BSpline
//purpose :
// function : BSpline
// purpose :
//=======================================================================
inline Handle(Geom2d_BSplineCurve)
HLRBRep_CurveTool::BSpline (const Standard_Address /*C*/)
inline Handle(Geom2d_BSplineCurve) HLRBRep_CurveTool::BSpline(const Standard_Address /*C*/)
{
#ifdef OCCT_DEBUG
std::cout<<" HLRBRep_CurveTool::BSpline : Not Implemented "<<std::endl;
std::cout << " HLRBRep_CurveTool::BSpline : Not Implemented " << std::endl;
#endif
//-- return(((HLRBRep_Curve *)C)->BSpline());
return(0);
return (0);
}
//=======================================================================
//function : EpsX
//purpose :
// function : EpsX
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_CurveTool::EpsX(const Standard_Address /*C*/)
{ return(1e-10); }
//=======================================================================
//function : Degree
//purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_CurveTool::Degree (const Standard_Address C)
inline Standard_Real HLRBRep_CurveTool::EpsX(const Standard_Address /*C*/)
{
return(((HLRBRep_Curve *)C)->Degree());
return (1e-10);
}
//=======================================================================
// function : Degree
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_CurveTool::Degree(const Standard_Address C)
{
return (((HLRBRep_Curve*)C)->Degree());
}

File diff suppressed because it is too large Load Diff

View File

@@ -55,212 +55,235 @@ class HLRBRep_Data : public Standard_Transient
{
public:
//! Create an empty data structure of <NV> vertices,
//! <NE> edges and <NF> faces.
Standard_EXPORT HLRBRep_Data(const Standard_Integer NV, const Standard_Integer NE, const Standard_Integer NF);
Standard_EXPORT HLRBRep_Data(const Standard_Integer NV,
const Standard_Integer NE,
const Standard_Integer NF);
//! Write <DS> in me with a translation of
//! <dv>,<de>,<df>.
Standard_EXPORT void Write (const Handle(HLRBRep_Data)& DS, const Standard_Integer dv, const Standard_Integer de, const Standard_Integer df);
HLRBRep_Array1OfEData& EDataArray();
HLRBRep_Array1OfFData& FDataArray();
Standard_EXPORT void Write(const Handle(HLRBRep_Data)& DS,
const Standard_Integer dv,
const Standard_Integer de,
const Standard_Integer df);
HLRBRep_Array1OfEData& EDataArray();
HLRBRep_Array1OfFData& FDataArray();
//! Set the tolerance for the rejections during the
//! exploration
void Tolerance (const Standard_ShortReal tol);
void Tolerance(const Standard_ShortReal tol);
//! returns the tolerance for the rejections during
//! the exploration
Standard_ShortReal Tolerance() const;
Standard_ShortReal Tolerance() const;
//! end of building of the Data and updating
//! all the information linked to the projection.
Standard_EXPORT void Update (const HLRAlgo_Projector& P);
HLRAlgo_Projector& Projector();
Standard_Integer NbVertices() const;
Standard_Integer NbEdges() const;
Standard_Integer NbFaces() const;
TopTools_IndexedMapOfShape& EdgeMap();
TopTools_IndexedMapOfShape& FaceMap();
Standard_EXPORT void Update(const HLRAlgo_Projector& P);
HLRAlgo_Projector& Projector();
Standard_Integer NbVertices() const;
Standard_Integer NbEdges() const;
Standard_Integer NbFaces() const;
TopTools_IndexedMapOfShape& EdgeMap();
TopTools_IndexedMapOfShape& FaceMap();
//! to compare with only non rejected edges.
Standard_EXPORT void InitBoundSort (const HLRAlgo_EdgesBlock::MinMaxIndices& MinMaxTot, const Standard_Integer e1, const Standard_Integer e2);
Standard_EXPORT void InitBoundSort(const HLRAlgo_EdgesBlock::MinMaxIndices& MinMaxTot,
const Standard_Integer e1,
const Standard_Integer e2);
//! Begin an iteration only on visible Edges
//! crossing the face number <FI>.
Standard_EXPORT void InitEdge (const Standard_Integer FI, BRepTopAdaptor_MapOfShapeTool& MST);
Standard_EXPORT void InitEdge(const Standard_Integer FI, BRepTopAdaptor_MapOfShapeTool& MST);
Standard_EXPORT Standard_Boolean MoreEdge();
Standard_EXPORT void NextEdge (const Standard_Boolean skip = Standard_True);
Standard_EXPORT void NextEdge(const Standard_Boolean skip = Standard_True);
//! Returns the current Edge
Standard_EXPORT Standard_Integer Edge() const;
//! Returns true if the current edge to be hidden
//! belongs to the hiding face.
Standard_Boolean HidingTheFace() const;
Standard_Boolean HidingTheFace() const;
//! Returns true if the current hiding face is not an
//! auto-intersected one.
Standard_Boolean SimpleHidingFace() const;
Standard_Boolean SimpleHidingFace() const;
//! Intersect the current Edge with the boundary of
//! the hiding face. The interferences are given by
//! the More, Next, and Value methods.
Standard_EXPORT void InitInterference();
Standard_Boolean MoreInterference() const;
Standard_Boolean MoreInterference() const;
Standard_EXPORT void NextInterference();
//! Returns True if the interference is rejected.
Standard_EXPORT Standard_Boolean RejectedInterference();
//! Returns True if the rejected interference is above
//! the face.
Standard_EXPORT Standard_Boolean AboveInterference();
HLRAlgo_Interference& Interference();
HLRAlgo_Interference& Interference();
//! Returns the local description of the projection of
//! the current LEdge at parameter <Param>.
Standard_EXPORT void LocalLEGeometry2D (const Standard_Real Param, gp_Dir2d& Tg, gp_Dir2d& Nm, Standard_Real& Cu);
Standard_EXPORT void LocalLEGeometry2D(const Standard_Real Param,
gp_Dir2d& Tg,
gp_Dir2d& Nm,
Standard_Real& Cu);
//! Returns the local description of the projection of
//! the current FEdge at parameter <Param>.
Standard_EXPORT void LocalFEGeometry2D (const Standard_Integer FE, const Standard_Real Param, gp_Dir2d& Tg, gp_Dir2d& Nm, Standard_Real& Cu);
Standard_EXPORT void LocalFEGeometry2D(const Standard_Integer FE,
const Standard_Real Param,
gp_Dir2d& Tg,
gp_Dir2d& Nm,
Standard_Real& Cu);
//! Returns the local 3D state of the intersection
//! between the current edge and the current face at the
//! <p1> and <p2> parameters.
Standard_EXPORT void EdgeState (const Standard_Real p1, const Standard_Real p2, TopAbs_State& stbef, TopAbs_State& staf);
Standard_EXPORT void EdgeState(const Standard_Real p1,
const Standard_Real p2,
TopAbs_State& stbef,
TopAbs_State& staf);
//! Returns the true if the Edge <ED> belongs to the
//! Hiding Face.
Standard_Boolean EdgeOfTheHidingFace (const Standard_Integer E, const HLRBRep_EdgeData& ED) const;
Standard_Boolean EdgeOfTheHidingFace(const Standard_Integer E, const HLRBRep_EdgeData& ED) const;
//! Returns the number of levels of hiding face above
//! the first point of the edge <ED>. The
//! InterferenceList is given to compute far away of
//! the Interferences and then come back.
Standard_EXPORT Standard_Integer HidingStartLevel (const Standard_Integer E, const HLRBRep_EdgeData& ED, const HLRAlgo_InterferenceList& IL);
Standard_EXPORT Standard_Integer HidingStartLevel(const Standard_Integer E,
const HLRBRep_EdgeData& ED,
const HLRAlgo_InterferenceList& IL);
//! Returns the state of the Edge <ED> after
//! classification.
Standard_EXPORT TopAbs_State Compare (const Standard_Integer E, const HLRBRep_EdgeData& ED);
Standard_EXPORT TopAbs_State Compare(const Standard_Integer E, const HLRBRep_EdgeData& ED);
//! Simple classification of part of edge [p1, p2].
//! Returns OUT if at least 1 of Nbp points of edge is out; otherwise returns IN.
//! It is used to check "suspicion" hidden part of edge.
Standard_EXPORT TopAbs_State SimplClassify (const Standard_Integer E, const HLRBRep_EdgeData& ED, const Standard_Integer Nbp, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT TopAbs_State SimplClassify(const Standard_Integer E,
const HLRBRep_EdgeData& ED,
const Standard_Integer Nbp,
const Standard_Real p1,
const Standard_Real p2);
//! Classification of an edge.
Standard_EXPORT TopAbs_State Classify (const Standard_Integer E, const HLRBRep_EdgeData& ED, const Standard_Boolean LevelFlag, Standard_Integer& Level, const Standard_Real param);
Standard_EXPORT TopAbs_State Classify(const Standard_Integer E,
const HLRBRep_EdgeData& ED,
const Standard_Boolean LevelFlag,
Standard_Integer& Level,
const Standard_Real param);
//! Returns true if the current face is bad.
Standard_EXPORT Standard_Boolean IsBadFace() const;
Standard_EXPORT void Destroy();
~HLRBRep_Data()
{
Destroy();
}
DEFINE_STANDARD_RTTIEXT(HLRBRep_Data,Standard_Transient)
~HLRBRep_Data() { Destroy(); }
DEFINE_STANDARD_RTTIEXT(HLRBRep_Data, Standard_Transient)
private:
//! Orient the OutLines ( left must be inside in
//! projection ). Returns True if the face of a closed
//! shell has been inverted;
Standard_EXPORT Standard_Boolean OrientOutLine (const Standard_Integer I, HLRBRep_FaceData& FD);
Standard_EXPORT Standard_Boolean OrientOutLine(const Standard_Integer I, HLRBRep_FaceData& FD);
//! Orient the Edges which are not Internal OutLine,
//! not Double and not IsoLine.
Standard_EXPORT void OrientOthEdge (const Standard_Integer I, HLRBRep_FaceData& FD);
Standard_EXPORT void OrientOthEdge(const Standard_Integer I, HLRBRep_FaceData& FD);
//! Returns True if the intersection is rejected.
Standard_EXPORT Standard_Boolean RejectedPoint (const IntRes2d_IntersectionPoint& PInter, const TopAbs_Orientation BoundOri, const Standard_Integer NumSeg);
//! Returns True if there is a common vertex between myLE and myFE depending on <head1> and <head2>.
Standard_EXPORT Standard_Boolean SameVertex (const Standard_Boolean head1, const Standard_Boolean head2);
Standard_EXPORT Standard_Boolean RejectedPoint(const IntRes2d_IntersectionPoint& PInter,
const TopAbs_Orientation BoundOri,
const Standard_Integer NumSeg);
//! Returns True if there is a common vertex between myLE and myFE depending on <head1> and
//! <head2>.
Standard_EXPORT Standard_Boolean SameVertex(const Standard_Boolean head1,
const Standard_Boolean head2);
private:
Standard_Integer myNbVertices;
Standard_Integer myNbEdges;
Standard_Integer myNbFaces;
TopTools_IndexedMapOfShape myEMap;
TopTools_IndexedMapOfShape myFMap;
HLRBRep_Array1OfEData myEData;
HLRBRep_Array1OfFData myFData;
TColStd_Array1OfInteger myEdgeIndices;
Standard_ShortReal myToler;
HLRAlgo_Projector myProj;
HLRBRep_CLProps myLLProps;
HLRBRep_CLProps myFLProps;
HLRBRep_SLProps mySLProps;
Standard_Real myBigSize;
HLRBRep_FaceIterator myFaceItr1;
HLRBRep_FaceIterator myFaceItr2;
Standard_Integer iFace;
HLRBRep_FaceData* iFaceData;
Standard_Address iFaceGeom;
Standard_Integer myNbVertices;
Standard_Integer myNbEdges;
Standard_Integer myNbFaces;
TopTools_IndexedMapOfShape myEMap;
TopTools_IndexedMapOfShape myFMap;
HLRBRep_Array1OfEData myEData;
HLRBRep_Array1OfFData myFData;
TColStd_Array1OfInteger myEdgeIndices;
Standard_ShortReal myToler;
HLRAlgo_Projector myProj;
HLRBRep_CLProps myLLProps;
HLRBRep_CLProps myFLProps;
HLRBRep_SLProps mySLProps;
Standard_Real myBigSize;
HLRBRep_FaceIterator myFaceItr1;
HLRBRep_FaceIterator myFaceItr2;
Standard_Integer iFace;
HLRBRep_FaceData* iFaceData;
Standard_Address iFaceGeom;
HLRAlgo_EdgesBlock::MinMaxIndices* iFaceMinMax;
GeomAbs_SurfaceType iFaceType;
Standard_Boolean iFaceBack;
Standard_Boolean iFaceSimp;
Standard_Boolean iFaceSmpl;
Standard_Boolean iFaceTest;
Standard_Integer myHideCount;
Standard_Real myDeca[16];
Standard_Real mySurD[16];
Standard_Integer myCurSortEd;
Standard_Integer myNbrSortEd;
Standard_Integer myLE;
Standard_Boolean myLEOutLine;
Standard_Boolean myLEInternal;
Standard_Boolean myLEDouble;
Standard_Boolean myLEIsoLine;
HLRBRep_EdgeData* myLEData;
const HLRBRep_Curve* myLEGeom;
GeomAbs_SurfaceType iFaceType;
Standard_Boolean iFaceBack;
Standard_Boolean iFaceSimp;
Standard_Boolean iFaceSmpl;
Standard_Boolean iFaceTest;
Standard_Integer myHideCount;
Standard_Real myDeca[16];
Standard_Real mySurD[16];
Standard_Integer myCurSortEd;
Standard_Integer myNbrSortEd;
Standard_Integer myLE;
Standard_Boolean myLEOutLine;
Standard_Boolean myLEInternal;
Standard_Boolean myLEDouble;
Standard_Boolean myLEIsoLine;
HLRBRep_EdgeData* myLEData;
const HLRBRep_Curve* myLEGeom;
HLRAlgo_EdgesBlock::MinMaxIndices* myLEMinMax;
GeomAbs_CurveType myLEType;
Standard_ShortReal myLETol;
Standard_Integer myFE;
TopAbs_Orientation myFEOri;
Standard_Boolean myFEOutLine;
Standard_Boolean myFEInternal;
Standard_Boolean myFEDouble;
HLRBRep_EdgeData* myFEData;
HLRBRep_Curve* myFEGeom;
GeomAbs_CurveType myFEType;
Standard_ShortReal myFETol;
HLRBRep_Intersector myIntersector;
Handle(BRepTopAdaptor_TopolTool) myClassifier;
Standard_Boolean mySameVertex;
Standard_Boolean myIntersected;
Standard_Integer myNbPoints;
Standard_Integer myNbSegments;
Standard_Integer iInterf;
HLRAlgo_Interference myIntf;
Standard_Boolean myAboveIntf;
TableauRejection* myReject;
GeomAbs_CurveType myLEType;
Standard_ShortReal myLETol;
Standard_Integer myFE;
TopAbs_Orientation myFEOri;
Standard_Boolean myFEOutLine;
Standard_Boolean myFEInternal;
Standard_Boolean myFEDouble;
HLRBRep_EdgeData* myFEData;
HLRBRep_Curve* myFEGeom;
GeomAbs_CurveType myFEType;
Standard_ShortReal myFETol;
HLRBRep_Intersector myIntersector;
Handle(BRepTopAdaptor_TopolTool) myClassifier;
Standard_Boolean mySameVertex;
Standard_Boolean myIntersected;
Standard_Integer myNbPoints;
Standard_Integer myNbSegments;
Standard_Integer iInterf;
HLRAlgo_Interference myIntf;
Standard_Boolean myAboveIntf;
TableauRejection* myReject;
};
#include <HLRBRep_Data.lxx>
#endif // _HLRBRep_Data_HeaderFile

View File

@@ -15,123 +15,152 @@
// commercial license or contractual agreement.
//=======================================================================
//function : EDataArray
//purpose :
// function : EDataArray
// purpose :
//=======================================================================
inline HLRBRep_Array1OfEData & HLRBRep_Data::EDataArray ()
{ return myEData; }
inline HLRBRep_Array1OfEData& HLRBRep_Data::EDataArray()
{
return myEData;
}
//=======================================================================
//function : FDataArray
//purpose :
// function : FDataArray
// purpose :
//=======================================================================
inline HLRBRep_Array1OfFData & HLRBRep_Data::FDataArray ()
{ return myFData; }
inline HLRBRep_Array1OfFData& HLRBRep_Data::FDataArray()
{
return myFData;
}
//=======================================================================
//function : Tolerance
//purpose :
// function : Tolerance
// purpose :
//=======================================================================
inline void HLRBRep_Data::Tolerance (const Standard_ShortReal tol)
{ myToler = tol; }
inline void HLRBRep_Data::Tolerance(const Standard_ShortReal tol)
{
myToler = tol;
}
//=======================================================================
//function : Tolerance
//purpose :
// function : Tolerance
// purpose :
//=======================================================================
inline Standard_ShortReal HLRBRep_Data::Tolerance () const
{ return myToler; }
inline Standard_ShortReal HLRBRep_Data::Tolerance() const
{
return myToler;
}
//=======================================================================
//function : Projector
//purpose :
// function : Projector
// purpose :
//=======================================================================
inline HLRAlgo_Projector & HLRBRep_Data::Projector ()
{ return myProj; }
inline HLRAlgo_Projector& HLRBRep_Data::Projector()
{
return myProj;
}
//=======================================================================
//function : NbVertices
//purpose :
// function : NbVertices
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Data::NbVertices () const
{ return myNbVertices; }
inline Standard_Integer HLRBRep_Data::NbVertices() const
{
return myNbVertices;
}
//=======================================================================
//function : NbEdges
//purpose :
// function : NbEdges
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Data::NbEdges () const
{ return myNbEdges; }
inline Standard_Integer HLRBRep_Data::NbEdges() const
{
return myNbEdges;
}
//=======================================================================
//function : NbFaces
//purpose :
// function : NbFaces
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Data::NbFaces () const
{ return myNbFaces; }
inline Standard_Integer HLRBRep_Data::NbFaces() const
{
return myNbFaces;
}
//=======================================================================
//function : EdgeMap
//purpose :
// function : EdgeMap
// purpose :
//=======================================================================
inline TopTools_IndexedMapOfShape & HLRBRep_Data::EdgeMap ()
{ return myEMap; }
inline TopTools_IndexedMapOfShape& HLRBRep_Data::EdgeMap()
{
return myEMap;
}
//=======================================================================
//function : FaceMap
//purpose :
// function : FaceMap
// purpose :
//=======================================================================
inline TopTools_IndexedMapOfShape & HLRBRep_Data::FaceMap ()
{ return myFMap; }
inline TopTools_IndexedMapOfShape& HLRBRep_Data::FaceMap()
{
return myFMap;
}
//=======================================================================
//function : SimpleHidingFace
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Data::SimpleHidingFace () const
{ return iFaceSimp; }
//=======================================================================
//function : HidingTheFace
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Data::HidingTheFace () const
{ return iFaceTest; }
//=======================================================================
//function : MoreInterference
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Data::MoreInterference () const
{ return (iInterf <= myNbPoints + 2*myNbSegments); }
//=======================================================================
//function : Interference
//purpose :
// function : SimpleHidingFace
// purpose :
//=======================================================================
inline HLRAlgo_Interference & HLRBRep_Data::Interference ()
{ return myIntf; }
inline Standard_Boolean HLRBRep_Data::SimpleHidingFace() const
{
return iFaceSimp;
}
//=======================================================================
//function :EdgeOfTheHidingFace
//purpose :
// function : HidingTheFace
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_Data::EdgeOfTheHidingFace (const Standard_Integer,
const HLRBRep_EdgeData& ED) const
{ return ED.HideCount() == myHideCount-1; }
inline Standard_Boolean HLRBRep_Data::HidingTheFace() const
{
return iFaceTest;
}
//=======================================================================
// function : MoreInterference
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Data::MoreInterference() const
{
return (iInterf <= myNbPoints + 2 * myNbSegments);
}
//=======================================================================
// function : Interference
// purpose :
//=======================================================================
inline HLRAlgo_Interference& HLRBRep_Data::Interference()
{
return myIntf;
}
//=======================================================================
// function :EdgeOfTheHidingFace
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Data::EdgeOfTheHidingFace(const Standard_Integer,
const HLRBRep_EdgeData& ED) const
{
return ED.HideCount() == myHideCount - 1;
}

View File

@@ -15,10 +15,9 @@
// commercial license or contractual agreement.
#ifndef No_Exception
#define No_Exception
#define No_Exception
#endif
#include <HLRAlgo_Intersection.hxx>
#include <HLRBRep_AreaLimit.hxx>
#include <HLRBRep_EdgeBuilder.hxx>
@@ -28,109 +27,116 @@
#include <Standard_NoSuchObject.hxx>
#include <TopAbs.hxx>
//=======================================================================
//function : HLRBRep_EdgeBuilder
//purpose :
//=======================================================================
HLRBRep_EdgeBuilder::HLRBRep_EdgeBuilder (HLRBRep_VertexList& VList)
//=================================================================================================
HLRBRep_EdgeBuilder::HLRBRep_EdgeBuilder(HLRBRep_VertexList& VList)
{
// at creation the EdgeBuilder explore the VertexList
// and use it to build a list of "AreaLimit" on the edge.
// An area is a part of the curve between
// An area is a part of the curve between
// two consecutive vertices
Standard_DomainError_Raise_if(!VList.More(),
"EdgeBuilder : Empty vertex list");
Handle(HLRBRep_AreaLimit) last,cur;
TopAbs_State before,after,ebefore,eafter;
HLRAlgo_Intersection V;
Standard_DomainError_Raise_if(!VList.More(), "EdgeBuilder : Empty vertex list");
Handle(HLRBRep_AreaLimit) last, cur;
TopAbs_State before, after, ebefore, eafter;
HLRAlgo_Intersection V;
// loop on the Vertices
for (;VList.More();VList.Next()) {
for (; VList.More(); VList.Next())
{
before = after = ebefore = eafter = TopAbs_UNKNOWN;
// compute the states
if (VList.IsBoundary()) {
switch (VList.Orientation()) {
if (VList.IsBoundary())
{
switch (VList.Orientation())
{
case TopAbs_FORWARD :
ebefore = TopAbs_OUT;
eafter = TopAbs_IN;
break;
case TopAbs_FORWARD:
ebefore = TopAbs_OUT;
eafter = TopAbs_IN;
break;
case TopAbs_REVERSED :
ebefore = TopAbs_IN;
eafter = TopAbs_OUT;
break;
case TopAbs_REVERSED:
ebefore = TopAbs_IN;
eafter = TopAbs_OUT;
break;
case TopAbs_INTERNAL :
ebefore = TopAbs_IN;
eafter = TopAbs_IN;
break;
case TopAbs_INTERNAL:
ebefore = TopAbs_IN;
eafter = TopAbs_IN;
break;
case TopAbs_EXTERNAL :
ebefore = TopAbs_OUT;
eafter = TopAbs_OUT;
break;
case TopAbs_EXTERNAL:
ebefore = TopAbs_OUT;
eafter = TopAbs_OUT;
break;
}
}
if (VList.IsInterference()) {
switch (VList.Transition()) {
if (VList.IsInterference())
{
switch (VList.Transition())
{
case TopAbs_FORWARD :
before = TopAbs_OUT;
after = TopAbs_IN;
break;
case TopAbs_FORWARD:
before = TopAbs_OUT;
after = TopAbs_IN;
break;
case TopAbs_REVERSED :
before = TopAbs_IN;
after = TopAbs_OUT;
break;
case TopAbs_REVERSED:
before = TopAbs_IN;
after = TopAbs_OUT;
break;
case TopAbs_INTERNAL :
before = TopAbs_IN;
after = TopAbs_IN;
break;
case TopAbs_INTERNAL:
before = TopAbs_IN;
after = TopAbs_IN;
break;
case TopAbs_EXTERNAL :
before = TopAbs_OUT;
after = TopAbs_OUT;
break;
case TopAbs_EXTERNAL:
before = TopAbs_OUT;
after = TopAbs_OUT;
break;
}
switch (VList.BoundaryTransition()) {
switch (VList.BoundaryTransition())
{
case TopAbs_FORWARD :
after = TopAbs_ON;
break;
case TopAbs_FORWARD:
after = TopAbs_ON;
break;
case TopAbs_REVERSED :
before = TopAbs_ON;
break;
case TopAbs_REVERSED:
before = TopAbs_ON;
break;
case TopAbs_INTERNAL :
before = TopAbs_ON;
after = TopAbs_ON;
break;
case TopAbs_INTERNAL:
before = TopAbs_ON;
after = TopAbs_ON;
break;
case TopAbs_EXTERNAL :
break;
case TopAbs_EXTERNAL:
break;
}
}
// create the Limit and connect to list
V = VList.Current();
V = VList.Current();
cur = new HLRBRep_AreaLimit(V,
VList.IsBoundary(),
VList.IsInterference(),
before,after,
ebefore,eafter);
if (myLimits.IsNull()) {
VList.IsBoundary(),
VList.IsInterference(),
before,
after,
ebefore,
eafter);
if (myLimits.IsNull())
{
myLimits = cur;
last = cur;
}
else {
else
{
last->Next(cur);
cur->Previous(last);
last = cur;
@@ -138,27 +144,33 @@ HLRBRep_EdgeBuilder::HLRBRep_EdgeBuilder (HLRBRep_VertexList& VList)
}
// periodicity, make a circular list
if (VList.IsPeriodic()) {
if (VList.IsPeriodic())
{
last->Next(myLimits);
myLimits->Previous(last);
}
// process UNKNOWN areas
TopAbs_State stat = TopAbs_UNKNOWN;
TopAbs_State stat = TopAbs_UNKNOWN;
TopAbs_State estat = TopAbs_UNKNOWN;
cur = myLimits;
while (!cur.IsNull()) {
if (stat == TopAbs_UNKNOWN) {
while (!cur.IsNull())
{
if (stat == TopAbs_UNKNOWN)
{
stat = cur->StateBefore();
if (stat == TopAbs_UNKNOWN) {
stat = cur->StateAfter();
if (stat == TopAbs_UNKNOWN)
{
stat = cur->StateAfter();
}
}
if (estat == TopAbs_UNKNOWN) {
if (estat == TopAbs_UNKNOWN)
{
estat = cur->EdgeBefore();
if (estat == TopAbs_UNKNOWN) {
estat = cur->EdgeAfter();
if (estat == TopAbs_UNKNOWN)
{
estat = cur->EdgeAfter();
}
}
cur = cur->Next();
@@ -168,15 +180,15 @@ HLRBRep_EdgeBuilder::HLRBRep_EdgeBuilder (HLRBRep_VertexList& VList)
}
// error if no interferences
Standard_DomainError_Raise_if(stat == TopAbs_UNKNOWN,
"EdgeBuilder : No interferences");
Standard_DomainError_Raise_if(stat == TopAbs_UNKNOWN, "EdgeBuilder : No interferences");
// if no boundary the edge covers the whole curve
if (estat == TopAbs_UNKNOWN)
estat = TopAbs_IN;
// propagate states
cur = myLimits;
while (!cur.IsNull()) {
while (!cur.IsNull())
{
if (cur->StateBefore() == TopAbs_UNKNOWN)
cur->StateBefore(stat);
else
@@ -200,20 +212,17 @@ HLRBRep_EdgeBuilder::HLRBRep_EdgeBuilder (HLRBRep_VertexList& VList)
}
//=======================================================================
//function : InitAreas
//purpose : set on the first area
// function : InitAreas
// purpose : set on the first area
//=======================================================================
void HLRBRep_EdgeBuilder::InitAreas()
{
left = myLimits->Previous();
left = myLimits->Previous();
right = myLimits;
}
//=======================================================================
//function : NextArea
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::NextArea()
{
@@ -222,10 +231,7 @@ void HLRBRep_EdgeBuilder::NextArea()
right = right->Next();
}
//=======================================================================
//function : PreviousArea
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::PreviousArea()
{
@@ -234,23 +240,19 @@ void HLRBRep_EdgeBuilder::PreviousArea()
left = left->Previous();
}
//=======================================================================
//function : HasArea
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeBuilder::HasArea() const
{
if (left.IsNull())
if (right.IsNull()) return Standard_False;
if (right == myLimits) return Standard_False;
if (right.IsNull())
return Standard_False;
if (right == myLimits)
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : AreaState
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_EdgeBuilder::AreaState() const
{
@@ -262,10 +264,7 @@ TopAbs_State HLRBRep_EdgeBuilder::AreaState() const
return stat;
}
//=======================================================================
//function : AreaEdgeState
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_State HLRBRep_EdgeBuilder::AreaEdgeState() const
{
@@ -277,107 +276,89 @@ TopAbs_State HLRBRep_EdgeBuilder::AreaEdgeState() const
return stat;
}
//=======================================================================
//function : LeftLimit
//purpose :
//=======================================================================
//=================================================================================================
Handle(HLRBRep_AreaLimit) HLRBRep_EdgeBuilder::LeftLimit() const
{
return left;
}
//=======================================================================
//function : RightLimit
//purpose :
//=======================================================================
//=================================================================================================
Handle(HLRBRep_AreaLimit) HLRBRep_EdgeBuilder::RightLimit() const
{
return right;
}
//=======================================================================
//function : Builds
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::Builds(const TopAbs_State ToBuild)
void HLRBRep_EdgeBuilder::Builds(const TopAbs_State ToBuild)
{
toBuild = ToBuild;
InitAreas();
do {
if ((AreaState() == toBuild) &&
(AreaEdgeState() == TopAbs_IN)) {
do
{
if ((AreaState() == toBuild) && (AreaEdgeState() == TopAbs_IN))
{
if (left.IsNull())
current = 2;
current = 2;
else
current = 1;
current = 1;
return;
}
NextArea();
}
while (HasArea());
} while (HasArea());
current = 3;
}
//=======================================================================
//function : MoreEdges
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeBuilder::MoreEdges() const
Standard_Boolean HLRBRep_EdgeBuilder::MoreEdges() const
{
return HasArea();
}
//=======================================================================
//function : NextEdge
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::NextEdge()
void HLRBRep_EdgeBuilder::NextEdge()
{
// clean the current edge
while (AreaState() == toBuild)
NextArea();
// go to the next edge
while (HasArea()) {
if ((AreaState() == toBuild) &&
(AreaEdgeState() == TopAbs_IN)) {
while (HasArea())
{
if ((AreaState() == toBuild) && (AreaEdgeState() == TopAbs_IN))
{
if (left.IsNull())
current = 2;
current = 2;
else
current = 1;
current = 1;
return;
}
NextArea();
}
}
//=======================================================================
//function : MoreVertices
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeBuilder::MoreVertices() const
Standard_Boolean HLRBRep_EdgeBuilder::MoreVertices() const
{
return (current < 3);
}
//=======================================================================
//function : NextVertex
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::NextVertex()
void HLRBRep_EdgeBuilder::NextVertex()
{
if (current == 1) {
if (current == 1)
{
current = 2;
if (right.IsNull())
current = 3;
}
else if (current == 2) {
else if (current == 2)
{
NextArea();
if ((AreaState() == toBuild) && (AreaEdgeState() == TopAbs_IN))
current = 2;
@@ -388,10 +369,7 @@ void HLRBRep_EdgeBuilder::NextVertex()
throw Standard_NoSuchObject("EdgeBuilder::NextVertex : No current edge");
}
//=======================================================================
//function : Current
//purpose :
//=======================================================================
//=================================================================================================
const HLRAlgo_Intersection& HLRBRep_EdgeBuilder::Current() const
{
@@ -403,12 +381,9 @@ const HLRAlgo_Intersection& HLRBRep_EdgeBuilder::Current() const
throw Standard_NoSuchObject("EdgeBuilder::Current : No current vertex");
}
//=======================================================================
//function : IsBoundary
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeBuilder::IsBoundary() const
Standard_Boolean HLRBRep_EdgeBuilder::IsBoundary() const
{
if (current == 1)
return left->IsBoundary();
@@ -418,12 +393,9 @@ Standard_Boolean HLRBRep_EdgeBuilder::IsBoundary() const
throw Standard_NoSuchObject("EdgeBuilder::IsBoundary : No current vertex");
}
//=======================================================================
//function : IsInterference
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeBuilder::IsInterference() const
Standard_Boolean HLRBRep_EdgeBuilder::IsInterference() const
{
if (current == 1)
return left->IsInterference();
@@ -433,23 +405,21 @@ Standard_Boolean HLRBRep_EdgeBuilder::IsInterference() const
throw Standard_NoSuchObject("EdgeBuilder::IsInterference : No current vertex");
}
//=======================================================================
//function : Orientation
//purpose :
//=======================================================================
//=================================================================================================
TopAbs_Orientation HLRBRep_EdgeBuilder::Orientation() const
TopAbs_Orientation HLRBRep_EdgeBuilder::Orientation() const
{
if (current == 1) {
if ((left->StateBefore() == left->StateAfter()) &&
(left->EdgeBefore() == left->EdgeAfter()))
if (current == 1)
{
if ((left->StateBefore() == left->StateAfter()) && (left->EdgeBefore() == left->EdgeAfter()))
return TopAbs_INTERNAL;
else
return TopAbs_FORWARD;
}
else if (current == 2) {
if ((right->StateBefore() == right->StateAfter()) &&
(right->EdgeBefore() == right->EdgeAfter()))
else if (current == 2)
{
if ((right->StateBefore() == right->StateAfter())
&& (right->EdgeBefore() == right->EdgeAfter()))
return TopAbs_INTERNAL;
else
return TopAbs_REVERSED;
@@ -457,15 +427,13 @@ TopAbs_Orientation HLRBRep_EdgeBuilder::Orientation() const
return TopAbs_EXTERNAL; // only for WNT.
}
//=======================================================================
//function : Destroy
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeBuilder::Destroy()
{
Handle(HLRBRep_AreaLimit) cur = myLimits;
while (!cur.IsNull()) {
while (!cur.IsNull())
{
Handle(HLRBRep_AreaLimit) n = cur->Next();
cur->Clear();
cur = n;

View File

@@ -28,114 +28,89 @@ class HLRBRep_AreaLimit;
class HLRBRep_VertexList;
class HLRAlgo_Intersection;
class HLRBRep_EdgeBuilder
class HLRBRep_EdgeBuilder
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an EdgeBuilder algorithm. <VList>
//! describes the edge and the interferences.
//! AreaLimits are created from the vertices.
//! Builds(IN) is automatically called.
Standard_EXPORT HLRBRep_EdgeBuilder(HLRBRep_VertexList& VList);
//! Initialize an iteration on the areas.
Standard_EXPORT void InitAreas();
//! Set the current area to the next area.
Standard_EXPORT void NextArea();
//! Set the current area to the previous area.
Standard_EXPORT void PreviousArea();
//! Returns True if there is a current area.
Standard_EXPORT Standard_Boolean HasArea() const;
//! Returns the state of the current area.
Standard_EXPORT TopAbs_State AreaState() const;
//! Returns the edge state of the current area.
Standard_EXPORT TopAbs_State AreaEdgeState() const;
//! Returns the AreaLimit beginning the current area.
//! This is a NULL handle when the area is infinite on
//! the left.
Standard_EXPORT Handle(HLRBRep_AreaLimit) LeftLimit() const;
//! Returns the AreaLimit ending the current area.
//! This is a NULL handle when the area is infinite on
//! the right.
Standard_EXPORT Handle(HLRBRep_AreaLimit) RightLimit() const;
//! Reinitialize the results iteration to the parts
//! with State <ToBuild>. If this method is not called
//! after construction the default is <ToBuild> = IN.
Standard_EXPORT void Builds (const TopAbs_State ToBuild);
Standard_EXPORT void Builds(const TopAbs_State ToBuild);
//! Returns True if there are more new edges to build.
Standard_EXPORT Standard_Boolean MoreEdges() const;
//! Proceeds to the next edge to build. Skip all
//! remaining vertices on the current edge.
Standard_EXPORT void NextEdge();
//! True if there are more vertices in the current new
//! edge.
Standard_EXPORT Standard_Boolean MoreVertices() const;
//! Proceeds to the next vertex of the current edge.
Standard_EXPORT void NextVertex();
//! Returns the current vertex of the current edge.
Standard_EXPORT const HLRAlgo_Intersection& Current() const;
//! Returns True if the current vertex comes from the
//! boundary of the edge.
Standard_EXPORT Standard_Boolean IsBoundary() const;
//! Returns True if the current vertex was an
//! interference.
Standard_EXPORT Standard_Boolean IsInterference() const;
//! Returns the new orientation of the current vertex.
Standard_EXPORT TopAbs_Orientation Orientation() const;
Standard_EXPORT void Destroy();
~HLRBRep_EdgeBuilder()
{
Destroy();
}
~HLRBRep_EdgeBuilder() { Destroy(); }
protected:
private:
TopAbs_State toBuild;
TopAbs_State toBuild;
Handle(HLRBRep_AreaLimit) myLimits;
Handle(HLRBRep_AreaLimit) left;
Handle(HLRBRep_AreaLimit) right;
Standard_Integer current;
Standard_Integer current;
};
#endif // _HLRBRep_EdgeBuilder_HeaderFile

View File

@@ -14,30 +14,26 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <HLRBRep_EdgeData.hxx>
#include <TopoDS_Edge.hxx>
//=======================================================================
//function : Set
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeData::Set (const Standard_Boolean Rg1L,
const Standard_Boolean RgNL,
const TopoDS_Edge& EG,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Boolean Out1,
const Standard_Boolean Out2,
const Standard_Boolean Cut1,
const Standard_Boolean Cut2,
const Standard_Real Start,
const Standard_ShortReal TolStart,
const Standard_Real End,
const Standard_ShortReal TolEnd)
{
void HLRBRep_EdgeData::Set(const Standard_Boolean Rg1L,
const Standard_Boolean RgNL,
const TopoDS_Edge& EG,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Boolean Out1,
const Standard_Boolean Out2,
const Standard_Boolean Cut1,
const Standard_Boolean Cut2,
const Standard_Real Start,
const Standard_ShortReal TolStart,
const Standard_Real End,
const Standard_ShortReal TolEnd)
{
Rg1Line(Rg1L);
RgNLine(RgNL);
Used(Standard_False);
@@ -49,9 +45,9 @@ void HLRBRep_EdgeData::Set (const Standard_Boolean Rg1L,
OutLVEnd(Out2);
CutAtSta(Cut1);
CutAtEnd(Cut2);
Status().Initialize
(Start,(Standard_ShortReal)(ChangeGeometry().Curve().Resolution
((Standard_Real)TolStart)),
End ,(Standard_ShortReal)(ChangeGeometry().Curve().Resolution
((Standard_Real)TolEnd )));
Status().Initialize(
Start,
(Standard_ShortReal)(ChangeGeometry().Curve().Resolution((Standard_Real)TolStart)),
End,
(Standard_ShortReal)(ChangeGeometry().Curve().Resolution((Standard_Real)TolEnd)));
}

View File

@@ -32,110 +32,114 @@ class TopoDS_Edge;
#undef Status
#endif
class HLRBRep_EdgeData
class HLRBRep_EdgeData
{
public:
DEFINE_STANDARD_ALLOC
HLRBRep_EdgeData() :
myFlags(0),
myHideCount(0)
HLRBRep_EdgeData()
: myFlags(0),
myHideCount(0)
{
Selected(Standard_True);
}
Standard_EXPORT void Set (const Standard_Boolean Reg1, const Standard_Boolean RegN, const TopoDS_Edge& EG, const Standard_Integer V1, const Standard_Integer V2, const Standard_Boolean Out1, const Standard_Boolean Out2, const Standard_Boolean Cut1, const Standard_Boolean Cut2, const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd);
Standard_Boolean Selected() const;
void Selected (const Standard_Boolean B);
Standard_Boolean Rg1Line() const;
void Rg1Line (const Standard_Boolean B);
Standard_Boolean RgNLine() const;
void RgNLine (const Standard_Boolean B);
Standard_Boolean Vertical() const;
void Vertical (const Standard_Boolean B);
Standard_Boolean Simple() const;
void Simple (const Standard_Boolean B);
Standard_Boolean OutLVSta() const;
void OutLVSta (const Standard_Boolean B);
Standard_Boolean OutLVEnd() const;
void OutLVEnd (const Standard_Boolean B);
Standard_Boolean CutAtSta() const;
void CutAtSta (const Standard_Boolean B);
Standard_Boolean CutAtEnd() const;
void CutAtEnd (const Standard_Boolean B);
Standard_Boolean VerAtSta() const;
void VerAtSta (const Standard_Boolean B);
Standard_Boolean VerAtEnd() const;
void VerAtEnd (const Standard_Boolean B);
Standard_Boolean AutoIntersectionDone() const;
void AutoIntersectionDone (const Standard_Boolean B);
Standard_Boolean Used() const;
void Used (const Standard_Boolean B);
Standard_Integer HideCount() const;
void HideCount (const Standard_Integer I);
Standard_Integer VSta() const;
void VSta (const Standard_Integer I);
Standard_Integer VEnd() const;
void VEnd (const Standard_Integer I);
void UpdateMinMax (const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
Standard_EXPORT void Set(const Standard_Boolean Reg1,
const Standard_Boolean RegN,
const TopoDS_Edge& EG,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Boolean Out1,
const Standard_Boolean Out2,
const Standard_Boolean Cut1,
const Standard_Boolean Cut2,
const Standard_Real Start,
const Standard_ShortReal TolStart,
const Standard_Real End,
const Standard_ShortReal TolEnd);
Standard_Boolean Selected() const;
void Selected(const Standard_Boolean B);
Standard_Boolean Rg1Line() const;
void Rg1Line(const Standard_Boolean B);
Standard_Boolean RgNLine() const;
void RgNLine(const Standard_Boolean B);
Standard_Boolean Vertical() const;
void Vertical(const Standard_Boolean B);
Standard_Boolean Simple() const;
void Simple(const Standard_Boolean B);
Standard_Boolean OutLVSta() const;
void OutLVSta(const Standard_Boolean B);
Standard_Boolean OutLVEnd() const;
void OutLVEnd(const Standard_Boolean B);
Standard_Boolean CutAtSta() const;
void CutAtSta(const Standard_Boolean B);
Standard_Boolean CutAtEnd() const;
void CutAtEnd(const Standard_Boolean B);
Standard_Boolean VerAtSta() const;
void VerAtSta(const Standard_Boolean B);
Standard_Boolean VerAtEnd() const;
void VerAtEnd(const Standard_Boolean B);
Standard_Boolean AutoIntersectionDone() const;
void AutoIntersectionDone(const Standard_Boolean B);
Standard_Boolean Used() const;
void Used(const Standard_Boolean B);
Standard_Integer HideCount() const;
void HideCount(const Standard_Integer I);
Standard_Integer VSta() const;
void VSta(const Standard_Integer I);
Standard_Integer VEnd() const;
void VEnd(const Standard_Integer I);
void UpdateMinMax(const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
{
myMinMax = theTotMinMax;
}
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax()
{
return myMinMax;
}
HLRAlgo_EdgeStatus& Status();
HLRBRep_Curve& ChangeGeometry();
const HLRBRep_Curve& Geometry() const;
HLRBRep_Curve* Curve()
{
return &myGeometry;
}
Standard_ShortReal Tolerance() const;
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax() { return myMinMax; }
HLRAlgo_EdgeStatus& Status();
HLRBRep_Curve& ChangeGeometry();
const HLRBRep_Curve& Geometry() const;
HLRBRep_Curve* Curve() { return &myGeometry; }
Standard_ShortReal Tolerance() const;
protected:
enum EMaskFlags
{
EMaskSelected = 1,
@@ -154,16 +158,14 @@ protected:
};
private:
Standard_Integer myFlags;
Standard_Integer myHideCount;
Standard_Integer myVSta;
Standard_Integer myVEnd;
Standard_Integer myFlags;
Standard_Integer myHideCount;
Standard_Integer myVSta;
Standard_Integer myVEnd;
HLRAlgo_EdgesBlock::MinMaxIndices myMinMax;
HLRAlgo_EdgeStatus myStatus;
HLRBRep_Curve myGeometry;
Standard_ShortReal myTolerance;
HLRAlgo_EdgeStatus myStatus;
HLRBRep_Curve myGeometry;
Standard_ShortReal myTolerance;
};
#include <HLRBRep_EdgeData.lxx>

View File

@@ -15,329 +15,400 @@
// commercial license or contractual agreement.
//=======================================================================
//function : Selected
//purpose :
// function : Selected
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Selected () const
{ return (myFlags & EMaskSelected) != 0; }
//=======================================================================
//function : Selected
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Selected (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::Selected() const
{
if (B) myFlags |= EMaskSelected;
else myFlags &= ~EMaskSelected;
return (myFlags & EMaskSelected) != 0;
}
//=======================================================================
//function : Rg1Line
//purpose :
// function : Selected
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Rg1Line () const
{ return (myFlags & EMaskRg1Line) != 0; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Rg1Line (const Standard_Boolean B)
inline void HLRBRep_EdgeData::Selected(const Standard_Boolean B)
{
if (B) myFlags |= EMaskRg1Line;
else myFlags &= ~EMaskRg1Line;
if (B)
myFlags |= EMaskSelected;
else
myFlags &= ~EMaskSelected;
}
//=======================================================================
//function : RgNLine
//purpose :
// function : Rg1Line
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::RgNLine () const
{ return (myFlags & EMaskRgNLine) != 0; }
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::RgNLine (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::Rg1Line() const
{
if (B) myFlags |= EMaskRgNLine;
else myFlags &= ~EMaskRgNLine;
return (myFlags & EMaskRg1Line) != 0;
}
//=======================================================================
//function : Vertical
//purpose :
// function : Rg1Line
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Vertical () const
{ return (myFlags & EMaskVertical) != 0; }
inline void HLRBRep_EdgeData::Rg1Line(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskRg1Line;
else
myFlags &= ~EMaskRg1Line;
}
//=======================================================================
//function : Vertical
//purpose :
// function : RgNLine
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::RgNLine() const
{
return (myFlags & EMaskRgNLine) != 0;
}
//=======================================================================
// function : RgNLine
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::RgNLine(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskRgNLine;
else
myFlags &= ~EMaskRgNLine;
}
//=======================================================================
// function : Vertical
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Vertical() const
{
return (myFlags & EMaskVertical) != 0;
}
//=======================================================================
// function : Vertical
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Vertical(const Standard_Boolean B)
{
if (B) myFlags |= EMaskVertical;
else myFlags &= ~EMaskVertical;
if (B)
myFlags |= EMaskVertical;
else
myFlags &= ~EMaskVertical;
}
//=======================================================================
//function : Simple
//purpose :
// function : Simple
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Simple () const
{ return (myFlags & EMaskSimple) != 0; }
//=======================================================================
//function : Simple
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Simple (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::Simple() const
{
if (B) myFlags |= EMaskSimple;
else myFlags &= ~EMaskSimple;
return (myFlags & EMaskSimple) != 0;
}
//=======================================================================
//function : OutLVSta
//purpose :
// function : Simple
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::OutLVSta () const
{ return (myFlags & EMaskOutLVSta) != 0; }
//=======================================================================
//function : OutLVSta
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::OutLVSta (const Standard_Boolean B)
inline void HLRBRep_EdgeData::Simple(const Standard_Boolean B)
{
if (B) myFlags |= EMaskOutLVSta;
else myFlags &= ~EMaskOutLVSta;
if (B)
myFlags |= EMaskSimple;
else
myFlags &= ~EMaskSimple;
}
//=======================================================================
//function : OutLVEnd
//purpose :
// function : OutLVSta
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::OutLVEnd () const
{ return (myFlags & EMaskOutLVEnd) != 0; }
//=======================================================================
//function : OutLVEnd
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::OutLVEnd (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::OutLVSta() const
{
if (B) myFlags |= EMaskOutLVEnd;
else myFlags &= ~EMaskOutLVEnd;
return (myFlags & EMaskOutLVSta) != 0;
}
//=======================================================================
//function : CutAtSta
//purpose :
// function : OutLVSta
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::CutAtSta () const
{ return (myFlags & EMaskCutAtSta) != 0; }
//=======================================================================
//function : CutAtSta
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::CutAtSta (const Standard_Boolean B)
inline void HLRBRep_EdgeData::OutLVSta(const Standard_Boolean B)
{
if (B) myFlags |= EMaskCutAtSta;
else myFlags &= ~EMaskCutAtSta;
if (B)
myFlags |= EMaskOutLVSta;
else
myFlags &= ~EMaskOutLVSta;
}
//=======================================================================
//function : CutAtEnd
//purpose :
// function : OutLVEnd
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::CutAtEnd () const
{ return (myFlags & EMaskCutAtEnd) != 0; }
//=======================================================================
//function : CutAtEnd
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::CutAtEnd (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::OutLVEnd() const
{
if (B) myFlags |= EMaskCutAtEnd;
else myFlags &= ~EMaskCutAtEnd;
return (myFlags & EMaskOutLVEnd) != 0;
}
//=======================================================================
//function : VerAtSta
//purpose :
// function : OutLVEnd
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::VerAtSta () const
{ return (myFlags & EMaskVerAtSta) != 0; }
//=======================================================================
//function : VerAtSta
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VerAtSta (const Standard_Boolean B)
inline void HLRBRep_EdgeData::OutLVEnd(const Standard_Boolean B)
{
if (B) myFlags |= EMaskVerAtSta;
else myFlags &= ~EMaskVerAtSta;
if (B)
myFlags |= EMaskOutLVEnd;
else
myFlags &= ~EMaskOutLVEnd;
}
//=======================================================================
//function : VerAtEnd
//purpose :
// function : CutAtSta
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::VerAtEnd () const
{ return (myFlags & EMaskVerAtEnd) != 0; }
//=======================================================================
//function : VerAtEnd
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VerAtEnd (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::CutAtSta() const
{
if (B) myFlags |= EMaskVerAtEnd;
else myFlags &= ~EMaskVerAtEnd;
return (myFlags & EMaskCutAtSta) != 0;
}
//=======================================================================
//function : AutoIntersectionDone
//purpose :
// function : CutAtSta
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::AutoIntersectionDone () const
{ return (myFlags & EMaskIntDone) != 0; }
//=======================================================================
//function : AutoIntersectionDone
//purpose :
//=======================================================================
inline void
HLRBRep_EdgeData::AutoIntersectionDone (const Standard_Boolean B)
inline void HLRBRep_EdgeData::CutAtSta(const Standard_Boolean B)
{
if (B) myFlags |= EMaskIntDone;
else myFlags &= ~EMaskIntDone;
if (B)
myFlags |= EMaskCutAtSta;
else
myFlags &= ~EMaskCutAtSta;
}
//=======================================================================
//function : Used
//purpose :
// function : CutAtEnd
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Used () const
{ return (myFlags & EMaskUsed) != 0; }
//=======================================================================
//function : Used
//purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Used (const Standard_Boolean B)
inline Standard_Boolean HLRBRep_EdgeData::CutAtEnd() const
{
if (B) myFlags |= EMaskUsed;
else myFlags &= ~EMaskUsed;
return (myFlags & EMaskCutAtEnd) != 0;
}
//=======================================================================
//function : HideCount
//purpose :
// function : CutAtEnd
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_EdgeData::HideCount () const
{ return myHideCount; }
inline void HLRBRep_EdgeData::CutAtEnd(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskCutAtEnd;
else
myFlags &= ~EMaskCutAtEnd;
}
//=======================================================================
//function : HideCount
//purpose :
// function : VerAtSta
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::HideCount (const Standard_Integer I)
{ myHideCount = I; }
inline Standard_Boolean HLRBRep_EdgeData::VerAtSta() const
{
return (myFlags & EMaskVerAtSta) != 0;
}
//=======================================================================
//function : VSta
//purpose :
// function : VerAtSta
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VerAtSta(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskVerAtSta;
else
myFlags &= ~EMaskVerAtSta;
}
//=======================================================================
// function : VerAtEnd
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::VerAtEnd() const
{
return (myFlags & EMaskVerAtEnd) != 0;
}
//=======================================================================
// function : VerAtEnd
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VerAtEnd(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskVerAtEnd;
else
myFlags &= ~EMaskVerAtEnd;
}
//=======================================================================
// function : AutoIntersectionDone
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::AutoIntersectionDone() const
{
return (myFlags & EMaskIntDone) != 0;
}
//=======================================================================
// function : AutoIntersectionDone
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::AutoIntersectionDone(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskIntDone;
else
myFlags &= ~EMaskIntDone;
}
//=======================================================================
// function : Used
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeData::Used() const
{
return (myFlags & EMaskUsed) != 0;
}
//=======================================================================
// function : Used
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::Used(const Standard_Boolean B)
{
if (B)
myFlags |= EMaskUsed;
else
myFlags &= ~EMaskUsed;
}
//=======================================================================
// function : HideCount
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_EdgeData::HideCount() const
{
return myHideCount;
}
//=======================================================================
// function : HideCount
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::HideCount(const Standard_Integer I)
{
myHideCount = I;
}
//=======================================================================
// function : VSta
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_EdgeData::VSta() const
{ return myVSta; }
{
return myVSta;
}
//=======================================================================
//function : VSta
//purpose :
// function : VSta
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VSta (const Standard_Integer I)
{ myVSta = I; }
inline void HLRBRep_EdgeData::VSta(const Standard_Integer I)
{
myVSta = I;
}
//=======================================================================
//function : VEnd
//purpose :
// function : VEnd
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_EdgeData::VEnd () const
{ return myVEnd; }
inline Standard_Integer HLRBRep_EdgeData::VEnd() const
{
return myVEnd;
}
//=======================================================================
//function : VEnd
//purpose :
// function : VEnd
// purpose :
//=======================================================================
inline void HLRBRep_EdgeData::VEnd (const Standard_Integer I)
{ myVEnd = I; }
inline void HLRBRep_EdgeData::VEnd(const Standard_Integer I)
{
myVEnd = I;
}
//=======================================================================
//function : Status
//purpose :
// function : Status
// purpose :
//=======================================================================
inline HLRAlgo_EdgeStatus & HLRBRep_EdgeData::Status ()
{ return myStatus; }
inline HLRAlgo_EdgeStatus& HLRBRep_EdgeData::Status()
{
return myStatus;
}
//=======================================================================
//function : ChangeGeometry
//purpose :
// function : ChangeGeometry
// purpose :
//=======================================================================
inline HLRBRep_Curve & HLRBRep_EdgeData::ChangeGeometry ()
{ return myGeometry; }
inline HLRBRep_Curve& HLRBRep_EdgeData::ChangeGeometry()
{
return myGeometry;
}
//=======================================================================
//function : Geometry
//purpose :
// function : Geometry
// purpose :
//=======================================================================
inline const HLRBRep_Curve & HLRBRep_EdgeData::Geometry () const
{ return myGeometry; }
inline const HLRBRep_Curve& HLRBRep_EdgeData::Geometry() const
{
return myGeometry;
}
//=======================================================================
//function : Tolerance
//purpose :
// function : Tolerance
// purpose :
//=======================================================================
inline Standard_ShortReal HLRBRep_EdgeData::Tolerance () const
{ return myTolerance; }
inline Standard_ShortReal HLRBRep_EdgeData::Tolerance() const
{
return myTolerance;
}

View File

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepExtrema_ExtPF.hxx>
@@ -25,32 +24,30 @@
#include <HLRBRep_Surface.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : CurvatureDirection
//purpose :
//=======================================================================
Standard_Real HLRBRep_EdgeFaceTool::CurvatureValue
(const Standard_Address F,
const Standard_Real U,
const Standard_Real V,
const gp_Dir& Tg)
//=================================================================================================
Standard_Real HLRBRep_EdgeFaceTool::CurvatureValue(const Standard_Address F,
const Standard_Real U,
const Standard_Real V,
const gp_Dir& Tg)
{
gp_Pnt P;
gp_Vec D1U,D1V,D2U,D2V,D2UV;
((HLRBRep_Surface*)F)->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
Standard_Real d1ut = D1U*Tg;
Standard_Real d1vt = D1V*Tg;
Standard_Real d1ud1v = D1U*D1V;
Standard_Real nmu2 = D1U*D1U;
Standard_Real nmv2 = D1V*D1V;
Standard_Real det = nmu2 * nmv2 - d1ud1v * d1ud1v;
if (det > gp::Resolution()) {
Standard_Real alfa = (d1ut * nmv2 - d1vt * d1ud1v) / det;
Standard_Real beta = (d1vt * nmu2 - d1ut * d1ud1v) / det;
Standard_Real alfa2 = alfa * alfa;
Standard_Real beta2 = beta * beta;
gp_Vec D1U, D1V, D2U, D2V, D2UV;
((HLRBRep_Surface*)F)->D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
Standard_Real d1ut = D1U * Tg;
Standard_Real d1vt = D1V * Tg;
Standard_Real d1ud1v = D1U * D1V;
Standard_Real nmu2 = D1U * D1U;
Standard_Real nmv2 = D1V * D1V;
Standard_Real det = nmu2 * nmv2 - d1ud1v * d1ud1v;
if (det > gp::Resolution())
{
Standard_Real alfa = (d1ut * nmv2 - d1vt * d1ud1v) / det;
Standard_Real beta = (d1vt * nmu2 - d1ut * d1ud1v) / det;
Standard_Real alfa2 = alfa * alfa;
Standard_Real beta2 = beta * beta;
Standard_Real alfabeta = alfa * beta;
gp_Vec Nm = D1U ^ D1V;
gp_Vec Nm = D1U ^ D1V;
Nm.Normalize();
Standard_Real N = (Nm * D2U) * alfa2 + 2 * (Nm * D2UV) * alfabeta + (Nm * D2V) * beta2;
Standard_Real D = nmu2 * alfa2 + 2 * d1ud1v * alfabeta + nmv2 * beta2;
@@ -59,31 +56,31 @@ Standard_Real HLRBRep_EdgeFaceTool::CurvatureValue
return 0.;
}
//=======================================================================
//function : UVPoint
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeFaceTool::UVPoint(const Standard_Real Par,
Standard_Boolean HLRBRep_EdgeFaceTool::UVPoint(const Standard_Real Par,
const Standard_Address E,
const Standard_Address F,
Standard_Real& U,
Standard_Real& V)
Standard_Real& U,
Standard_Real& V)
{
Standard_Real pfbid,plbid;
if (BRep_Tool::CurveOnSurface
(((HLRBRep_Curve *)E)->Curve().Edge(),
((HLRBRep_Surface*)F)->Surface().Face(),pfbid,plbid).IsNull())
Standard_Real pfbid, plbid;
if (BRep_Tool::CurveOnSurface(((HLRBRep_Curve*)E)->Curve().Edge(),
((HLRBRep_Surface*)F)->Surface().Face(),
pfbid,
plbid)
.IsNull())
{
BRepExtrema_ExtPF proj
(BRepLib_MakeVertex(((HLRBRep_Curve*)E)->Value3D(Par)),
((HLRBRep_Surface*)F)->Surface().Face());
Standard_Integer i, index = 0;
Standard_Real dist2 = RealLast();
const Standard_Integer n = proj.NbExt();
for (i = 1; i <= n; i++) {
BRepExtrema_ExtPF proj(BRepLib_MakeVertex(((HLRBRep_Curve*)E)->Value3D(Par)),
((HLRBRep_Surface*)F)->Surface().Face());
Standard_Integer i, index = 0;
Standard_Real dist2 = RealLast();
const Standard_Integer n = proj.NbExt();
for (i = 1; i <= n; i++)
{
const Standard_Real newdist2 = proj.SquareDistance(i);
if (newdist2 < dist2) {
if (newdist2 < dist2)
{
dist2 = newdist2;
index = i;
}
@@ -91,14 +88,14 @@ Standard_Boolean HLRBRep_EdgeFaceTool::UVPoint(const Standard_Real Par,
if (index == 0)
return Standard_False;
proj.Parameter(index,U,V);
proj.Parameter(index, U, V);
}
else {
BRepAdaptor_Curve2d PC
(((HLRBRep_Curve *)E)->Curve().Edge(),
((HLRBRep_Surface*)F)->Surface().Face());
gp_Pnt2d P2d;
PC.D0(Par,P2d);
else
{
BRepAdaptor_Curve2d PC(((HLRBRep_Curve*)E)->Curve().Edge(),
((HLRBRep_Surface*)F)->Surface().Face());
gp_Pnt2d P2d;
PC.D0(Par, P2d);
U = P2d.X();
V = P2d.Y();
}

View File

@@ -22,44 +22,29 @@
class gp_Dir;
//! The EdgeFaceTool computes the UV coordinates at a
//! given parameter on a Curve and a Surface. It also
//! compute the signed curvature value in a direction
//! at a given u,v point on a surface.
class HLRBRep_EdgeFaceTool
class HLRBRep_EdgeFaceTool
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static Standard_Real CurvatureValue (const Standard_Address F, const Standard_Real U, const Standard_Real V, const gp_Dir& Tg);
Standard_EXPORT static Standard_Real CurvatureValue(const Standard_Address F,
const Standard_Real U,
const Standard_Real V,
const gp_Dir& Tg);
//! return True if U and V are found.
Standard_EXPORT static Standard_Boolean UVPoint (const Standard_Real Par, const Standard_Address E, const Standard_Address F, Standard_Real& U, Standard_Real& V);
Standard_EXPORT static Standard_Boolean UVPoint(const Standard_Real Par,
const Standard_Address E,
const Standard_Address F,
Standard_Real& U,
Standard_Real& V);
protected:
private:
};
#endif // _HLRBRep_EdgeFaceTool_HeaderFile

View File

@@ -15,28 +15,28 @@
// commercial license or contractual agreement.
#ifndef No_Exception
#define No_Exception
#define No_Exception
#endif
#include <HLRBRep_EdgeIList.hxx>
#include <HLRBRep_EdgeInterferenceTool.hxx>
#include <TopCnx_EdgeFaceTransition.hxx>
//=======================================================================
//function : AddInterference
//purpose : insert an interference in a sorted list
// function : AddInterference
// purpose : insert an interference in a sorted list
//=======================================================================
void HLRBRep_EdgeIList::
AddInterference(HLRAlgo_InterferenceList& IL,
const HLRAlgo_Interference& I,
const HLRBRep_EdgeInterferenceTool& T)
void HLRBRep_EdgeIList::AddInterference(HLRAlgo_InterferenceList& IL,
const HLRAlgo_Interference& I,
const HLRBRep_EdgeInterferenceTool& T)
{
HLRAlgo_ListIteratorOfInterferenceList It(IL);
Standard_Real p = T.ParameterOfInterference(I);
while (It.More()) {
if (p < T.ParameterOfInterference(It.Value())) {
IL.InsertBefore(I,It);
Standard_Real p = T.ParameterOfInterference(I);
while (It.More())
{
if (p < T.ParameterOfInterference(It.Value()))
{
IL.InsertBefore(I, It);
return;
}
It.Next();
@@ -44,136 +44,138 @@ AddInterference(HLRAlgo_InterferenceList& IL,
IL.Append(I);
}
//=======================================================================
//function : ProcessComplex
//purpose :
//=======================================================================
//=================================================================================================
#ifdef OCCT_DEBUG_SI
static Standard_Boolean SimilarInterference(const HLRAlgo_Interference& I1,
const HLRAlgo_Interference& I2)
const HLRAlgo_Interference& I2)
{
Standard_Real p1, p2;
Standard_Real eps = 1.e-7;
Standard_Real p1, p2;
Standard_Real eps = 1.e-7;
TopAbs_Orientation or1, or2;
//Standard_Integer l1, l2; //levels
// Standard_Integer l1, l2; //levels
p1 = I1.Intersection().Parameter();
//l1 = I1.Intersection().Level();
// l1 = I1.Intersection().Level();
or1 = I1.Transition();
p2 = I2.Intersection().Parameter();
//l2 = I2.Intersection().Level();
// l2 = I2.Intersection().Level();
or2 = I2.Transition();
Standard_Boolean IsSimilar = Abs(p1-p2) <= eps && or1 == or2;
Standard_Boolean IsSimilar = Abs(p1 - p2) <= eps && or1 == or2;
return IsSimilar;
}
#endif
void HLRBRep_EdgeIList::
ProcessComplex(HLRAlgo_InterferenceList& IL,
const HLRBRep_EdgeInterferenceTool& T)
void HLRBRep_EdgeIList::ProcessComplex(HLRAlgo_InterferenceList& IL,
const HLRBRep_EdgeInterferenceTool& T)
{
TopCnx_EdgeFaceTransition transTool;
gp_Dir TgtE, NormE, TgtI, NormI;
const Standard_Real TolAng = 0.0001;
Standard_Real CurvE, CurvI;
TopCnx_EdgeFaceTransition transTool;
gp_Dir TgtE, NormE, TgtI, NormI;
const Standard_Real TolAng = 0.0001;
Standard_Real CurvE, CurvI;
HLRAlgo_ListIteratorOfInterferenceList It1(IL);
while (It1.More()) {
while (It1.More())
{
HLRAlgo_ListIteratorOfInterferenceList It2(It1);
It2.Next();
if (It2.More()) {
if (T.SameInterferences(It1.Value(),It2.Value())
if (It2.More())
{
if (T.SameInterferences(It1.Value(), It2.Value())
#ifdef OCCT_DEBUG_SI
|| SimilarInterference(It1.Value(),It2.Value())
|| SimilarInterference(It1.Value(), It2.Value())
#endif
)
{
T.EdgeGeometry(T.ParameterOfInterference(It1.Value()),
TgtE, NormE, CurvE);
transTool.Reset(TgtE,NormE,CurvE);
T.InterferenceBoundaryGeometry(It1.Value(),TgtI,NormI,CurvI);
transTool.AddInterference(TolAng,
TgtI,NormI,CurvI,
It1.Value().Orientation(),
It1.Value().Transition(),
It1.Value().BoundaryTransition());
)
{
T.EdgeGeometry(T.ParameterOfInterference(It1.Value()), TgtE, NormE, CurvE);
transTool.Reset(TgtE, NormE, CurvE);
T.InterferenceBoundaryGeometry(It1.Value(), TgtI, NormI, CurvI);
transTool.AddInterference(TolAng,
TgtI,
NormI,
CurvI,
It1.Value().Orientation(),
It1.Value().Transition(),
It1.Value().BoundaryTransition());
while (It2.More()) {
if (!(T.SameInterferences(It1.Value(),It2.Value())
while (It2.More())
{
if (!(T.SameInterferences(It1.Value(), It2.Value())
#ifdef OCCT_DEBUG_SI
|| SimilarInterference(It1.Value(),It2.Value())
|| SimilarInterference(It1.Value(), It2.Value())
#endif
)) break;
))
break;
T.InterferenceBoundaryGeometry(It2.Value(),TgtI,NormI,CurvI);
transTool.AddInterference(TolAng,
TgtI,NormI,CurvI,
It2.Value().Orientation(),
It2.Value().Transition(),
It2.Value().BoundaryTransition());
IL.Remove(It2);
}
// get the cumulated results
It1.ChangeValue().Transition(transTool.Transition());
It1.ChangeValue().BoundaryTransition(transTool.BoundaryTransition());
T.InterferenceBoundaryGeometry(It2.Value(), TgtI, NormI, CurvI);
transTool.AddInterference(TolAng,
TgtI,
NormI,
CurvI,
It2.Value().Orientation(),
It2.Value().Transition(),
It2.Value().BoundaryTransition());
IL.Remove(It2);
}
// get the cumulated results
It1.ChangeValue().Transition(transTool.Transition());
It1.ChangeValue().BoundaryTransition(transTool.BoundaryTransition());
}
}
It1.Next();
}
/*
//Removing "coinciding" interference
/*
//Removing "coinciding" interference
Standard_Real p1, p2;
Standard_Real eps = 1.e-7;
HLRAlgo_InterferenceList ILNew;
HLRAlgo_Interference I1, I2;
TopAbs_Orientation or1, or2;
Standard_Integer l1, l2; //levels
It1.Initialize(IL);
Standard_Real p1, p2;
Standard_Real eps = 1.e-7;
HLRAlgo_InterferenceList ILNew;
HLRAlgo_Interference I1, I2;
TopAbs_Orientation or1, or2;
Standard_Integer l1, l2; //levels
It1.Initialize(IL);
if(It1.More()) {
I1 = It1.Value();
p1 = I1.Intersection().Parameter();
l1 = I1.Intersection().Level();
or1 = I1.Transition();
if(It1.More()) {
I1 = It1.Value();
p1 = I1.Intersection().Parameter();
l1 = I1.Intersection().Level();
or1 = I1.Transition();
ILNew.Append(I1);
HLRAlgo_ListIteratorOfInterferenceList It2(ILNew);
ILNew.Append(I1);
HLRAlgo_ListIteratorOfInterferenceList It2(ILNew);
It1.Next();
while(It1.More()) {
I2 = It1.Value();
p2 = I2.Intersection().Parameter();
l2 = I2.Intersection().Level();
or2 = I2.Transition();
if(p2 - p1 <= eps && or1 == or2) {
ILNew.Remove(It2);
if(l2 < l1) {
ILNew.Append(I2);
}
else {
ILNew.Append(I1);
}
It1.Next();
while(It1.More()) {
I2 = It1.Value();
p2 = I2.Intersection().Parameter();
l2 = I2.Intersection().Level();
or2 = I2.Transition();
if(p2 - p1 <= eps && or1 == or2) {
ILNew.Remove(It2);
if(l2 < l1) {
ILNew.Append(I2);
}
else {
ILNew.Append(I2);
ILNew.Append(I1);
}
It1.Next();
if(It2.More()) It2.Next();
p1 = p2;
l1 = l2;
or1 = or2;
I1 = I2;
}
else {
ILNew.Append(I2);
}
It1.Next();
if(It2.More()) It2.Next();
p1 = p2;
l1 = l2;
or1 = or2;
I1 = I2;
}
IL = ILNew;
}
IL = ILNew;
}
*/
*/
}

View File

@@ -25,42 +25,22 @@
class HLRAlgo_Interference;
class HLRBRep_EdgeInterferenceTool;
class HLRBRep_EdgeIList
class HLRBRep_EdgeIList
{
public:
DEFINE_STANDARD_ALLOC
//! Add the interference <I> to the list <IL>.
Standard_EXPORT static void AddInterference (HLRAlgo_InterferenceList& IL, const HLRAlgo_Interference& I, const HLRBRep_EdgeInterferenceTool& T);
Standard_EXPORT static void AddInterference(HLRAlgo_InterferenceList& IL,
const HLRAlgo_Interference& I,
const HLRBRep_EdgeInterferenceTool& T);
//! Process complex transitions on the list IL.
Standard_EXPORT static void ProcessComplex (HLRAlgo_InterferenceList& IL, const HLRBRep_EdgeInterferenceTool& T);
Standard_EXPORT static void ProcessComplex(HLRAlgo_InterferenceList& IL,
const HLRBRep_EdgeInterferenceTool& T);
protected:
private:
};
#endif // _HLRBRep_EdgeIList_HeaderFile

View File

@@ -15,34 +15,28 @@
// commercial license or contractual agreement.
#ifndef No_Exception
#define No_Exception
#define No_Exception
#endif
#include <HLRBRep_Data.hxx>
#include <HLRBRep_EdgeInterferenceTool.hxx>
//=======================================================================
//function : HLRBRep_EdgeInterferenceTool
//purpose :
//=======================================================================
HLRBRep_EdgeInterferenceTool::HLRBRep_EdgeInterferenceTool
(const Handle(HLRBRep_Data)& DS) : myDS(DS)
//=================================================================================================
HLRBRep_EdgeInterferenceTool::HLRBRep_EdgeInterferenceTool(const Handle(HLRBRep_Data)& DS)
: myDS(DS)
{
}
//=======================================================================
//function : LoadEdge
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeInterferenceTool::LoadEdge()
{
Standard_Real p1,p2;
Standard_ShortReal t1,t2;
Standard_Real p1, p2;
Standard_ShortReal t1, t2;
HLRBRep_Array1OfEData& ED = myDS->EDataArray();
HLRBRep_EdgeData& ed = ED(myDS->Edge());
ed.Status().Bounds(p1,t1,p2,t2);
HLRBRep_EdgeData& ed = ED(myDS->Edge());
ed.Status().Bounds(p1, t1, p2, t2);
inter[0].Parameter(p1);
inter[0].Tolerance(t1);
inter[0].Index(ed.VSta());
@@ -51,68 +45,54 @@ void HLRBRep_EdgeInterferenceTool::LoadEdge()
inter[1].Index(ed.VEnd());
}
//=======================================================================
//function : EdgeGeometry
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeInterferenceTool::EdgeGeometry
(const Standard_Real Param,
gp_Dir& Tgt,
gp_Dir& Nrm,
Standard_Real& CrLE) const
void HLRBRep_EdgeInterferenceTool::EdgeGeometry(const Standard_Real Param,
gp_Dir& Tgt,
gp_Dir& Nrm,
Standard_Real& CrLE) const
{
gp_Dir2d TgLE,NmLE;
myDS->LocalLEGeometry2D(Param,TgLE,NmLE,CrLE);
Tgt.SetCoord(TgLE.X(),TgLE.Y(),0);
Nrm.SetCoord(NmLE.X(),NmLE.Y(),0);
gp_Dir2d TgLE, NmLE;
myDS->LocalLEGeometry2D(Param, TgLE, NmLE, CrLE);
Tgt.SetCoord(TgLE.X(), TgLE.Y(), 0);
Nrm.SetCoord(NmLE.X(), NmLE.Y(), 0);
}
//=======================================================================
//function : SameInterferences
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeInterferenceTool::SameInterferences
(const HLRAlgo_Interference& I1,
const HLRAlgo_Interference& I2) const
Standard_Boolean HLRBRep_EdgeInterferenceTool::SameInterferences(
const HLRAlgo_Interference& I1,
const HLRAlgo_Interference& I2) const
{
Standard_Integer ind1 = I1.Intersection().Index();
Standard_Integer ind2 = I2.Intersection().Index();
if ( ind1 != 0 && ind2 != 0 ) return ind1 == ind2;
if (ind1 != 0 && ind2 != 0)
return ind1 == ind2;
return Standard_False;
}
//=======================================================================
//function : SameVertexAndInterference
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean HLRBRep_EdgeInterferenceTool::SameVertexAndInterference
(const HLRAlgo_Interference& I) const
Standard_Boolean HLRBRep_EdgeInterferenceTool::SameVertexAndInterference(
const HLRAlgo_Interference& I) const
{
if (I.Intersection().Index() == inter[cur].Index())
return Standard_True;
return I.Intersection().Orientation() ==
((cur == 0) ? TopAbs_FORWARD : TopAbs_REVERSED);
return I.Intersection().Orientation() == ((cur == 0) ? TopAbs_FORWARD : TopAbs_REVERSED);
}
//=======================================================================
//function : InterferenceBoundaryGeometry
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_EdgeInterferenceTool::InterferenceBoundaryGeometry
(const HLRAlgo_Interference& I,
gp_Dir& Tang,
gp_Dir& Norm,
Standard_Real& CrFE) const
void HLRBRep_EdgeInterferenceTool::InterferenceBoundaryGeometry(const HLRAlgo_Interference& I,
gp_Dir& Tang,
gp_Dir& Norm,
Standard_Real& CrFE) const
{
Standard_Integer FE;
Standard_Real Param;
gp_Dir2d TgFE,NmFE;
I.Boundary().Value2D(FE,Param);
myDS->LocalFEGeometry2D(FE,Param,TgFE,NmFE,CrFE);
Tang.SetCoord(TgFE.X(),TgFE.Y(),0);
Norm.SetCoord(NmFE.X(),NmFE.Y(),0);
Standard_Real Param;
gp_Dir2d TgFE, NmFE;
I.Boundary().Value2D(FE, Param);
myDS->LocalFEGeometry2D(FE, Param, TgFE, NmFE, CrFE);
Tang.SetCoord(TgFE.X(), TgFE.Y(), 0);
Norm.SetCoord(NmFE.X(), NmFE.Y(), 0);
}

View File

@@ -28,80 +28,66 @@ class HLRBRep_Data;
class gp_Dir;
class HLRAlgo_Interference;
//! Implements the methods required to instantiates
//! the EdgeInterferenceList from HLRAlgo.
class HLRBRep_EdgeInterferenceTool
class HLRBRep_EdgeInterferenceTool
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_EdgeInterferenceTool(const Handle(HLRBRep_Data)& DS);
Standard_EXPORT void LoadEdge();
void InitVertices();
Standard_Boolean MoreVertices() const;
void NextVertex();
const HLRAlgo_Intersection& CurrentVertex() const;
TopAbs_Orientation CurrentOrientation() const;
Standard_Real CurrentParameter() const;
Standard_Boolean IsPeriodic() const;
void InitVertices();
Standard_Boolean MoreVertices() const;
void NextVertex();
const HLRAlgo_Intersection& CurrentVertex() const;
TopAbs_Orientation CurrentOrientation() const;
Standard_Real CurrentParameter() const;
Standard_Boolean IsPeriodic() const;
//! Returns local geometric description of the Edge at
//! parameter <Para>. See method Reset of class
//! EdgeFaceTransition from TopCnx for other arguments.
Standard_EXPORT void EdgeGeometry (const Standard_Real Param, gp_Dir& Tgt, gp_Dir& Nrm, Standard_Real& Curv) const;
Standard_Real ParameterOfInterference (const HLRAlgo_Interference& I) const;
Standard_EXPORT void EdgeGeometry(const Standard_Real Param,
gp_Dir& Tgt,
gp_Dir& Nrm,
Standard_Real& Curv) const;
Standard_Real ParameterOfInterference(const HLRAlgo_Interference& I) const;
//! True if the two interferences are on the same
//! geometric locus.
Standard_EXPORT Standard_Boolean SameInterferences (const HLRAlgo_Interference& I1, const HLRAlgo_Interference& I2) const;
Standard_EXPORT Standard_Boolean SameInterferences(const HLRAlgo_Interference& I1,
const HLRAlgo_Interference& I2) const;
//! True if the Interference and the current Vertex
//! are on the same geometric locus.
Standard_EXPORT Standard_Boolean SameVertexAndInterference (const HLRAlgo_Interference& I) const;
Standard_EXPORT Standard_Boolean SameVertexAndInterference(const HLRAlgo_Interference& I) const;
//! Returns the geometry of the boundary at the
//! interference <I>. See the AddInterference method
//! of the class EdgeFaceTransition from TopCnx for
//! the other arguments.
Standard_EXPORT void InterferenceBoundaryGeometry (const HLRAlgo_Interference& I, gp_Dir& Tang, gp_Dir& Norm, Standard_Real& Curv) const;
Standard_EXPORT void InterferenceBoundaryGeometry(const HLRAlgo_Interference& I,
gp_Dir& Tang,
gp_Dir& Norm,
Standard_Real& Curv) const;
protected:
private:
Handle(HLRBRep_Data) myDS;
HLRAlgo_Intersection inter[2];
Standard_Integer cur;
Standard_Integer cur;
};
#include <HLRBRep_EdgeInterferenceTool.lxx>
#endif // _HLRBRep_EdgeInterferenceTool_HeaderFile

View File

@@ -17,77 +17,85 @@
#include <HLRAlgo_Interference.hxx>
//=======================================================================
//function : InitVertices
//purpose :
// function : InitVertices
// purpose :
//=======================================================================
inline void HLRBRep_EdgeInterferenceTool::InitVertices()
{ cur = 0; }
//=======================================================================
//function : MoreVertices
//purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_EdgeInterferenceTool::MoreVertices() const
{ return cur < 2; }
//=======================================================================
//function : NextVertex
//purpose :
//=======================================================================
inline void HLRBRep_EdgeInterferenceTool::NextVertex()
{ cur++; }
//=======================================================================
//function : CurrentVertex
//purpose :
//=======================================================================
inline const HLRAlgo_Intersection&
HLRBRep_EdgeInterferenceTool::CurrentVertex
() const
{ return inter[cur]; }
//=======================================================================
//function : CurrentOrientation
//purpose :
//=======================================================================
inline TopAbs_Orientation
HLRBRep_EdgeInterferenceTool::CurrentOrientation
() const
{
if (cur == 0) return TopAbs_FORWARD;
else return TopAbs_REVERSED;
cur = 0;
}
//=======================================================================
//function : CurrentParameter
//purpose :
// function : MoreVertices
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_EdgeInterferenceTool::CurrentParameter() const
{ return inter[cur].Parameter(); }
inline Standard_Boolean HLRBRep_EdgeInterferenceTool::MoreVertices() const
{
return cur < 2;
}
//=======================================================================
//function : IsPeriodic
//purpose :
// function : NextVertex
// purpose :
//=======================================================================
inline Standard_Boolean
HLRBRep_EdgeInterferenceTool::IsPeriodic() const
{ return Standard_False; }
inline void HLRBRep_EdgeInterferenceTool::NextVertex()
{
cur++;
}
//=======================================================================
//function : ParameterOfInterference
//purpose :
// function : CurrentVertex
// purpose :
//=======================================================================
inline Standard_Real
HLRBRep_EdgeInterferenceTool::ParameterOfInterference
(const HLRAlgo_Interference& I) const
{ return I.Intersection().Parameter(); }
inline const HLRAlgo_Intersection& HLRBRep_EdgeInterferenceTool::CurrentVertex() const
{
return inter[cur];
}
//=======================================================================
// function : CurrentOrientation
// purpose :
//=======================================================================
inline TopAbs_Orientation HLRBRep_EdgeInterferenceTool::CurrentOrientation() const
{
if (cur == 0)
return TopAbs_FORWARD;
else
return TopAbs_REVERSED;
}
//=======================================================================
// function : CurrentParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_EdgeInterferenceTool::CurrentParameter() const
{
return inter[cur].Parameter();
}
//=======================================================================
// function : IsPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_EdgeInterferenceTool::IsPeriodic() const
{
return Standard_False;
}
//=======================================================================
// function : ParameterOfInterference
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_EdgeInterferenceTool::ParameterOfInterference(
const HLRAlgo_Interference& I) const
{
return I.Intersection().Parameter();
}

View File

@@ -30,60 +30,50 @@ class HLRBRep_TheIntPCurvePCurveOfCInter;
class HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter;
class HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter;
class HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
class HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter(const Standard_Address& C1, const Standard_Address& C2, const Standard_Real Tol);
Standard_EXPORT void Perform (const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& Poly1, const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& Poly2, Standard_Integer& NumSegOn1, Standard_Integer& NumSegOn2, Standard_Real& ParamOnSeg1, Standard_Real& ParamOnSeg2);
Standard_EXPORT void Perform (const Standard_Real Uo, const Standard_Real Vo, const Standard_Real UInf, const Standard_Real VInf, const Standard_Real USup, const Standard_Real VSup);
Standard_EXPORT HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter(
const Standard_Address& C1,
const Standard_Address& C2,
const Standard_Real Tol);
Standard_EXPORT void Perform(const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& Poly1,
const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& Poly2,
Standard_Integer& NumSegOn1,
Standard_Integer& NumSegOn2,
Standard_Real& ParamOnSeg1,
Standard_Real& ParamOnSeg2);
Standard_EXPORT void Perform(const Standard_Real Uo,
const Standard_Real Vo,
const Standard_Real UInf,
const Standard_Real VInf,
const Standard_Real USup,
const Standard_Real VSup);
Standard_EXPORT Standard_Integer NbRoots() const;
Standard_EXPORT void Roots (Standard_Real& U, Standard_Real& V);
Standard_EXPORT void Roots(Standard_Real& U, Standard_Real& V);
Standard_EXPORT Standard_Boolean AnErrorOccurred() const;
protected:
private:
Standard_EXPORT void MathPerform();
Standard_Boolean done;
Standard_Integer nbroots;
Standard_Real myTol;
Standard_Boolean done;
Standard_Integer nbroots;
Standard_Real myTol;
HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter FctDist;
math_Vector ToleranceVector;
math_Vector BInfVector;
math_Vector BSupVector;
math_Vector StartingPoint;
math_Vector Root;
Standard_Boolean anErrorOccurred;
math_Vector ToleranceVector;
math_Vector BInfVector;
math_Vector BSupVector;
math_Vector StartingPoint;
math_Vector Root;
Standard_Boolean anErrorOccurred;
};
#endif // _HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter_HeaderFile

View File

@@ -21,7 +21,6 @@
#include <HLRBRep_TheIntPCurvePCurveOfCInter.hxx>
#include <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#include <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define TheCurve Standard_Address
#define TheCurve_hxx <Standard_Address.hxx>
@@ -32,10 +31,11 @@
#define IntCurve_ThePolygon2d HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
#define IntCurve_ThePolygon2d_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurves HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
#define IntCurve_TheDistBetweenPCurves_hxx <HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_TheDistBetweenPCurves_hxx \
<HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPoint HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter
#define IntCurve_ExactIntersectionPoint_hxx <HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_ExactIntersectionPoint_hxx \
<HLRBRep_ExactIntersectionPointOfTheIntPCurvePCurveOfCInter.hxx>
#define IntCurve_IntPolyPolyGen HLRBRep_TheIntPCurvePCurveOfCInter
#define IntCurve_IntPolyPolyGen_hxx <HLRBRep_TheIntPCurvePCurveOfCInter.hxx>
#include "../IntCurve/IntCurve_ExactIntersectionPoint.gxx"

View File

@@ -14,30 +14,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <HLRAlgo_WiresBlock.hxx>
#include <HLRBRep_FaceData.hxx>
#include <HLRBRep_Surface.hxx>
#include <TopoDS_Face.hxx>
//=======================================================================
//function : FaceData
//purpose :
//=======================================================================
HLRBRep_FaceData::HLRBRep_FaceData () :
myFlags(0),mySize(0)
{ Selected(Standard_True); }
//=================================================================================================
//=======================================================================
//function : Set
//purpose :
//=======================================================================
HLRBRep_FaceData::HLRBRep_FaceData()
: myFlags(0),
mySize(0)
{
Selected(Standard_True);
}
void HLRBRep_FaceData::Set (const TopoDS_Face& FG,
const TopAbs_Orientation Or,
const Standard_Boolean Cl,
const Standard_Integer NW)
//=================================================================================================
void HLRBRep_FaceData::Set(const TopoDS_Face& FG,
const TopAbs_Orientation Or,
const Standard_Boolean Cl,
const Standard_Integer NW)
{
Closed(Cl);
Geometry().Surface(FG);
@@ -46,35 +43,28 @@ void HLRBRep_FaceData::Set (const TopoDS_Face& FG,
Wires() = new HLRAlgo_WiresBlock(NW);
}
//=======================================================================
//function : SetWire
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_FaceData::SetWire (const Standard_Integer WI,
const Standard_Integer NE)
void HLRBRep_FaceData::SetWire(const Standard_Integer WI, const Standard_Integer NE)
{
Wires()->Set(WI,new HLRAlgo_EdgesBlock(NE));
Wires()->Set(WI, new HLRAlgo_EdgesBlock(NE));
}
//=======================================================================
//function : SetWEdge
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_FaceData::SetWEdge (const Standard_Integer WI,
const Standard_Integer EWI,
const Standard_Integer EI,
const TopAbs_Orientation Or,
const Standard_Boolean OutL,
const Standard_Boolean Inte,
const Standard_Boolean Dble,
const Standard_Boolean IsoL)
void HLRBRep_FaceData::SetWEdge(const Standard_Integer WI,
const Standard_Integer EWI,
const Standard_Integer EI,
const TopAbs_Orientation Or,
const Standard_Boolean OutL,
const Standard_Boolean Inte,
const Standard_Boolean Dble,
const Standard_Boolean IsoL)
{
Wires()->Wire(WI)->Edge (EWI,EI);
Wires()->Wire(WI)->Orientation(EWI,Or);
Wires()->Wire(WI)->OutLine (EWI,OutL);
Wires()->Wire(WI)->Internal (EWI,Inte);
Wires()->Wire(WI)->Double (EWI,Dble);
Wires()->Wire(WI)->IsoLine (EWI,IsoL);
Wires()->Wire(WI)->Edge(EWI, EI);
Wires()->Wire(WI)->Orientation(EWI, Or);
Wires()->Wire(WI)->OutLine(EWI, OutL);
Wires()->Wire(WI)->Internal(EWI, Inte);
Wires()->Wire(WI)->Double(EWI, Dble);
Wires()->Wire(WI)->IsoLine(EWI, IsoL);
}

View File

@@ -27,98 +27,103 @@
class HLRAlgo_WiresBlock;
class TopoDS_Face;
class HLRBRep_FaceData
class HLRBRep_FaceData
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_FaceData();
//! <Or> is the orientation of the face. <Cl> is true
//! if the face belongs to a closed volume. <NW> is
//! the number of wires ( or block of edges ) of the
//! face.
Standard_EXPORT void Set (const TopoDS_Face& FG, const TopAbs_Orientation Or, const Standard_Boolean Cl, const Standard_Integer NW);
Standard_EXPORT void Set(const TopoDS_Face& FG,
const TopAbs_Orientation Or,
const Standard_Boolean Cl,
const Standard_Integer NW);
//! Set <NE> the number of edges of the wire number
//! <WI>.
Standard_EXPORT void SetWire (const Standard_Integer WI, const Standard_Integer NE);
Standard_EXPORT void SetWire(const Standard_Integer WI, const Standard_Integer NE);
//! Set the edge number <EWI> of the wire <WI>.
Standard_EXPORT void SetWEdge (const Standard_Integer WI, const Standard_Integer EWI, const Standard_Integer EI, const TopAbs_Orientation Or, const Standard_Boolean OutL, const Standard_Boolean Inte, const Standard_Boolean Dble, const Standard_Boolean IsoL);
Standard_Boolean Selected() const;
void Selected (const Standard_Boolean B);
Standard_Boolean Back() const;
void Back (const Standard_Boolean B);
Standard_Boolean Side() const;
void Side (const Standard_Boolean B);
Standard_Boolean Closed() const;
void Closed (const Standard_Boolean B);
Standard_Boolean Hiding() const;
void Hiding (const Standard_Boolean B);
Standard_Boolean Simple() const;
void Simple (const Standard_Boolean B);
Standard_Boolean Cut() const;
void Cut (const Standard_Boolean B);
Standard_Boolean WithOutL() const;
void WithOutL (const Standard_Boolean B);
Standard_Boolean Plane() const;
void Plane (const Standard_Boolean B);
Standard_Boolean Cylinder() const;
void Cylinder (const Standard_Boolean B);
Standard_Boolean Cone() const;
void Cone (const Standard_Boolean B);
Standard_Boolean Sphere() const;
void Sphere (const Standard_Boolean B);
Standard_Boolean Torus() const;
void Torus (const Standard_Boolean B);
Standard_Real Size() const;
void Size (const Standard_Real S);
TopAbs_Orientation Orientation() const;
void Orientation (const TopAbs_Orientation O);
Handle(HLRAlgo_WiresBlock)& Wires();
HLRBRep_Surface& Geometry();
Standard_ShortReal Tolerance() const;
Standard_EXPORT void SetWEdge(const Standard_Integer WI,
const Standard_Integer EWI,
const Standard_Integer EI,
const TopAbs_Orientation Or,
const Standard_Boolean OutL,
const Standard_Boolean Inte,
const Standard_Boolean Dble,
const Standard_Boolean IsoL);
Standard_Boolean Selected() const;
void Selected(const Standard_Boolean B);
Standard_Boolean Back() const;
void Back(const Standard_Boolean B);
Standard_Boolean Side() const;
void Side(const Standard_Boolean B);
Standard_Boolean Closed() const;
void Closed(const Standard_Boolean B);
Standard_Boolean Hiding() const;
void Hiding(const Standard_Boolean B);
Standard_Boolean Simple() const;
void Simple(const Standard_Boolean B);
Standard_Boolean Cut() const;
void Cut(const Standard_Boolean B);
Standard_Boolean WithOutL() const;
void WithOutL(const Standard_Boolean B);
Standard_Boolean Plane() const;
void Plane(const Standard_Boolean B);
Standard_Boolean Cylinder() const;
void Cylinder(const Standard_Boolean B);
Standard_Boolean Cone() const;
void Cone(const Standard_Boolean B);
Standard_Boolean Sphere() const;
void Sphere(const Standard_Boolean B);
Standard_Boolean Torus() const;
void Torus(const Standard_Boolean B);
Standard_Real Size() const;
void Size(const Standard_Real S);
TopAbs_Orientation Orientation() const;
void Orientation(const TopAbs_Orientation O);
Handle(HLRAlgo_WiresBlock)& Wires();
HLRBRep_Surface& Geometry();
Standard_ShortReal Tolerance() const;
protected:
enum EMaskFlags
{
EMaskOrient = 15,
@@ -138,13 +143,11 @@ protected:
};
private:
Standard_Integer myFlags;
Standard_Integer myFlags;
Handle(HLRAlgo_WiresBlock) myWires;
HLRBRep_Surface myGeometry;
Standard_Real mySize;
Standard_ShortReal myTolerance;
HLRBRep_Surface myGeometry;
Standard_Real mySize;
Standard_ShortReal myTolerance;
};
#include <HLRBRep_FaceData.lxx>

View File

@@ -15,279 +15,337 @@
// commercial license or contractual agreement.
//=======================================================================
//function : Selected
//purpose :
// function : Selected
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Selected() const
{ return (myFlags & (Standard_Integer)FMaskSelected) != 0; }
{
return (myFlags & (Standard_Integer)FMaskSelected) != 0;
}
//=======================================================================
//function : Selected
//purpose :
// function : Selected
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Selected(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskSelected;
else myFlags &= ~((Standard_Integer)FMaskSelected);
if (B)
myFlags |= (Standard_Integer)FMaskSelected;
else
myFlags &= ~((Standard_Integer)FMaskSelected);
}
//=======================================================================
//function : Back
//purpose :
// function : Back
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Back() const
{ return (myFlags & (Standard_Integer)FMaskBack) != 0; }
{
return (myFlags & (Standard_Integer)FMaskBack) != 0;
}
//=======================================================================
//function : Back
//purpose :
// function : Back
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Back(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskBack;
else myFlags &= ~((Standard_Integer)FMaskBack);
if (B)
myFlags |= (Standard_Integer)FMaskBack;
else
myFlags &= ~((Standard_Integer)FMaskBack);
}
//=======================================================================
//function : Side
//purpose :
// function : Side
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Side() const
{ return (myFlags & (Standard_Integer)FMaskSide) != 0; }
{
return (myFlags & (Standard_Integer)FMaskSide) != 0;
}
//=======================================================================
//function : Side
//purpose :
// function : Side
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Side(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskSide;
else myFlags &= ~((Standard_Integer)FMaskSide);
if (B)
myFlags |= (Standard_Integer)FMaskSide;
else
myFlags &= ~((Standard_Integer)FMaskSide);
}
//=======================================================================
//function : Closed
//purpose :
// function : Closed
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Closed() const
{ return (myFlags & (Standard_Integer)FMaskClosed) != 0; }
{
return (myFlags & (Standard_Integer)FMaskClosed) != 0;
}
//=======================================================================
//function : Closed
//purpose :
// function : Closed
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Closed(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskClosed;
else myFlags &= ~((Standard_Integer)FMaskClosed);
if (B)
myFlags |= (Standard_Integer)FMaskClosed;
else
myFlags &= ~((Standard_Integer)FMaskClosed);
}
//=======================================================================
//function : Hiding
//purpose :
// function : Hiding
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Hiding() const
{ return (myFlags & (Standard_Integer)FMaskHiding) != 0; }
{
return (myFlags & (Standard_Integer)FMaskHiding) != 0;
}
//=======================================================================
//function : Hiding
//purpose :
// function : Hiding
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Hiding(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskHiding;
else myFlags &= ~((Standard_Integer)FMaskHiding);
if (B)
myFlags |= (Standard_Integer)FMaskHiding;
else
myFlags &= ~((Standard_Integer)FMaskHiding);
}
//=======================================================================
//function : Simple
//purpose :
// function : Simple
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Simple() const
{ return (myFlags & (Standard_Integer)FMaskSimple) != 0; }
{
return (myFlags & (Standard_Integer)FMaskSimple) != 0;
}
//=======================================================================
//function : Simple
//purpose :
// function : Simple
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Simple(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskSimple;
else myFlags &= ~((Standard_Integer)FMaskSimple);
if (B)
myFlags |= (Standard_Integer)FMaskSimple;
else
myFlags &= ~((Standard_Integer)FMaskSimple);
}
//=======================================================================
//function : Cut
//purpose :
// function : Cut
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cut() const
{ return (myFlags & (Standard_Integer)FMaskCut) != 0; }
{
return (myFlags & (Standard_Integer)FMaskCut) != 0;
}
//=======================================================================
//function : Cut
//purpose :
// function : Cut
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cut(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskCut;
else myFlags &= ~((Standard_Integer)FMaskCut);
if (B)
myFlags |= (Standard_Integer)FMaskCut;
else
myFlags &= ~((Standard_Integer)FMaskCut);
}
//=======================================================================
//function : WithOutL
//purpose :
// function : WithOutL
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::WithOutL() const
{ return (myFlags & (Standard_Integer)FMaskWithOutL) != 0; }
{
return (myFlags & (Standard_Integer)FMaskWithOutL) != 0;
}
//=======================================================================
//function : WithOutL
//purpose :
// function : WithOutL
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::WithOutL(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskWithOutL;
else myFlags &= ~((Standard_Integer)FMaskWithOutL);
if (B)
myFlags |= (Standard_Integer)FMaskWithOutL;
else
myFlags &= ~((Standard_Integer)FMaskWithOutL);
}
//=======================================================================
//function : Plane
//purpose :
// function : Plane
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Plane() const
{ return (myFlags & (Standard_Integer)FMaskPlane) != 0; }
{
return (myFlags & (Standard_Integer)FMaskPlane) != 0;
}
//=======================================================================
//function : Plane
//purpose :
// function : Plane
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Plane(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskPlane;
else myFlags &= ~((Standard_Integer)FMaskPlane);
if (B)
myFlags |= (Standard_Integer)FMaskPlane;
else
myFlags &= ~((Standard_Integer)FMaskPlane);
}
//=======================================================================
//function : Cylinder
//purpose :
// function : Cylinder
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cylinder() const
{ return (myFlags & (Standard_Integer)FMaskCylinder) != 0; }
{
return (myFlags & (Standard_Integer)FMaskCylinder) != 0;
}
//=======================================================================
//function : Cylinder
//purpose :
// function : Cylinder
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cylinder(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskCylinder;
else myFlags &= ~((Standard_Integer)FMaskCylinder);
if (B)
myFlags |= (Standard_Integer)FMaskCylinder;
else
myFlags &= ~((Standard_Integer)FMaskCylinder);
}
//=======================================================================
//function : Cone
//purpose :
// function : Cone
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cone() const
{ return (myFlags & (Standard_Integer)FMaskCone) != 0; }
{
return (myFlags & (Standard_Integer)FMaskCone) != 0;
}
//=======================================================================
//function : Cone
//purpose :
// function : Cone
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cone(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskCone;
else myFlags &= ~((Standard_Integer)FMaskCone);
if (B)
myFlags |= (Standard_Integer)FMaskCone;
else
myFlags &= ~((Standard_Integer)FMaskCone);
}
//=======================================================================
//function : Sphere
//purpose :
// function : Sphere
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Sphere() const
{ return (myFlags & (Standard_Integer)FMaskSphere) != 0; }
{
return (myFlags & (Standard_Integer)FMaskSphere) != 0;
}
//=======================================================================
//function : Sphere
//purpose :
// function : Sphere
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Sphere(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskSphere;
else myFlags &= ~((Standard_Integer)FMaskSphere);
if (B)
myFlags |= (Standard_Integer)FMaskSphere;
else
myFlags &= ~((Standard_Integer)FMaskSphere);
}
//=======================================================================
//function : Torus
//purpose :
// function : Torus
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Torus() const
{ return (myFlags & (Standard_Integer)FMaskTorus) != 0; }
{
return (myFlags & (Standard_Integer)FMaskTorus) != 0;
}
//=======================================================================
//function : Torus
//purpose :
// function : Torus
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Torus(const Standard_Boolean B)
{
if (B) myFlags |= (Standard_Integer)FMaskTorus;
else myFlags &= ~((Standard_Integer)FMaskTorus);
if (B)
myFlags |= (Standard_Integer)FMaskTorus;
else
myFlags &= ~((Standard_Integer)FMaskTorus);
}
//=======================================================================
//function : Size
//purpose :
// function : Size
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_FaceData::Size() const
{ return mySize; }
{
return mySize;
}
//=======================================================================
//function : Size
//purpose :
// function : Size
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Size(const Standard_Real S)
{ mySize = S; }
{
mySize = S;
}
//=======================================================================
//function : Orientation
//purpose :
// function : Orientation
// purpose :
//=======================================================================
inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
{ return ((TopAbs_Orientation)(myFlags & (Standard_Integer)EMaskOrient)); }
{
return ((TopAbs_Orientation)(myFlags & (Standard_Integer)EMaskOrient));
}
//=======================================================================
//function : Orientation
//purpose :
// function : Orientation
// purpose :
//=======================================================================
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
@@ -297,25 +355,31 @@ inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
}
//=======================================================================
//function : Wires
//purpose :
// function : Wires
// purpose :
//=======================================================================
inline Handle(HLRAlgo_WiresBlock)& HLRBRep_FaceData::Wires()
{ return myWires; }
{
return myWires;
}
//=======================================================================
//function : Geometry
//purpose :
// function : Geometry
// purpose :
//=======================================================================
inline HLRBRep_Surface& HLRBRep_FaceData::Geometry()
{ return myGeometry; }
{
return myGeometry;
}
//=======================================================================
//function : Tolerance
//purpose :
// function : Tolerance
// purpose :
//=======================================================================
inline Standard_ShortReal HLRBRep_FaceData::Tolerance () const
{ return myTolerance; }
inline Standard_ShortReal HLRBRep_FaceData::Tolerance() const
{
return myTolerance;
}

View File

@@ -15,48 +15,40 @@
// commercial license or contractual agreement.
#ifndef No_Exception
#define No_Exception
#define No_Exception
#endif
#include <HLRBRep_FaceData.hxx>
#include <HLRBRep_FaceIterator.hxx>
//=======================================================================
//function : FaceIterator
//purpose :
//=======================================================================
HLRBRep_FaceIterator::HLRBRep_FaceIterator()
{}
//=================================================================================================
//=======================================================================
//function : InitEdge
//purpose :
//=======================================================================
HLRBRep_FaceIterator::HLRBRep_FaceIterator() {}
//=================================================================================================
void HLRBRep_FaceIterator::InitEdge(HLRBRep_FaceData& fd)
{
iWire = 0;
iWire = 0;
myWires = fd.Wires();
nbWires = myWires->NbWires();
iEdge = 0;
iEdge = 0;
nbEdges = 0;
NextEdge();
}
//=======================================================================
//function : NextEdge
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_FaceIterator::NextEdge()
{
iEdge++;
if (iEdge > nbEdges) {
if (iEdge > nbEdges)
{
iWire++;
if (iWire <= nbWires) {
iEdge = 1;
if (iWire <= nbWires)
{
iEdge = 1;
myEdges = myWires->Wire(iWire);
nbEdges = myEdges->NbEdges();
}

View File

@@ -27,78 +27,56 @@ class HLRAlgo_WiresBlock;
class HLRAlgo_EdgesBlock;
class HLRBRep_FaceData;
class HLRBRep_FaceIterator
class HLRBRep_FaceIterator
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_FaceIterator();
//! Begin an exploration of the edges of the face <fd>
Standard_EXPORT void InitEdge (HLRBRep_FaceData& fd);
Standard_Boolean MoreEdge() const;
Standard_EXPORT void InitEdge(HLRBRep_FaceData& fd);
Standard_Boolean MoreEdge() const;
Standard_EXPORT void NextEdge();
//! Returns True if the current edge is the first of a
//! wire.
Standard_Boolean BeginningOfWire() const;
Standard_Boolean BeginningOfWire() const;
//! Returns True if the current edge is the last of a
//! wire.
Standard_Boolean EndOfWire() const;
Standard_Boolean EndOfWire() const;
//! Skip the current wire in the exploration.
void SkipWire();
void SkipWire();
//! Returns the edges of the current wire.
Handle(HLRAlgo_EdgesBlock) Wire() const;
Standard_Integer Edge() const;
TopAbs_Orientation Orientation() const;
Standard_Boolean OutLine() const;
Standard_Boolean Internal() const;
Standard_Boolean Double() const;
Standard_Boolean IsoLine() const;
Handle(HLRAlgo_EdgesBlock) Wire() const;
Standard_Integer Edge() const;
TopAbs_Orientation Orientation() const;
Standard_Boolean OutLine() const;
Standard_Boolean Internal() const;
Standard_Boolean Double() const;
Standard_Boolean IsoLine() const;
protected:
private:
Standard_Integer iWire;
Standard_Integer nbWires;
Standard_Integer iEdge;
Standard_Integer nbEdges;
Standard_Integer iWire;
Standard_Integer nbWires;
Standard_Integer iEdge;
Standard_Integer nbEdges;
Handle(HLRAlgo_WiresBlock) myWires;
Handle(HLRAlgo_EdgesBlock) myEdges;
};
#include <HLRBRep_FaceIterator.lxx>
#endif // _HLRBRep_FaceIterator_HeaderFile

View File

@@ -18,92 +18,112 @@
#include <HLRAlgo_EdgesBlock.hxx>
//=======================================================================
//function : MoreEdge
//purpose :
// function : MoreEdge
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::MoreEdge () const
{ return iWire <= nbWires;}
inline Standard_Boolean HLRBRep_FaceIterator::MoreEdge() const
{
return iWire <= nbWires;
}
//=======================================================================
//function : BeginningOfWire
//purpose :
// function : BeginningOfWire
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::BeginningOfWire () const
{ return iEdge == 1;}
inline Standard_Boolean HLRBRep_FaceIterator::BeginningOfWire() const
{
return iEdge == 1;
}
//=======================================================================
//function : EndOfWire
//purpose :
// function : EndOfWire
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::EndOfWire () const
{ return iEdge == nbEdges;}
inline Standard_Boolean HLRBRep_FaceIterator::EndOfWire() const
{
return iEdge == nbEdges;
}
//=======================================================================
//function : SkipWire
//purpose :
// function : SkipWire
// purpose :
//=======================================================================
inline void HLRBRep_FaceIterator::SkipWire ()
{
inline void HLRBRep_FaceIterator::SkipWire()
{
iEdge = nbEdges;
NextEdge();
}
//=======================================================================
//function : Wire
//purpose :
// function : Wire
// purpose :
//=======================================================================
inline Handle(HLRAlgo_EdgesBlock) HLRBRep_FaceIterator::Wire() const
{ return myWires->Wire(iWire); }
{
return myWires->Wire(iWire);
}
//=======================================================================
//function : Edge
//purpose :
// function : Edge
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_FaceIterator::Edge () const
{ return myEdges->Edge(iEdge); }
inline Standard_Integer HLRBRep_FaceIterator::Edge() const
{
return myEdges->Edge(iEdge);
}
//=======================================================================
//function : Orientation
//purpose :
// function : Orientation
// purpose :
//=======================================================================
inline TopAbs_Orientation HLRBRep_FaceIterator::Orientation() const
{ return myEdges->Orientation(iEdge); }
{
return myEdges->Orientation(iEdge);
}
//=======================================================================
//function : OutLine
//purpose :
// function : OutLine
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::OutLine() const
{ return myEdges->OutLine(iEdge); }
{
return myEdges->OutLine(iEdge);
}
//=======================================================================
//function : Internal
//purpose :
// function : Internal
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::Internal() const
{ return myEdges->Internal(iEdge); }
{
return myEdges->Internal(iEdge);
}
//=======================================================================
//function : Double
//purpose :
// function : Double
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::Double() const
{ return myEdges->Double(iEdge); }
{
return myEdges->Double(iEdge);
}
//=======================================================================
//function : IsoLine
//purpose :
// function : IsoLine
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceIterator::IsoLine() const
{ return myEdges->IsoLine(iEdge); }
{
return myEdges->IsoLine(iEdge);
}

View File

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRep_Builder.hxx>
#include <HLRAlgo_EdgeIterator.hxx>
#include <HLRBRep.hxx>
@@ -28,222 +27,235 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
//=======================================================================
//function : HLRBRep_HLRToShape
//purpose :
//=======================================================================
HLRBRep_HLRToShape::HLRBRep_HLRToShape (const Handle(HLRBRep_Algo)& A) :
myAlgo(A)
{}
//=================================================================================================
//=======================================================================
//function : InternalCompound
//purpose :
//=======================================================================
TopoDS_Shape
HLRBRep_HLRToShape::InternalCompound (const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S,
const Standard_Boolean In3d)
HLRBRep_HLRToShape::HLRBRep_HLRToShape(const Handle(HLRBRep_Algo)& A)
: myAlgo(A)
{
Standard_Boolean added = Standard_False;
TopoDS_Shape Result;
}
//=================================================================================================
TopoDS_Shape HLRBRep_HLRToShape::InternalCompound(const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S,
const Standard_Boolean In3d)
{
Standard_Boolean added = Standard_False;
TopoDS_Shape Result;
Handle(HLRBRep_Data) DS = myAlgo->DataStructure();
if (!DS.IsNull()) {
if (!DS.IsNull())
{
DS->Projector().Scaled(Standard_True);
Standard_Integer e1 = 1;
Standard_Integer e2 = DS->NbEdges();
Standard_Integer f1 = 1;
Standard_Integer f2 = DS->NbFaces();
Standard_Integer e1 = 1;
Standard_Integer e2 = DS->NbEdges();
Standard_Integer f1 = 1;
Standard_Integer f2 = DS->NbFaces();
Standard_Boolean explor = Standard_False;
// Standard_Boolean todraw;
if (!S.IsNull()) {
Standard_Integer v1,v2;
// Standard_Boolean todraw;
if (!S.IsNull())
{
Standard_Integer v1, v2;
Standard_Integer index = myAlgo->Index(S);
if (index == 0) explor = Standard_True;
else myAlgo->ShapeBounds(index).Bounds(v1,v2,e1,e2,f1,f2);
if (index == 0)
explor = Standard_True;
else
myAlgo->ShapeBounds(index).Bounds(v1, v2, e1, e2, f1, f2);
}
BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Result));
HLRBRep_EdgeData* ed = &(DS->EDataArray().ChangeValue(e1 - 1));
for (Standard_Integer ie = e1; ie <= e2; ie++) {
for (Standard_Integer ie = e1; ie <= e2; ie++)
{
ed++;
if (ed->Selected() && !ed->Vertical()) {
ed->Used(Standard_False);
ed->HideCount(0);
if (ed->Selected() && !ed->Vertical())
{
ed->Used(Standard_False);
ed->HideCount(0);
}
else ed->Used(Standard_True);
else
ed->Used(Standard_True);
}
if (explor) {
if (explor)
{
TopTools_IndexedMapOfShape& Edges = DS->EdgeMap();
TopTools_IndexedMapOfShape& Faces = DS->FaceMap();
TopExp_Explorer Exp;
for (Exp.Init (S, TopAbs_FACE);
Exp.More();
Exp.Next()) {
Standard_Integer iface = Faces.FindIndex(Exp.Current());
if (iface != 0)
DrawFace(visible,typ,iface,DS,Result,added,In3d);
}
if (typ >= 3) {
TopExp_Explorer Exp;
for (Exp.Init (S, TopAbs_EDGE, TopAbs_FACE);
Exp.More();
Exp.Next()) {
Standard_Integer ie = Edges.FindIndex(Exp.Current());
if (ie != 0) {
HLRBRep_EdgeData& EDataIE = DS->EDataArray().ChangeValue(ie);
if (!EDataIE.Used()) {
DrawEdge(visible,Standard_False,typ, EDataIE,Result,added,In3d);
EDataIE.Used(Standard_True);
}
}
}
for (Exp.Init(S, TopAbs_FACE); Exp.More(); Exp.Next())
{
Standard_Integer iface = Faces.FindIndex(Exp.Current());
if (iface != 0)
DrawFace(visible, typ, iface, DS, Result, added, In3d);
}
if (typ >= 3)
{
for (Exp.Init(S, TopAbs_EDGE, TopAbs_FACE); Exp.More(); Exp.Next())
{
Standard_Integer ie = Edges.FindIndex(Exp.Current());
if (ie != 0)
{
HLRBRep_EdgeData& EDataIE = DS->EDataArray().ChangeValue(ie);
if (!EDataIE.Used())
{
DrawEdge(visible, Standard_False, typ, EDataIE, Result, added, In3d);
EDataIE.Used(Standard_True);
}
}
}
}
}
else {
else
{
for (Standard_Integer iface = f1; iface <= f2; iface++)
DrawFace(visible,typ,iface,DS,Result,added,In3d);
DrawFace(visible, typ, iface, DS, Result, added, In3d);
if (typ >= 3) {
HLRBRep_EdgeData* EDataE11 = &(DS->EDataArray().ChangeValue(e1 - 1));
for (Standard_Integer ie = e1; ie <= e2; ie++) {
if (typ >= 3)
{
HLRBRep_EdgeData* EDataE11 = &(DS->EDataArray().ChangeValue(e1 - 1));
for (Standard_Integer ie = e1; ie <= e2; ie++)
{
EDataE11++;
if (!EDataE11->Used()) {
DrawEdge(visible,Standard_False,typ,*EDataE11,Result,added,In3d);
EDataE11->Used(Standard_True);
}
}
if (!EDataE11->Used())
{
DrawEdge(visible, Standard_False, typ, *EDataE11, Result, added, In3d);
EDataE11->Used(Standard_True);
}
}
}
}
DS->Projector().Scaled(Standard_False);
}
if (!added) Result = TopoDS_Shape();
if (!added)
Result = TopoDS_Shape();
return Result;
}
//=======================================================================
//function : DrawFace
//purpose :
//=======================================================================
//=================================================================================================
void
HLRBRep_HLRToShape::DrawFace (const Standard_Boolean visible,
const Standard_Integer typ,
const Standard_Integer iface,
Handle(HLRBRep_Data)& DS,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d) const
void HLRBRep_HLRToShape::DrawFace(const Standard_Boolean visible,
const Standard_Integer typ,
const Standard_Integer iface,
Handle(HLRBRep_Data)& DS,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d) const
{
HLRBRep_FaceIterator Itf;
for (Itf.InitEdge(DS->FDataArray().ChangeValue(iface));
Itf.MoreEdge();
Itf.NextEdge()) {
Standard_Integer ie = Itf.Edge();
for (Itf.InitEdge(DS->FDataArray().ChangeValue(iface)); Itf.MoreEdge(); Itf.NextEdge())
{
Standard_Integer ie = Itf.Edge();
HLRBRep_EdgeData& edf = DS->EDataArray().ChangeValue(ie);
if (!edf.Used()) {
if (!edf.Used())
{
Standard_Boolean todraw;
if (typ == 1) todraw = Itf.IsoLine();
else if (typ == 2) //outlines
if (typ == 1)
todraw = Itf.IsoLine();
else if (typ == 2) // outlines
{
if (In3d)
todraw = Itf.Internal() || Itf.OutLine();
else
todraw = Itf.Internal();
todraw = Itf.Internal();
}
else if (typ == 3) todraw = edf.Rg1Line() &&
!edf.RgNLine() && !Itf.OutLine();
else if (typ == 4) todraw = edf.RgNLine() && !Itf.OutLine();
else todraw =
!(Itf.IsoLine() ||
Itf.Internal() ||
(edf.Rg1Line() && !Itf.OutLine()));
else if (typ == 3)
todraw = edf.Rg1Line() && !edf.RgNLine() && !Itf.OutLine();
else if (typ == 4)
todraw = edf.RgNLine() && !Itf.OutLine();
else
todraw = !(Itf.IsoLine() || Itf.Internal() || (edf.Rg1Line() && !Itf.OutLine()));
if (todraw) {
DrawEdge(visible,Standard_True,typ,edf,Result,added,In3d);
edf.Used(Standard_True);
if (todraw)
{
DrawEdge(visible, Standard_True, typ, edf, Result, added, In3d);
edf.Used(Standard_True);
}
else {
if((typ > 4 || typ == 2) && //sharp or outlines
(edf.Rg1Line() && !Itf.OutLine()))
else
{
if ((typ > 4 || typ == 2) && // sharp or outlines
(edf.Rg1Line() && !Itf.OutLine()))
{
Standard_Integer hc = edf.HideCount();
if(hc > 0) {
edf.Used(Standard_True);
}
else {
++hc;
edf.HideCount(hc); //to try with another face
}
}
else {
edf.Used(Standard_True);
}
Standard_Integer hc = edf.HideCount();
if (hc > 0)
{
edf.Used(Standard_True);
}
else
{
++hc;
edf.HideCount(hc); // to try with another face
}
}
else
{
edf.Used(Standard_True);
}
}
}
}
}
//=======================================================================
//function : DrawEdge
//purpose :
//=======================================================================
//=================================================================================================
void
HLRBRep_HLRToShape::DrawEdge (const Standard_Boolean visible,
const Standard_Boolean inFace,
const Standard_Integer typ,
HLRBRep_EdgeData& ed,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d) const
void HLRBRep_HLRToShape::DrawEdge(const Standard_Boolean visible,
const Standard_Boolean inFace,
const Standard_Integer typ,
HLRBRep_EdgeData& ed,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d) const
{
Standard_Boolean todraw = Standard_False;
if (inFace) todraw = Standard_True;
else if (typ == 3) todraw = ed.Rg1Line() && !ed.RgNLine();
else if (typ == 4) todraw = ed.RgNLine();
else todraw =!ed.Rg1Line();
if (inFace)
todraw = Standard_True;
else if (typ == 3)
todraw = ed.Rg1Line() && !ed.RgNLine();
else if (typ == 4)
todraw = ed.RgNLine();
else
todraw = !ed.Rg1Line();
if (todraw) {
Standard_Real sta,end;
Standard_ShortReal tolsta,tolend;
BRep_Builder B;
TopoDS_Edge E;
if (todraw)
{
Standard_Real sta, end;
Standard_ShortReal tolsta, tolend;
BRep_Builder B;
TopoDS_Edge E;
HLRAlgo_EdgeIterator It;
if (visible)
{
for (It.InitVisible(ed.Status()); It.MoreVisible(); It.NextVisible()) {
It.Visible(sta,tolsta,end,tolend);
for (It.InitVisible(ed.Status()); It.MoreVisible(); It.NextVisible())
{
It.Visible(sta, tolsta, end, tolend);
if (!In3d)
E = HLRBRep::MakeEdge(ed.Geometry(),sta,end);
E = HLRBRep::MakeEdge(ed.Geometry(), sta, end);
else
E = HLRBRep::MakeEdge3d(ed.Geometry(),sta,end);
E = HLRBRep::MakeEdge3d(ed.Geometry(), sta, end);
if (!E.IsNull())
{
B.Add(Result,E);
B.Add(Result, E);
added = Standard_True;
}
}
}
else
{
for (It.InitHidden(ed.Status()); It.MoreHidden(); It.NextHidden()) {
It.Hidden(sta,tolsta,end,tolend);
for (It.InitHidden(ed.Status()); It.MoreHidden(); It.NextHidden())
{
It.Hidden(sta, tolsta, end, tolend);
if (!In3d)
E = HLRBRep::MakeEdge(ed.Geometry(),sta,end);
E = HLRBRep::MakeEdge(ed.Geometry(), sta, end);
else
E = HLRBRep::MakeEdge3d(ed.Geometry(),sta,end);
E = HLRBRep::MakeEdge3d(ed.Geometry(), sta, end);
if (!E.IsNull())
{
B.Add(Result,E);
B.Add(Result, E);
added = Standard_True;
}
}

View File

@@ -29,7 +29,6 @@ class TopoDS_Shape;
class HLRBRep_Data;
class HLRBRep_EdgeData;
//! A framework for filtering the computation
//! results of an HLRBRep_Algo algorithm by extraction.
//! From the results calculated by the algorithm on
@@ -58,106 +57,102 @@ class HLRBRep_EdgeData;
//! new computation of the algorithm, but only
//! reads its internal results.
//! The methods of this shape are almost identic to those of the HLRBrep_PolyHLRToShape class.
class HLRBRep_HLRToShape
class HLRBRep_HLRToShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for filtering the
//! results of the HLRBRep_Algo algorithm, A.
//! Use the extraction filters to obtain the results you want for A.
Standard_EXPORT HLRBRep_HLRToShape(const Handle(HLRBRep_Algo)& A);
TopoDS_Shape VCompound();
TopoDS_Shape VCompound (const TopoDS_Shape& S);
TopoDS_Shape Rg1LineVCompound();
TopoDS_Shape Rg1LineVCompound (const TopoDS_Shape& S);
TopoDS_Shape RgNLineVCompound();
TopoDS_Shape RgNLineVCompound (const TopoDS_Shape& S);
TopoDS_Shape OutLineVCompound();
TopoDS_Shape OutLineVCompound3d();
TopoDS_Shape OutLineVCompound (const TopoDS_Shape& S);
TopoDS_Shape IsoLineVCompound();
TopoDS_Shape IsoLineVCompound (const TopoDS_Shape& S);
TopoDS_Shape HCompound();
TopoDS_Shape HCompound (const TopoDS_Shape& S);
TopoDS_Shape Rg1LineHCompound();
TopoDS_Shape Rg1LineHCompound (const TopoDS_Shape& S);
TopoDS_Shape RgNLineHCompound();
TopoDS_Shape RgNLineHCompound (const TopoDS_Shape& S);
TopoDS_Shape OutLineHCompound();
TopoDS_Shape OutLineHCompound (const TopoDS_Shape& S);
TopoDS_Shape IsoLineHCompound();
TopoDS_Shape IsoLineHCompound (const TopoDS_Shape& S);
//! Returns compound of resulting edges
//! of required type and visibility,
//! taking into account the kind of space
//! (2d or 3d)
TopoDS_Shape CompoundOfEdges(const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d);
//! For specified shape
//! returns compound of resulting edges
//! of required type and visibility,
//! taking into account the kind of space
//! (2d or 3d)
TopoDS_Shape CompoundOfEdges(const TopoDS_Shape& S,
const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d);
TopoDS_Shape VCompound();
TopoDS_Shape VCompound(const TopoDS_Shape& S);
TopoDS_Shape Rg1LineVCompound();
TopoDS_Shape Rg1LineVCompound(const TopoDS_Shape& S);
TopoDS_Shape RgNLineVCompound();
TopoDS_Shape RgNLineVCompound(const TopoDS_Shape& S);
TopoDS_Shape OutLineVCompound();
TopoDS_Shape OutLineVCompound3d();
TopoDS_Shape OutLineVCompound(const TopoDS_Shape& S);
TopoDS_Shape IsoLineVCompound();
TopoDS_Shape IsoLineVCompound(const TopoDS_Shape& S);
TopoDS_Shape HCompound();
TopoDS_Shape HCompound(const TopoDS_Shape& S);
TopoDS_Shape Rg1LineHCompound();
TopoDS_Shape Rg1LineHCompound(const TopoDS_Shape& S);
TopoDS_Shape RgNLineHCompound();
TopoDS_Shape RgNLineHCompound(const TopoDS_Shape& S);
TopoDS_Shape OutLineHCompound();
TopoDS_Shape OutLineHCompound(const TopoDS_Shape& S);
TopoDS_Shape IsoLineHCompound();
TopoDS_Shape IsoLineHCompound(const TopoDS_Shape& S);
//! Returns compound of resulting edges
//! of required type and visibility,
//! taking into account the kind of space
//! (2d or 3d)
TopoDS_Shape CompoundOfEdges(const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d);
//! For specified shape
//! returns compound of resulting edges
//! of required type and visibility,
//! taking into account the kind of space
//! (2d or 3d)
TopoDS_Shape CompoundOfEdges(const TopoDS_Shape& S,
const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d);
protected:
private:
Standard_EXPORT TopoDS_Shape InternalCompound(const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S,
const Standard_Boolean In3d = Standard_False);
Standard_EXPORT TopoDS_Shape InternalCompound (const Standard_Integer typ, const Standard_Boolean visible, const TopoDS_Shape& S, const Standard_Boolean In3d = Standard_False);
Standard_EXPORT void DrawFace (const Standard_Boolean visible, const Standard_Integer typ, const Standard_Integer iface, Handle(HLRBRep_Data)& DS, TopoDS_Shape& Result, Standard_Boolean& added, const Standard_Boolean In3d = Standard_False) const;
Standard_EXPORT void DrawEdge (const Standard_Boolean visible, const Standard_Boolean inFace, const Standard_Integer typ, HLRBRep_EdgeData& ed, TopoDS_Shape& Result, Standard_Boolean& added, const Standard_Boolean In3d = Standard_False) const;
Standard_EXPORT void DrawFace(const Standard_Boolean visible,
const Standard_Integer typ,
const Standard_Integer iface,
Handle(HLRBRep_Data)& DS,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d = Standard_False) const;
Standard_EXPORT void DrawEdge(const Standard_Boolean visible,
const Standard_Boolean inFace,
const Standard_Integer typ,
HLRBRep_EdgeData& ed,
TopoDS_Shape& Result,
Standard_Boolean& added,
const Standard_Boolean In3d = Standard_False) const;
Handle(HLRBRep_Algo) myAlgo;
};
#include <HLRBRep_HLRToShape.lxx>
#endif // _HLRBRep_HLRToShape_HeaderFile

View File

@@ -17,202 +17,236 @@
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : VCompound
//purpose :
// function : VCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::VCompound()
{ return InternalCompound(5,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(5, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : VCompound
//purpose :
// function : VCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::VCompound(const TopoDS_Shape& S)
{ return InternalCompound(5,Standard_True,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::VCompound(const TopoDS_Shape& S)
{
return InternalCompound(5, Standard_True, S);
}
//=======================================================================
//function : Rg1LineVCompound
//purpose :
// function : Rg1LineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::Rg1LineVCompound()
{ return InternalCompound(3,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(3, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : Rg1LineVCompound
//purpose :
// function : Rg1LineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::Rg1LineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(3,Standard_True,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::Rg1LineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(3, Standard_True, S);
}
//=======================================================================
//function : RgNLineVCompound
//purpose :
// function : RgNLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::RgNLineVCompound()
{ return InternalCompound(4,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(4, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : RgNLineVCompound
//purpose :
// function : RgNLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::RgNLineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(4,Standard_True,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::RgNLineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(4, Standard_True, S);
}
//=======================================================================
//function : OutLineVCompound
//purpose :
// function : OutLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::OutLineVCompound()
{ return InternalCompound(2,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(2, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : OutLineVCompound3d
//purpose :
// function : OutLineVCompound3d
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::OutLineVCompound3d()
{ return InternalCompound(2,Standard_True,TopoDS_Shape(),Standard_True); }
{
return InternalCompound(2, Standard_True, TopoDS_Shape(), Standard_True);
}
//=======================================================================
//function : OutLineVCompound
//purpose :
// function : OutLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::OutLineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(2,Standard_True,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::OutLineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(2, Standard_True, S);
}
//=======================================================================
//function : IsoLineVCompound
//purpose :
// function : IsoLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::IsoLineVCompound()
{ return InternalCompound(1,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(1, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : IsoLineVCompound
//purpose :
// function : IsoLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::IsoLineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(1,Standard_True,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::IsoLineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(1, Standard_True, S);
}
//=======================================================================
//function : HCompound
//purpose :
// function : HCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::HCompound()
{ return InternalCompound(5,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(5, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : HCompound
//purpose :
// function : HCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::HCompound(const TopoDS_Shape& S)
{ return InternalCompound(5,Standard_False,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::HCompound(const TopoDS_Shape& S)
{
return InternalCompound(5, Standard_False, S);
}
//=======================================================================
//function : Rg1LineHCompound
//purpose :
// function : Rg1LineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::Rg1LineHCompound()
{ return InternalCompound(3,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(3, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : Rg1LineHCompound
//purpose :
// function : Rg1LineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::Rg1LineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(3,Standard_False,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::Rg1LineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(3, Standard_False, S);
}
//=======================================================================
//function : RgNLineHCompound
//purpose :
// function : RgNLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::RgNLineHCompound()
{ return InternalCompound(4,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(4, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : RgNLineHCompound
//purpose :
// function : RgNLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::RgNLineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(4,Standard_False,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::RgNLineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(4, Standard_False, S);
}
//=======================================================================
//function : OutLineHCompound
//purpose :
// function : OutLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::OutLineHCompound()
{ return InternalCompound(2,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(2, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : OutLineHCompound
//purpose :
// function : OutLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::OutLineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(2,Standard_False,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::OutLineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(2, Standard_False, S);
}
//=======================================================================
//function : IsoLineHCompound
//purpose :
// function : IsoLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_HLRToShape::IsoLineHCompound()
{ return InternalCompound(1,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(1, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : IsoLineHCompound
//purpose :
// function : IsoLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::IsoLineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(1,Standard_False,S); }
inline TopoDS_Shape HLRBRep_HLRToShape::IsoLineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(1, Standard_False, S);
}
//=======================================================================
//function : CompoundOfEdges
//purpose :
// function : CompoundOfEdges
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::CompoundOfEdges(const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d)
{ return InternalCompound(type,visible,TopoDS_Shape(),In3d); }
inline TopoDS_Shape HLRBRep_HLRToShape::CompoundOfEdges(const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d)
{
return InternalCompound(type, visible, TopoDS_Shape(), In3d);
}
//=======================================================================
//function : CompoundOfEdges
//purpose :
// function : CompoundOfEdges
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_HLRToShape::CompoundOfEdges(const TopoDS_Shape& S,
const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d)
{ return InternalCompound(type,visible,S,In3d); }
inline TopoDS_Shape HLRBRep_HLRToShape::CompoundOfEdges(const TopoDS_Shape& S,
const HLRBRep_TypeOfResultingEdge type,
const Standard_Boolean visible,
const Standard_Boolean In3d)
{
return InternalCompound(type, visible, S, In3d);
}

File diff suppressed because it is too large Load Diff

View File

@@ -25,49 +25,26 @@
#include <BRepTopAdaptor_MapOfShapeTool.hxx>
class HLRBRep_Data;
class HLRBRep_Hider
class HLRBRep_Hider
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a Hider processing the set of Edges and
//! hiding faces described by <DS>. Stores the hidden
//! parts in <DS>.
Standard_EXPORT HLRBRep_Hider(const Handle(HLRBRep_Data)& DS);
//! own hiding the side face number <FI>.
Standard_EXPORT void OwnHiding (const Standard_Integer FI);
Standard_EXPORT void OwnHiding(const Standard_Integer FI);
//! Removes from the edges, the parts hidden by the
//! hiding face number <FI>.
Standard_EXPORT void Hide (const Standard_Integer FI, BRepTopAdaptor_MapOfShapeTool& MST);
Standard_EXPORT void Hide(const Standard_Integer FI, BRepTopAdaptor_MapOfShapeTool& MST);
protected:
private:
Handle(HLRBRep_Data) myDS;
};
#endif // _HLRBRep_Hider_HeaderFile

View File

@@ -36,87 +36,144 @@ class gp_Elips2d;
class gp_Parab2d;
class gp_Hypr2d;
class HLRBRep_IntConicCurveOfCInter : public IntRes2d_Intersection
class HLRBRep_IntConicCurveOfCInter : public IntRes2d_Intersection
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter();
//! Intersection between a line and a parametric curve.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Lin2d& L,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between a line and a parametric curve.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Circ2d& C,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between an ellipse and a parametric curve.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Elips2d& E,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between a parabola and a parametric curve.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Parab2d& Prb,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between the main branch of an hyperbola
//! and a parametric curve.
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Hypr2d& H,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between a line and a parametric curve.
Standard_EXPORT void Perform (const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const gp_Lin2d& L,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between a line and a parametric curve.
Standard_EXPORT void Perform (const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const gp_Circ2d& C,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between an ellipse and a parametric curve.
Standard_EXPORT void Perform (const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const gp_Elips2d& E,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between a parabola and a parametric curve.
Standard_EXPORT void Perform (const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const gp_Parab2d& Prb,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
//! Intersection between the main branch of an hyperbola
//! and a parametric curve.
Standard_EXPORT void Perform (const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
Standard_EXPORT void Perform(const gp_Hypr2d& H,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol);
protected:
private:
Standard_EXPORT void InternalPerform(const gp_Lin2d& Lin1,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform (const gp_Lin2d& Lin1, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform (const gp_Circ2d& Circ1, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform (const gp_Elips2d& Eli1, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform (const gp_Parab2d& Prb1, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform (const gp_Hypr2d& Hpr1, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform(const gp_Circ2d& Circ1,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform(const gp_Elips2d& Eli1,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_Real param1inf;
Standard_Real param1sup;
Standard_Real param2inf;
Standard_Real param2sup;
IntCurve_IntConicConic intconiconi;
Standard_EXPORT void InternalPerform(const gp_Parab2d& Prb1,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_EXPORT void InternalPerform(const gp_Hypr2d& Hpr1,
const IntRes2d_Domain& D1,
const Standard_Address& PCurve,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Boolean Composite);
Standard_Real param1inf;
Standard_Real param1sup;
Standard_Real param2inf;
Standard_Real param2sup;
IntCurve_IntConicConic intconiconi;
HLRBRep_TheIntConicCurveOfCInter intconicurv;
};
#endif // _HLRBRep_IntConicCurveOfCInter_HeaderFile

View File

@@ -26,7 +26,6 @@
#include <gp_Elips2d.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Hypr2d.hxx>
#define TheImpTool IntCurve_IConicTool
#define TheImpTool_hxx <IntCurve_IConicTool.hxx>
@@ -39,4 +38,3 @@
#define IntCurve_UserIntConicCurveGen HLRBRep_IntConicCurveOfCInter
#define IntCurve_UserIntConicCurveGen_hxx <HLRBRep_IntConicCurveOfCInter.hxx>
#include "../IntCurve/IntCurve_UserIntConicCurveGen.gxx"

View File

@@ -43,97 +43,166 @@ class gp_Hypr;
class IntAna_IntConicQuad;
class Bnd_Box;
class HLRBRep_InterCSurf : public IntCurveSurface_Intersection
class HLRBRep_InterCSurf : public IntCurveSurface_Intersection
{
public:
DEFINE_STANDARD_ALLOC
//! Empty Constructor
Standard_EXPORT HLRBRep_InterCSurf();
//! Compute the Intersection between the curve and the
//! surface
Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface);
Standard_EXPORT void Perform(const gp_Lin& Curve, const Standard_Address& Surface);
//! Compute the Intersection between the curve and
//! the surface. The Curve is already sampled and
//! its polygon : <Polygon> is given.
Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& Polygon, const Standard_Address& Surface);
Standard_EXPORT void Perform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& Polygon,
const Standard_Address& Surface);
//! Compute the Intersection between the curve and
//! the surface. The Curve is already sampled and
//! its polygon : <Polygon> is given. The Surface is
//! also sampled and <Polyhedron> is given.
Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& ThePolygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron);
Standard_EXPORT void Perform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& ThePolygon,
const Standard_Address& Surface,
const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron);
//! Compute the Intersection between the curve and
//! the surface. The Curve is already sampled and
//! its polygon : <Polygon> is given. The Surface is
//! also sampled and <Polyhedron> is given.
Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& ThePolygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron, Bnd_BoundSortBox& BndBSB);
Standard_EXPORT void Perform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& ThePolygon,
const Standard_Address& Surface,
const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron,
Bnd_BoundSortBox& BndBSB);
//! Compute the Intersection between the curve and
//! the surface. The Surface is already sampled and
//! its polyhedron : <Polyhedron> is given.
Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron);
Standard_EXPORT void Perform(const gp_Lin& Curve,
const Standard_Address& Surface,
const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron);
protected:
//! Compute the Intersection between the curve and the
//! surface
Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U0, const Standard_Real V0, const Standard_Real U1, const Standard_Real V1);
Standard_EXPORT void InternalPerformCurveQuadric (const gp_Lin& Curve, const Standard_Address& Surface);
Standard_EXPORT void InternalPerform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& Polygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void InternalPerform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& Polygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, Bnd_BoundSortBox& BSB);
Standard_EXPORT void InternalPerform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& Polygon, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void PerformConicSurf (const gp_Lin& Line, const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void PerformConicSurf (const gp_Circ& Circle, const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void PerformConicSurf (const gp_Elips& Ellipse, const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void PerformConicSurf (const gp_Parab& Parab, const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void PerformConicSurf (const gp_Hypr& Hyper, const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2);
Standard_EXPORT void AppendIntAna (const gp_Lin& Curve, const Standard_Address& Surface, const IntAna_IntConicQuad& InterAna);
Standard_EXPORT void AppendPoint (const gp_Lin& Curve, const Standard_Real w, const Standard_Address& Surface, const Standard_Real u, const Standard_Real v);
Standard_EXPORT void AppendSegment (const gp_Lin& Curve, const Standard_Real u0, const Standard_Real u1, const Standard_Address& Surface);
Standard_EXPORT void Perform(const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U0,
const Standard_Real V0,
const Standard_Real U1,
const Standard_Real V1);
Standard_EXPORT void InternalPerformCurveQuadric(const gp_Lin& Curve,
const Standard_Address& Surface);
Standard_EXPORT void InternalPerform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& Polygon,
const Standard_Address& Surface,
const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void InternalPerform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& Polygon,
const Standard_Address& Surface,
const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2,
Bnd_BoundSortBox& BSB);
Standard_EXPORT void InternalPerform(const gp_Lin& Curve,
const HLRBRep_ThePolygonOfInterCSurf& Polygon,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void PerformConicSurf(const gp_Lin& Line,
const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void PerformConicSurf(const gp_Circ& Circle,
const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void PerformConicSurf(const gp_Elips& Ellipse,
const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void PerformConicSurf(const gp_Parab& Parab,
const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void PerformConicSurf(const gp_Hypr& Hyper,
const gp_Lin& Curve,
const Standard_Address& Surface,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2);
Standard_EXPORT void AppendIntAna(const gp_Lin& Curve,
const Standard_Address& Surface,
const IntAna_IntConicQuad& InterAna);
Standard_EXPORT void AppendPoint(const gp_Lin& Curve,
const Standard_Real w,
const Standard_Address& Surface,
const Standard_Real u,
const Standard_Real v);
Standard_EXPORT void AppendSegment(const gp_Lin& Curve,
const Standard_Real u0,
const Standard_Real u1,
const Standard_Address& Surface);
private:
Standard_EXPORT void DoSurface(const Standard_Address& surface,
const Standard_Real u0,
const Standard_Real u1,
const Standard_Real v0,
const Standard_Real v1,
TColgp_Array2OfPnt& pntsOnSurface,
Bnd_Box& boxSurface,
Standard_Real& gap);
Standard_EXPORT void DoSurface (const Standard_Address& surface, const Standard_Real u0, const Standard_Real u1, const Standard_Real v0, const Standard_Real v1, TColgp_Array2OfPnt& pntsOnSurface, Bnd_Box& boxSurface, Standard_Real& gap);
Standard_EXPORT void DoNewBounds (const Standard_Address& surface, const Standard_Real u0, const Standard_Real u1, const Standard_Real v0, const Standard_Real v1, const TColgp_Array2OfPnt& pntsOnSurface, const TColStd_Array1OfReal& X, const TColStd_Array1OfReal& Y, const TColStd_Array1OfReal& Z, TColStd_Array1OfReal& Bounds);
Standard_EXPORT void DoNewBounds(const Standard_Address& surface,
const Standard_Real u0,
const Standard_Real u1,
const Standard_Real v0,
const Standard_Real v1,
const TColgp_Array2OfPnt& pntsOnSurface,
const TColStd_Array1OfReal& X,
const TColStd_Array1OfReal& Y,
const TColStd_Array1OfReal& Z,
TColStd_Array1OfReal& Bounds);
};
#endif // _HLRBRep_InterCSurf_HeaderFile

View File

@@ -35,7 +35,6 @@
#include <gp_Hypr.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <Bnd_Box.hxx>
#define TheCurve gp_Lin
#define TheCurve_hxx <gp_Lin.hxx>
@@ -61,11 +60,14 @@
#define IntCurveSurface_TheExactInter_hxx <HLRBRep_TheExactInterCSurf.hxx>
#define IntCurveSurface_TheQuadCurvExactInter HLRBRep_TheQuadCurvExactInterCSurf
#define IntCurveSurface_TheQuadCurvExactInter_hxx <HLRBRep_TheQuadCurvExactInterCSurf.hxx>
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter_hxx <HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx>
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter_hxx <HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx>
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter \
HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter_hxx \
<HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx>
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter \
HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf
#define IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactInter_hxx \
<HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx>
#define IntCurveSurface_Inter HLRBRep_InterCSurf
#define IntCurveSurface_Inter_hxx <HLRBRep_InterCSurf.hxx>
#include "../IntCurveSurface/IntCurveSurface_Inter.gxx"

File diff suppressed because it is too large Load Diff

View File

@@ -29,130 +29,112 @@ class HLRBRep_Data;
class HLRTopoBRep_OutLiner;
class HLRBRep_ShapeBounds;
class HLRBRep_InternalAlgo;
DEFINE_STANDARD_HANDLE(HLRBRep_InternalAlgo, Standard_Transient)
class HLRBRep_InternalAlgo : public Standard_Transient
{
public:
Standard_EXPORT HLRBRep_InternalAlgo();
Standard_EXPORT HLRBRep_InternalAlgo(const Handle(HLRBRep_InternalAlgo)& A);
//! set the projector.
Standard_EXPORT void Projector (const HLRAlgo_Projector& P);
Standard_EXPORT void Projector(const HLRAlgo_Projector& P);
//! set the projector.
Standard_EXPORT HLRAlgo_Projector& Projector();
//! update the DataStructure.
Standard_EXPORT void Update();
//! add the shape <S>.
Standard_EXPORT void Load (const Handle(HLRTopoBRep_OutLiner)& S, const Handle(Standard_Transient)& SData, const Standard_Integer nbIso = 0);
Standard_EXPORT void Load(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso = 0);
//! add the shape <S>.
Standard_EXPORT void Load (const Handle(HLRTopoBRep_OutLiner)& S, const Standard_Integer nbIso = 0);
Standard_EXPORT void Load(const Handle(HLRTopoBRep_OutLiner)& S,
const Standard_Integer nbIso = 0);
//! return the index of the Shape <S> and return 0 if
//! the Shape <S> is not found.
Standard_EXPORT Standard_Integer Index (const Handle(HLRTopoBRep_OutLiner)& S) const;
Standard_EXPORT Standard_Integer Index(const Handle(HLRTopoBRep_OutLiner)& S) const;
//! remove the Shape of Index <I>.
Standard_EXPORT void Remove (const Standard_Integer I);
Standard_EXPORT void Remove(const Standard_Integer I);
//! Change the Shape Data of the Shape of index <I>.
Standard_EXPORT void ShapeData (const Standard_Integer I, const Handle(Standard_Transient)& SData);
Standard_EXPORT void ShapeData(const Standard_Integer I, const Handle(Standard_Transient)& SData);
Standard_EXPORT HLRBRep_SeqOfShapeBounds& SeqOfShapeBounds();
Standard_EXPORT Standard_Integer NbShapes() const;
Standard_EXPORT HLRBRep_ShapeBounds& ShapeBounds (const Standard_Integer I);
Standard_EXPORT HLRBRep_ShapeBounds& ShapeBounds(const Standard_Integer I);
//! init the status of the selected edges depending of
//! the back faces of a closed shell.
Standard_EXPORT void InitEdgeStatus();
//! select all the DataStructure.
Standard_EXPORT void Select();
//! select only the Shape of index <I>.
Standard_EXPORT void Select (const Standard_Integer I);
Standard_EXPORT void Select(const Standard_Integer I);
//! select only the edges of the Shape <S>.
Standard_EXPORT void SelectEdge (const Standard_Integer I);
Standard_EXPORT void SelectEdge(const Standard_Integer I);
//! select only the faces of the Shape <S>.
Standard_EXPORT void SelectFace (const Standard_Integer I);
Standard_EXPORT void SelectFace(const Standard_Integer I);
//! set to visible all the edges.
Standard_EXPORT void ShowAll();
//! set to visible all the edges of the Shape <S>.
Standard_EXPORT void ShowAll (const Standard_Integer I);
Standard_EXPORT void ShowAll(const Standard_Integer I);
//! set to hide all the edges.
Standard_EXPORT void HideAll();
//! set to hide all the edges of the Shape <S>.
Standard_EXPORT void HideAll (const Standard_Integer I);
Standard_EXPORT void HideAll(const Standard_Integer I);
//! own hiding of all the shapes of the DataStructure
//! without hiding by each other.
Standard_EXPORT void PartialHide();
//! hide all the DataStructure.
Standard_EXPORT void Hide();
//! hide the Shape <S> by itself.
Standard_EXPORT void Hide (const Standard_Integer I);
Standard_EXPORT void Hide(const Standard_Integer I);
//! hide the Shape <S1> by the shape <S2>.
Standard_EXPORT void Hide (const Standard_Integer I, const Standard_Integer J);
Standard_EXPORT void Debug (const Standard_Boolean deb);
Standard_EXPORT void Hide(const Standard_Integer I, const Standard_Integer J);
Standard_EXPORT void Debug(const Standard_Boolean deb);
Standard_EXPORT Standard_Boolean Debug() const;
Standard_EXPORT Handle(HLRBRep_Data) DataStructure() const;
DEFINE_STANDARD_RTTIEXT(HLRBRep_InternalAlgo,Standard_Transient)
DEFINE_STANDARD_RTTIEXT(HLRBRep_InternalAlgo, Standard_Transient)
protected:
private:
//! first if <SideFace> own hiding of the side faces.
//! After hiding of the selected parts of the
//! DataStructure.
Standard_EXPORT void HideSelected (const Standard_Integer I, const Standard_Boolean SideFace);
Standard_EXPORT void HideSelected(const Standard_Integer I, const Standard_Boolean SideFace);
Handle(HLRBRep_Data) myDS;
HLRAlgo_Projector myProj;
HLRBRep_SeqOfShapeBounds myShapes;
Handle(HLRBRep_Data) myDS;
HLRAlgo_Projector myProj;
HLRBRep_SeqOfShapeBounds myShapes;
BRepTopAdaptor_MapOfShapeTool myMapOfShapeTool;
Standard_Boolean myDebug;
Standard_Boolean myDebug;
};
#endif // _HLRBRep_InternalAlgo_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@@ -30,59 +30,68 @@ class IntCurveSurface_IntersectionSegment;
//! The Intersector computes 2D intersections of the projections of 3D curves.
//! It can also computes the intersection of a 3D line and a surface.
class HLRBRep_Intersector
class HLRBRep_Intersector
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_Intersector();
//! Performs the auto intersection of an edge.
//! The edge domain is cut at start with da1*(b-a) and at end with db1*(b-a).
Standard_EXPORT void Perform (const Standard_Address A1, const Standard_Real da1, const Standard_Real db1);
Standard_EXPORT void Perform(const Standard_Address A1,
const Standard_Real da1,
const Standard_Real db1);
//! Performs the intersection between the two edges.
//! The edges domains are cut at start with da*(b-a) and at end with db*(b-a).
Standard_EXPORT void Perform (const Standard_Integer nA, const Standard_Address A1, const Standard_Real da1, const Standard_Real db1, const Standard_Integer nB, const Standard_Address A2, const Standard_Real da2, const Standard_Real db2, const Standard_Boolean NoBound);
Standard_EXPORT void Perform(const Standard_Integer nA,
const Standard_Address A1,
const Standard_Real da1,
const Standard_Real db1,
const Standard_Integer nB,
const Standard_Address A2,
const Standard_Real da2,
const Standard_Real db2,
const Standard_Boolean NoBound);
//! Create a single IntersectionPoint (U on A1) (V on A2)
//! The point is middle on both curves.
Standard_EXPORT void SimulateOnePoint (const Standard_Address A1, const Standard_Real U, const Standard_Address A2, const Standard_Real V);
Standard_EXPORT void Load (Standard_Address& A);
Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real P);
Standard_EXPORT void SimulateOnePoint(const Standard_Address A1,
const Standard_Real U,
const Standard_Address A2,
const Standard_Real V);
Standard_EXPORT void Load(Standard_Address& A);
Standard_EXPORT void Perform(const gp_Lin& L, const Standard_Real P);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Integer NbPoints() const;
Standard_EXPORT const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
Standard_EXPORT const IntCurveSurface_IntersectionPoint& CSPoint (const Standard_Integer N) const;
Standard_EXPORT const IntRes2d_IntersectionPoint& Point(const Standard_Integer N) const;
Standard_EXPORT const IntCurveSurface_IntersectionPoint& CSPoint(const Standard_Integer N) const;
Standard_EXPORT Standard_Integer NbSegments() const;
Standard_EXPORT const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
Standard_EXPORT const IntCurveSurface_IntersectionSegment& CSSegment (const Standard_Integer N) const;
Standard_EXPORT const IntRes2d_IntersectionSegment& Segment(const Standard_Integer N) const;
Standard_EXPORT const IntCurveSurface_IntersectionSegment& CSSegment(
const Standard_Integer N) const;
Standard_EXPORT void Destroy();
~HLRBRep_Intersector()
{
Destroy();
}
~HLRBRep_Intersector() { Destroy(); }
private:
IntRes2d_IntersectionPoint mySinglePoint;
Standard_Integer myTypePerform;
HLRBRep_CInter myIntersector;
HLRBRep_InterCSurf myCSIntersector;
Standard_Address mySurface;
IntRes2d_IntersectionPoint mySinglePoint;
Standard_Integer myTypePerform;
HLRBRep_CInter myIntersector;
HLRBRep_InterCSurf myCSIntersector;
Standard_Address mySurface;
HLRBRep_ThePolyhedronOfInterCSurf* myPolyhedron;
};
#endif // _HLRBRep_Intersector_HeaderFile

View File

@@ -43,143 +43,133 @@ class gp_Vec;
class Geom_BezierCurve;
class Geom_BSplineCurve;
//! The LineTool class provides class methods to
//! access the methodes of the Line.
class HLRBRep_LineTool
class HLRBRep_LineTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstParameter (const gp_Lin& C);
static Standard_Real LastParameter (const gp_Lin& C);
static GeomAbs_Shape Continuity (const gp_Lin& C);
static Standard_Real FirstParameter(const gp_Lin& C);
static Standard_Real LastParameter(const gp_Lin& C);
static GeomAbs_Shape Continuity(const gp_Lin& C);
//! If necessary, breaks the line in intervals of
//! continuity <S>. And returns the number of
//! intervals.
static Standard_Integer NbIntervals (const gp_Lin& C, const GeomAbs_Shape S);
static Standard_Integer NbIntervals(const gp_Lin& C, const GeomAbs_Shape S);
//! Sets the current working interval.
static void Intervals (const gp_Lin& C, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void Intervals(const gp_Lin& C, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
//! Returns the first parameter of the current
//! interval.
static Standard_Real IntervalFirst (const gp_Lin& C);
static Standard_Real IntervalFirst(const gp_Lin& C);
//! Returns the last parameter of the current
//! interval.
static Standard_Real IntervalLast (const gp_Lin& C);
static GeomAbs_Shape IntervalContinuity (const gp_Lin& C);
static Standard_Boolean IsClosed (const gp_Lin& C);
static Standard_Boolean IsPeriodic (const gp_Lin& C);
static Standard_Real Period (const gp_Lin& C);
static Standard_Real IntervalLast(const gp_Lin& C);
static GeomAbs_Shape IntervalContinuity(const gp_Lin& C);
static Standard_Boolean IsClosed(const gp_Lin& C);
static Standard_Boolean IsPeriodic(const gp_Lin& C);
static Standard_Real Period(const gp_Lin& C);
//! Computes the point of parameter U on the line.
static gp_Pnt Value (const gp_Lin& C, const Standard_Real U);
static gp_Pnt Value(const gp_Lin& C, const Standard_Real U);
//! Computes the point of parameter U on the line.
static void D0 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P);
static void D0(const gp_Lin& C, const Standard_Real U, gp_Pnt& P);
//! Computes the point of parameter U on the line with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
static void D1 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
static void D1(const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V);
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
static void D2 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
static void D2(const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
static void D3 (const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
static void D3(const gp_Lin& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3);
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
static gp_Vec DN (const gp_Lin& C, const Standard_Real U, const Standard_Integer N);
static gp_Vec DN(const gp_Lin& C, const Standard_Real U, const Standard_Integer N);
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
static Standard_Real Resolution (const gp_Lin& C, const Standard_Real R3d);
static Standard_Real Resolution(const gp_Lin& C, const Standard_Real R3d);
//! Returns the type of the line in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
static GeomAbs_CurveType GetType (const gp_Lin& C);
static gp_Lin Line (const gp_Lin& C);
static gp_Circ Circle (const gp_Lin& C);
static gp_Elips Ellipse (const gp_Lin& C);
static gp_Hypr Hyperbola (const gp_Lin& C);
static gp_Parab Parabola (const gp_Lin& C);
static Handle(Geom_BezierCurve) Bezier (const gp_Lin& C);
static Handle(Geom_BSplineCurve) BSpline (const gp_Lin& C);
static Standard_Integer Degree (const gp_Lin& C);
static Standard_Integer NbPoles (const gp_Lin& C);
static void Poles (const gp_Lin& C, TColgp_Array1OfPnt& TP);
static Standard_Boolean IsRational (const gp_Lin& C);
static void PolesAndWeights (const gp_Lin& C, TColgp_Array1OfPnt& TP, TColStd_Array1OfReal& TW);
static Standard_Integer NbKnots (const gp_Lin& C);
static void KnotsAndMultiplicities (const gp_Lin& C, TColStd_Array1OfReal& TK, TColStd_Array1OfInteger& TM);
static Standard_Integer NbSamples (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1);
static void SamplePars (const gp_Lin& C, const Standard_Real U0, const Standard_Real U1, const Standard_Real Defl, const Standard_Integer NbMin, Handle(TColStd_HArray1OfReal)& Pars);
static GeomAbs_CurveType GetType(const gp_Lin& C);
static gp_Lin Line(const gp_Lin& C);
static gp_Circ Circle(const gp_Lin& C);
static gp_Elips Ellipse(const gp_Lin& C);
static gp_Hypr Hyperbola(const gp_Lin& C);
static gp_Parab Parabola(const gp_Lin& C);
static Handle(Geom_BezierCurve) Bezier(const gp_Lin& C);
static Handle(Geom_BSplineCurve) BSpline(const gp_Lin& C);
static Standard_Integer Degree(const gp_Lin& C);
static Standard_Integer NbPoles(const gp_Lin& C);
static void Poles(const gp_Lin& C, TColgp_Array1OfPnt& TP);
static Standard_Boolean IsRational(const gp_Lin& C);
static void PolesAndWeights(const gp_Lin& C, TColgp_Array1OfPnt& TP, TColStd_Array1OfReal& TW);
static Standard_Integer NbKnots(const gp_Lin& C);
static void KnotsAndMultiplicities(const gp_Lin& C,
TColStd_Array1OfReal& TK,
TColStd_Array1OfInteger& TM);
static Standard_Integer NbSamples(const gp_Lin& C,
const Standard_Real U0,
const Standard_Real U1);
static void SamplePars(const gp_Lin& C,
const Standard_Real U0,
const Standard_Real U1,
const Standard_Real Defl,
const Standard_Integer NbMin,
Handle(TColStd_HArray1OfReal)& Pars);
protected:
private:
};
#include <HLRBRep_LineTool.lxx>
#endif // _HLRBRep_LineTool_HeaderFile

View File

@@ -26,143 +26,197 @@
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_Array1OfReal.hxx>
inline Standard_Real HLRBRep_LineTool::FirstParameter(const gp_Lin&)
{ return RealFirst(); }
inline Standard_Real HLRBRep_LineTool::LastParameter(const gp_Lin& )
{ return RealLast(); }
inline GeomAbs_Shape HLRBRep_LineTool::Continuity( const gp_Lin& )
{ return GeomAbs_CN; }
inline Standard_Integer HLRBRep_LineTool::NbIntervals
(const gp_Lin& , const GeomAbs_Shape )
{ return 1; }
inline void HLRBRep_LineTool::Intervals
(const gp_Lin& , TColStd_Array1OfReal& , const GeomAbs_Shape)
{}
inline Standard_Real HLRBRep_LineTool::IntervalFirst(const gp_Lin& )
{ return RealFirst(); }
inline Standard_Real HLRBRep_LineTool::IntervalLast(const gp_Lin& )
{ return RealLast(); }
inline GeomAbs_Shape HLRBRep_LineTool::IntervalContinuity(const gp_Lin& )
{ return GeomAbs_CN; }
inline Standard_Boolean HLRBRep_LineTool::IsClosed( const gp_Lin& )
{ return Standard_False; }
inline Standard_Boolean HLRBRep_LineTool::IsPeriodic( const gp_Lin& )
{ return Standard_False; }
inline Standard_Real HLRBRep_LineTool::Period(const gp_Lin& )
{ return 0.; }
inline gp_Pnt HLRBRep_LineTool::Value(const gp_Lin& C,const Standard_Real U)
{ return ElCLib::Value(U,C); }
inline void HLRBRep_LineTool::D0
(const gp_Lin& C,const Standard_Real U, gp_Pnt& P)
{ P = ElCLib::Value(U,C); }
inline void HLRBRep_LineTool::D1
(const gp_Lin& C,const Standard_Real U,
gp_Pnt& P, gp_Vec& V)
{ ElCLib::D1(U,C,P,V); }
inline void HLRBRep_LineTool::D2
(const gp_Lin& C, const Standard_Real U,
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2)
{
ElCLib::D1(U,C,P,V1);
V2 = gp_Vec(0,0,0);
}
inline void HLRBRep_LineTool::D3
(const gp_Lin& C, const Standard_Real U,
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3)
{
ElCLib::D1(U,C,P,V1);
V2 = V3 = gp_Vec(0,0,0);
return RealFirst();
}
inline gp_Vec HLRBRep_LineTool::DN
(const gp_Lin& C, const Standard_Real U, const Standard_Integer N)
{ return ElCLib::DN(U,C,N); }
inline Standard_Real HLRBRep_LineTool::LastParameter(const gp_Lin&)
{
return RealLast();
}
inline Standard_Real HLRBRep_LineTool::Resolution
( const gp_Lin& , const Standard_Real R3D)
{ return R3D; }
inline GeomAbs_Shape HLRBRep_LineTool::Continuity(const gp_Lin&)
{
return GeomAbs_CN;
}
inline GeomAbs_CurveType HLRBRep_LineTool::GetType(const gp_Lin& )
{ return GeomAbs_Line; }
inline Standard_Integer HLRBRep_LineTool::NbIntervals(const gp_Lin&, const GeomAbs_Shape)
{
return 1;
}
inline gp_Lin HLRBRep_LineTool::Line(const gp_Lin& C)
{ return C; }
inline void HLRBRep_LineTool::Intervals(const gp_Lin&, TColStd_Array1OfReal&, const GeomAbs_Shape)
{
}
inline gp_Circ HLRBRep_LineTool::Circle(const gp_Lin&)
{ return gp_Circ(); }
inline Standard_Real HLRBRep_LineTool::IntervalFirst(const gp_Lin&)
{
return RealFirst();
}
inline gp_Elips HLRBRep_LineTool::Ellipse(const gp_Lin&)
{ return gp_Elips(); }
inline Standard_Real HLRBRep_LineTool::IntervalLast(const gp_Lin&)
{
return RealLast();
}
inline gp_Hypr HLRBRep_LineTool::Hyperbola(const gp_Lin&)
{ return gp_Hypr(); }
inline GeomAbs_Shape HLRBRep_LineTool::IntervalContinuity(const gp_Lin&)
{
return GeomAbs_CN;
}
inline gp_Parab HLRBRep_LineTool::Parabola(const gp_Lin&)
{ return gp_Parab(); }
inline Standard_Boolean HLRBRep_LineTool::IsClosed(const gp_Lin&)
{
return Standard_False;
}
inline Handle(Geom_BezierCurve) HLRBRep_LineTool::Bezier(const gp_Lin&)
inline Standard_Boolean HLRBRep_LineTool::IsPeriodic(const gp_Lin&)
{
return Standard_False;
}
inline Standard_Real HLRBRep_LineTool::Period(const gp_Lin&)
{
return 0.;
}
inline gp_Pnt HLRBRep_LineTool::Value(const gp_Lin& C, const Standard_Real U)
{
return ElCLib::Value(U, C);
}
inline void HLRBRep_LineTool::D0(const gp_Lin& C, const Standard_Real U, gp_Pnt& P)
{
P = ElCLib::Value(U, C);
}
inline void HLRBRep_LineTool::D1(const gp_Lin& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V)
{
ElCLib::D1(U, C, P, V);
}
inline void HLRBRep_LineTool::D2(const gp_Lin& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2)
{
ElCLib::D1(U, C, P, V1);
V2 = gp_Vec(0, 0, 0);
}
inline void HLRBRep_LineTool::D3(const gp_Lin& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3)
{
ElCLib::D1(U, C, P, V1);
V2 = V3 = gp_Vec(0, 0, 0);
}
inline gp_Vec HLRBRep_LineTool::DN(const gp_Lin& C, const Standard_Real U, const Standard_Integer N)
{
return ElCLib::DN(U, C, N);
}
inline Standard_Real HLRBRep_LineTool::Resolution(const gp_Lin&, const Standard_Real R3D)
{
return R3D;
}
inline GeomAbs_CurveType HLRBRep_LineTool::GetType(const gp_Lin&)
{
return GeomAbs_Line;
}
inline gp_Lin HLRBRep_LineTool::Line(const gp_Lin& C)
{
return C;
}
inline gp_Circ HLRBRep_LineTool::Circle(const gp_Lin&)
{
return gp_Circ();
}
inline gp_Elips HLRBRep_LineTool::Ellipse(const gp_Lin&)
{
return gp_Elips();
}
inline gp_Hypr HLRBRep_LineTool::Hyperbola(const gp_Lin&)
{
return gp_Hypr();
}
inline gp_Parab HLRBRep_LineTool::Parabola(const gp_Lin&)
{
return gp_Parab();
}
inline Handle(Geom_BezierCurve) HLRBRep_LineTool::Bezier(const gp_Lin&)
{
Handle(Geom_BezierCurve) NullCurve;
return NullCurve;
}
inline Handle(Geom_BSplineCurve) HLRBRep_LineTool::BSpline(const gp_Lin&)
inline Handle(Geom_BSplineCurve) HLRBRep_LineTool::BSpline(const gp_Lin&)
{
Handle(Geom_BSplineCurve) NullCurve;
return NullCurve;
}
inline Standard_Integer HLRBRep_LineTool::Degree(const gp_Lin& )
{ return 1; }
inline Standard_Integer HLRBRep_LineTool::Degree(const gp_Lin&)
{
return 1;
}
inline Standard_Integer HLRBRep_LineTool::NbPoles(const gp_Lin&)
{ return 0; }
{
return 0;
}
inline void HLRBRep_LineTool::Poles(const gp_Lin&, TColgp_Array1OfPnt&)
{}
inline void HLRBRep_LineTool::Poles(const gp_Lin&, TColgp_Array1OfPnt&) {}
inline Standard_Boolean HLRBRep_LineTool::IsRational(const gp_Lin&)
{ return Standard_False; }
{
return Standard_False;
}
inline void HLRBRep_LineTool::PolesAndWeights
(const gp_Lin&, TColgp_Array1OfPnt&, TColStd_Array1OfReal&)
{}
inline void HLRBRep_LineTool::PolesAndWeights(const gp_Lin&,
TColgp_Array1OfPnt&,
TColStd_Array1OfReal&)
{
}
inline Standard_Integer HLRBRep_LineTool::NbKnots(const gp_Lin&)
{ return 0; }
{
return 0;
}
inline void HLRBRep_LineTool::KnotsAndMultiplicities
(const gp_Lin&, TColStd_Array1OfReal&, TColStd_Array1OfInteger&)
{}
inline void HLRBRep_LineTool::KnotsAndMultiplicities(const gp_Lin&,
TColStd_Array1OfReal&,
TColStd_Array1OfInteger&)
{
}
inline Standard_Integer HLRBRep_LineTool::NbSamples(const gp_Lin&,
const Standard_Real,
const Standard_Real )
{ return 3; }
const Standard_Real,
const Standard_Real)
{
return 3;
}
// modified by NIZHNY-MKK Tue Nov 1 18:49:28 2005
inline void HLRBRep_LineTool::SamplePars (const gp_Lin&,
const Standard_Real U0,
const Standard_Real U1,
const Standard_Real,
const Standard_Integer,
Handle(TColStd_HArray1OfReal)& Pars) {
inline void HLRBRep_LineTool::SamplePars(const gp_Lin&,
const Standard_Real U0,
const Standard_Real U1,
const Standard_Real,
const Standard_Integer,
Handle(TColStd_HArray1OfReal)& Pars)
{
Pars = new TColStd_HArray1OfReal(1, 3);
Pars->SetValue(1, U0);

View File

@@ -11,7 +11,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef HLRBRep_ListIteratorOfListOfBPnt2D_HeaderFile
#define HLRBRep_ListIteratorOfListOfBPnt2D_HeaderFile

View File

@@ -11,7 +11,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef HLRBRep_ListIteratorOfListOfBPoint_HeaderFile
#define HLRBRep_ListIteratorOfListOfBPoint_HeaderFile

View File

@@ -20,8 +20,7 @@
#include <HLRBRep_BiPnt2D.hxx>
#include <NCollection_List.hxx>
typedef NCollection_List<HLRBRep_BiPnt2D> HLRBRep_ListOfBPnt2D;
typedef NCollection_List<HLRBRep_BiPnt2D> HLRBRep_ListOfBPnt2D;
typedef NCollection_List<HLRBRep_BiPnt2D>::Iterator HLRBRep_ListIteratorOfListOfBPnt2D;
#endif

View File

@@ -20,8 +20,7 @@
#include <HLRBRep_BiPoint.hxx>
#include <NCollection_List.hxx>
typedef NCollection_List<HLRBRep_BiPoint> HLRBRep_ListOfBPoint;
typedef NCollection_List<HLRBRep_BiPoint> HLRBRep_ListOfBPoint;
typedef NCollection_List<HLRBRep_BiPoint>::Iterator HLRBRep_ListIteratorOfListOfBPoint;
#endif

View File

@@ -27,53 +27,37 @@
class IntCurve_IConicTool;
class HLRBRep_CurveTool;
class HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter : public math_FunctionWithDerivative
class HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter
: public math_FunctionWithDerivative
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor of the class.
Standard_EXPORT HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter(const IntCurve_IConicTool& IT, const Standard_Address& PC);
Standard_EXPORT HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter(
const IntCurve_IConicTool& IT,
const Standard_Address& PC);
//! Computes the value of the signed distance between
//! the implicit curve and the point at parameter Param
//! on the parametrised curve.
Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Value(const Standard_Real Param,
Standard_Real& F) Standard_OVERRIDE;
//! Computes the derivative of the previous function at
//! parameter Param.
Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Derivative(const Standard_Real Param,
Standard_Real& D) Standard_OVERRIDE;
//! Computes the value and the derivative of the function.
Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Values(const Standard_Real Param,
Standard_Real& F,
Standard_Real& D) Standard_OVERRIDE;
protected:
private:
Standard_Address TheParCurve;
Standard_Address TheParCurve;
IntCurve_IConicTool TheImpTool;
};
#endif // _HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter_HeaderFile

View File

@@ -18,7 +18,6 @@
#include <IntCurve_IConicTool.hxx>
#include <HLRBRep_CurveTool.hxx>
#define ImpTool IntCurve_IConicTool
#define ImpTool_hxx <IntCurve_IConicTool.hxx>
@@ -27,6 +26,6 @@
#define ParTool HLRBRep_CurveTool
#define ParTool_hxx <HLRBRep_CurveTool.hxx>
#define IntImpParGen_ImpParTool HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter
#define IntImpParGen_ImpParTool_hxx <HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx>
#define IntImpParGen_ImpParTool_hxx \
<HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx>
#include "../IntImpParGen/IntImpParGen_ImpParTool.gxx"

View File

@@ -34,90 +34,74 @@ class Extrema_POnCurv2d;
class gp_Pnt2d;
class gp_Vec2d;
class HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter : public math_FunctionWithDerivative
class HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter : public math_FunctionWithDerivative
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter();
Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C);
Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P,
const Standard_Address& C);
//! sets the field mycurve of the function.
Standard_EXPORT void Initialize (const Standard_Address& C);
Standard_EXPORT void Initialize(const Standard_Address& C);
//! sets the field P of the function.
Standard_EXPORT void SetPoint (const gp_Pnt2d& P);
Standard_EXPORT void SetPoint(const gp_Pnt2d& P);
//! Calculation of F(U).
Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Value(const Standard_Real U, Standard_Real& F) Standard_OVERRIDE;
//! Calculation of F'(U).
Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Derivative(const Standard_Real U,
Standard_Real& DF) Standard_OVERRIDE;
//! Calculation of F(U) and F'(U).
Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Values(const Standard_Real U,
Standard_Real& F,
Standard_Real& DF) Standard_OVERRIDE;
//! Save the found extremum.
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
//! Return the number of found extrema.
Standard_EXPORT Standard_Integer NbExt() const;
//! Returns the Nth distance.
Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const;
//! Shows if the Nth distance is a minimum.
Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const;
//! Returns the Nth extremum.
Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
Standard_EXPORT const Extrema_POnCurv2d& Point(const Standard_Integer N) const;
//! Determines boundaries of subinterval for find of root.
Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast);
Standard_EXPORT void SubIntervalInitialize(const Standard_Real theUfirst,
const Standard_Real theUlast);
//! Computes a Tol value. If 1st derivative of curve
//! |D1|<Tol, it is considered D1=0.
Standard_EXPORT Standard_Real SearchOfTolerance();
protected:
private:
gp_Pnt2d myP;
Standard_Address myC;
Standard_Real myU;
gp_Pnt2d myPc;
Standard_Real myD1f;
TColStd_SequenceOfReal mySqDist;
TColStd_SequenceOfInteger myIsMin;
gp_Pnt2d myP;
Standard_Address myC;
Standard_Real myU;
gp_Pnt2d myPc;
Standard_Real myD1f;
TColStd_SequenceOfReal mySqDist;
TColStd_SequenceOfInteger myIsMin;
Extrema_SequenceOfPOnCurv2d myPoint;
Standard_Boolean myPinit;
Standard_Boolean myCinit;
Standard_Boolean myD1Init;
Standard_Real myTol;
Standard_Integer myMaxDerivOrder;
Standard_Real myUinfium;
Standard_Real myUsupremum;
Standard_Boolean myPinit;
Standard_Boolean myCinit;
Standard_Boolean myD1Init;
Standard_Real myTol;
Standard_Integer myMaxDerivOrder;
Standard_Real myUinfium;
Standard_Real myUsupremum;
};
#endif // _HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_HeaderFile

View File

@@ -39,4 +39,3 @@
#define Extrema_FuncExtPC HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter
#define Extrema_FuncExtPC_hxx <HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx>
#include "../Extrema/Extrema_FuncExtPC.gxx"

File diff suppressed because it is too large Load Diff

View File

@@ -93,8 +93,6 @@ class HLRBRep_PolyAlgo : public Standard_Transient
{
public:
//! Constructs an empty framework for the
//! calculation of the visible and hidden lines of a shape in a projection.
//! Use the functions:
@@ -104,25 +102,25 @@ public:
//! Warning
//! The shape or shapes to be visualized must have already been triangulated.
Standard_EXPORT HLRBRep_PolyAlgo();
Standard_EXPORT HLRBRep_PolyAlgo(const Handle(HLRBRep_PolyAlgo)& A);
Standard_EXPORT HLRBRep_PolyAlgo(const TopoDS_Shape& S);
Standard_Integer NbShapes() const { return myShapes.Length(); }
Standard_EXPORT TopoDS_Shape& Shape (const Standard_Integer I);
Standard_EXPORT TopoDS_Shape& Shape(const Standard_Integer I);
//! remove the Shape of Index <I>.
Standard_EXPORT void Remove (const Standard_Integer I);
Standard_EXPORT void Remove(const Standard_Integer I);
//! return the index of the Shape <S> and return 0 if
//! the Shape <S> is not found.
Standard_EXPORT Standard_Integer Index (const TopoDS_Shape& S) const;
Standard_EXPORT Standard_Integer Index(const TopoDS_Shape& S) const;
//! Loads the shape S into this framework.
//! Warning S must have already been triangulated.
void Load (const TopoDS_Shape& theShape) { myShapes.Append (theShape); }
void Load(const TopoDS_Shape& theShape) { myShapes.Append(theShape); }
const Handle(HLRAlgo_PolyAlgo)& Algo() const { return myAlgo; }
@@ -131,15 +129,15 @@ public:
//! which is returned by the Projector function on a Prs3d_Projector object.
const HLRAlgo_Projector& Projector() const { return myProj; }
void Projector (const HLRAlgo_Projector& theProj) { myProj = theProj; }
void Projector(const HLRAlgo_Projector& theProj) { myProj = theProj; }
Standard_Real TolAngular() const { return myTolAngular; }
void TolAngular (const Standard_Real theTol) { myTolAngular = theTol; }
void TolAngular(const Standard_Real theTol) { myTolAngular = theTol; }
Standard_Real TolCoef() const { return myTolSta; }
void TolCoef (const Standard_Real theTol)
void TolCoef(const Standard_Real theTol)
{
myTolSta = theTol;
myTolEnd = 1.0 - theTol;
@@ -156,13 +154,12 @@ public:
void NextHide() { myAlgo->NextHide(); }
Standard_EXPORT HLRAlgo_BiPoint::PointsT& Hide (
HLRAlgo_EdgeStatus& status,
TopoDS_Shape& S,
Standard_Boolean& reg1,
Standard_Boolean& regn,
Standard_Boolean& outl,
Standard_Boolean& intl);
Standard_EXPORT HLRAlgo_BiPoint::PointsT& Hide(HLRAlgo_EdgeStatus& status,
TopoDS_Shape& S,
Standard_Boolean& reg1,
Standard_Boolean& regn,
Standard_Boolean& outl,
Standard_Boolean& intl);
void InitShow() { myAlgo->InitShow(); }
@@ -170,184 +167,462 @@ public:
void NextShow() { myAlgo->NextShow(); }
Standard_EXPORT HLRAlgo_BiPoint::PointsT& Show (TopoDS_Shape& S, Standard_Boolean& reg1, Standard_Boolean& regn, Standard_Boolean& outl, Standard_Boolean& intl);
Standard_EXPORT HLRAlgo_BiPoint::PointsT& Show(TopoDS_Shape& S,
Standard_Boolean& reg1,
Standard_Boolean& regn,
Standard_Boolean& outl,
Standard_Boolean& intl);
//! Make a shape with the internal outlines in each
//! face.
Standard_EXPORT TopoDS_Shape OutLinedShape (const TopoDS_Shape& S) const;
Standard_EXPORT TopoDS_Shape OutLinedShape(const TopoDS_Shape& S) const;
Standard_Boolean Debug() const { return myDebug; }
void Debug (const Standard_Boolean theDebug) { myDebug = theDebug; }
void Debug(const Standard_Boolean theDebug) { myDebug = theDebug; }
DEFINE_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,Standard_Transient)
DEFINE_STANDARD_RTTIEXT(HLRBRep_PolyAlgo, Standard_Transient)
private:
Standard_EXPORT TopoDS_Shape MakeShape() const;
Standard_EXPORT Standard_Integer InitShape (const TopoDS_Shape& Shape, Standard_Boolean& IsoledF, Standard_Boolean& IsoledE);
Standard_EXPORT void StoreShell (const TopoDS_Shape& theShape,
Standard_Integer& theIShell,
NCollection_Array1<Handle(HLRAlgo_PolyShellData)>& theShell,
const Standard_Boolean theIsoledF,
const Standard_Boolean theIsoledE,
TColStd_Array1OfInteger& theES,
NCollection_Array1<Handle(HLRAlgo_PolyData)>& thePD,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
TopTools_MapOfShape& theShapeMap1,
TopTools_MapOfShape& theShapeMap2);
Standard_EXPORT Standard_Integer InitShape(const TopoDS_Shape& Shape,
Standard_Boolean& IsoledF,
Standard_Boolean& IsoledE);
Standard_EXPORT Standard_Boolean Normal (const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodIndices,
HLRAlgo_PolyInternalNode::NodeData& theNod1RValues,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
const Standard_Boolean orient) const;
Standard_EXPORT void StoreShell(const TopoDS_Shape& theShape,
Standard_Integer& theIShell,
NCollection_Array1<Handle(HLRAlgo_PolyShellData)>& theShell,
const Standard_Boolean theIsoledF,
const Standard_Boolean theIsoledE,
TColStd_Array1OfInteger& theES,
NCollection_Array1<Handle(HLRAlgo_PolyData)>& thePD,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
TopTools_MapOfShape& theShapeMap1,
TopTools_MapOfShape& theShapeMap2);
Standard_EXPORT Standard_Boolean AverageNormal (const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ) const;
Standard_EXPORT Standard_Boolean Normal(const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodIndices,
HLRAlgo_PolyInternalNode::NodeData& theNod1RValues,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
const Standard_Boolean orient) const;
Standard_Boolean AverageNormal (const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
gp_XYZ& theNormal) const
Standard_EXPORT Standard_Boolean
AverageNormal(const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ) const;
Standard_Boolean AverageNormal(const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod,
gp_XYZ& theNormal) const
{
return AverageNormal (theINode, theNodeIndices, theTData, thePISeg, thePINod,
theNormal.ChangeCoord(1), theNormal.ChangeCoord(2), theNormal.ChangeCoord(3));
return AverageNormal(theINode,
theNodeIndices,
theTData,
thePISeg,
thePINod,
theNormal.ChangeCoord(1),
theNormal.ChangeCoord(2),
theNormal.ChangeCoord(3));
}
Standard_EXPORT void AddNormalOnTriangle (const Standard_Integer theITri,
const Standard_Integer theINode,
Standard_Integer& theJNode,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPINod& thePINod,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ,
Standard_Boolean& theOK) const;
Standard_EXPORT void AddNormalOnTriangle(const Standard_Integer theITri,
const Standard_Integer theINode,
Standard_Integer& theJNode,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPINod& thePINod,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ,
Standard_Boolean& theOK) const;
Standard_EXPORT void InitBiPointsWithConnexity (const Standard_Integer theIEdge,
TopoDS_Edge& theEdge,
HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
TopTools_ListOfShape& theLS,
const Standard_Boolean theIsConnex);
Standard_EXPORT void InitBiPointsWithConnexity(
const Standard_Integer theIEdge,
TopoDS_Edge& theEdge,
HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
TopTools_ListOfShape& theLS,
const Standard_Boolean theIsConnex);
Standard_EXPORT void Interpolation (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices1, HLRAlgo_PolyInternalNode::NodeData& Nod11RValues, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices2, HLRAlgo_PolyInternalNode::NodeData& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, HLRAlgo_Array1OfTData*& TData1, HLRAlgo_Array1OfPISeg*& PISeg1, HLRAlgo_Array1OfPINod*& PINod1) const;
Standard_EXPORT void Interpolation (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, const GeomAbs_Shape rg, HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices, HLRAlgo_PolyInternalNode::NodeData& Nod11RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices, HLRAlgo_PolyInternalNode::NodeData& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, HLRAlgo_Array1OfTData*& TData1, HLRAlgo_Array1OfPISeg*& PISeg1, HLRAlgo_Array1OfPINod*& PINod1, HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices, HLRAlgo_PolyInternalNode::NodeData& Nod21RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices, HLRAlgo_PolyInternalNode::NodeData& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, HLRAlgo_Array1OfTData*& TData2, HLRAlgo_Array1OfPISeg*& PISeg2, HLRAlgo_Array1OfPINod*& PINod2) const;
Standard_EXPORT Standard_Boolean Interpolation (const Standard_Real U1, const Standard_Real U2, HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues, Standard_Real& X3, Standard_Real& Y3, Standard_Real& Z3, Standard_Real& XT3, Standard_Real& YT3, Standard_Real& ZT3, Standard_Real& coef3, Standard_Real& U3, Standard_Boolean& mP3P1) const;
Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices, HLRAlgo_PolyInternalNode::NodeData& Nod11RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices, HLRAlgo_PolyInternalNode::NodeData& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, HLRAlgo_Array1OfTData*& TData1, HLRAlgo_Array1OfPISeg*& PISeg1, HLRAlgo_Array1OfPINod*& PINod1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const;
Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices, HLRAlgo_PolyInternalNode::NodeData& Nod11RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices, HLRAlgo_PolyInternalNode::NodeData& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, HLRAlgo_Array1OfTData*& TData1, HLRAlgo_Array1OfPISeg*& PISeg1, HLRAlgo_Array1OfPINod*& PINod1, HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices, HLRAlgo_PolyInternalNode::NodeData& Nod21RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices, HLRAlgo_PolyInternalNode::NodeData& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, HLRAlgo_Array1OfTData*& TData2, HLRAlgo_Array1OfPISeg*& PISeg2, HLRAlgo_Array1OfPINod*& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const;
Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices, HLRAlgo_PolyInternalNode::NodeData& Nod11RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices, HLRAlgo_PolyInternalNode::NodeData& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, HLRAlgo_Array1OfTData*& TData1, HLRAlgo_Array1OfPISeg*& PISeg1, HLRAlgo_Array1OfPINod*& PINod1, HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices, HLRAlgo_PolyInternalNode::NodeData& Nod21RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices, HLRAlgo_PolyInternalNode::NodeData& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, HLRAlgo_Array1OfTData*& TData2, HLRAlgo_Array1OfPISeg*& PISeg2, HLRAlgo_Array1OfPINod*& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Real X4, const Standard_Real Y4, const Standard_Real Z4, const Standard_Real XT4, const Standard_Real YT4, const Standard_Real ZT4, const Standard_Real coef4, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, const Standard_Integer flag) const;
Standard_EXPORT void Interpolation(HLRAlgo_ListOfBPoint& List,
Standard_Real& X1,
Standard_Real& Y1,
Standard_Real& Z1,
Standard_Real& X2,
Standard_Real& Y2,
Standard_Real& Z2,
Standard_Real& XTI1,
Standard_Real& YTI1,
Standard_Real& ZTI1,
Standard_Real& XTI2,
Standard_Real& YTI2,
Standard_Real& ZTI2,
const Standard_Integer e,
Standard_Real& U1,
Standard_Real& U2,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices1,
HLRAlgo_PolyInternalNode::NodeData& Nod11RValues,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices2,
HLRAlgo_PolyInternalNode::NodeData& Nod12RValues,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Integer i1,
const Handle(HLRAlgo_PolyInternalData)& pid1,
HLRAlgo_Array1OfTData*& TData1,
HLRAlgo_Array1OfPISeg*& PISeg1,
HLRAlgo_Array1OfPINod*& PINod1) const;
Standard_EXPORT void InsertOnOutLine (NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT void Interpolation(HLRAlgo_ListOfBPoint& List,
Standard_Real& X1,
Standard_Real& Y1,
Standard_Real& Z1,
Standard_Real& X2,
Standard_Real& Y2,
Standard_Real& Z2,
Standard_Real& XTI1,
Standard_Real& YTI1,
Standard_Real& ZTI1,
Standard_Real& XTI2,
Standard_Real& YTI2,
Standard_Real& ZTI2,
const Standard_Integer e,
Standard_Real& U1,
Standard_Real& U2,
const GeomAbs_Shape rg,
HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod11RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod12RValues,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Integer i1,
const Handle(HLRAlgo_PolyInternalData)& pid1,
HLRAlgo_Array1OfTData*& TData1,
HLRAlgo_Array1OfPISeg*& PISeg1,
HLRAlgo_Array1OfPINod*& PINod1,
HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod21RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod22RValues,
const Standard_Integer i2p1,
const Standard_Integer i2p2,
const Standard_Integer i2,
const Handle(HLRAlgo_PolyInternalData)& pid2,
HLRAlgo_Array1OfTData*& TData2,
HLRAlgo_Array1OfPISeg*& PISeg2,
HLRAlgo_Array1OfPINod*& PINod2) const;
Standard_EXPORT void CheckFrBackTriangles (HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT Standard_Boolean Interpolation(const Standard_Real U1,
const Standard_Real U2,
HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
Standard_Real& X3,
Standard_Real& Y3,
Standard_Real& Z3,
Standard_Real& XT3,
Standard_Real& YT3,
Standard_Real& ZT3,
Standard_Real& coef3,
Standard_Real& U3,
Standard_Boolean& mP3P1) const;
Standard_EXPORT void FindEdgeOnTriangle (const HLRAlgo_TriangleData& theTriangle, const Standard_Integer ip1, const Standard_Integer ip2, Standard_Integer& jtrouv, Standard_Boolean& isDirect) const;
Standard_EXPORT void MoveOrInsertPoint(HLRAlgo_ListOfBPoint& List,
Standard_Real& X1,
Standard_Real& Y1,
Standard_Real& Z1,
Standard_Real& X2,
Standard_Real& Y2,
Standard_Real& Z2,
Standard_Real& XTI1,
Standard_Real& YTI1,
Standard_Real& ZTI1,
Standard_Real& XTI2,
Standard_Real& YTI2,
Standard_Real& ZTI2,
const Standard_Integer e,
Standard_Real& U1,
Standard_Real& U2,
HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod11RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod12RValues,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Integer i1,
const Handle(HLRAlgo_PolyInternalData)& pid1,
HLRAlgo_Array1OfTData*& TData1,
HLRAlgo_Array1OfPISeg*& PISeg1,
HLRAlgo_Array1OfPINod*& PINod1,
const Standard_Real X3,
const Standard_Real Y3,
const Standard_Real Z3,
const Standard_Real XT3,
const Standard_Real YT3,
const Standard_Real ZT3,
const Standard_Real coef3,
const Standard_Real U3,
const Standard_Boolean insP3,
const Standard_Boolean mP3P1,
const Standard_Integer flag) const;
Standard_EXPORT void ChangeNode (const Standard_Integer theIp1,
const Standard_Integer theIp2,
HLRAlgo_PolyInternalNode::NodeIndices& theNod1Indices,
HLRAlgo_PolyInternalNode::NodeData& theNod1RValues,
HLRAlgo_PolyInternalNode::NodeIndices& theNod2Indices,
HLRAlgo_PolyInternalNode::NodeData& theNod2RValues,
const Standard_Real theCoef1,
const Standard_Real theX3,
const Standard_Real theY3,
const Standard_Real theZ3,
const Standard_Boolean theIsFirst,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod) const;
Standard_EXPORT void MoveOrInsertPoint(HLRAlgo_ListOfBPoint& List,
Standard_Real& X1,
Standard_Real& Y1,
Standard_Real& Z1,
Standard_Real& X2,
Standard_Real& Y2,
Standard_Real& Z2,
Standard_Real& XTI1,
Standard_Real& YTI1,
Standard_Real& ZTI1,
Standard_Real& XTI2,
Standard_Real& YTI2,
Standard_Real& ZTI2,
const Standard_Integer e,
Standard_Real& U1,
Standard_Real& U2,
HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod11RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod12RValues,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Integer i1,
const Handle(HLRAlgo_PolyInternalData)& pid1,
HLRAlgo_Array1OfTData*& TData1,
HLRAlgo_Array1OfPISeg*& PISeg1,
HLRAlgo_Array1OfPINod*& PINod1,
HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod21RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod22RValues,
const Standard_Integer i2p1,
const Standard_Integer i2p2,
const Standard_Integer i2,
const Handle(HLRAlgo_PolyInternalData)& pid2,
HLRAlgo_Array1OfTData*& TData2,
HLRAlgo_Array1OfPISeg*& PISeg2,
HLRAlgo_Array1OfPINod*& PINod2,
const Standard_Real X3,
const Standard_Real Y3,
const Standard_Real Z3,
const Standard_Real XT3,
const Standard_Real YT3,
const Standard_Real ZT3,
const Standard_Real coef3,
const Standard_Real U3,
const Standard_Boolean insP3,
const Standard_Boolean mP3P1,
const Standard_Integer flag) const;
Standard_EXPORT void UpdateAroundNode (const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod) const;
Standard_EXPORT void MoveOrInsertPoint(HLRAlgo_ListOfBPoint& List,
Standard_Real& X1,
Standard_Real& Y1,
Standard_Real& Z1,
Standard_Real& X2,
Standard_Real& Y2,
Standard_Real& Z2,
Standard_Real& XTI1,
Standard_Real& YTI1,
Standard_Real& ZTI1,
Standard_Real& XTI2,
Standard_Real& YTI2,
Standard_Real& ZTI2,
const Standard_Integer e,
Standard_Real& U1,
Standard_Real& U2,
HLRAlgo_PolyInternalNode::NodeIndices& Nod11Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod11RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod12Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod12RValues,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Integer i1,
const Handle(HLRAlgo_PolyInternalData)& pid1,
HLRAlgo_Array1OfTData*& TData1,
HLRAlgo_Array1OfPISeg*& PISeg1,
HLRAlgo_Array1OfPINod*& PINod1,
HLRAlgo_PolyInternalNode::NodeIndices& Nod21Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod21RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod22Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod22RValues,
const Standard_Integer i2p1,
const Standard_Integer i2p2,
const Standard_Integer i2,
const Handle(HLRAlgo_PolyInternalData)& pid2,
HLRAlgo_Array1OfTData*& TData2,
HLRAlgo_Array1OfPISeg*& PISeg2,
HLRAlgo_Array1OfPINod*& PINod2,
const Standard_Real X3,
const Standard_Real Y3,
const Standard_Real Z3,
const Standard_Real XT3,
const Standard_Real YT3,
const Standard_Real ZT3,
const Standard_Real coef3,
const Standard_Real U3,
const Standard_Boolean insP3,
const Standard_Boolean mP3P1,
const Standard_Real X4,
const Standard_Real Y4,
const Standard_Real Z4,
const Standard_Real XT4,
const Standard_Real YT4,
const Standard_Real ZT4,
const Standard_Real coef4,
const Standard_Real U4,
const Standard_Boolean insP4,
const Standard_Boolean mP4P1,
const Standard_Integer flag) const;
Standard_EXPORT void OrientTriangle (const Standard_Integer iTri, HLRAlgo_TriangleData& theTriangle, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices1, HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices2, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices3, HLRAlgo_PolyInternalNode::NodeData& Nod3RValues) const;
Standard_EXPORT Standard_Boolean Triangles (const Standard_Integer ip1, const Standard_Integer ip2, HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices, HLRAlgo_Array1OfPISeg*& PISeg, Standard_Integer& iTri1, Standard_Integer& iTri2) const;
Standard_EXPORT Standard_Boolean NewNode (HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues, Standard_Real& coef1, Standard_Boolean& moveP1) const;
Standard_EXPORT void UVNode (HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues, const Standard_Real coef1, Standard_Real& U3, Standard_Real& V3) const;
Standard_EXPORT void CheckDegeneratedSegment (HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices, HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod2Indices, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues) const;
Standard_EXPORT void InsertOnOutLine(
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT void UpdateOutLines (HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT void CheckFrBackTriangles(
HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT void UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& theList,
const NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
const Standard_Boolean theIsClosed);
Standard_EXPORT void FindEdgeOnTriangle(const HLRAlgo_TriangleData& theTriangle,
const Standard_Integer ip1,
const Standard_Integer ip2,
Standard_Integer& jtrouv,
Standard_Boolean& isDirect) const;
Standard_EXPORT void UpdatePolyData (NCollection_Array1<Handle(HLRAlgo_PolyData)>& thePD,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
const Standard_Boolean theClosed);
Standard_EXPORT void ChangeNode(const Standard_Integer theIp1,
const Standard_Integer theIp2,
HLRAlgo_PolyInternalNode::NodeIndices& theNod1Indices,
HLRAlgo_PolyInternalNode::NodeData& theNod1RValues,
HLRAlgo_PolyInternalNode::NodeIndices& theNod2Indices,
HLRAlgo_PolyInternalNode::NodeData& theNod2RValues,
const Standard_Real theCoef1,
const Standard_Real theX3,
const Standard_Real theY3,
const Standard_Real theZ3,
const Standard_Boolean theIsFirst,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod) const;
Standard_EXPORT void TMultiply (Standard_Real& X, Standard_Real& Y, Standard_Real& Z, const Standard_Boolean VecPartOnly = Standard_False) const;
Standard_EXPORT void UpdateAroundNode(const Standard_Integer theINode,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices,
HLRAlgo_Array1OfTData& theTData,
HLRAlgo_Array1OfPISeg& thePISeg,
HLRAlgo_Array1OfPINod& thePINod) const;
Standard_EXPORT void OrientTriangle(const Standard_Integer iTri,
HLRAlgo_TriangleData& theTriangle,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices1,
HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices2,
HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices3,
HLRAlgo_PolyInternalNode::NodeData& Nod3RValues) const;
Standard_EXPORT Standard_Boolean Triangles(const Standard_Integer ip1,
const Standard_Integer ip2,
HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices,
HLRAlgo_Array1OfPISeg*& PISeg,
Standard_Integer& iTri1,
Standard_Integer& iTri2) const;
Standard_EXPORT Standard_Boolean NewNode(HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
Standard_Real& coef1,
Standard_Boolean& moveP1) const;
Standard_EXPORT void UVNode(HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
const Standard_Real coef1,
Standard_Real& U3,
Standard_Real& V3) const;
Standard_EXPORT void CheckDegeneratedSegment(
HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
HLRAlgo_PolyInternalNode::NodeIndices& Nod2Indices,
HLRAlgo_PolyInternalNode::NodeData& Nod2RValues) const;
Standard_EXPORT void UpdateOutLines(HLRAlgo_ListOfBPoint& theList,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID);
Standard_EXPORT void UpdateEdgesBiPoints(
HLRAlgo_ListOfBPoint& theList,
const NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
const Standard_Boolean theIsClosed);
Standard_EXPORT void UpdatePolyData(NCollection_Array1<Handle(HLRAlgo_PolyData)>& thePD,
NCollection_Array1<Handle(HLRAlgo_PolyInternalData)>& thePID,
const Standard_Boolean theClosed);
Standard_EXPORT void TMultiply(Standard_Real& X,
Standard_Real& Y,
Standard_Real& Z,
const Standard_Boolean VecPartOnly = Standard_False) const;
void TMultiply(gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
{
TMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly);
TMultiply(thePoint.ChangeCoord(1),
thePoint.ChangeCoord(2),
thePoint.ChangeCoord(3),
VecPartOnly);
}
Standard_EXPORT void TTMultiply (Standard_Real& X, Standard_Real& Y, Standard_Real& Z, const Standard_Boolean VecPartOnly = Standard_False) const;
Standard_EXPORT void TTMultiply(Standard_Real& X,
Standard_Real& Y,
Standard_Real& Z,
const Standard_Boolean VecPartOnly = Standard_False) const;
void TTMultiply (gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
void TTMultiply(gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
{
TTMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly);\
TTMultiply(thePoint.ChangeCoord(1),
thePoint.ChangeCoord(2),
thePoint.ChangeCoord(3),
VecPartOnly);
}
Standard_EXPORT void TIMultiply (Standard_Real& X, Standard_Real& Y, Standard_Real& Z, const Standard_Boolean VecPartOnly = Standard_False) const;
Standard_EXPORT void TIMultiply(Standard_Real& X,
Standard_Real& Y,
Standard_Real& Z,
const Standard_Boolean VecPartOnly = Standard_False) const;
void TIMultiply (gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
void TIMultiply(gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
{
TIMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly);
TIMultiply(thePoint.ChangeCoord(1),
thePoint.ChangeCoord(2),
thePoint.ChangeCoord(3),
VecPartOnly);
}
private:
HLRAlgo_Projector myProj;
Standard_Real TMat[3][3];
Standard_Real TLoc[3];
Standard_Real TTMa[3][3];
Standard_Real TTLo[3];
Standard_Real TIMa[3][3];
Standard_Real TILo[3];
TopTools_SequenceOfShape myShapes;
HLRAlgo_Projector myProj;
Standard_Real TMat[3][3];
Standard_Real TLoc[3];
Standard_Real TTMa[3][3];
Standard_Real TTLo[3];
Standard_Real TIMa[3][3];
Standard_Real TILo[3];
TopTools_SequenceOfShape myShapes;
TopTools_IndexedMapOfShape myEMap;
TopTools_IndexedMapOfShape myFMap;
Handle(HLRAlgo_PolyAlgo) myAlgo;
Standard_Boolean myDebug;
Standard_Real myTolSta;
Standard_Real myTolEnd;
Standard_Real myTolAngular;
Handle(Geom_Surface) myGSurf;
BRepAdaptor_Surface myBSurf;
BRepAdaptor_Curve myBCurv;
BRepAdaptor_Curve2d myPC;
Handle(HLRAlgo_PolyAlgo) myAlgo;
Standard_Boolean myDebug;
Standard_Real myTolSta;
Standard_Real myTolEnd;
Standard_Real myTolAngular;
Handle(Geom_Surface) myGSurf;
BRepAdaptor_Surface myBSurf;
BRepAdaptor_Curve myBCurv;
BRepAdaptor_Curve2d myPC;
};
#endif // _HLRBRep_PolyAlgo_HeaderFile

View File

@@ -27,145 +27,151 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
//=======================================================================
//function : HLRBRep_PolyHLRToShape
//purpose :
//=======================================================================
//=================================================================================================
HLRBRep_PolyHLRToShape::HLRBRep_PolyHLRToShape ()
{}
HLRBRep_PolyHLRToShape::HLRBRep_PolyHLRToShape() {}
//=======================================================================
//function : Update
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A)
void HLRBRep_PolyHLRToShape::Update(const Handle(HLRBRep_PolyAlgo)& A)
{
myAlgo = A;
myAlgo = A;
myHideMode = Standard_True;
Standard_Real sta,end;
Standard_ShortReal tolsta,tolend;
Standard_Real sta, end;
Standard_ShortReal tolsta, tolend;
HLRAlgo_EdgeIterator It;
myBiPntVis.Clear();
myBiPntHid.Clear();
TopoDS_Shape S;
Standard_Boolean reg1,regn,outl,intl;
const gp_Trsf& T = myAlgo->Projector().Transformation();
TopoDS_Shape S;
Standard_Boolean reg1, regn, outl, intl;
const gp_Trsf& T = myAlgo->Projector().Transformation();
HLRAlgo_EdgeStatus status;
for (myAlgo->InitHide(); myAlgo->MoreHide(); myAlgo->NextHide()) {
HLRAlgo_BiPoint::PointsT& aPoints = myAlgo->Hide(status,S,reg1,regn,outl,intl);
gp_XYZ aSta = aPoints.Pnt1;
gp_XYZ aEnd = aPoints.Pnt2;
for (myAlgo->InitHide(); myAlgo->MoreHide(); myAlgo->NextHide())
{
HLRAlgo_BiPoint::PointsT& aPoints = myAlgo->Hide(status, S, reg1, regn, outl, intl);
gp_XYZ aSta = aPoints.Pnt1;
gp_XYZ aEnd = aPoints.Pnt2;
T.Transforms(aSta);
T.Transforms(aEnd);
const gp_XY aSta2D(aSta.X(), aSta.Y());
const gp_XY aEnd2D(aEnd.X(), aEnd.Y());
const gp_XY aD = aEnd2D - aSta2D;
if (aD.Modulus() > 1.e-10) {
for (It.InitVisible(status);
It.MoreVisible();
It.NextVisible()) {
It.Visible(sta,tolsta,end,tolend);
myBiPntVis.Append
(HLRBRep_BiPnt2D
(aSta2D + sta * aD, aSta2D + end * aD,
S,reg1,regn,outl,intl));
if (aD.Modulus() > 1.e-10)
{
for (It.InitVisible(status); It.MoreVisible(); It.NextVisible())
{
It.Visible(sta, tolsta, end, tolend);
myBiPntVis.Append(
HLRBRep_BiPnt2D(aSta2D + sta * aD, aSta2D + end * aD, S, reg1, regn, outl, intl));
}
for (It.InitHidden(status);
It.MoreHidden();
It.NextHidden()) {
It.Hidden(sta,tolsta,end,tolend);
myBiPntHid.Append
(HLRBRep_BiPnt2D
(aSta2D + sta * aD, aSta2D + end * aD,
S,reg1,regn,outl,intl));
for (It.InitHidden(status); It.MoreHidden(); It.NextHidden())
{
It.Hidden(sta, tolsta, end, tolend);
myBiPntHid.Append(
HLRBRep_BiPnt2D(aSta2D + sta * aD, aSta2D + end * aD, S, reg1, regn, outl, intl));
}
}
}
}
//=======================================================================
//function : InternalCompound
//purpose :
//=======================================================================
//=================================================================================================
TopoDS_Shape
HLRBRep_PolyHLRToShape::InternalCompound (const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S)
TopoDS_Shape HLRBRep_PolyHLRToShape::InternalCompound(const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S)
{
TopTools_MapOfShape Map;
if (!S.IsNull()) {
if (!S.IsNull())
{
TopExp_Explorer ex;
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next())
for (ex.Init(S, TopAbs_EDGE); ex.More(); ex.Next())
Map.Add(ex.Current());
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next())
for (ex.Init(S, TopAbs_FACE); ex.More(); ex.Next())
Map.Add(ex.Current());
}
Standard_Boolean todraw,reg1,regn,outl,intl;
Standard_Boolean todraw, reg1, regn, outl, intl;
Standard_Boolean added = Standard_False;
TopoDS_Shape Result;
BRep_Builder B;
TopoDS_Shape Result;
BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Result));
if (myHideMode) {
if (myHideMode)
{
HLRBRep_ListIteratorOfListOfBPnt2D It;
if (visible) It.Initialize(myBiPntVis);
else It.Initialize(myBiPntHid);
for (; It.More(); It.Next()) {
if (visible)
It.Initialize(myBiPntVis);
else
It.Initialize(myBiPntHid);
for (; It.More(); It.Next())
{
const HLRBRep_BiPnt2D& BP = It.Value();
reg1 = BP.Rg1Line();
regn = BP.RgNLine();
outl = BP.OutLine();
intl = BP.IntLine();
if (typ == 1) todraw = intl;
else if (typ == 2) todraw = reg1 && !regn && !outl;
else if (typ == 3) todraw = regn && !outl;
else todraw = !(intl || (reg1 && !outl));
reg1 = BP.Rg1Line();
regn = BP.RgNLine();
outl = BP.OutLine();
intl = BP.IntLine();
if (typ == 1)
todraw = intl;
else if (typ == 2)
todraw = reg1 && !regn && !outl;
else if (typ == 3)
todraw = regn && !outl;
else
todraw = !(intl || (reg1 && !outl));
if (todraw)
if (!S.IsNull()) todraw = Map.Contains(BP.Shape());
if (todraw) {
if (!S.IsNull())
todraw = Map.Contains(BP.Shape());
if (todraw)
{
const gp_Pnt2d& FirstP2d = BP.P1();
const gp_Pnt2d& LastP2d = BP.P2();
if (FirstP2d.SquareDistance(LastP2d) > 1.e-20)
{
B.Add(Result,BRepLib_MakeEdge2d(BP.P1(),BP.P2()));
B.Add(Result, BRepLib_MakeEdge2d(BP.P1(), BP.P2()));
added = Standard_True;
}
}
}
}
else {
else
{
const gp_Trsf& T = myAlgo->Projector().Transformation();
TopoDS_Shape SBP;
TopoDS_Shape SBP;
for (myAlgo->InitShow(); myAlgo->MoreShow(); myAlgo->NextShow()) {
HLRAlgo_BiPoint::PointsT& aPoints = myAlgo->Show(SBP,reg1,regn,outl,intl);
if (typ == 1) todraw = intl;
else if (typ == 2) todraw = reg1 && !regn && !outl;
else if (typ == 3) todraw = regn && !outl;
else todraw = !(intl || (reg1 && !outl));
for (myAlgo->InitShow(); myAlgo->MoreShow(); myAlgo->NextShow())
{
HLRAlgo_BiPoint::PointsT& aPoints = myAlgo->Show(SBP, reg1, regn, outl, intl);
if (typ == 1)
todraw = intl;
else if (typ == 2)
todraw = reg1 && !regn && !outl;
else if (typ == 3)
todraw = regn && !outl;
else
todraw = !(intl || (reg1 && !outl));
if (todraw)
if (!S.IsNull()) todraw = Map.Contains(SBP);
if (todraw) {
gp_XYZ aSta = aPoints.Pnt1, aEnd = aPoints.Pnt2;
T.Transforms(aSta);
T.Transforms(aEnd);
const gp_XY aSta2D(aSta.X(), aSta.Y());
const gp_XY aEnd2D(aEnd.X(), aEnd.Y());
const gp_XY aD = aEnd2D - aSta2D;
if (aD.SquareModulus() > 1.e-20) {
B.Add(Result,BRepLib_MakeEdge2d(aSta2D, aEnd2D));
added = Standard_True;
}
if (!S.IsNull())
todraw = Map.Contains(SBP);
if (todraw)
{
gp_XYZ aSta = aPoints.Pnt1, aEnd = aPoints.Pnt2;
T.Transforms(aSta);
T.Transforms(aEnd);
const gp_XY aSta2D(aSta.X(), aSta.Y());
const gp_XY aEnd2D(aEnd.X(), aEnd.Y());
const gp_XY aD = aEnd2D - aSta2D;
if (aD.SquareModulus() > 1.e-20)
{
B.Add(Result, BRepLib_MakeEdge2d(aSta2D, aEnd2D));
added = Standard_True;
}
}
}
}
if (!added) Result = TopoDS_Shape();
if (!added)
Result = TopoDS_Shape();
return Result;
}

View File

@@ -27,7 +27,6 @@
class HLRBRep_PolyAlgo;
class TopoDS_Shape;
//! A framework for filtering the computation
//! results of an HLRBRep_Algo algorithm by extraction.
//! From the results calculated by the algorithm on
@@ -55,92 +54,74 @@ class TopoDS_Shape;
//! The construction of the shape does not call a
//! new computation of the algorithm, but only
//! reads its internal results.
class HLRBRep_PolyHLRToShape
class HLRBRep_PolyHLRToShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for filtering the results
//! of the HLRBRep_Algo algorithm, A.
//! Use the extraction filters to obtain the results you want for A.
Standard_EXPORT HLRBRep_PolyHLRToShape();
Standard_EXPORT void Update (const Handle(HLRBRep_PolyAlgo)& A);
void Show();
void Hide();
TopoDS_Shape VCompound();
TopoDS_Shape VCompound (const TopoDS_Shape& S);
Standard_EXPORT void Update(const Handle(HLRBRep_PolyAlgo)& A);
void Show();
void Hide();
TopoDS_Shape VCompound();
TopoDS_Shape VCompound(const TopoDS_Shape& S);
//! Sets the extraction filter for visible smooth edges.
TopoDS_Shape Rg1LineVCompound();
TopoDS_Shape Rg1LineVCompound (const TopoDS_Shape& S);
TopoDS_Shape Rg1LineVCompound();
TopoDS_Shape Rg1LineVCompound(const TopoDS_Shape& S);
//! Sets the extraction filter for visible sewn edges.
TopoDS_Shape RgNLineVCompound();
TopoDS_Shape RgNLineVCompound (const TopoDS_Shape& S);
TopoDS_Shape OutLineVCompound();
TopoDS_Shape RgNLineVCompound();
TopoDS_Shape RgNLineVCompound(const TopoDS_Shape& S);
TopoDS_Shape OutLineVCompound();
//! Sets the extraction filter for visible outlines.
TopoDS_Shape OutLineVCompound (const TopoDS_Shape& S);
TopoDS_Shape HCompound();
TopoDS_Shape HCompound (const TopoDS_Shape& S);
TopoDS_Shape Rg1LineHCompound();
TopoDS_Shape OutLineVCompound(const TopoDS_Shape& S);
TopoDS_Shape HCompound();
TopoDS_Shape HCompound(const TopoDS_Shape& S);
TopoDS_Shape Rg1LineHCompound();
//! Sets the extraction filter for hidden smooth edges.
TopoDS_Shape Rg1LineHCompound (const TopoDS_Shape& S);
TopoDS_Shape RgNLineHCompound();
TopoDS_Shape Rg1LineHCompound(const TopoDS_Shape& S);
TopoDS_Shape RgNLineHCompound();
//! Sets the extraction filter for hidden sewn edges.
TopoDS_Shape RgNLineHCompound (const TopoDS_Shape& S);
TopoDS_Shape OutLineHCompound();
TopoDS_Shape RgNLineHCompound(const TopoDS_Shape& S);
TopoDS_Shape OutLineHCompound();
//! Sets the extraction filter for hidden outlines.
//! Hidden outlines occur, for instance, in tori. In
//! this case, the inner outlines of the torus seen on its side are hidden.
TopoDS_Shape OutLineHCompound (const TopoDS_Shape& S);
TopoDS_Shape OutLineHCompound(const TopoDS_Shape& S);
protected:
private:
Standard_EXPORT TopoDS_Shape InternalCompound (const Standard_Integer typ, const Standard_Boolean visible, const TopoDS_Shape& S);
Standard_EXPORT TopoDS_Shape InternalCompound(const Standard_Integer typ,
const Standard_Boolean visible,
const TopoDS_Shape& S);
Handle(HLRBRep_PolyAlgo) myAlgo;
HLRBRep_ListOfBPnt2D myBiPntVis;
HLRBRep_ListOfBPnt2D myBiPntHid;
Standard_Boolean myHideMode;
HLRBRep_ListOfBPnt2D myBiPntVis;
HLRBRep_ListOfBPnt2D myBiPntHid;
Standard_Boolean myHideMode;
};
#include <HLRBRep_PolyHLRToShape.lxx>
#endif // _HLRBRep_PolyHLRToShape_HeaderFile

View File

@@ -17,153 +17,181 @@
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : Show
//purpose :
// function : Show
// purpose :
//=======================================================================
inline void HLRBRep_PolyHLRToShape::Show()
{ myHideMode = Standard_False; }
{
myHideMode = Standard_False;
}
//=======================================================================
//function : Hide
//purpose :
// function : Hide
// purpose :
//=======================================================================
inline void HLRBRep_PolyHLRToShape::Hide()
{ myHideMode = Standard_True; }
{
myHideMode = Standard_True;
}
//=======================================================================
//function : VCompound
//purpose :
// function : VCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::VCompound()
{ return InternalCompound(4,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(4, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : VCompound
//purpose :
// function : VCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::VCompound(const TopoDS_Shape& S)
{ return InternalCompound(4,Standard_True,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::VCompound(const TopoDS_Shape& S)
{
return InternalCompound(4, Standard_True, S);
}
//=======================================================================
//function : Rg1LineVCompound
//purpose :
// function : Rg1LineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::Rg1LineVCompound()
{ return InternalCompound(2,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(2, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : Rg1LineVCompound
//purpose :
// function : Rg1LineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::Rg1LineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(2,Standard_True,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::Rg1LineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(2, Standard_True, S);
}
//=======================================================================
//function : RgNLineVCompound
//purpose :
// function : RgNLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::RgNLineVCompound()
{ return InternalCompound(3,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(3, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : RgNLineVCompound
//purpose :
// function : RgNLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::RgNLineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(3,Standard_True,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::RgNLineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(3, Standard_True, S);
}
//=======================================================================
//function : OutLineVCompound
//purpose :
// function : OutLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::OutLineVCompound()
{ return InternalCompound(1,Standard_True,TopoDS_Shape()); }
{
return InternalCompound(1, Standard_True, TopoDS_Shape());
}
//=======================================================================
//function : OutLineVCompound
//purpose :
// function : OutLineVCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::OutLineVCompound(const TopoDS_Shape& S)
{ return InternalCompound(1,Standard_True,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::OutLineVCompound(const TopoDS_Shape& S)
{
return InternalCompound(1, Standard_True, S);
}
//=======================================================================
//function : HCompound
//purpose :
// function : HCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::HCompound()
{ return InternalCompound(4,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(4, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : HCompound
//purpose :
// function : HCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::HCompound(const TopoDS_Shape& S)
{ return InternalCompound(4,Standard_False,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::HCompound(const TopoDS_Shape& S)
{
return InternalCompound(4, Standard_False, S);
}
//=======================================================================
//function : Rg1LineHCompound
//purpose :
// function : Rg1LineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::Rg1LineHCompound()
{ return InternalCompound(2,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(2, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : Rg1LineHCompound
//purpose :
// function : Rg1LineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::Rg1LineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(2,Standard_False,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::Rg1LineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(2, Standard_False, S);
}
//=======================================================================
//function : RgNLineHCompound
//purpose :
// function : RgNLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::RgNLineHCompound()
{ return InternalCompound(3,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(3, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : RgNLineHCompound
//purpose :
// function : RgNLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::RgNLineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(3,Standard_False,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::RgNLineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(3, Standard_False, S);
}
//=======================================================================
//function : OutLineHCompound
//purpose :
// function : OutLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape HLRBRep_PolyHLRToShape::OutLineHCompound()
{ return InternalCompound(1,Standard_False,TopoDS_Shape()); }
{
return InternalCompound(1, Standard_False, TopoDS_Shape());
}
//=======================================================================
//function : OutLineHCompound
//purpose :
// function : OutLineHCompound
// purpose :
//=======================================================================
inline TopoDS_Shape
HLRBRep_PolyHLRToShape::OutLineHCompound(const TopoDS_Shape& S)
{ return InternalCompound(1,Standard_False,S); }
inline TopoDS_Shape HLRBRep_PolyHLRToShape::OutLineHCompound(const TopoDS_Shape& S)
{
return InternalCompound(1, Standard_False, S);
}

View File

@@ -34,15 +34,11 @@ class gp_Pnt;
class gp_Vec;
class gp_Dir;
class HLRBRep_SLProps
class HLRBRep_SLProps
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes the local properties of the surface <S>
//! for the parameter values (<U>, <V>).
//! The current point and the derivatives are
@@ -53,139 +49,126 @@ public:
//! only the tangent, N should be equal to 1.
//! <Resolution> is the linear tolerance (it is used to test
//! if a vector is null).
Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution);
Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer N,
const Standard_Real Resolution);
//! idem as previous constructor but without setting the value
//! of parameters <U> and <V>.
Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S, const Standard_Integer N, const Standard_Real Resolution);
Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S,
const Standard_Integer N,
const Standard_Real Resolution);
//! idem as previous constructor but without setting the value
//! of parameters <U> and <V> and the surface.
//! the surface can have an empty constructor.
Standard_EXPORT HLRBRep_SLProps(const Standard_Integer N, const Standard_Real Resolution);
//! Initializes the local properties of the surface S
//! for the new surface.
Standard_EXPORT void SetSurface (const Standard_Address& S);
Standard_EXPORT void SetSurface(const Standard_Address& S);
//! Initializes the local properties of the surface S
//! for the new parameter values (<U>, <V>).
Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V);
Standard_EXPORT void SetParameters(const Standard_Real U, const Standard_Real V);
//! Returns the point.
Standard_EXPORT const gp_Pnt& Value() const;
//! Returns the first U derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec& D1U();
//! Returns the first V derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec& D1V();
//! Returns the second U derivatives
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec& D2U();
//! Returns the second V derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec& D2V();
//! Returns the second UV cross-derivative.
//! The derivative is computed if it has not been yet.
Standard_EXPORT const gp_Vec& DUV();
//! returns True if the U tangent is defined.
//! For example, the tangent is not defined if the
//! two first U derivatives are null.
Standard_EXPORT Standard_Boolean IsTangentUDefined();
//! Returns the tangent direction <D> on the iso-V.
Standard_EXPORT void TangentU (gp_Dir& D);
Standard_EXPORT void TangentU(gp_Dir& D);
//! returns if the V tangent is defined.
//! For example, the tangent is not defined if the
//! two first V derivatives are null.
Standard_EXPORT Standard_Boolean IsTangentVDefined();
//! Returns the tangent direction <D> on the iso-V.
Standard_EXPORT void TangentV (gp_Dir& D);
Standard_EXPORT void TangentV(gp_Dir& D);
//! Tells if the normal is defined.
Standard_EXPORT Standard_Boolean IsNormalDefined();
//! Returns the normal direction.
Standard_EXPORT const gp_Dir& Normal();
//! returns True if the curvature is defined.
Standard_EXPORT Standard_Boolean IsCurvatureDefined();
//! returns True if the point is umbilic (i.e. if the
//! curvature is constant).
Standard_EXPORT Standard_Boolean IsUmbilic();
//! Returns the maximum curvature
Standard_EXPORT Standard_Real MaxCurvature();
//! Returns the minimum curvature
Standard_EXPORT Standard_Real MinCurvature();
//! Returns the direction of the maximum and minimum curvature
//! <MaxD> and <MinD>
Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD);
Standard_EXPORT void CurvatureDirections(gp_Dir& MaxD, gp_Dir& MinD);
//! Returns the mean curvature.
Standard_EXPORT Standard_Real MeanCurvature();
//! Returns the Gaussian curvature
Standard_EXPORT Standard_Real GaussianCurvature();
protected:
private:
Standard_Address mySurf;
Standard_Real myU;
Standard_Real myV;
Standard_Real myU;
Standard_Real myV;
Standard_Integer myDerOrder;
Standard_Integer myCN;
Standard_Real myLinTol;
gp_Pnt myPnt;
gp_Vec myD1u;
gp_Vec myD1v;
gp_Vec myD2u;
gp_Vec myD2v;
gp_Vec myDuv;
gp_Dir myNormal;
Standard_Real myMinCurv;
Standard_Real myMaxCurv;
gp_Dir myDirMinCurv;
gp_Dir myDirMaxCurv;
Standard_Real myMeanCurv;
Standard_Real myGausCurv;
Standard_Real myLinTol;
gp_Pnt myPnt;
gp_Vec myD1u;
gp_Vec myD1v;
gp_Vec myD2u;
gp_Vec myD2v;
gp_Vec myDuv;
gp_Dir myNormal;
Standard_Real myMinCurv;
Standard_Real myMaxCurv;
gp_Dir myDirMinCurv;
gp_Dir myDirMaxCurv;
Standard_Real myMeanCurv;
Standard_Real myGausCurv;
Standard_Integer mySignificantFirstDerivativeOrderU;
Standard_Integer mySignificantFirstDerivativeOrderV;
LProp_Status myUTangentStatus;
LProp_Status myVTangentStatus;
LProp_Status myNormalStatus;
LProp_Status myCurvatureStatus;
LProp_Status myUTangentStatus;
LProp_Status myVTangentStatus;
LProp_Status myNormalStatus;
LProp_Status myCurvatureStatus;
};
#endif // _HLRBRep_SLProps_HeaderFile

View File

@@ -25,61 +25,63 @@
class gp_Pnt;
class gp_Vec;
class HLRBRep_SLPropsATool
class HLRBRep_SLPropsATool
{
public:
DEFINE_STANDARD_ALLOC
//! Computes the point <P> of parameter <U> and <V>
//! on the Surface <A>.
static void Value (const Standard_Address A, const Standard_Real U, const Standard_Real V, gp_Pnt& P);
static void Value(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P);
//! Computes the point <P> and first derivative <D1*>
//! of parameter <U> and <V> on the Surface <A>.
static void D1 (const Standard_Address A, const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V);
static void D1(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V);
//! Computes the point <P>, the first derivative <D1*>
//! and second derivative <D2*> of parameter <U> and
//! <V> on the Surface <A>.
static void D2 (const Standard_Address A, const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& DUV);
static gp_Vec DN (const Standard_Address A, const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv);
static void D2(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& DUV);
static gp_Vec DN(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv);
//! returns the order of continuity of the Surface
//! <A>. returns 1 : first derivative only is
//! computable returns 2 : first and second derivative
//! only are computable.
static Standard_Integer Continuity (const Standard_Address A);
static Standard_Integer Continuity(const Standard_Address A);
//! returns the bounds of the Surface.
static void Bounds (const Standard_Address A, Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2);
static void Bounds(const Standard_Address A,
Standard_Real& U1,
Standard_Real& V1,
Standard_Real& U2,
Standard_Real& V2);
protected:
private:
};
#include <HLRBRep_SLPropsATool.lxx>
#endif // _HLRBRep_SLPropsATool_HeaderFile

View File

@@ -19,81 +19,85 @@
#include <gp_Pnt.hxx>
//=======================================================================
//function : Value
//purpose :
// function : Value
// purpose :
//=======================================================================
inline void HLRBRep_SLPropsATool::Value
(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{ P = ((HLRBRep_Surface*)A)->Value(U, V); }
inline void HLRBRep_SLPropsATool::Value(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
P = ((HLRBRep_Surface*)A)->Value(U, V);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void HLRBRep_SLPropsATool::D1
(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{ ((HLRBRep_Surface*)A)->D1(U, V, P, D1U, D1V); }
inline void HLRBRep_SLPropsATool::D1(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
((HLRBRep_Surface*)A)->D1(U, V, P, D1U, D1V);
}
//=======================================================================
//function : D2
//purpose :
// function : D2
// purpose :
//=======================================================================
inline void HLRBRep_SLPropsATool::D2
(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& DUV)
{ ((HLRBRep_Surface*)A)->D2(U, V, P, D1U, D1V, D2U, D2V, DUV); }
inline void HLRBRep_SLPropsATool::D2(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& DUV)
{
((HLRBRep_Surface*)A)->D2(U, V, P, D1U, D1V, D2U, D2V, DUV);
}
//=======================================================================
//function : DN
//purpose :
// function : DN
// purpose :
//=======================================================================
inline gp_Vec HLRBRep_SLPropsATool::DN
(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{ return ((HLRBRep_Surface*)A)->DN(U, V, Nu, Nv); }
inline gp_Vec HLRBRep_SLPropsATool::DN(const Standard_Address A,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return ((HLRBRep_Surface*)A)->DN(U, V, Nu, Nv);
}
//=======================================================================
//function : Continuity
//purpose :
// function : Continuity
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_SLPropsATool::Continuity
(const Standard_Address)
{ return 2; } // et boum ! cky le 27 - 04 - 1993
inline Standard_Integer HLRBRep_SLPropsATool::Continuity(const Standard_Address)
{
return 2;
} // et boum ! cky le 27 - 04 - 1993
//=======================================================================
//function : Bounds
//purpose :
// function : Bounds
// purpose :
//=======================================================================
inline void HLRBRep_SLPropsATool::Bounds
(const Standard_Address,
Standard_Real& U1,
Standard_Real& V1,
Standard_Real& U2,
Standard_Real& V2)
inline void HLRBRep_SLPropsATool::Bounds(const Standard_Address,
Standard_Real& U1,
Standard_Real& V1,
Standard_Real& U2,
Standard_Real& V2)
{
U1 = V1 = RealFirst();
U2 = V2 = RealLast();

View File

@@ -24,7 +24,6 @@
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#define Surface Standard_Address
#define Surface_hxx <Standard_Address.hxx>
@@ -33,4 +32,3 @@
#define LProp_SLProps HLRBRep_SLProps
#define LProp_SLProps_hxx <HLRBRep_SLProps.hxx>
#include "../LProp/LProp_SLProps.gxx"

View File

@@ -22,5 +22,4 @@
typedef NCollection_Sequence<HLRBRep_ShapeBounds> HLRBRep_SeqOfShapeBounds;
#endif

View File

@@ -14,96 +14,87 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <HLRBRep_ShapeBounds.hxx>
#include <HLRTopoBRep_OutLiner.hxx>
#include <Standard_Transient.hxx>
//=======================================================================
//function : HLRBRep_ShapeBounds
//purpose :
//=======================================================================
HLRBRep_ShapeBounds::
HLRBRep_ShapeBounds (const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2) :
myShape(S),
myShapeData(SData),
myNbIso(nbIso),
myVertStart(V1),myVertEnd(V2),
myEdgeStart(E1),myEdgeEnd(E2),
myFaceStart(F1),myFaceEnd(F2)
{}
//=================================================================================================
//=======================================================================
//function : HLRBRep_ShapeBounds
//purpose :
//=======================================================================
HLRBRep_ShapeBounds::
HLRBRep_ShapeBounds (const Handle(HLRTopoBRep_OutLiner)& S,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2) :
myShape(S),
myNbIso(nbIso),
myVertStart(V1),myVertEnd(V2),
myEdgeStart(E1),myEdgeEnd(E2),
myFaceStart(F1),myFaceEnd(F2)
{}
//=======================================================================
//function : Translate
//purpose :
//=======================================================================
void HLRBRep_ShapeBounds::Translate (const Standard_Integer NV,
const Standard_Integer NE,
const Standard_Integer NF)
HLRBRep_ShapeBounds::HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2)
: myShape(S),
myShapeData(SData),
myNbIso(nbIso),
myVertStart(V1),
myVertEnd(V2),
myEdgeStart(E1),
myEdgeEnd(E2),
myFaceStart(F1),
myFaceEnd(F2)
{
myVertStart += NV;
myVertEnd += NV;
myEdgeStart += NE;
myEdgeEnd += NE;
myFaceStart += NF;
myFaceEnd += NF;
}
//=======================================================================
//function : Sizes
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_ShapeBounds::Sizes (Standard_Integer& NV,
Standard_Integer& NE,
Standard_Integer& NF) const
HLRBRep_ShapeBounds::HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2)
: myShape(S),
myNbIso(nbIso),
myVertStart(V1),
myVertEnd(V2),
myEdgeStart(E1),
myEdgeEnd(E2),
myFaceStart(F1),
myFaceEnd(F2)
{
}
//=================================================================================================
void HLRBRep_ShapeBounds::Translate(const Standard_Integer NV,
const Standard_Integer NE,
const Standard_Integer NF)
{
myVertStart += NV;
myVertEnd += NV;
myEdgeStart += NE;
myEdgeEnd += NE;
myFaceStart += NF;
myFaceEnd += NF;
}
//=================================================================================================
void HLRBRep_ShapeBounds::Sizes(Standard_Integer& NV,
Standard_Integer& NE,
Standard_Integer& NF) const
{
NV = myVertEnd + 1 - myVertStart;
NE = myEdgeEnd + 1 - myEdgeStart;
NF = myFaceEnd + 1 - myFaceStart;
}
//=======================================================================
//function : Bounds
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_ShapeBounds::Bounds (Standard_Integer& V1,
Standard_Integer& V2,
Standard_Integer& E1,
Standard_Integer& E2,
Standard_Integer& F1,
Standard_Integer& F2) const
void HLRBRep_ShapeBounds::Bounds(Standard_Integer& V1,
Standard_Integer& V2,
Standard_Integer& E1,
Standard_Integer& E2,
Standard_Integer& F1,
Standard_Integer& F2) const
{
V1 = myVertStart;
V2 = myVertEnd;

View File

@@ -26,82 +26,82 @@
#include <Standard_Integer.hxx>
class HLRTopoBRep_OutLiner;
//! Contains a Shape and the bounds of its vertices,
//! edges and faces in the DataStructure.
class HLRBRep_ShapeBounds
class HLRBRep_ShapeBounds
{
public:
DEFINE_STANDARD_ALLOC
HLRBRep_ShapeBounds();
Standard_EXPORT HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S, const Handle(Standard_Transient)& SData, const Standard_Integer nbIso, const Standard_Integer V1, const Standard_Integer V2, const Standard_Integer E1, const Standard_Integer E2, const Standard_Integer F1, const Standard_Integer F2);
Standard_EXPORT HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S, const Standard_Integer nbIso, const Standard_Integer V1, const Standard_Integer V2, const Standard_Integer E1, const Standard_Integer E2, const Standard_Integer F1, const Standard_Integer F2);
Standard_EXPORT void Translate (const Standard_Integer NV, const Standard_Integer NE, const Standard_Integer NF);
void Shape (const Handle(HLRTopoBRep_OutLiner)& S);
const Handle(HLRTopoBRep_OutLiner)& Shape() const;
void ShapeData (const Handle(Standard_Transient)& SD);
const Handle(Standard_Transient)& ShapeData() const;
void NbOfIso (const Standard_Integer nbIso);
Standard_Integer NbOfIso() const;
Standard_EXPORT void Sizes (Standard_Integer& NV, Standard_Integer& NE, Standard_Integer& NF) const;
Standard_EXPORT void Bounds (Standard_Integer& V1, Standard_Integer& V2, Standard_Integer& E1, Standard_Integer& E2, Standard_Integer& F1, Standard_Integer& F2) const;
void UpdateMinMax (const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
HLRBRep_ShapeBounds();
Standard_EXPORT HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(Standard_Transient)& SData,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2);
Standard_EXPORT HLRBRep_ShapeBounds(const Handle(HLRTopoBRep_OutLiner)& S,
const Standard_Integer nbIso,
const Standard_Integer V1,
const Standard_Integer V2,
const Standard_Integer E1,
const Standard_Integer E2,
const Standard_Integer F1,
const Standard_Integer F2);
Standard_EXPORT void Translate(const Standard_Integer NV,
const Standard_Integer NE,
const Standard_Integer NF);
void Shape(const Handle(HLRTopoBRep_OutLiner)& S);
const Handle(HLRTopoBRep_OutLiner)& Shape() const;
void ShapeData(const Handle(Standard_Transient)& SD);
const Handle(Standard_Transient)& ShapeData() const;
void NbOfIso(const Standard_Integer nbIso);
Standard_Integer NbOfIso() const;
Standard_EXPORT void Sizes(Standard_Integer& NV,
Standard_Integer& NE,
Standard_Integer& NF) const;
Standard_EXPORT void Bounds(Standard_Integer& V1,
Standard_Integer& V2,
Standard_Integer& E1,
Standard_Integer& E2,
Standard_Integer& F1,
Standard_Integer& F2) const;
void UpdateMinMax(const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
{
myMinMax = theTotMinMax;
}
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax()
{
return myMinMax;
}
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax() { return myMinMax; }
protected:
private:
Handle(HLRTopoBRep_OutLiner) myShape;
Handle(Standard_Transient) myShapeData;
Standard_Integer myNbIso;
Standard_Integer myVertStart;
Standard_Integer myVertEnd;
Standard_Integer myEdgeStart;
Standard_Integer myEdgeEnd;
Standard_Integer myFaceStart;
Standard_Integer myFaceEnd;
Handle(HLRTopoBRep_OutLiner) myShape;
Handle(Standard_Transient) myShapeData;
Standard_Integer myNbIso;
Standard_Integer myVertStart;
Standard_Integer myVertEnd;
Standard_Integer myEdgeStart;
Standard_Integer myEdgeEnd;
Standard_Integer myFaceStart;
Standard_Integer myFaceEnd;
HLRAlgo_EdgesBlock::MinMaxIndices myMinMax;
};
#include <HLRBRep_ShapeBounds.lxx>
#endif // _HLRBRep_ShapeBounds_HeaderFile

View File

@@ -15,68 +15,77 @@
// commercial license or contractual agreement.
//=======================================================================
//function : HLRBRep_ShapeBounds
//purpose :
// function : HLRBRep_ShapeBounds
// purpose :
//=======================================================================
inline HLRBRep_ShapeBounds::HLRBRep_ShapeBounds ()
: myNbIso(0),
myVertStart(0),
myVertEnd(0),
myEdgeStart(0),
myEdgeEnd(0),
myFaceStart(0),
myFaceEnd(0)
inline HLRBRep_ShapeBounds::HLRBRep_ShapeBounds()
: myNbIso(0),
myVertStart(0),
myVertEnd(0),
myEdgeStart(0),
myEdgeEnd(0),
myFaceStart(0),
myFaceEnd(0)
{
}
//=======================================================================
//function : Shape
//purpose :
// function : Shape
// purpose :
//=======================================================================
inline void
HLRBRep_ShapeBounds::Shape (const Handle(HLRTopoBRep_OutLiner)& S)
{ myShape = S; }
inline void HLRBRep_ShapeBounds::Shape(const Handle(HLRTopoBRep_OutLiner)& S)
{
myShape = S;
}
//=======================================================================
//function : Shape
//purpose :
// function : Shape
// purpose :
//=======================================================================
inline const Handle(HLRTopoBRep_OutLiner) &
HLRBRep_ShapeBounds::Shape () const
{ return myShape; }
inline const Handle(HLRTopoBRep_OutLiner)& HLRBRep_ShapeBounds::Shape() const
{
return myShape;
}
//=======================================================================
//function : ShapeData
//purpose :
// function : ShapeData
// purpose :
//=======================================================================
inline void HLRBRep_ShapeBounds::
ShapeData (const Handle(Standard_Transient)& SD)
{ myShapeData = SD; }
inline void HLRBRep_ShapeBounds::ShapeData(const Handle(Standard_Transient)& SD)
{
myShapeData = SD;
}
//=======================================================================
//function : ShapeData
//purpose :
// function : ShapeData
// purpose :
//=======================================================================
inline const Handle(Standard_Transient) & HLRBRep_ShapeBounds::ShapeData () const
{ return myShapeData; }
inline const Handle(Standard_Transient)& HLRBRep_ShapeBounds::ShapeData() const
{
return myShapeData;
}
//=======================================================================
//function : NbOfIso
//purpose :
// function : NbOfIso
// purpose :
//=======================================================================
inline void HLRBRep_ShapeBounds::NbOfIso (const Standard_Integer nbIso)
{ myNbIso = nbIso; }
inline void HLRBRep_ShapeBounds::NbOfIso(const Standard_Integer nbIso)
{
myNbIso = nbIso;
}
//=======================================================================
//function : NbOfIso
//purpose :
// function : NbOfIso
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_ShapeBounds::NbOfIso () const
{ return myNbIso; }
inline Standard_Integer HLRBRep_ShapeBounds::NbOfIso() const
{
return myNbIso;
}

View File

@@ -18,7 +18,6 @@
// #define No_Exception
#endif
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <HLRBRep_Data.hxx>
@@ -34,261 +33,252 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
//=======================================================================
// Function : Load
// Purpose :
//=======================================================================
Handle(HLRBRep_Data)
HLRBRep_ShapeToHLR::Load(const Handle(HLRTopoBRep_OutLiner)& S,
const HLRAlgo_Projector& P,
BRepTopAdaptor_MapOfShapeTool& MST,
const Standard_Integer nbIso)
{
S->Fill(P,MST,nbIso);
//=================================================================================================
HLRTopoBRep_Data& TopDS = S->DataStructure();
Handle(HLRBRep_Data) HLRBRep_ShapeToHLR::Load(const Handle(HLRTopoBRep_OutLiner)& S,
const HLRAlgo_Projector& P,
BRepTopAdaptor_MapOfShapeTool& MST,
const Standard_Integer nbIso)
{
S->Fill(P, MST, nbIso);
HLRTopoBRep_Data& TopDS = S->DataStructure();
TopTools_IndexedMapOfShape FM;
TopTools_IndexedMapOfShape EM;
TopTools_IndexedDataMapOfShapeListOfShape VerticesToEdges;
TopTools_IndexedDataMapOfShapeListOfShape EdgesToFaces;
TopExp_Explorer exshell,exface;
TopExp_Explorer exshell, exface;
for (exshell.Init(S->OutLinedShape(), TopAbs_SHELL);
exshell.More();
exshell.Next()) { // faces in a shell
for (exface.Init(exshell.Current(), TopAbs_FACE);
exface.More();
exface.Next()) {
for (exshell.Init(S->OutLinedShape(), TopAbs_SHELL); exshell.More(); exshell.Next())
{ // faces in a shell
for (exface.Init(exshell.Current(), TopAbs_FACE); exface.More(); exface.Next())
{
if (!FM.Contains(exface.Current()))
FM.Add(exface.Current());
FM.Add(exface.Current());
}
}
for (exface.Init(S->OutLinedShape(), TopAbs_FACE, TopAbs_SHELL);
exface.More();
exface.Next()) { // faces not in a shell
for (exface.Init(S->OutLinedShape(), TopAbs_FACE, TopAbs_SHELL); exface.More(); exface.Next())
{ // faces not in a shell
if (!FM.Contains(exface.Current()))
FM.Add(exface.Current());
}
TopExp::MapShapes(S->OutLinedShape(),TopAbs_EDGE,EM);
TopExp::MapShapes(S->OutLinedShape(), TopAbs_EDGE, EM);
Standard_Integer i;
Standard_Integer nbEdge = EM.Extent ();
Standard_Integer nbEdge = EM.Extent();
for (i = 1; i <= nbEdge; i++) // vertices back to edges
TopExp::MapShapesAndAncestors(EM(i), TopAbs_VERTEX, TopAbs_EDGE, VerticesToEdges);
for (i = 1; i <= nbEdge; i++) // vertices back to edges
TopExp::MapShapesAndAncestors
(EM(i), TopAbs_VERTEX, TopAbs_EDGE, VerticesToEdges);
Standard_Integer nbVert = VerticesToEdges.Extent();
Standard_Integer nbFace = FM.Extent();
TopoDS_Vertex VF, VL;
TopoDS_Vertex VF, VL;
TopTools_ListIteratorOfListOfShape itn;
Standard_Integer i1, i2;
Standard_Boolean o1, o2;
Standard_Boolean c1, c2;
Standard_Real pf, pl;
Standard_ShortReal tf, tl;
Standard_Integer i1, i2;
Standard_Boolean o1, o2;
Standard_Boolean c1, c2;
Standard_Real pf, pl;
Standard_ShortReal tf, tl;
// Create the data structure
Handle(HLRBRep_Data) DS = new HLRBRep_Data (nbVert, nbEdge, nbFace);
HLRBRep_EdgeData* ed = NULL;
if(nbEdge != 0) ed = &(DS->EDataArray().ChangeValue(1));
// ed++;
Handle(HLRBRep_Data) DS = new HLRBRep_Data(nbVert, nbEdge, nbFace);
HLRBRep_EdgeData* ed = NULL;
if (nbEdge != 0)
ed = &(DS->EDataArray().ChangeValue(1));
// ed++;
for (i = 1; i <= nbFace; i++) { // test of Double edges
TopExp::MapShapesAndAncestors
(FM(i),TopAbs_EDGE, TopAbs_FACE, EdgesToFaces);
for (i = 1; i <= nbFace; i++)
{ // test of Double edges
TopExp::MapShapesAndAncestors(FM(i), TopAbs_EDGE, TopAbs_FACE, EdgesToFaces);
}
for (i = 1; i <= nbEdge; i++) { // load the Edges
const TopoDS_Edge& Edg = TopoDS::Edge (EM(i));
TopExp::Vertices (Edg, VF, VL);
BRep_Tool::Range (Edg, pf, pl);
for (i = 1; i <= nbEdge; i++)
{ // load the Edges
const TopoDS_Edge& Edg = TopoDS::Edge(EM(i));
TopExp::Vertices(Edg, VF, VL);
BRep_Tool::Range(Edg, pf, pl);
Standard_Boolean reg1 = Standard_False;
Standard_Boolean regn = Standard_False;
Standard_Integer inde = EdgesToFaces.FindIndex(Edg);
if (inde > 0) {
if (EdgesToFaces(inde).Extent() == 2) {
itn = EdgesToFaces(inde);
const TopoDS_Face& F1 = TopoDS::Face(itn.Value());
itn.Next();
const TopoDS_Face& F2 = TopoDS::Face(itn.Value());
GeomAbs_Shape rg = BRep_Tool::Continuity(Edg,F1,F2);
reg1 = rg >= GeomAbs_G1;
regn = rg >= GeomAbs_G2;
if (inde > 0)
{
if (EdgesToFaces(inde).Extent() == 2)
{
itn = EdgesToFaces(inde);
const TopoDS_Face& F1 = TopoDS::Face(itn.Value());
itn.Next();
const TopoDS_Face& F2 = TopoDS::Face(itn.Value());
GeomAbs_Shape rg = BRep_Tool::Continuity(Edg, F1, F2);
reg1 = rg >= GeomAbs_G1;
regn = rg >= GeomAbs_G2;
}
}
if (VF.IsNull()) {
if (VF.IsNull())
{
i1 = 0;
o1 = Standard_False;
c1 = Standard_False;
pf = RealFirst();
tf = (Standard_ShortReal) Epsilon(pf);
tf = (Standard_ShortReal)Epsilon(pf);
}
else {
else
{
i1 = VerticesToEdges.FindIndex(VF);
o1 = TopDS.IsOutV(VF);
c1 = TopDS.IsIntV(VF);
tf = (Standard_ShortReal) BRep_Tool::Tolerance(VF);
tf = (Standard_ShortReal)BRep_Tool::Tolerance(VF);
}
if (VL.IsNull()) {
if (VL.IsNull())
{
i2 = 0;
o2 = Standard_False;
c2 = Standard_False;
pl = RealLast();
tl = (Standard_ShortReal) Epsilon (pl);
tl = (Standard_ShortReal)Epsilon(pl);
}
else {
else
{
i2 = VerticesToEdges.FindIndex(VL);
o2 = TopDS.IsOutV(VL);
c2 = TopDS.IsIntV(VL);
tl = (Standard_ShortReal) BRep_Tool::Tolerance(VL);
tl = (Standard_ShortReal)BRep_Tool::Tolerance(VL);
}
ed->Set (reg1,regn, Edg, i1, i2, o1, o2, c1, c2, pf, tf, pl, tl);
ed->Set(reg1, regn, Edg, i1, i2, o1, o2, c1, c2, pf, tf, pl, tl);
DS->EdgeMap().Add(Edg);
ed++;
}
ExploreShape(S,DS,FM,EM);
ExploreShape(S, DS, FM, EM);
return DS;
}
//=======================================================================
// Function : ExploreFace
// Purpose :
//=======================================================================
//=================================================================================================
void
HLRBRep_ShapeToHLR::ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM,
Standard_Integer& i,
const TopoDS_Face& F,
const Standard_Boolean closed)
void HLRBRep_ShapeToHLR::ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM,
Standard_Integer& i,
const TopoDS_Face& F,
const Standard_Boolean closed)
{
i++;
TopExp_Explorer Ex1,Ex2;
HLRTopoBRep_Data& TopDS = S->DataStructure();
TopAbs_Orientation orient = FM(i).Orientation();
TopoDS_Face theFace = TopoDS::Face(FM(i));
theFace.Orientation (TopAbs_FORWARD);
TopExp_Explorer Ex1, Ex2;
HLRTopoBRep_Data& TopDS = S->DataStructure();
TopAbs_Orientation orient = FM(i).Orientation();
TopoDS_Face theFace = TopoDS::Face(FM(i));
theFace.Orientation(TopAbs_FORWARD);
HLRBRep_FaceData& fd = DS->FDataArray().ChangeValue(i);
Standard_Integer nw = 0;
for (Ex1.Init(theFace, TopAbs_WIRE); Ex1.More(); Ex1.Next())
nw++;
fd.Set (theFace, orient, closed, nw);
fd.Set(theFace, orient, closed, nw);
nw = 0;
for (Ex1.Init(theFace, TopAbs_WIRE); Ex1.More(); Ex1.Next()) {
for (Ex1.Init(theFace, TopAbs_WIRE); Ex1.More(); Ex1.Next())
{
nw++;
Standard_Integer ne = 0;
for (Ex2.Init(Ex1.Current(), TopAbs_EDGE); Ex2.More(); Ex2.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Ex2.Current());
if (!BRep_Tool::Degenerated(anEdge))
ne++;
}
fd.SetWire (nw, ne);
fd.SetWire(nw, ne);
ne = 0;
for (Ex2.Init(Ex1.Current(), TopAbs_EDGE);
Ex2.More();
Ex2.Next()) {
for (Ex2.Init(Ex1.Current(), TopAbs_EDGE); Ex2.More(); Ex2.Next())
{
const TopoDS_Edge& E = TopoDS::Edge(Ex2.Current());
if (BRep_Tool::Degenerated(E))
continue;
ne++;
Standard_Integer ie = EM.FindIndex(E);
Standard_Integer ie = EM.FindIndex(E);
TopAbs_Orientation anOrientE = E.Orientation();
Standard_Boolean Int = TopDS.IsIntLFaceEdge(F,E);
Standard_Boolean Iso = TopDS.IsIsoLFaceEdge(F,E);
Standard_Boolean Out = TopDS.IsOutLFaceEdge(F,E);
Standard_Boolean Dbl = BRepTools::IsReallyClosed(TopoDS::Edge(E),theFace);
Standard_Boolean Int = TopDS.IsIntLFaceEdge(F, E);
Standard_Boolean Iso = TopDS.IsIsoLFaceEdge(F, E);
Standard_Boolean Out = TopDS.IsOutLFaceEdge(F, E);
Standard_Boolean Dbl = BRepTools::IsReallyClosed(TopoDS::Edge(E), theFace);
fd.SetWEdge(nw, ne, ie, anOrientE, Out, Int, Dbl, Iso);
}
}
DS->FaceMap().Add(theFace);
}
//=======================================================================
//function : ExploreShape
//purpose :
//=======================================================================
//=================================================================================================
void
HLRBRep_ShapeToHLR::ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM)
void HLRBRep_ShapeToHLR::ExploreShape(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM)
{
TopTools_MapOfShape ShapeMap;
TopExp_Explorer exshell, exface, exedge;
Standard_Integer i = 0;
TopExp_Explorer exshell, exface, exedge;
Standard_Integer i = 0;
for (exshell.Init (S->OriginalShape(), TopAbs_SHELL);
exshell.More ();
exshell.Next ()) { // faces in a shell (open or close)
for (exshell.Init(S->OriginalShape(), TopAbs_SHELL); exshell.More(); exshell.Next())
{ // faces in a shell (open or close)
Standard_Boolean closed = exshell.Current().Closed();
if (!closed) {
Standard_Integer ie;
Standard_Integer nbEdge = EM.Extent ();
Standard_Integer *flag = new Standard_Integer[nbEdge + 1];
if (!closed)
{
Standard_Integer ie;
Standard_Integer nbEdge = EM.Extent();
Standard_Integer* flag = new Standard_Integer[nbEdge + 1];
for(ie = 1; ie<=nbEdge; ie++)
flag[ie] = 0;
for (exedge.Init(exshell.Current(), TopAbs_EDGE);
exedge.More();
exedge.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exedge.Current());
ie = EM.FindIndex(E);
TopAbs_Orientation orient = E.Orientation();
if (!BRep_Tool::Degenerated(E)) {
if (orient == TopAbs_FORWARD ) flag[ie] += 1;
else if (orient == TopAbs_REVERSED) flag[ie] -= 1;
}
for (ie = 1; ie <= nbEdge; ie++)
flag[ie] = 0;
for (exedge.Init(exshell.Current(), TopAbs_EDGE); exedge.More(); exedge.Next())
{
const TopoDS_Edge& E = TopoDS::Edge(exedge.Current());
ie = EM.FindIndex(E);
TopAbs_Orientation orient = E.Orientation();
if (!BRep_Tool::Degenerated(E))
{
if (orient == TopAbs_FORWARD)
flag[ie] += 1;
else if (orient == TopAbs_REVERSED)
flag[ie] -= 1;
}
}
closed = Standard_True;
for (ie = 1; ie <= nbEdge && closed; ie++)
closed = (flag[ie] == 0);
delete [] flag;
closed = (flag[ie] == 0);
delete[] flag;
flag = NULL;
}
for (exface.Init(exshell.Current(), TopAbs_FACE);
exface.More();
exface.Next()) {
if (ShapeMap.Add(exface.Current())) {
ExploreFace(S,DS,FM,EM,i,
TopoDS::Face(exface.Current()),
closed);
for (exface.Init(exshell.Current(), TopAbs_FACE); exface.More(); exface.Next())
{
if (ShapeMap.Add(exface.Current()))
{
ExploreFace(S, DS, FM, EM, i, TopoDS::Face(exface.Current()), closed);
}
}
}
for (exface.Init(S->OriginalShape(), TopAbs_FACE, TopAbs_SHELL);
exface.More();
exface.Next()) { // faces not in a shell
if (ShapeMap.Add(exface.Current())) {
ExploreFace(S,DS,FM,EM,i,
TopoDS::Face(exface.Current()),
Standard_False);
for (exface.Init(S->OriginalShape(), TopAbs_FACE, TopAbs_SHELL); exface.More(); exface.Next())
{ // faces not in a shell
if (ShapeMap.Add(exface.Current()))
{
ExploreFace(S, DS, FM, EM, i, TopoDS::Face(exface.Current()), Standard_False);
}
}
}

View File

@@ -29,46 +29,35 @@ class HLRTopoBRep_OutLiner;
class HLRAlgo_Projector;
class TopoDS_Face;
//! compute the OutLinedShape of a Shape with an
//! OutLiner, a Projector and create the Data
//! Structure of a Shape.
class HLRBRep_ShapeToHLR
class HLRBRep_ShapeToHLR
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a DataStructure containing the OutLiner
//! <S> depending on the projector <P> and nbIso.
Standard_EXPORT static Handle(HLRBRep_Data) Load (const Handle(HLRTopoBRep_OutLiner)& S, const HLRAlgo_Projector& P, BRepTopAdaptor_MapOfShapeTool& MST, const Standard_Integer nbIso = 0);
Standard_EXPORT static Handle(HLRBRep_Data) Load(const Handle(HLRTopoBRep_OutLiner)& S,
const HLRAlgo_Projector& P,
BRepTopAdaptor_MapOfShapeTool& MST,
const Standard_Integer nbIso = 0);
protected:
private:
Standard_EXPORT static void ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM,
Standard_Integer& i,
const TopoDS_Face& F,
const Standard_Boolean closed);
Standard_EXPORT static void ExploreFace (const Handle(HLRTopoBRep_OutLiner)& S, const Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM, Standard_Integer& i, const TopoDS_Face& F, const Standard_Boolean closed);
Standard_EXPORT static void ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, const Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM);
Standard_EXPORT static void ExploreShape(const Handle(HLRTopoBRep_OutLiner)& S,
const Handle(HLRBRep_Data)& DS,
const TopTools_IndexedMapOfShape& FM,
const TopTools_IndexedMapOfShape& EM);
};
#endif // _HLRBRep_ShapeToHLR_HeaderFile

View File

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <gp_Vec.hxx>
#include <GProp_PEquation.hxx>
#include <HLRAlgo_Projector.hxx>
@@ -23,261 +22,267 @@
#include <TColStd_Array2OfReal.hxx>
#include <TopoDS_Face.hxx>
//=======================================================================
//function : HLRBRep_Surface
//purpose :
//=======================================================================
HLRBRep_Surface::HLRBRep_Surface ()
: myType(GeomAbs_OtherSurface),
myProj(NULL)
//=================================================================================================
HLRBRep_Surface::HLRBRep_Surface()
: myType(GeomAbs_OtherSurface),
myProj(NULL)
{
}
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
//=================================================================================================
void HLRBRep_Surface::Surface (const TopoDS_Face& F)
void HLRBRep_Surface::Surface(const TopoDS_Face& F)
{
//mySurf.Initialize(F,Standard_False);
mySurf.Initialize(F,Standard_True);
// mySurf.Initialize(F,Standard_False);
mySurf.Initialize(F, Standard_True);
GeomAbs_SurfaceType typ = HLRBRep_BSurfaceTool::GetType(mySurf);
switch (typ) {
switch (typ)
{
case GeomAbs_Plane :
case GeomAbs_Cylinder :
case GeomAbs_Cone :
case GeomAbs_Sphere :
case GeomAbs_Torus :
// unchanged type
myType = typ;
break;
case GeomAbs_BezierSurface :
if (HLRBRep_BSurfaceTool::UDegree(mySurf) == 1 &&
HLRBRep_BSurfaceTool::VDegree(mySurf) == 1) {
myType = GeomAbs_Plane;
}
else
case GeomAbs_Plane:
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
// unchanged type
myType = typ;
break;
default :
myType = GeomAbs_OtherSurface;
break;
break;
case GeomAbs_BezierSurface:
if (HLRBRep_BSurfaceTool::UDegree(mySurf) == 1 && HLRBRep_BSurfaceTool::VDegree(mySurf) == 1)
{
myType = GeomAbs_Plane;
}
else
myType = typ;
break;
default:
myType = GeomAbs_OtherSurface;
break;
}
}
//=======================================================================
//function : SideRowsOfPoles
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean
HLRBRep_Surface::SideRowsOfPoles (const Standard_Real tol,
const Standard_Integer nbuPoles,
const Standard_Integer nbvPoles,
TColgp_Array2OfPnt& Pnt) const
Standard_Boolean HLRBRep_Surface::SideRowsOfPoles(const Standard_Real tol,
const Standard_Integer nbuPoles,
const Standard_Integer nbvPoles,
TColgp_Array2OfPnt& Pnt) const
{
Standard_Integer iu,iv;
Standard_Real x0,y0,x,y,z;
Standard_Integer iu, iv;
Standard_Real x0, y0, x, y, z;
Standard_Boolean result;
Standard_Real tole = (Standard_Real)tol;
const gp_Trsf& T = myProj->Transformation();
Standard_Real tole = (Standard_Real)tol;
const gp_Trsf& T = myProj->Transformation();
for (iu = 1; iu <= nbuPoles; iu++)
{
for (iu = 1; iu <= nbuPoles; iu++) {
for (iv = 1; iv <= nbvPoles; iv++)
Pnt(iu,iv).Transform(T);
Pnt(iu, iv).Transform(T);
}
result = Standard_True;
for (iu = 1; iu <= nbuPoles && result; iu++) { // Side iso u ?
Pnt(iu,1).Coord(x0,y0,z);
for (iv = 2; iv <= nbvPoles && result; iv++) {
Pnt(iu,iv).Coord(x,y,z);
result = Abs(x-x0) < tole && Abs(y-y0) < tole;
for (iu = 1; iu <= nbuPoles && result; iu++)
{ // Side iso u ?
Pnt(iu, 1).Coord(x0, y0, z);
for (iv = 2; iv <= nbvPoles && result; iv++)
{
Pnt(iu, iv).Coord(x, y, z);
result = Abs(x - x0) < tole && Abs(y - y0) < tole;
}
}
if (result) return result;
if (result)
return result;
result = Standard_True;
for (iv = 1; iv <= nbvPoles && result; iv++) { // Side iso v ?
Pnt(1,iv).Coord(x0,y0,z);
for (iu = 2; iu <= nbuPoles && result; iu++) {
Pnt(iu,iv).Coord(x,y,z);
result = Abs(x-x0) < tole && Abs(y-y0) < tole;
for (iv = 1; iv <= nbvPoles && result; iv++)
{ // Side iso v ?
Pnt(1, iv).Coord(x0, y0, z);
for (iu = 2; iu <= nbuPoles && result; iu++)
{
Pnt(iu, iv).Coord(x, y, z);
result = Abs(x - x0) < tole && Abs(y - y0) < tole;
}
}
if (result) return result;
if (result)
return result;
// Are the Poles in a Side Plane ?
TColgp_Array1OfPnt p(1,nbuPoles*nbvPoles);
Standard_Integer i = 0;
TColgp_Array1OfPnt p(1, nbuPoles * nbvPoles);
Standard_Integer i = 0;
for (iu = 1; iu <= nbuPoles; iu++) {
for (iv = 1; iv <= nbvPoles; iv++) {
for (iu = 1; iu <= nbuPoles; iu++)
{
for (iv = 1; iv <= nbvPoles; iv++)
{
i++;
p(i) = Pnt(iu,iv);
p(i) = Pnt(iu, iv);
}
}
GProp_PEquation Pl(p,(Standard_Real)tol);
GProp_PEquation Pl(p, (Standard_Real)tol);
if (Pl.IsPlanar())
result = Abs(Pl.Plane().Axis().Direction().Z()) < 0.0001;
return result;
}
//=======================================================================
//function : IsSide
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean
HLRBRep_Surface::IsSide (const Standard_Real tolF,
const Standard_Real toler) const
Standard_Boolean HLRBRep_Surface::IsSide(const Standard_Real tolF, const Standard_Real toler) const
{
gp_Pnt Pt;
gp_Vec D;
gp_Pnt Pt;
gp_Vec D;
Standard_Real r;
if (myType == GeomAbs_Plane) {
if (myType == GeomAbs_Plane)
{
gp_Pln Pl = Plane();
gp_Ax1 A = Pl.Axis();
Pt = A.Location();
D = A.Direction();
Pt = A.Location();
D = A.Direction();
Pt.Transform(myProj->Transformation());
D .Transform(myProj->Transformation());
if (myProj->Perspective()) {
r = D.Z() * myProj->Focus() -
( D.X() * Pt.X() + D.Y() * Pt.Y() + D.Z() * Pt.Z() );
D.Transform(myProj->Transformation());
if (myProj->Perspective())
{
r = D.Z() * myProj->Focus() - (D.X() * Pt.X() + D.Y() * Pt.Y() + D.Z() * Pt.Z());
}
else r= D.Z();
else
r = D.Z();
return Abs(r) < toler;
}
else if (myType == GeomAbs_Cylinder) {
if (myProj->Perspective()) return Standard_False;
else if (myType == GeomAbs_Cylinder)
{
if (myProj->Perspective())
return Standard_False;
gp_Cylinder Cyl = HLRBRep_BSurfaceTool::Cylinder(mySurf);
gp_Ax1 A = Cyl.Axis();
D = A.Direction();
D .Transform(myProj->Transformation());
gp_Ax1 A = Cyl.Axis();
D = A.Direction();
D.Transform(myProj->Transformation());
r = Sqrt(D.X() * D.X() + D.Y() * D.Y());
return r < toler;
}
else if (myType == GeomAbs_Cone) {
if (!myProj->Perspective()) return Standard_False;
else if (myType == GeomAbs_Cone)
{
if (!myProj->Perspective())
return Standard_False;
gp_Cone Con = HLRBRep_BSurfaceTool::Cone(mySurf);
Pt = Con.Apex();
Pt = Con.Apex();
Pt.Transform(myProj->Transformation());
Standard_Real tol = 0.001;
return Pt.IsEqual(gp_Pnt(0,0,myProj->Focus()),tol);
return Pt.IsEqual(gp_Pnt(0, 0, myProj->Focus()), tol);
}
else if (myType == GeomAbs_BezierSurface) {
if (myProj->Perspective()) return Standard_False;
Standard_Integer nu = HLRBRep_BSurfaceTool::NbUPoles(mySurf);
Standard_Integer nv = HLRBRep_BSurfaceTool::NbVPoles(mySurf);
TColgp_Array2OfPnt Pnt(1,nu,1,nv);
else if (myType == GeomAbs_BezierSurface)
{
if (myProj->Perspective())
return Standard_False;
Standard_Integer nu = HLRBRep_BSurfaceTool::NbUPoles(mySurf);
Standard_Integer nv = HLRBRep_BSurfaceTool::NbVPoles(mySurf);
TColgp_Array2OfPnt Pnt(1, nu, 1, nv);
HLRBRep_BSurfaceTool::Bezier(mySurf)->Poles(Pnt);
return SideRowsOfPoles (tolF,nu,nv,Pnt);
return SideRowsOfPoles(tolF, nu, nv, Pnt);
}
else if (myType == GeomAbs_BSplineSurface) {
if (myProj->Perspective()) return Standard_False;
Standard_Integer nu = HLRBRep_BSurfaceTool::NbUPoles(mySurf);
Standard_Integer nv = HLRBRep_BSurfaceTool::NbVPoles(mySurf);
TColgp_Array2OfPnt Pnt(1,nu,1,nv);
TColStd_Array2OfReal W(1,nu,1,nv);
else if (myType == GeomAbs_BSplineSurface)
{
if (myProj->Perspective())
return Standard_False;
Standard_Integer nu = HLRBRep_BSurfaceTool::NbUPoles(mySurf);
Standard_Integer nv = HLRBRep_BSurfaceTool::NbVPoles(mySurf);
TColgp_Array2OfPnt Pnt(1, nu, 1, nv);
TColStd_Array2OfReal W(1, nu, 1, nv);
HLRBRep_BSurfaceTool::BSpline(mySurf)->Poles(Pnt);
HLRBRep_BSurfaceTool::BSpline(mySurf)->Weights(W);
return SideRowsOfPoles (tolF,nu,nv,Pnt);
return SideRowsOfPoles(tolF, nu, nv, Pnt);
}
else return Standard_False;
else
return Standard_False;
}
//=======================================================================
//function : IsAbove
//purpose :
//=======================================================================
//=================================================================================================
Standard_Boolean
HLRBRep_Surface::IsAbove (const Standard_Boolean back,
const HLRBRep_Curve* A,
const Standard_Real tol) const
{
Standard_Boolean HLRBRep_Surface::IsAbove(const Standard_Boolean back,
const HLRBRep_Curve* A,
const Standard_Real tol) const
{
Standard_Boolean planar = (myType == GeomAbs_Plane);
if (planar) {
gp_Pln Pl = Plane();
Standard_Real a,b,c,d;
Pl.Coefficients(a,b,c,d);
Standard_Real u,u1,u2,dd,x,y,z;
gp_Pnt P;
if (planar)
{
gp_Pln Pl = Plane();
Standard_Real a, b, c, d;
Pl.Coefficients(a, b, c, d);
Standard_Real u, u1, u2, dd, x, y, z;
gp_Pnt P;
u1 = A->Parameter3d(A->FirstParameter());
u2 = A->Parameter3d(A->LastParameter());
u=u1;
A->D0(u,P);
P.Coord(x,y,z);
dd = a*x + b*y + c*z + d;
if (back) dd = -dd;
if (dd < -tol) return Standard_False;
if (A->GetType() != GeomAbs_Line) {
u = u1;
A->D0(u, P);
P.Coord(x, y, z);
dd = a * x + b * y + c * z + d;
if (back)
dd = -dd;
if (dd < -tol)
return Standard_False;
if (A->GetType() != GeomAbs_Line)
{
Standard_Integer nbPnt = 30;
Standard_Real step = (u2-u1)/(nbPnt+1);
for (Standard_Integer i = 1; i <= nbPnt; i++) {
u += step;
A->D0(u,P);
P.Coord(x,y,z);
dd = a*x + b*y + c*z + d;
if (back) dd = -dd;
if (dd < -tol) return Standard_False;
Standard_Real step = (u2 - u1) / (nbPnt + 1);
for (Standard_Integer i = 1; i <= nbPnt; i++)
{
u += step;
A->D0(u, P);
P.Coord(x, y, z);
dd = a * x + b * y + c * z + d;
if (back)
dd = -dd;
if (dd < -tol)
return Standard_False;
}
}
u = u2;
A->D0(u,P);
P.Coord(x,y,z);
dd = a*x + b*y + c*z + d;
if (back) dd = -dd;
if (dd < -tol) return Standard_False;
A->D0(u, P);
P.Coord(x, y, z);
dd = a * x + b * y + c * z + d;
if (back)
dd = -dd;
if (dd < -tol)
return Standard_False;
return Standard_True;
}
else return Standard_False;
else
return Standard_False;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
//=================================================================================================
gp_Pnt HLRBRep_Surface::Value (const Standard_Real U,
const Standard_Real V) const
{
gp_Pnt HLRBRep_Surface::Value(const Standard_Real U, const Standard_Real V) const
{
gp_Pnt P;
D0(U,V,P);
D0(U, V, P);
return P;
}
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
//=================================================================================================
gp_Pln HLRBRep_Surface::Plane () const
gp_Pln HLRBRep_Surface::Plane() const
{
GeomAbs_SurfaceType typ = HLRBRep_BSurfaceTool::GetType(mySurf);
switch (typ) {
case GeomAbs_BezierSurface :
{
switch (typ)
{
case GeomAbs_BezierSurface: {
gp_Pnt P;
gp_Vec D1U;
gp_Vec D1V;
D1(0.5,0.5,P,D1U,D1V);
return gp_Pln(P,gp_Dir(D1U.Crossed(D1V)));
D1(0.5, 0.5, P, D1U, D1V);
return gp_Pln(P, gp_Dir(D1U.Crossed(D1V)));
}
default :
return HLRBRep_BSurfaceTool::Plane(mySurf);
default:
return HLRBRep_BSurfaceTool::Plane(mySurf);
}
}

View File

@@ -37,162 +37,164 @@ class gp_Pnt;
class gp_Vec;
class gp_Pln;
class HLRBRep_Surface
class HLRBRep_Surface
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an undefined surface with no face loaded.
Standard_EXPORT HLRBRep_Surface();
void Projector (const HLRAlgo_Projector* Proj)
{
myProj = Proj;
}
void Projector(const HLRAlgo_Projector* Proj) { myProj = Proj; }
//! Returns the 3D Surface.
BRepAdaptor_Surface& Surface();
BRepAdaptor_Surface& Surface();
//! Sets the 3D Surface to be projected.
Standard_EXPORT void Surface (const TopoDS_Face& F);
Standard_EXPORT void Surface(const TopoDS_Face& F);
//! returns true if it is a side face
Standard_EXPORT Standard_Boolean IsSide (const Standard_Real tolf, const Standard_Real toler) const;
Standard_EXPORT Standard_Boolean IsAbove (const Standard_Boolean back, const HLRBRep_Curve* A, const Standard_Real tolC) const;
Standard_Real FirstUParameter() const;
Standard_Real LastUParameter() const;
Standard_Real FirstVParameter() const;
Standard_Real LastVParameter() const;
GeomAbs_Shape UContinuity() const;
GeomAbs_Shape VContinuity() const;
Standard_EXPORT Standard_Boolean IsSide(const Standard_Real tolf,
const Standard_Real toler) const;
Standard_EXPORT Standard_Boolean IsAbove(const Standard_Boolean back,
const HLRBRep_Curve* A,
const Standard_Real tolC) const;
Standard_Real FirstUParameter() const;
Standard_Real LastUParameter() const;
Standard_Real FirstVParameter() const;
Standard_Real LastVParameter() const;
GeomAbs_Shape UContinuity() const;
GeomAbs_Shape VContinuity() const;
//! If necessary, breaks the surface in U intervals of
//! continuity <S>. And returns the number of
//! intervals.
Standard_Integer NbUIntervals (const GeomAbs_Shape S);
Standard_Integer NbUIntervals(const GeomAbs_Shape S);
//! If necessary, breaks the surface in V intervals of
//! continuity <S>. And returns the number of
//! intervals.
Standard_Integer NbVIntervals (const GeomAbs_Shape S);
GeomAbs_Shape UIntervalContinuity() const;
GeomAbs_Shape VIntervalContinuity() const;
Standard_Boolean IsUClosed() const;
Standard_Boolean IsVClosed() const;
Standard_Boolean IsUPeriodic() const;
Standard_Real UPeriod() const;
Standard_Boolean IsVPeriodic() const;
Standard_Real VPeriod() const;
Standard_Integer NbVIntervals(const GeomAbs_Shape S);
GeomAbs_Shape UIntervalContinuity() const;
GeomAbs_Shape VIntervalContinuity() const;
Standard_Boolean IsUClosed() const;
Standard_Boolean IsVClosed() const;
Standard_Boolean IsUPeriodic() const;
Standard_Real UPeriod() const;
Standard_Boolean IsVPeriodic() const;
Standard_Real VPeriod() const;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
Standard_EXPORT gp_Pnt Value(const Standard_Real U, const Standard_Real V) const;
//! Computes the point of parameters U,V on the surface.
void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
void D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
//! Computes the point and the first derivatives on
//! the surface.
//! Raised if the continuity of the current
//! intervals is not C1.
void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
void D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
//! Computes the point, the first and second
//! derivatives on the surface.
//! Raised if the continuity of the current
//! intervals is not C2.
void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const;
void D2(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV) const;
//! Computes the point, the first, second and third
//! derivatives on the surface.
//! Raised if the continuity of the current
//! intervals is not C3.
void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const;
void D3(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV) const;
//! Computes the derivative of order Nu in the
//! direction U and Nv in the direction V at the point P(U,
//! V).
//! Raised if the current U interval is not not CNu
//! and the current V interval is not CNv.
//! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const;
gp_Vec DN(const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv) const;
//! Returns the type of the surface : Plane, Cylinder,
//! Cone, Sphere, Torus, BezierSurface,
//! BSplineSurface, SurfaceOfRevolution,
//! SurfaceOfExtrusion, OtherSurface
GeomAbs_SurfaceType GetType() const;
GeomAbs_SurfaceType GetType() const;
Standard_EXPORT gp_Pln Plane() const;
gp_Cylinder Cylinder() const;
gp_Cone Cone() const;
gp_Sphere Sphere() const;
gp_Torus Torus() const;
Standard_Integer UDegree() const;
Standard_Integer NbUPoles() const;
Standard_Integer VDegree() const;
Standard_Integer NbVPoles() const;
Standard_Integer NbUKnots() const;
Standard_Integer NbVKnots() const;
gp_Ax1 Axis() const;
gp_Cylinder Cylinder() const;
gp_Cone Cone() const;
gp_Sphere Sphere() const;
gp_Torus Torus() const;
Standard_Integer UDegree() const;
Standard_Integer NbUPoles() const;
Standard_Integer VDegree() const;
Standard_Integer NbVPoles() const;
Standard_Integer NbUKnots() const;
Standard_Integer NbVKnots() const;
gp_Ax1 Axis() const;
protected:
private:
//! returns true if it is a side face
Standard_EXPORT Standard_Boolean SideRowsOfPoles (const Standard_Real tol, const Standard_Integer nbuPoles, const Standard_Integer nbvPoles, TColgp_Array2OfPnt& Pnt) const;
Standard_EXPORT Standard_Boolean SideRowsOfPoles(const Standard_Real tol,
const Standard_Integer nbuPoles,
const Standard_Integer nbvPoles,
TColgp_Array2OfPnt& Pnt) const;
BRepAdaptor_Surface mySurf;
GeomAbs_SurfaceType myType;
BRepAdaptor_Surface mySurf;
GeomAbs_SurfaceType myType;
const HLRAlgo_Projector* myProj;
};
#include <HLRBRep_Surface.lxx>
#endif // _HLRBRep_Surface_HeaderFile

View File

@@ -18,289 +18,346 @@
#include <HLRBRep_BSurfaceTool.hxx>
//=======================================================================
//function : Surface
//purpose :
// function : Surface
// purpose :
//=======================================================================
inline BRepAdaptor_Surface & HLRBRep_Surface::Surface()
{ return mySurf; }
inline BRepAdaptor_Surface& HLRBRep_Surface::Surface()
{
return mySurf;
}
//=======================================================================
//function : FirstUParameter
//purpose :
// function : FirstUParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::FirstUParameter()const
{ return HLRBRep_BSurfaceTool::FirstUParameter(mySurf); }
inline Standard_Real HLRBRep_Surface::FirstUParameter() const
{
return HLRBRep_BSurfaceTool::FirstUParameter(mySurf);
}
//=======================================================================
//function : LastUParameter
//purpose :
// function : LastUParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::LastUParameter()const
{ return HLRBRep_BSurfaceTool::LastUParameter(mySurf); }
inline Standard_Real HLRBRep_Surface::LastUParameter() const
{
return HLRBRep_BSurfaceTool::LastUParameter(mySurf);
}
//=======================================================================
//function : FirstVParameter
//purpose :
// function : FirstVParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::FirstVParameter()const
{ return HLRBRep_BSurfaceTool::FirstVParameter(mySurf); }
inline Standard_Real HLRBRep_Surface::FirstVParameter() const
{
return HLRBRep_BSurfaceTool::FirstVParameter(mySurf);
}
//=======================================================================
//function : LastVParameter
//purpose :
// function : LastVParameter
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::LastVParameter()const
{ return HLRBRep_BSurfaceTool::LastVParameter(mySurf); }
inline Standard_Real HLRBRep_Surface::LastVParameter() const
{
return HLRBRep_BSurfaceTool::LastVParameter(mySurf);
}
//=======================================================================
//function : UContinuity
//purpose :
// function : UContinuity
// purpose :
//=======================================================================
inline GeomAbs_Shape HLRBRep_Surface::UContinuity()const
{ return HLRBRep_BSurfaceTool::UContinuity(mySurf); }
inline GeomAbs_Shape HLRBRep_Surface::UContinuity() const
{
return HLRBRep_BSurfaceTool::UContinuity(mySurf);
}
//=======================================================================
//function : VContinuity
//purpose :
// function : VContinuity
// purpose :
//=======================================================================
inline GeomAbs_Shape HLRBRep_Surface::VContinuity()const
{ return HLRBRep_BSurfaceTool::VContinuity(mySurf); }
inline GeomAbs_Shape HLRBRep_Surface::VContinuity() const
{
return HLRBRep_BSurfaceTool::VContinuity(mySurf);
}
//=======================================================================
//function : NbUIntervals
//purpose :
// function : NbUIntervals
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_Surface::NbUIntervals(const GeomAbs_Shape S)
{ return HLRBRep_BSurfaceTool::NbUIntervals(mySurf,S); }
inline Standard_Integer HLRBRep_Surface::NbUIntervals(const GeomAbs_Shape S)
{
return HLRBRep_BSurfaceTool::NbUIntervals(mySurf, S);
}
//=======================================================================
//function : NbVIntervals
//purpose :
// function : NbVIntervals
// purpose :
//=======================================================================
inline Standard_Integer
HLRBRep_Surface::NbVIntervals(const GeomAbs_Shape S)
{ return HLRBRep_BSurfaceTool::NbVIntervals(mySurf,S); }
inline Standard_Integer HLRBRep_Surface::NbVIntervals(const GeomAbs_Shape S)
{
return HLRBRep_BSurfaceTool::NbVIntervals(mySurf, S);
}
//=======================================================================
//function : IsUClosed
//purpose :
// function : IsUClosed
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Surface::IsUClosed()const
{ return HLRBRep_BSurfaceTool::IsUClosed(mySurf); }
inline Standard_Boolean HLRBRep_Surface::IsUClosed() const
{
return HLRBRep_BSurfaceTool::IsUClosed(mySurf);
}
//=======================================================================
//function : IsVClosed
//purpose :
// function : IsVClosed
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Surface::IsVClosed()const
{ return HLRBRep_BSurfaceTool::IsVClosed(mySurf); }
inline Standard_Boolean HLRBRep_Surface::IsVClosed() const
{
return HLRBRep_BSurfaceTool::IsVClosed(mySurf);
}
//=======================================================================
//function : IsUPeriodic
//purpose :
// function : IsUPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Surface::IsUPeriodic()const
{ return HLRBRep_BSurfaceTool::IsUPeriodic(mySurf); }
inline Standard_Boolean HLRBRep_Surface::IsUPeriodic() const
{
return HLRBRep_BSurfaceTool::IsUPeriodic(mySurf);
}
//=======================================================================
//function : UPeriod
//purpose :
// function : UPeriod
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::UPeriod()const
{ return HLRBRep_BSurfaceTool::UPeriod(mySurf); }
inline Standard_Real HLRBRep_Surface::UPeriod() const
{
return HLRBRep_BSurfaceTool::UPeriod(mySurf);
}
//=======================================================================
//function : IsVPeriodic
//purpose :
// function : IsVPeriodic
// purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_Surface::IsVPeriodic()const
{ return HLRBRep_BSurfaceTool::IsVPeriodic(mySurf); }
inline Standard_Boolean HLRBRep_Surface::IsVPeriodic() const
{
return HLRBRep_BSurfaceTool::IsVPeriodic(mySurf);
}
//=======================================================================
//function : VPeriod
//purpose :
// function : VPeriod
// purpose :
//=======================================================================
inline Standard_Real HLRBRep_Surface::VPeriod()const
{ return HLRBRep_BSurfaceTool::VPeriod(mySurf); }
inline Standard_Real HLRBRep_Surface::VPeriod() const
{
return HLRBRep_BSurfaceTool::VPeriod(mySurf);
}
//=======================================================================
//function : D0
//purpose :
// function : D0
// purpose :
//=======================================================================
inline void HLRBRep_Surface::D0(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P) const
{ HLRBRep_BSurfaceTool::D0(mySurf,U,V,P); }
inline void HLRBRep_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
{
HLRBRep_BSurfaceTool::D0(mySurf, U, V, P);
}
//=======================================================================
//function : D1
//purpose :
// function : D1
// purpose :
//=======================================================================
inline void HLRBRep_Surface::D1(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V) const
{ HLRBRep_BSurfaceTool::D1(mySurf,U,V,P,D1U,D1V); }
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V) const
{
HLRBRep_BSurfaceTool::D1(mySurf, U, V, P, D1U, D1V);
}
//=======================================================================
//function : D2
//purpose :
// function : D2
// purpose :
//=======================================================================
inline void HLRBRep_Surface::D2(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV) const
{ HLRBRep_BSurfaceTool::D2(mySurf,U,V,P,D1U,D1V,D2U,D2V,D2UV); }
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV) const
{
HLRBRep_BSurfaceTool::D2(mySurf, U, V, P, D1U, D1V, D2U, D2V, D2UV);
}
//=======================================================================
//function : D3
//purpose :
// function : D3
// purpose :
//=======================================================================
inline void HLRBRep_Surface::D3(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV) const
{ HLRBRep_BSurfaceTool::D3
(mySurf,U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); }
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV) const
{
HLRBRep_BSurfaceTool::D3(mySurf, U, V, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
}
//=======================================================================
//function : DN
//purpose :
// function : DN
// purpose :
//=======================================================================
inline gp_Vec HLRBRep_Surface::DN(const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{ return HLRBRep_BSurfaceTool::DN(mySurf,U,V,Nu,Nv); }
inline gp_Vec HLRBRep_Surface::DN(const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{
return HLRBRep_BSurfaceTool::DN(mySurf, U, V, Nu, Nv);
}
//=======================================================================
//function : GetType
//purpose :
// function : GetType
// purpose :
//=======================================================================
inline GeomAbs_SurfaceType HLRBRep_Surface::GetType()const
{ return myType; }
inline GeomAbs_SurfaceType HLRBRep_Surface::GetType() const
{
return myType;
}
//=======================================================================
//function : Cylinder
//purpose :
// function : Cylinder
// purpose :
//=======================================================================
inline gp_Cylinder HLRBRep_Surface::Cylinder()const
{ return HLRBRep_BSurfaceTool::Cylinder(mySurf); }
inline gp_Cylinder HLRBRep_Surface::Cylinder() const
{
return HLRBRep_BSurfaceTool::Cylinder(mySurf);
}
//=======================================================================
//function : Cone
//purpose :
// function : Cone
// purpose :
//=======================================================================
inline gp_Cone HLRBRep_Surface::Cone()const
{ return HLRBRep_BSurfaceTool::Cone(mySurf); }
inline gp_Cone HLRBRep_Surface::Cone() const
{
return HLRBRep_BSurfaceTool::Cone(mySurf);
}
//=======================================================================
//function : Sphere
//purpose :
// function : Sphere
// purpose :
//=======================================================================
inline gp_Sphere HLRBRep_Surface::Sphere()const
{ return HLRBRep_BSurfaceTool::Sphere(mySurf); }
inline gp_Sphere HLRBRep_Surface::Sphere() const
{
return HLRBRep_BSurfaceTool::Sphere(mySurf);
}
//=======================================================================
//function : Torus
//purpose :
// function : Torus
// purpose :
//=======================================================================
inline gp_Torus HLRBRep_Surface::Torus()const
{ return HLRBRep_BSurfaceTool::Torus(mySurf); }
inline gp_Torus HLRBRep_Surface::Torus() const
{
return HLRBRep_BSurfaceTool::Torus(mySurf);
}
//=======================================================================
//function : UDegree
//purpose :
// function : UDegree
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::UDegree()const
{ return HLRBRep_BSurfaceTool::UDegree(mySurf); }
inline Standard_Integer HLRBRep_Surface::UDegree() const
{
return HLRBRep_BSurfaceTool::UDegree(mySurf);
}
//=======================================================================
//function : NbUPoles
//purpose :
// function : NbUPoles
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::NbUPoles()const
{ return HLRBRep_BSurfaceTool::NbUPoles(mySurf); }
inline Standard_Integer HLRBRep_Surface::NbUPoles() const
{
return HLRBRep_BSurfaceTool::NbUPoles(mySurf);
}
//=======================================================================
//function : VDegree
//purpose :
// function : VDegree
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::VDegree()const
{ return HLRBRep_BSurfaceTool::VDegree(mySurf); }
inline Standard_Integer HLRBRep_Surface::VDegree() const
{
return HLRBRep_BSurfaceTool::VDegree(mySurf);
}
//=======================================================================
//function : NbVPoles
//purpose :
// function : NbVPoles
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::NbVPoles()const
{ return HLRBRep_BSurfaceTool::NbVPoles(mySurf); }
inline Standard_Integer HLRBRep_Surface::NbVPoles() const
{
return HLRBRep_BSurfaceTool::NbVPoles(mySurf);
}
//=======================================================================
//function : NbUKnots
//purpose :
// function : NbUKnots
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::NbUKnots()const
{ return HLRBRep_BSurfaceTool::NbUKnots(mySurf); }
inline Standard_Integer HLRBRep_Surface::NbUKnots() const
{
return HLRBRep_BSurfaceTool::NbUKnots(mySurf);
}
//=======================================================================
//function : NbVKnots
//purpose :
// function : NbVKnots
// purpose :
//=======================================================================
inline Standard_Integer HLRBRep_Surface::NbVKnots()const
{ return HLRBRep_BSurfaceTool::NbVKnots(mySurf); }
inline Standard_Integer HLRBRep_Surface::NbVKnots() const
{
return HLRBRep_BSurfaceTool::NbVKnots(mySurf);
}
//=======================================================================
//function : Axis
//purpose :
// function : Axis
// purpose :
//=======================================================================
inline gp_Ax1 HLRBRep_Surface::Axis()const
{ return HLRBRep_BSurfaceTool::AxeOfRevolution(mySurf); }
inline gp_Ax1 HLRBRep_Surface::Axis() const
{
return HLRBRep_BSurfaceTool::AxeOfRevolution(mySurf);
}

View File

@@ -17,120 +17,121 @@
#include <BRepAdaptor_Surface.hxx>
Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S) {
Standard_Integer nbs;
GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType();
switch(typS) {
case GeomAbs_Plane:
{
Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S)
{
Standard_Integer nbs;
GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface*)S)->GetType();
switch (typS)
{
case GeomAbs_Plane: {
nbs = 2;
}
break;
case GeomAbs_BezierSurface:
{
nbs = 3 + ((BRepAdaptor_Surface *)S)->NbUPoles();
case GeomAbs_BezierSurface: {
nbs = 3 + ((BRepAdaptor_Surface*)S)->NbUPoles();
}
break;
case GeomAbs_BSplineSurface:
{
nbs = ((BRepAdaptor_Surface *)S)->NbUKnots();
nbs*= ((BRepAdaptor_Surface *)S)->UDegree();
if(nbs < 2) nbs=2;
case GeomAbs_BSplineSurface: {
nbs = ((BRepAdaptor_Surface*)S)->NbUKnots();
nbs *= ((BRepAdaptor_Surface*)S)->UDegree();
if (nbs < 2)
nbs = 2;
}
break;
case GeomAbs_Torus:
{
case GeomAbs_Torus: {
nbs = 20;
}
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion:
{
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion: {
nbs = 10;
}
break;
default:
{
default: {
nbs = 10;
}
break;
}
return(nbs);
return (nbs);
}
Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S) {
Standard_Integer nbs;
GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType();
switch(typS) {
case GeomAbs_Plane:
{
Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S)
{
Standard_Integer nbs;
GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface*)S)->GetType();
switch (typS)
{
case GeomAbs_Plane: {
nbs = 2;
}
break;
case GeomAbs_BezierSurface:
{
nbs = 3 + ((BRepAdaptor_Surface *)S)->NbVPoles();
case GeomAbs_BezierSurface: {
nbs = 3 + ((BRepAdaptor_Surface*)S)->NbVPoles();
}
break;
case GeomAbs_BSplineSurface:
{
nbs = ((BRepAdaptor_Surface *)S)->NbVKnots();
nbs*= ((BRepAdaptor_Surface *)S)->VDegree();
if(nbs < 2) nbs=2;
case GeomAbs_BSplineSurface: {
nbs = ((BRepAdaptor_Surface*)S)->NbVKnots();
nbs *= ((BRepAdaptor_Surface*)S)->VDegree();
if (nbs < 2)
nbs = 2;
}
break;
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion:
{
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
case GeomAbs_SurfaceOfRevolution:
case GeomAbs_SurfaceOfExtrusion: {
nbs = 15;
}
break;
default:
{
default: {
nbs = 10;
}
break;
}
return(nbs);
return (nbs);
}
Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S,
const Standard_Real u1,
const Standard_Real u2) {
Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S,
const Standard_Real u1,
const Standard_Real u2)
{
Standard_Integer nbs = NbSamplesU(S);
Standard_Integer n = nbs;
if(nbs>10) {
Standard_Integer n = nbs;
if (nbs > 10)
{
Standard_Real uf = FirstUParameter(S);
Standard_Real ul = LastUParameter(S);
n*= (Standard_Integer)((u2-u1)/(uf-ul));
if(n>nbs) n = nbs;
if(n<5) n = 5;
n *= (Standard_Integer)((u2 - u1) / (uf - ul));
if (n > nbs)
n = nbs;
if (n < 5)
n = 5;
}
return(n);
return (n);
}
Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S,
const Standard_Real v1,
const Standard_Real v2) {
Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S,
const Standard_Real v1,
const Standard_Real v2)
{
Standard_Integer nbs = NbSamplesV(S);
Standard_Integer n = nbs;
if(nbs>10) {
Standard_Integer n = nbs;
if (nbs > 10)
{
Standard_Real vf = FirstVParameter(S);
Standard_Real vl = LastVParameter(S);
n*= (Standard_Integer)((v2-v1)/(vf-vl));
if(n>nbs) n = nbs;
if(n<5) n = 5;
n *= (Standard_Integer)((v2 - v1) / (vf - vl));
if (n > nbs)
n = nbs;
if (n < 5)
n = 5;
}
return(n);
return (n);
}

View File

@@ -37,119 +37,138 @@ class gp_Vec;
class Geom_BezierSurface;
class Geom_BSplineSurface;
class HLRBRep_SurfaceTool
class HLRBRep_SurfaceTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter (const Standard_Address S);
static Standard_Real FirstVParameter (const Standard_Address S);
static Standard_Real LastUParameter (const Standard_Address S);
static Standard_Real LastVParameter (const Standard_Address S);
static Standard_Integer NbUIntervals (const Standard_Address S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const Standard_Address S, const GeomAbs_Shape Sh);
static void UIntervals (const Standard_Address S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const Standard_Address S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static Standard_Real FirstUParameter(const Standard_Address S);
static Standard_Real FirstVParameter(const Standard_Address S);
static Standard_Real LastUParameter(const Standard_Address S);
static Standard_Real LastVParameter(const Standard_Address S);
static Standard_Integer NbUIntervals(const Standard_Address S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals(const Standard_Address S, const GeomAbs_Shape Sh);
static void UIntervals(const Standard_Address S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals(const Standard_Address S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim (const Standard_Address S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) UTrim(const Standard_Address S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim (const Standard_Address S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Standard_Boolean IsUClosed (const Standard_Address S);
static Standard_Boolean IsVClosed (const Standard_Address S);
static Standard_Boolean IsUPeriodic (const Standard_Address S);
static Standard_Real UPeriod (const Standard_Address S);
static Standard_Boolean IsVPeriodic (const Standard_Address S);
static Standard_Real VPeriod (const Standard_Address S);
static gp_Pnt Value (const Standard_Address S, const Standard_Real u, const Standard_Real v);
static void D0 (const Standard_Address S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1 (const Standard_Address S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D2 (const Standard_Address S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D3 (const Standard_Address S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static gp_Vec DN (const Standard_Address S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static Standard_Real UResolution (const Standard_Address S, const Standard_Real R3d);
static Standard_Real VResolution (const Standard_Address S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType (const Standard_Address S);
static gp_Pln Plane (const Standard_Address S);
static gp_Cylinder Cylinder (const Standard_Address S);
static gp_Cone Cone (const Standard_Address S);
static gp_Torus Torus (const Standard_Address S);
static gp_Sphere Sphere (const Standard_Address S);
static Handle(Geom_BezierSurface) Bezier (const Standard_Address S);
static Handle(Geom_BSplineSurface) BSpline (const Standard_Address S);
static gp_Ax1 AxeOfRevolution (const Standard_Address S);
static gp_Dir Direction (const Standard_Address S);
static Handle(Adaptor3d_Curve) BasisCurve (const Standard_Address S);
static Handle(Adaptor3d_Surface) BasisSurface (const Standard_Address S);
static Standard_Real OffsetValue (const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesU (const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesV (const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesU (const Standard_Address S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV (const Standard_Address S, const Standard_Real v1, const Standard_Real v2);
static Handle(Adaptor3d_Surface) VTrim(const Standard_Address S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
static Standard_Boolean IsUClosed(const Standard_Address S);
static Standard_Boolean IsVClosed(const Standard_Address S);
static Standard_Boolean IsUPeriodic(const Standard_Address S);
static Standard_Real UPeriod(const Standard_Address S);
static Standard_Boolean IsVPeriodic(const Standard_Address S);
static Standard_Real VPeriod(const Standard_Address S);
static gp_Pnt Value(const Standard_Address S, const Standard_Real u, const Standard_Real v);
static void D0(const Standard_Address S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1(const Standard_Address S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1u,
gp_Vec& D1v);
static void D2(const Standard_Address S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV);
static void D3(const Standard_Address S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV);
static gp_Vec DN(const Standard_Address S,
const Standard_Real u,
const Standard_Real v,
const Standard_Integer Nu,
const Standard_Integer Nv);
static Standard_Real UResolution(const Standard_Address S, const Standard_Real R3d);
static Standard_Real VResolution(const Standard_Address S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType(const Standard_Address S);
static gp_Pln Plane(const Standard_Address S);
static gp_Cylinder Cylinder(const Standard_Address S);
static gp_Cone Cone(const Standard_Address S);
static gp_Torus Torus(const Standard_Address S);
static gp_Sphere Sphere(const Standard_Address S);
static Handle(Geom_BezierSurface) Bezier(const Standard_Address S);
static Handle(Geom_BSplineSurface) BSpline(const Standard_Address S);
static gp_Ax1 AxeOfRevolution(const Standard_Address S);
static gp_Dir Direction(const Standard_Address S);
static Handle(Adaptor3d_Curve) BasisCurve(const Standard_Address S);
static Handle(Adaptor3d_Surface) BasisSurface(const Standard_Address S);
static Standard_Real OffsetValue(const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesU(const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesV(const Standard_Address S);
Standard_EXPORT static Standard_Integer NbSamplesU(const Standard_Address S,
const Standard_Real u1,
const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV(const Standard_Address S,
const Standard_Real v1,
const Standard_Real v2);
protected:
private:
};
#include <HLRBRep_SurfaceTool.lxx>
#endif // _HLRBRep_SurfaceTool_HeaderFile

View File

@@ -28,213 +28,235 @@
#include <Adaptor3d_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
inline Standard_Real HLRBRep_SurfaceTool::FirstUParameter(const Standard_Address Surf){ return ((BRepAdaptor_Surface *)Surf)->FirstUParameter(); }
inline Standard_Real HLRBRep_SurfaceTool::FirstVParameter(const Standard_Address Surf){ return ((BRepAdaptor_Surface *)Surf)->FirstVParameter();}
inline Standard_Real HLRBRep_SurfaceTool::LastUParameter(const Standard_Address Surf){ return ((BRepAdaptor_Surface *)Surf)->LastUParameter();}
inline Standard_Real HLRBRep_SurfaceTool::LastVParameter(const Standard_Address Surf){ return ((BRepAdaptor_Surface *)Surf)->LastVParameter();}
inline Standard_Real HLRBRep_SurfaceTool::FirstUParameter(const Standard_Address Surf)
{
return ((BRepAdaptor_Surface*)Surf)->FirstUParameter();
}
inline Standard_Real HLRBRep_SurfaceTool::FirstVParameter(const Standard_Address Surf)
{
return ((BRepAdaptor_Surface*)Surf)->FirstVParameter();
}
inline Standard_Real HLRBRep_SurfaceTool::LastUParameter(const Standard_Address Surf)
{
return ((BRepAdaptor_Surface*)Surf)->LastUParameter();
}
inline Standard_Real HLRBRep_SurfaceTool::LastVParameter(const Standard_Address Surf)
{
return ((BRepAdaptor_Surface*)Surf)->LastVParameter();
}
inline Standard_Integer HLRBRep_SurfaceTool::NbUIntervals(const Standard_Address Surf,
const GeomAbs_Shape S){
return ((BRepAdaptor_Surface *)Surf)->NbUIntervals(S);
const GeomAbs_Shape S)
{
return ((BRepAdaptor_Surface*)Surf)->NbUIntervals(S);
}
inline Standard_Integer HLRBRep_SurfaceTool::NbVIntervals(const Standard_Address Surf,
const GeomAbs_Shape S){
return ((BRepAdaptor_Surface *)Surf)->NbVIntervals(S);
const GeomAbs_Shape S)
{
return ((BRepAdaptor_Surface*)Surf)->NbVIntervals(S);
}
inline void HLRBRep_SurfaceTool::UIntervals(const Standard_Address Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
((BRepAdaptor_Surface *)Surf)->UIntervals(Tab,S);
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
((BRepAdaptor_Surface*)Surf)->UIntervals(Tab, S);
}
inline void HLRBRep_SurfaceTool::VIntervals(const Standard_Address Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
((BRepAdaptor_Surface *)Surf)->VIntervals(Tab,S);
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
((BRepAdaptor_Surface*)Surf)->VIntervals(Tab, S);
}
inline Handle(Adaptor3d_Surface) HLRBRep_SurfaceTool::UTrim(const Standard_Address Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return ((BRepAdaptor_Surface *)Surf)->UTrim(F,L,Tol);
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return ((BRepAdaptor_Surface*)Surf)->UTrim(F, L, Tol);
}
inline Handle(Adaptor3d_Surface) HLRBRep_SurfaceTool::VTrim(const Standard_Address Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return ((BRepAdaptor_Surface *)Surf)->VTrim(F,L,Tol);
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return ((BRepAdaptor_Surface*)Surf)->VTrim(F, L, Tol);
}
inline Standard_Boolean HLRBRep_SurfaceTool::IsUClosed(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->IsUClosed();
return ((BRepAdaptor_Surface*)S)->IsUClosed();
}
inline Standard_Boolean HLRBRep_SurfaceTool::IsVClosed(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->IsVClosed();
return ((BRepAdaptor_Surface*)S)->IsVClosed();
}
inline Standard_Boolean HLRBRep_SurfaceTool::IsUPeriodic(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->IsUPeriodic();
return ((BRepAdaptor_Surface*)S)->IsUPeriodic();
}
inline Standard_Real HLRBRep_SurfaceTool::UPeriod(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->UPeriod();
return ((BRepAdaptor_Surface*)S)->UPeriod();
}
inline Standard_Boolean HLRBRep_SurfaceTool::IsVPeriodic(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->IsVPeriodic();
return ((BRepAdaptor_Surface*)S)->IsVPeriodic();
}
inline Standard_Real HLRBRep_SurfaceTool::VPeriod(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->VPeriod();
return ((BRepAdaptor_Surface*)S)->VPeriod();
}
inline gp_Pnt HLRBRep_SurfaceTool::Value(const Standard_Address S,
const Standard_Real U,
const Standard_Real V )
const Standard_Real U,
const Standard_Real V)
{
return ((BRepAdaptor_Surface *)S)->Value(U,V);
return ((BRepAdaptor_Surface*)S)->Value(U, V);
}
inline void HLRBRep_SurfaceTool::D0(const Standard_Address S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
((BRepAdaptor_Surface *)S)->D0(U,V,P);
((BRepAdaptor_Surface*)S)->D0(U, V, P);
}
inline void HLRBRep_SurfaceTool::D1(const Standard_Address S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
((BRepAdaptor_Surface *)S)->D1(U,V,P,D1U,D1V);
((BRepAdaptor_Surface*)S)->D1(U, V, P, D1U, D1V);
}
inline void HLRBRep_SurfaceTool::D2(const Standard_Address S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV)
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV)
{
((BRepAdaptor_Surface *)S)->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
((BRepAdaptor_Surface*)S)->D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
}
inline void HLRBRep_SurfaceTool::D3(const Standard_Address S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V,
gp_Vec& D2U,
gp_Vec& D2V,
gp_Vec& D2UV,
gp_Vec& D3U,
gp_Vec& D3V,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{
((BRepAdaptor_Surface *)S)->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
((BRepAdaptor_Surface*)S)->D3(U, V, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
}
inline gp_Vec HLRBRep_SurfaceTool::DN(const Standard_Address S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return ((BRepAdaptor_Surface *)S)->DN(U,V,Nu,Nv);
return ((BRepAdaptor_Surface*)S)->DN(U, V, Nu, Nv);
}
inline Standard_Real HLRBRep_SurfaceTool::UResolution(const Standard_Address S,
const Standard_Real R3d)
const Standard_Real R3d)
{
return ((BRepAdaptor_Surface *)S)->UResolution(R3d);
return ((BRepAdaptor_Surface*)S)->UResolution(R3d);
}
inline Standard_Real HLRBRep_SurfaceTool::VResolution(const Standard_Address S,
const Standard_Real R3d)
const Standard_Real R3d)
{
return ((BRepAdaptor_Surface *)S)->VResolution(R3d);
return ((BRepAdaptor_Surface*)S)->VResolution(R3d);
}
inline GeomAbs_SurfaceType HLRBRep_SurfaceTool::GetType(const Standard_Address S )
inline GeomAbs_SurfaceType HLRBRep_SurfaceTool::GetType(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->GetType();
return ((BRepAdaptor_Surface*)S)->GetType();
}
inline gp_Pln HLRBRep_SurfaceTool::Plane(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->Plane();
return ((BRepAdaptor_Surface*)S)->Plane();
}
inline gp_Cylinder HLRBRep_SurfaceTool::Cylinder(const Standard_Address S)
inline gp_Cylinder HLRBRep_SurfaceTool::Cylinder(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->Cylinder();
return ((BRepAdaptor_Surface*)S)->Cylinder();
}
inline gp_Cone HLRBRep_SurfaceTool::Cone(const Standard_Address S)
inline gp_Cone HLRBRep_SurfaceTool::Cone(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->Cone();
return ((BRepAdaptor_Surface*)S)->Cone();
}
inline gp_Sphere HLRBRep_SurfaceTool::Sphere(const Standard_Address S)
inline gp_Sphere HLRBRep_SurfaceTool::Sphere(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->Sphere();
return ((BRepAdaptor_Surface*)S)->Sphere();
}
inline gp_Torus HLRBRep_SurfaceTool::Torus(const Standard_Address S)
inline gp_Torus HLRBRep_SurfaceTool::Torus(const Standard_Address S)
{
return ((BRepAdaptor_Surface *)S)->Torus();
return ((BRepAdaptor_Surface*)S)->Torus();
}
inline Handle(Geom_BezierSurface) HLRBRep_SurfaceTool::Bezier(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->Bezier());
inline Handle(Geom_BezierSurface) HLRBRep_SurfaceTool::Bezier(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->Bezier());
}
inline Handle(Geom_BSplineSurface) HLRBRep_SurfaceTool::BSpline(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->BSpline());
inline Handle(Geom_BSplineSurface) HLRBRep_SurfaceTool::BSpline(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->BSpline());
}
inline gp_Ax1 HLRBRep_SurfaceTool::AxeOfRevolution(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->AxeOfRevolution());
inline gp_Ax1 HLRBRep_SurfaceTool::AxeOfRevolution(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->AxeOfRevolution());
}
inline gp_Dir HLRBRep_SurfaceTool::Direction(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->Direction());
inline gp_Dir HLRBRep_SurfaceTool::Direction(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->Direction());
}
inline Handle(Adaptor3d_Curve) HLRBRep_SurfaceTool::BasisCurve(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->BasisCurve());
inline Handle(Adaptor3d_Curve) HLRBRep_SurfaceTool::BasisCurve(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->BasisCurve());
}
inline Handle(Adaptor3d_Surface) HLRBRep_SurfaceTool::BasisSurface(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->BasisSurface());
inline Handle(Adaptor3d_Surface) HLRBRep_SurfaceTool::BasisSurface(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->BasisSurface());
}
inline Standard_Real HLRBRep_SurfaceTool::OffsetValue(const Standard_Address S) {
return(((BRepAdaptor_Surface *)S)->OffsetValue());
inline Standard_Real HLRBRep_SurfaceTool::OffsetValue(const Standard_Address S)
{
return (((BRepAdaptor_Surface*)S)->OffsetValue());
}

View File

@@ -32,60 +32,37 @@ class HLRBRep_LineTool;
class math_Matrix;
class gp_Pnt;
class HLRBRep_TheCSFunctionOfInterCSurf : public math_FunctionSetWithDerivatives
class HLRBRep_TheCSFunctionOfInterCSurf : public math_FunctionSetWithDerivatives
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_TheCSFunctionOfInterCSurf(const Standard_Address& S, const gp_Lin& C);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Integer NbEquations() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F);
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X, math_Matrix& D);
Standard_EXPORT Standard_Boolean Values(const math_Vector& X, math_Vector& F, math_Matrix& D);
Standard_EXPORT const gp_Pnt& Point() const;
Standard_EXPORT Standard_Real Root() const;
Standard_EXPORT const Standard_Address& AuxillarSurface() const;
Standard_EXPORT const gp_Lin& AuxillarCurve() const;
protected:
private:
Standard_Address surface;
gp_Lin curve;
gp_Pnt p;
Standard_Real f;
gp_Lin curve;
gp_Pnt p;
Standard_Real f;
};
#endif // _HLRBRep_TheCSFunctionOfInterCSurf_HeaderFile

View File

@@ -21,7 +21,6 @@
#include <HLRBRep_LineTool.hxx>
#include <math_Matrix.hxx>
#include <gp_Pnt.hxx>
#define ThePSurface Standard_Address
#define ThePSurface_hxx <Standard_Address.hxx>
@@ -34,4 +33,3 @@
#define IntImp_ZerCSParFunc HLRBRep_TheCSFunctionOfInterCSurf
#define IntImp_ZerCSParFunc_hxx <HLRBRep_TheCSFunctionOfInterCSurf.hxx>
#include "../IntImp/IntImp_ZerCSParFunc.gxx"

View File

@@ -26,53 +26,43 @@ class HLRBRep_CurveTool;
class Extrema_POnCurv2d;
class gp_Pnt2d;
class HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
class HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
{
public:
DEFINE_STANDARD_ALLOC
//! Among a set of points {C(ui),i=1,NbU}, locate the point
//! P=C(uj) such that:
//! distance(P,C) = Min{distance(P,C(ui))}
Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Standard_Address& C, const Standard_Integer NbU, Extrema_POnCurv2d& Papp);
Standard_EXPORT static void Locate(const gp_Pnt2d& P,
const Standard_Address& C,
const Standard_Integer NbU,
Extrema_POnCurv2d& Papp);
//! Among a set of points {C(ui),i=1,NbU}, locate the point
//! P=C(uj) such that:
//! distance(P,C) = Min{distance(P,C(ui))}
//! The research is done between umin and usup.
Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Standard_Address& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, Extrema_POnCurv2d& Papp);
Standard_EXPORT static void Locate(const gp_Pnt2d& P,
const Standard_Address& C,
const Standard_Integer NbU,
const Standard_Real Umin,
const Standard_Real Usup,
Extrema_POnCurv2d& Papp);
//! Among two sets of points {C1(ui),i=1,NbU} and
//! {C2(vj),j=1,NbV}, locate the two points P1=C1(uk) and
//! P2=C2(vl) such that:
//! distance(P1,P2) = Min {distance(C1(ui),C2(vj))}.
Standard_EXPORT static void Locate (const Standard_Address& C1, const Standard_Address& C2, const Standard_Integer NbU, const Standard_Integer NbV, Extrema_POnCurv2d& Papp1, Extrema_POnCurv2d& Papp2);
Standard_EXPORT static void Locate(const Standard_Address& C1,
const Standard_Address& C2,
const Standard_Integer NbU,
const Standard_Integer NbV,
Extrema_POnCurv2d& Papp1,
Extrema_POnCurv2d& Papp2);
protected:
private:
};
#endif // _HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter_HeaderFile

View File

@@ -19,7 +19,6 @@
#include <HLRBRep_CurveTool.hxx>
#include <Extrema_POnCurv2d.hxx>
#include <gp_Pnt2d.hxx>
#define Curve1 Standard_Address
#define Curve1_hxx <Standard_Address.hxx>
@@ -36,4 +35,3 @@
#define Extrema_CurveLocator HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter
#define Extrema_CurveLocator_hxx <HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx>
#include "../Extrema/Extrema_CurveLocator.gxx"

View File

@@ -27,64 +27,44 @@
class HLRBRep_CurveTool;
class math_Matrix;
class HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter : public math_FunctionSetWithDerivatives
class HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter
: public math_FunctionSetWithDerivatives
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter(const Standard_Address& curve1, const Standard_Address& curve2);
Standard_EXPORT HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter(
const Standard_Address& curve1,
const Standard_Address& curve2);
//! returns 2.
Standard_EXPORT Standard_Integer NbVariables() const;
//! returns 2.
Standard_EXPORT Standard_Integer NbEquations() const;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F);
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X, math_Matrix& D);
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
Standard_EXPORT Standard_Boolean Values(const math_Vector& X, math_Vector& F, math_Matrix& D);
protected:
private:
Standard_Address thecurve1;
Standard_Address thecurve2;
};
#endif // _HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter_HeaderFile

Some files were not shown because too many files have changed in this diff Show More