1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0027870: Modeling - refactoring of HLR algorithms

Toolkit 'TKHLR' was fully refactored for 'Standard_Address' and macros except about half of package 'HLRBREP' there 'Standard_Address' is used through the 'generic' mechanism.
This commit is contained in:
abk
2016-10-05 13:49:44 +03:00
committed by apn
parent 4a6d278356
commit 681f3919f0
69 changed files with 2533 additions and 3949 deletions

View File

@@ -37,7 +37,9 @@ public:
: myRg1Line (false),
myRgNLine (false),
myOutLine (false),
myIntLine (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),
@@ -46,7 +48,27 @@ public:
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl) {}
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)
{
}
const gp_Pnt2d& P1() const { return myP1; }

View File

@@ -21,7 +21,6 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Address.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <gp_Pnt2d.hxx>
@@ -37,6 +36,7 @@ class gp_Vec2d;
class gp_Pnt2d;
class gp_Dir2d;
class HLRBRep_CLPropsATool;
class HLRBRep_Curve;
@@ -56,12 +56,12 @@ 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 Standard_Address& 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 Standard_Address& 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
@@ -77,7 +77,7 @@ public:
//! Initializes the local properties of the curve
//! for the new curve.
Standard_EXPORT void SetCurve (const Standard_Address& C);
Standard_EXPORT void SetCurve (const HLRBRep_Curve*& C);
//! Returns the Point.
Standard_EXPORT const gp_Pnt2d& Value() const;
@@ -124,7 +124,7 @@ private:
Standard_Address myCurve;
const HLRBRep_Curve* myCurve;
Standard_Real myU;
Standard_Integer myDerOrder;
Standard_Real myCN;

View File

@@ -21,7 +21,6 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Address.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
class gp_Pnt2d;
@@ -38,35 +37,35 @@ public:
//! Computes the point <P> of parameter <U> on the
//! Curve from HLRBRep <C>.
static void Value (const Standard_Address 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 Standard_Address 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 Standard_Address 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 Standard_Address 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 Standard_Address A);
static Standard_Integer Continuity (const HLRBRep_Curve* A);
//! returns the first parameter bound of the curve.
static Standard_Real FirstParameter (const Standard_Address 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 Standard_Address A);
static Standard_Real LastParameter (const HLRBRep_Curve* A);

View File

@@ -24,10 +24,10 @@
//=======================================================================
inline void HLRBRep_CLPropsATool::Value
(const Standard_Address A,
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P)
{ P = ((HLRBRep_Curve*)A)->Value(U); }
{ P = A->Value(U); }
//=======================================================================
//function : D1
@@ -35,11 +35,11 @@ inline void HLRBRep_CLPropsATool::Value
//=======================================================================
inline void HLRBRep_CLPropsATool::D1
(const Standard_Address A,
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1)
{ ((HLRBRep_Curve*)A)->D1(U,P,V1); }
{ A->D1(U,P,V1); }
//=======================================================================
//function : D2
@@ -47,12 +47,12 @@ inline void HLRBRep_CLPropsATool::D1
//=======================================================================
inline void HLRBRep_CLPropsATool::D2
(const Standard_Address A,
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2)
{ ((HLRBRep_Curve*)A)->D2(U, P, V1, V2); }
{ A->D2(U, P, V1, V2); }
//=======================================================================
//function : D3
@@ -60,13 +60,13 @@ inline void HLRBRep_CLPropsATool::D2
//=======================================================================
inline void HLRBRep_CLPropsATool::D3
(const Standard_Address A,
(const HLRBRep_Curve* A,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{ ((HLRBRep_Curve*)A)->D3(U, P, V1, V2, V3); }
{ A->D3(U, P, V1, V2, V3); }
//=======================================================================
//function : Continuity
@@ -74,7 +74,7 @@ inline void HLRBRep_CLPropsATool::D3
//=======================================================================
inline Standard_Integer HLRBRep_CLPropsATool::Continuity
(const Standard_Address)
(const HLRBRep_Curve*)
{ return GeomAbs_C2; }
//=======================================================================
@@ -83,8 +83,8 @@ inline Standard_Integer HLRBRep_CLPropsATool::Continuity
//=======================================================================
inline Standard_Real HLRBRep_CLPropsATool::FirstParameter
(const Standard_Address A)
{ return ((HLRBRep_Curve*)A)->FirstParameter(); }
(const HLRBRep_Curve* A)
{ return A->FirstParameter(); }
//=======================================================================
//function : LastParameter
@@ -92,5 +92,5 @@ inline Standard_Real HLRBRep_CLPropsATool::FirstParameter
//=======================================================================
inline Standard_Real HLRBRep_CLPropsATool::LastParameter
(const Standard_Address A)
{ return ((HLRBRep_Curve*)A)->LastParameter(); }
(const HLRBRep_Curve* A)
{ return A->LastParameter(); }

View File

@@ -26,8 +26,8 @@
#include <HLRBRep_CLPropsATool.hxx>
#define Curve Standard_Address
#define Curve_hxx <Standard_Address.hxx>
#define Curve HLRBRep_Curve*
#define Curve_hxx <HLRBRep_Curve.hxx>
#define Vec gp_Vec2d
#define Vec_hxx <gp_Vec2d.hxx>
#define Pnt gp_Pnt2d

View File

@@ -127,8 +127,8 @@ HLRBRep_Curve::Parameter3d (const Standard_Real P2d) const
//purpose :
//=======================================================================
Standard_Real HLRBRep_Curve::Update (const Standard_Address TotMin,
const Standard_Address TotMax)
Standard_Real HLRBRep_Curve::Update(
Standard_Real TotMin[16], Standard_Real TotMax[16])
{
GeomAbs_CurveType typ = HLRBRep_BCurveTool::GetType(myCurve);
myType = GeomAbs_OtherCurve;
@@ -229,9 +229,8 @@ Standard_Real HLRBRep_Curve::Update (const Standard_Address TotMin,
//purpose :
//=======================================================================
Standard_Real
HLRBRep_Curve::UpdateMinMax (const Standard_Address TotMin,
const Standard_Address TotMax)
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);
@@ -302,8 +301,8 @@ void HLRBRep_Curve::Tangent (const Standard_Boolean AtStart,
D0(U,P);
HLRBRep_CLProps CLP(2,Epsilon(1.));
const Standard_Address crv = (const Standard_Address)this;
CLP.SetCurve(crv);
const HLRBRep_Curve* aCurve = this;
CLP.SetCurve(aCurve);
CLP.SetParameter(U);
StdFail_UndefinedDerivative_Raise_if
(!CLP.IsTangentDefined(), "HLRBRep_Curve::Tangent");
@@ -463,7 +462,7 @@ gp_Lin2d HLRBRep_Curve::Line () const
gp_Circ2d HLRBRep_Curve::Circle () const
{
gp_Circ C = HLRBRep_BCurveTool::Circle(myCurve);
C.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
C.Transform(myProj->Transformation());
return ProjLib::Project(gp_Pln(gp::XOY()),C);
}
@@ -476,12 +475,12 @@ gp_Elips2d HLRBRep_Curve::Ellipse () const
{
if (HLRBRep_BCurveTool::GetType(myCurve) == GeomAbs_Ellipse) {
gp_Elips E = HLRBRep_BCurveTool::Ellipse(myCurve);
E.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
E.Transform(myProj->Transformation());
return ProjLib::Project(gp_Pln(gp::XOY()),E);
}
// this is a circle
gp_Circ C = HLRBRep_BCurveTool::Circle(myCurve);
C.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
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);
@@ -526,7 +525,7 @@ void HLRBRep_Curve::Poles (TColgp_Array1OfPnt2d& TP) const
(HLRBRep_BCurveTool::Bezier(myCurve))->Poles(TP3);
}
for (Standard_Integer i = i1; i <= i2; i++) {
((HLRAlgo_Projector*) myProj)->Transform(TP3(i));
myProj->Transform(TP3(i));
TP(i).SetCoord(TP3(i).X(),TP3(i).Y());
}
}

View File

@@ -23,7 +23,6 @@
#include <BRepAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Standard_Address.hxx>
#include <Standard_Real.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Boolean.hxx>
@@ -50,6 +49,7 @@ class gp_Elips2d;
class gp_Hypr2d;
class gp_Parab2d;
class Geom_BSplineCurve;
class HLRAlgo_Projector;
//! Defines a 2d curve by projection of a 3D curve on
@@ -65,7 +65,8 @@ public:
//! Creates an undefined Curve.
Standard_EXPORT HLRBRep_Curve();
void Projector (const Standard_Address Proj);
void Projector (const HLRAlgo_Projector* Proj)
{myProj = Proj;}
//! Returns the 3D curve.
BRepAdaptor_Curve& Curve();
@@ -85,10 +86,10 @@ public:
Standard_EXPORT Standard_Real Parameter3d (const Standard_Real P2d) const;
//! Update the minmax and the internal data
Standard_EXPORT Standard_Real Update (const Standard_Address TotMin, const Standard_Address TotMax);
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 (const Standard_Address TotMin, const Standard_Address TotMax);
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
@@ -221,7 +222,7 @@ private:
BRepAdaptor_Curve myCurve;
GeomAbs_CurveType myType;
Standard_Address myProj;
const HLRAlgo_Projector* myProj;
Standard_Real myOX;
Standard_Real myOZ;
Standard_Real myVX;

View File

@@ -24,14 +24,6 @@
#include <gp_Parab2d.hxx>
#include <HLRBRep_BCurveTool.hxx>
//=======================================================================
//function : Projector
//purpose :
//=======================================================================
inline void HLRBRep_Curve::Projector(const Standard_Address Proj)
{ myProj = Proj; }
//=======================================================================
//function : Curve
//purpose :

View File

@@ -57,114 +57,7 @@ static const Standard_Real CutBig = 1.e-1;
//-- voir HLRAlgo.cxx
#define MinShap1 ((Standard_Integer*)MinMaxShap)[ 0]
#define MinShap2 ((Standard_Integer*)MinMaxShap)[ 1]
#define MinShap3 ((Standard_Integer*)MinMaxShap)[ 2]
#define MinShap4 ((Standard_Integer*)MinMaxShap)[ 3]
#define MinShap5 ((Standard_Integer*)MinMaxShap)[ 4]
#define MinShap6 ((Standard_Integer*)MinMaxShap)[ 5]
#define MinShap7 ((Standard_Integer*)MinMaxShap)[ 6]
#define MinShap8 ((Standard_Integer*)MinMaxShap)[ 7]
#define MaxShap1 ((Standard_Integer*)MinMaxShap)[ 8]
#define MaxShap2 ((Standard_Integer*)MinMaxShap)[ 9]
#define MaxShap3 ((Standard_Integer*)MinMaxShap)[10]
#define MaxShap4 ((Standard_Integer*)MinMaxShap)[11]
#define MaxShap5 ((Standard_Integer*)MinMaxShap)[12]
#define MaxShap6 ((Standard_Integer*)MinMaxShap)[13]
#define MaxShap7 ((Standard_Integer*)MinMaxShap)[14]
#define MaxShap8 ((Standard_Integer*)MinMaxShap)[15]
#define MinFace1 ((Standard_Integer*)iFaceMinMax)[ 0]
#define MinFace2 ((Standard_Integer*)iFaceMinMax)[ 1]
#define MinFace3 ((Standard_Integer*)iFaceMinMax)[ 2]
#define MinFace4 ((Standard_Integer*)iFaceMinMax)[ 3]
#define MinFace5 ((Standard_Integer*)iFaceMinMax)[ 4]
#define MinFace6 ((Standard_Integer*)iFaceMinMax)[ 5]
#define MinFace7 ((Standard_Integer*)iFaceMinMax)[ 6]
#define MinFace8 ((Standard_Integer*)iFaceMinMax)[ 7]
#define MaxFace1 ((Standard_Integer*)iFaceMinMax)[ 8]
#define MaxFace2 ((Standard_Integer*)iFaceMinMax)[ 9]
#define MaxFace3 ((Standard_Integer*)iFaceMinMax)[10]
#define MaxFace4 ((Standard_Integer*)iFaceMinMax)[11]
#define MaxFace5 ((Standard_Integer*)iFaceMinMax)[12]
#define MaxFace6 ((Standard_Integer*)iFaceMinMax)[13]
#define MaxFace7 ((Standard_Integer*)iFaceMinMax)[14]
#define MaxFace8 ((Standard_Integer*)iFaceMinMax)[15]
#define MinWire1 ((Standard_Integer*)MinMaxWire)[ 0]
#define MinWire2 ((Standard_Integer*)MinMaxWire)[ 1]
#define MinWire3 ((Standard_Integer*)MinMaxWire)[ 2]
#define MinWire4 ((Standard_Integer*)MinMaxWire)[ 3]
#define MinWire5 ((Standard_Integer*)MinMaxWire)[ 4]
#define MinWire6 ((Standard_Integer*)MinMaxWire)[ 5]
#define MinWire7 ((Standard_Integer*)MinMaxWire)[ 6]
#define MinWire8 ((Standard_Integer*)MinMaxWire)[ 7]
#define MaxWire1 ((Standard_Integer*)MinMaxWire)[ 8]
#define MaxWire2 ((Standard_Integer*)MinMaxWire)[ 9]
#define MaxWire3 ((Standard_Integer*)MinMaxWire)[10]
#define MaxWire4 ((Standard_Integer*)MinMaxWire)[11]
#define MaxWire5 ((Standard_Integer*)MinMaxWire)[12]
#define MaxWire6 ((Standard_Integer*)MinMaxWire)[13]
#define MaxWire7 ((Standard_Integer*)MinMaxWire)[14]
#define MaxWire8 ((Standard_Integer*)MinMaxWire)[15]
#define MinLEdg1 ((Standard_Integer*)myLEMinMax)[ 0]
#define MinLEdg2 ((Standard_Integer*)myLEMinMax)[ 1]
#define MinLEdg3 ((Standard_Integer*)myLEMinMax)[ 2]
#define MinLEdg4 ((Standard_Integer*)myLEMinMax)[ 3]
#define MinLEdg5 ((Standard_Integer*)myLEMinMax)[ 4]
#define MinLEdg6 ((Standard_Integer*)myLEMinMax)[ 5]
#define MinLEdg7 ((Standard_Integer*)myLEMinMax)[ 6]
#define MinLEdg8 ((Standard_Integer*)myLEMinMax)[ 7]
#define MaxLEdg1 ((Standard_Integer*)myLEMinMax)[ 8]
#define MaxLEdg2 ((Standard_Integer*)myLEMinMax)[ 9]
#define MaxLEdg3 ((Standard_Integer*)myLEMinMax)[10]
#define MaxLEdg4 ((Standard_Integer*)myLEMinMax)[11]
#define MaxLEdg5 ((Standard_Integer*)myLEMinMax)[12]
#define MaxLEdg6 ((Standard_Integer*)myLEMinMax)[13]
#define MaxLEdg7 ((Standard_Integer*)myLEMinMax)[14]
#define MaxLEdg8 ((Standard_Integer*)myLEMinMax)[15]
#define MinFEdg1 ((Standard_Integer*)MinMaxFEdg)[ 0]
#define MinFEdg2 ((Standard_Integer*)MinMaxFEdg)[ 1]
#define MinFEdg3 ((Standard_Integer*)MinMaxFEdg)[ 2]
#define MinFEdg4 ((Standard_Integer*)MinMaxFEdg)[ 3]
#define MinFEdg5 ((Standard_Integer*)MinMaxFEdg)[ 4]
#define MinFEdg6 ((Standard_Integer*)MinMaxFEdg)[ 5]
#define MinFEdg7 ((Standard_Integer*)MinMaxFEdg)[ 6]
#define MinFEdg8 ((Standard_Integer*)MinMaxFEdg)[ 7]
#define MaxFEdg1 ((Standard_Integer*)MinMaxFEdg)[ 8]
#define MaxFEdg2 ((Standard_Integer*)MinMaxFEdg)[ 9]
#define MaxFEdg3 ((Standard_Integer*)MinMaxFEdg)[10]
#define MaxFEdg4 ((Standard_Integer*)MinMaxFEdg)[11]
#define MaxFEdg5 ((Standard_Integer*)MinMaxFEdg)[12]
#define MaxFEdg6 ((Standard_Integer*)MinMaxFEdg)[13]
#define MaxFEdg7 ((Standard_Integer*)MinMaxFEdg)[14]
#define MaxFEdg8 ((Standard_Integer*)MinMaxFEdg)[15]
#define MinVert1 MinMaxVert[ 0]
#define MinVert2 MinMaxVert[ 1]
#define MinVert3 MinMaxVert[ 2]
#define MinVert4 MinMaxVert[ 3]
#define MinVert5 MinMaxVert[ 4]
#define MinVert6 MinMaxVert[ 5]
#define MinVert7 MinMaxVert[ 6]
#define MinVert8 MinMaxVert[ 7]
#define MaxVert1 MinMaxVert[ 8]
#define MaxVert2 MinMaxVert[ 9]
#define MaxVert3 MinMaxVert[10]
#define MaxVert4 MinMaxVert[11]
#define MaxVert5 MinMaxVert[12]
#define MaxVert6 MinMaxVert[13]
#define MaxVert7 MinMaxVert[14]
#define MaxVert8 MinMaxVert[15]
#define DERIVEE_PREMIERE_NULLE 0.000000000001
static const Standard_Real DERIVEE_PREMIERE_NULLE = 0.000000000001;
//-- ======================================================================
//--
@@ -181,7 +74,7 @@ static long unsigned Mask32[32] = { 1,2,4,8, 16,32,64,128, 256,512,1024,2048,
16777216,33554432,67108864,134217728,
268435456,536870912,1073741824,2147483648U};
#define SIZEUV 8
static const Standard_Integer SIZEUV = 8;
class TableauRejection {
public:
@@ -520,7 +413,7 @@ HLRBRep_Data::HLRBRep_Data (const Standard_Integer NV,
mySLProps(2,Epsilon(1.)),
myHideCount(0)
{
myReject=(void *)(new TableauRejection());
myReject = new TableauRejection();
((TableauRejection *)myReject)->SetDim(myNbEdges);
}
@@ -601,13 +494,13 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
Standard_Integer i;
Standard_Real tolMinMax = 0;
Standard_Integer FaceMin[16],FaceMax[16],MinMaxFace[16];
Standard_Integer WireMin[16],WireMax[16],MinMaxWire[16];
Standard_Integer EdgeMin[16],EdgeMax[16],MinMaxEdge[16];
HLRAlgo_EdgesBlock::MinMaxIndices FaceMin, FaceMax;
HLRAlgo_EdgesBlock::MinMaxIndices MinMaxFace;
HLRAlgo_EdgesBlock::MinMaxIndices WireMin, WireMax, MinMaxWire;
HLRAlgo_EdgesBlock::MinMaxIndices EdgeMin, EdgeMax;
HLRAlgo_EdgesBlock::MinMaxIndices MinMaxEdge;
Standard_Real TotMin[16],TotMax[16];
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
// compute the global MinMax
// *************************
@@ -617,13 +510,10 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
HLRBRep_EdgeData& ed = myEData.ChangeValue(edge);
HLRBRep_Curve& EC = ed.ChangeGeometry();
EC.Projector(&myProj);
Standard_Real enl =EC.Update((Standard_Address)TotMin,
(Standard_Address)TotMax);
Standard_Real enl =EC.Update(TotMin, TotMax);
if (enl > tolMinMax) tolMinMax = enl;
}
HLRAlgo::EnlargeMinMax(tolMinMax,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tolMinMax, TotMin, TotMax);
Standard_Real d[16];
Standard_Real precad = -Precision::Infinite();
@@ -651,11 +541,8 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
HLRBRep_EdgeData& ed = myEData.ChangeValue(edge);
HLRBRep_Curve& EC = ed.ChangeGeometry();
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
tolMinMax = EC.UpdateMinMax((Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
tolMinMax = EC.UpdateMinMax(TotMin, TotMax);
tol = (Standard_Real)(ed.Tolerance());
ed.Vertical(TotMax[0] - TotMin[0] < tol &&
TotMax[1] - TotMin[1] < tol &&
@@ -664,47 +551,43 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
TotMax[4] - TotMin[4] < tol &&
TotMax[5] - TotMin[5] < tol &&
TotMax[6] - TotMin[6] < tol );
HLRAlgo::EnlargeMinMax(tolMinMax,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tolMinMax, TotMin, TotMax);
// Linux warning : assignment to `int' from `double'. Cast has been added.
EdgeMin[ 0] = (Standard_Integer)( (myDeca[ 0] + TotMin[ 0]) * mySurD[ 0]);
EdgeMax[ 0] = (Standard_Integer)( (myDeca[ 0] + TotMax[ 0]) * mySurD[ 0]);
EdgeMin[ 1] = (Standard_Integer)( (myDeca[ 1] + TotMin[ 1]) * mySurD[ 1]);
EdgeMax[ 1] = (Standard_Integer)( (myDeca[ 1] + TotMax[ 1]) * mySurD[ 1]);
EdgeMin[ 2] = (Standard_Integer)( (myDeca[ 2] + TotMin[ 2]) * mySurD[ 2]);
EdgeMax[ 2] = (Standard_Integer)( (myDeca[ 2] + TotMax[ 2]) * mySurD[ 2]);
EdgeMin[ 3] = (Standard_Integer)( (myDeca[ 3] + TotMin[ 3]) * mySurD[ 3]);
EdgeMax[ 3] = (Standard_Integer)( (myDeca[ 3] + TotMax[ 3]) * mySurD[ 3]);
EdgeMin[ 4] = (Standard_Integer)( (myDeca[ 4] + TotMin[ 4]) * mySurD[ 4]);
EdgeMax[ 4] = (Standard_Integer)( (myDeca[ 4] + TotMax[ 4]) * mySurD[ 4]);
EdgeMin[ 5] = (Standard_Integer)( (myDeca[ 5] + TotMin[ 5]) * mySurD[ 5]);
EdgeMax[ 5] = (Standard_Integer)( (myDeca[ 5] + TotMax[ 5]) * mySurD[ 5]);
EdgeMin[ 6] = (Standard_Integer)( (myDeca[ 6] + TotMin[ 6]) * mySurD[ 6]);
EdgeMax[ 6] = (Standard_Integer)( (myDeca[ 6] + TotMax[ 6]) * mySurD[ 6]);
EdgeMin[ 7] = (Standard_Integer)( (myDeca[ 7] + TotMin[ 7]) * mySurD[ 7]);
EdgeMax[ 7] = (Standard_Integer)( (myDeca[ 7] + TotMax[ 7]) * mySurD[ 7]);
EdgeMin[ 8] = (Standard_Integer)( (myDeca[ 8] + TotMin[ 8]) * mySurD[ 8]);
EdgeMax[ 8] = (Standard_Integer)( (myDeca[ 8] + TotMax[ 8]) * mySurD[ 8]);
EdgeMin[ 9] = (Standard_Integer)( (myDeca[ 9] + TotMin[ 9]) * mySurD[ 9]);
EdgeMax[ 9] = (Standard_Integer)( (myDeca[ 9] + TotMax[ 9]) * mySurD[ 9]);
EdgeMin[10] = (Standard_Integer)( (myDeca[10] + TotMin[10]) * mySurD[10]);
EdgeMax[10] = (Standard_Integer)( (myDeca[10] + TotMax[10]) * mySurD[10]);
EdgeMin[11] = (Standard_Integer)( (myDeca[11] + TotMin[11]) * mySurD[11]);
EdgeMax[11] = (Standard_Integer)( (myDeca[11] + TotMax[11]) * mySurD[11]);
EdgeMin[12] = (Standard_Integer)( (myDeca[12] + TotMin[12]) * mySurD[12]);
EdgeMax[12] = (Standard_Integer)( (myDeca[12] + TotMax[12]) * mySurD[12]);
EdgeMin[13] = (Standard_Integer)( (myDeca[13] + TotMin[13]) * mySurD[13]);
EdgeMax[13] = (Standard_Integer)( (myDeca[13] + TotMax[13]) * mySurD[13]);
EdgeMin[14] = (Standard_Integer)( (myDeca[14] + TotMin[14]) * mySurD[14]);
EdgeMax[14] = (Standard_Integer)( (myDeca[14] + TotMax[14]) * mySurD[14]);
EdgeMin[15] = (Standard_Integer)( (myDeca[15] + TotMin[15]) * mySurD[15]);
EdgeMax[15] = (Standard_Integer)( (myDeca[15] + TotMax[15]) * mySurD[15]);
EdgeMin.Min[0] = (Standard_Integer)( (myDeca[ 0] + TotMin[ 0]) * mySurD[ 0]);
EdgeMax.Min[0] = (Standard_Integer)( (myDeca[ 0] + TotMax[ 0]) * mySurD[ 0]);
EdgeMin.Min[1] = (Standard_Integer)( (myDeca[ 1] + TotMin[ 1]) * mySurD[ 1]);
EdgeMax.Min[1] = (Standard_Integer)( (myDeca[ 1] + TotMax[ 1]) * mySurD[ 1]);
EdgeMin.Min[2] = (Standard_Integer)( (myDeca[ 2] + TotMin[ 2]) * mySurD[ 2]);
EdgeMax.Min[2] = (Standard_Integer)( (myDeca[ 2] + TotMax[ 2]) * mySurD[ 2]);
EdgeMin.Min[3] = (Standard_Integer)( (myDeca[ 3] + TotMin[ 3]) * mySurD[ 3]);
EdgeMax.Min[3] = (Standard_Integer)( (myDeca[ 3] + TotMax[ 3]) * mySurD[ 3]);
EdgeMin.Min[4] = (Standard_Integer)( (myDeca[ 4] + TotMin[ 4]) * mySurD[ 4]);
EdgeMax.Min[4] = (Standard_Integer)( (myDeca[ 4] + TotMax[ 4]) * mySurD[ 4]);
EdgeMin.Min[5] = (Standard_Integer)( (myDeca[ 5] + TotMin[ 5]) * mySurD[ 5]);
EdgeMax.Min[5] = (Standard_Integer)( (myDeca[ 5] + TotMax[ 5]) * mySurD[ 5]);
EdgeMin.Min[6] = (Standard_Integer)( (myDeca[ 6] + TotMin[ 6]) * mySurD[ 6]);
EdgeMax.Min[6] = (Standard_Integer)( (myDeca[ 6] + TotMax[ 6]) * mySurD[ 6]);
EdgeMin.Min[7] = (Standard_Integer)( (myDeca[ 7] + TotMin[ 7]) * mySurD[ 7]);
EdgeMax.Min[7] = (Standard_Integer)( (myDeca[ 7] + TotMax[ 7]) * mySurD[ 7]);
EdgeMin.Max[0] = (Standard_Integer)( (myDeca[ 8] + TotMin[ 8]) * mySurD[ 8]);
EdgeMax.Max[0] = (Standard_Integer)( (myDeca[ 8] + TotMax[ 8]) * mySurD[ 8]);
EdgeMin.Max[1] = (Standard_Integer)( (myDeca[ 9] + TotMin[ 9]) * mySurD[ 9]);
EdgeMax.Max[1] = (Standard_Integer)( (myDeca[ 9] + TotMax[ 9]) * mySurD[ 9]);
EdgeMin.Max[2] = (Standard_Integer)( (myDeca[10] + TotMin[10]) * mySurD[10]);
EdgeMax.Max[2] = (Standard_Integer)( (myDeca[10] + TotMax[10]) * mySurD[10]);
EdgeMin.Max[3] = (Standard_Integer)( (myDeca[11] + TotMin[11]) * mySurD[11]);
EdgeMax.Max[3] = (Standard_Integer)( (myDeca[11] + TotMax[11]) * mySurD[11]);
EdgeMin.Max[4] = (Standard_Integer)( (myDeca[12] + TotMin[12]) * mySurD[12]);
EdgeMax.Max[4] = (Standard_Integer)( (myDeca[12] + TotMax[12]) * mySurD[12]);
EdgeMin.Max[5] = (Standard_Integer)( (myDeca[13] + TotMin[13]) * mySurD[13]);
EdgeMax.Max[5] = (Standard_Integer)( (myDeca[13] + TotMax[13]) * mySurD[13]);
EdgeMin.Max[6] = (Standard_Integer)( (myDeca[14] + TotMin[14]) * mySurD[14]);
EdgeMax.Max[6] = (Standard_Integer)( (myDeca[14] + TotMax[14]) * mySurD[14]);
EdgeMin.Max[7] = (Standard_Integer)( (myDeca[15] + TotMin[15]) * mySurD[15]);
EdgeMax.Max[7] = (Standard_Integer)( (myDeca[15] + TotMax[15]) * mySurD[15]);
HLRAlgo::EncodeMinMax((Standard_Address)EdgeMin,
(Standard_Address)EdgeMax,
(Standard_Address)MinMaxEdge);
ed.UpdateMinMax((Standard_Address)MinMaxEdge);
HLRAlgo::EncodeMinMax(EdgeMin, EdgeMax, MinMaxEdge);
ed.UpdateMinMax(MinMaxEdge);
if (ed.Vertical()) {
ver1 = Standard_True;
ver2 = Standard_True;
@@ -889,42 +772,24 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
myFE = myFaceItr1.Edge();
HLRBRep_EdgeData& EDataFE2 = myEData(myFE);
if (!fd.Simple()) EDataFE2.AutoIntersectionDone(Standard_False);
HLRAlgo::DecodeMinMax(EDataFE2.MinMax(),
(Standard_Address)EdgeMin,
(Standard_Address)EdgeMax);
HLRAlgo::DecodeMinMax(EDataFE2.MinMax(), EdgeMin, EdgeMax);
if (myFaceItr1.BeginningOfWire())
HLRAlgo::CopyMinMax((Standard_Address)EdgeMin,
(Standard_Address)EdgeMax,
(Standard_Address)WireMin,
(Standard_Address)WireMax);
HLRAlgo::CopyMinMax(EdgeMin, EdgeMax, WireMin, WireMax);
else
HLRAlgo::AddMinMax((Standard_Address)EdgeMin,
(Standard_Address)EdgeMax,
(Standard_Address)WireMin,
(Standard_Address)WireMax);
HLRAlgo::AddMinMax(EdgeMin, EdgeMax, WireMin, WireMax);
if (myFaceItr1.EndOfWire()) {
HLRAlgo::EncodeMinMax((Standard_Address)WireMin,
(Standard_Address)WireMax,
(Standard_Address)MinMaxWire);
myFaceItr1.Wire()->UpdateMinMax((Standard_Address)MinMaxWire);
HLRAlgo::EncodeMinMax(WireMin, WireMax, MinMaxWire);
myFaceItr1.Wire()->UpdateMinMax(MinMaxWire);
if (FirstTime) {
FirstTime = Standard_False;
HLRAlgo::CopyMinMax((Standard_Address)WireMin,
(Standard_Address)WireMax,
(Standard_Address)FaceMin,
(Standard_Address)FaceMax);
HLRAlgo::CopyMinMax(WireMin, WireMax, FaceMin, FaceMax);
}
else
HLRAlgo::AddMinMax((Standard_Address)WireMin,
(Standard_Address)WireMax,
(Standard_Address)FaceMin,
(Standard_Address)FaceMax);
HLRAlgo::AddMinMax(WireMin, WireMax, FaceMin, FaceMax);
}
}
HLRAlgo::EncodeMinMax((Standard_Address)FaceMin,
(Standard_Address)FaceMax,
(Standard_Address)MinMaxFace);
fd.Wires()->UpdateMinMax((Standard_Address)MinMaxFace);
HLRAlgo::EncodeMinMax(FaceMin, FaceMax, MinMaxFace);
fd.Wires()->UpdateMinMax(MinMaxFace);
fd.Size(HLRAlgo::SizeBox(FaceMin,FaceMax));
}
}
@@ -935,32 +800,32 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
//=======================================================================
void
HLRBRep_Data::InitBoundSort (const Standard_Address MinMaxTot,
HLRBRep_Data::InitBoundSort (const HLRAlgo_EdgesBlock::MinMaxIndices& MinMaxTot,
const Standard_Integer e1,
const Standard_Integer e2)
{
myNbrSortEd = 0;
Standard_Address MinMaxShap = MinMaxTot;
const HLRAlgo_EdgesBlock::MinMaxIndices& MinMaxShap = MinMaxTot;
for (Standard_Integer e = e1; e <= e2; e++) {
HLRBRep_EdgeData& ed = myEData(e);
if (!ed.Status().AllHidden()) {
myLEMinMax = ed.MinMax();
if (((MaxShap1 - MinLEdg1) & 0x80008000) == 0 &&
((MaxLEdg1 - MinShap1) & 0x80008000) == 0 &&
((MaxShap2 - MinLEdg2) & 0x80008000) == 0 &&
((MaxLEdg2 - MinShap2) & 0x80008000) == 0 &&
((MaxShap3 - MinLEdg3) & 0x80008000) == 0 &&
((MaxLEdg3 - MinShap3) & 0x80008000) == 0 &&
((MaxShap4 - MinLEdg4) & 0x80008000) == 0 &&
((MaxLEdg4 - MinShap4) & 0x80008000) == 0 &&
((MaxShap5 - MinLEdg5) & 0x80008000) == 0 &&
((MaxLEdg5 - MinShap5) & 0x80008000) == 0 &&
((MaxShap6 - MinLEdg6) & 0x80008000) == 0 &&
((MaxLEdg6 - MinShap6) & 0x80008000) == 0 &&
((MaxShap7 - MinLEdg7) & 0x80008000) == 0 &&
((MaxLEdg7 - MinShap7) & 0x80008000) == 0 &&
((MaxShap8 - MinLEdg8) & 0x80008000) == 0) { //- rejection en z
myLEMinMax = &ed.MinMax();
if (((MinMaxShap.Max[0] - myLEMinMax->Min[0]) & 0x80008000) == 0 &&
((myLEMinMax->Max[0] - MinMaxShap.Min[0]) & 0x80008000) == 0 &&
((MinMaxShap.Max[1] - myLEMinMax->Min[1]) & 0x80008000) == 0 &&
((myLEMinMax->Max[1] - MinMaxShap.Min[1]) & 0x80008000) == 0 &&
((MinMaxShap.Max[2] - myLEMinMax->Min[2]) & 0x80008000) == 0 &&
((myLEMinMax->Max[2] - MinMaxShap.Min[2]) & 0x80008000) == 0 &&
((MinMaxShap.Max[3] - myLEMinMax->Min[3]) & 0x80008000) == 0 &&
((myLEMinMax->Max[3] - MinMaxShap.Min[3]) & 0x80008000) == 0 &&
((MinMaxShap.Max[4] - myLEMinMax->Min[4]) & 0x80008000) == 0 &&
((myLEMinMax->Max[4] - MinMaxShap.Min[4]) & 0x80008000) == 0 &&
((MinMaxShap.Max[5] - myLEMinMax->Min[5]) & 0x80008000) == 0 &&
((myLEMinMax->Max[5] - MinMaxShap.Min[5]) & 0x80008000) == 0 &&
((MinMaxShap.Max[6] - myLEMinMax->Min[6]) & 0x80008000) == 0 &&
((myLEMinMax->Max[6] - MinMaxShap.Min[6]) & 0x80008000) == 0 &&
((MinMaxShap.Max[7] - myLEMinMax->Min[7]) & 0x80008000) == 0) { //- rejection en z
myNbrSortEd++;
myEdgeIndices(myNbrSortEd) = e;
}
@@ -980,10 +845,10 @@ void HLRBRep_Data::InitEdge (const Standard_Integer FI,
iFace = FI;
iFaceData = &myFData(iFace);
iFaceGeom = &(((HLRBRep_FaceData*)iFaceData)->Geometry());
iFaceBack = ((HLRBRep_FaceData*)iFaceData)->Back();
iFaceSimp = ((HLRBRep_FaceData*)iFaceData)->Simple();
iFaceMinMax = ((HLRBRep_FaceData*)iFaceData)->Wires()->MinMax();
iFaceGeom = &iFaceData->Geometry();
iFaceBack = iFaceData->Back();
iFaceSimp = iFaceData->Simple();
iFaceMinMax = &iFaceData->Wires()->MinMax();
iFaceType = ((HLRBRep_Surface*)iFaceGeom)->GetType();
iFaceTest = !iFaceSimp;
mySLProps.SetSurface(iFaceGeom);
@@ -1010,12 +875,12 @@ void HLRBRep_Data::InitEdge (const Standard_Integer FI,
}
if (iFaceTest) {
iFaceSmpl = !((HLRBRep_FaceData*)iFaceData)->Cut();
myFaceItr2.InitEdge(*((HLRBRep_FaceData*)iFaceData));
iFaceSmpl = !iFaceData->Cut();
myFaceItr2.InitEdge(*iFaceData);
}
else {
for (myFaceItr1.InitEdge(*((HLRBRep_FaceData*)iFaceData));
for (myFaceItr1.InitEdge(*iFaceData);
myFaceItr1.MoreEdge();
myFaceItr1.NextEdge()) {
myFE = myFaceItr1.Edge(); // edges of a simple hiding
@@ -1043,18 +908,18 @@ Standard_Boolean HLRBRep_Data::MoreEdge ()
myLEDouble = myFaceItr2.Double ();
myLEIsoLine = myFaceItr2.IsoLine ();
myLEData = &myEData(myLE);
myLEGeom = &(((HLRBRep_EdgeData*)myLEData)->ChangeGeometry());
myLEMinMax = ((HLRBRep_EdgeData*)myLEData)->MinMax();
myLETol = ((HLRBRep_EdgeData*)myLEData)->Tolerance();
myLEType = ((HLRBRep_Curve *)myLEGeom)->GetType();
myLEGeom = &myLEData->ChangeGeometry();
myLEMinMax = &myLEData->MinMax();
myLETol = myLEData->Tolerance();
myLEType = myLEGeom->GetType();
if (!myLEDouble)
((HLRBRep_EdgeData*)myLEData)->HideCount(myHideCount-1);
myLEData->HideCount(myHideCount-1);
return Standard_True;
}
else {
iFaceTest = Standard_False; // at the end of the test
iFaceSimp = iFaceSmpl; // we know if it is a simple face
((HLRBRep_FaceData*)iFaceData)->Simple(iFaceSimp);
iFaceData->Simple(iFaceSimp);
myCurSortEd = 1;
NextEdge(Standard_False);
}
@@ -1081,10 +946,10 @@ void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
myLEDouble = myFaceItr2.Double ();
myLEIsoLine = myFaceItr2.IsoLine ();
myLEData = &myEData(myLE);
myLEGeom = &(((HLRBRep_EdgeData*)myLEData)->ChangeGeometry());
myLEMinMax = ((HLRBRep_EdgeData*)myLEData)->MinMax();
myLETol = ((HLRBRep_EdgeData*)myLEData)->Tolerance();
myLEType = ((HLRBRep_Curve *)myLEGeom)->GetType();
myLEGeom = &myLEData->ChangeGeometry();
myLEMinMax = &myLEData->MinMax();
myLETol = myLEData->Tolerance();
myLEType = myLEGeom->GetType();
if (((HLRBRep_EdgeData*)myLEData)->Vertical() ||
(myLEDouble &&
((HLRBRep_EdgeData*)myLEData)->HideCount() == myHideCount-1))
@@ -1099,10 +964,10 @@ void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
myLEDouble = Standard_False;
myLEIsoLine = Standard_False;
myLEData = &myEData(myLE);
myLEGeom = &(((HLRBRep_EdgeData*)myLEData)->ChangeGeometry());
myLEMinMax = ((HLRBRep_EdgeData*)myLEData)->MinMax();
myLETol = ((HLRBRep_EdgeData*)myLEData)->Tolerance();
myLEType = ((HLRBRep_Curve *)myLEGeom)->GetType();
myLEGeom = &myLEData->ChangeGeometry();
myLEMinMax = &myLEData->MinMax();
myLETol = myLEData->Tolerance();
myLEType = myLEGeom->GetType();
}
if (((HLRBRep_EdgeData*)myLEData)->Vertical()) {
NextEdge();
@@ -1116,21 +981,21 @@ void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
NextEdge();
return;
}
if (((MaxFace1 - MinLEdg1) & 0x80008000) != 0 ||
((MaxLEdg1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinLEdg2) & 0x80008000) != 0 ||
((MaxLEdg2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinLEdg3) & 0x80008000) != 0 ||
((MaxLEdg3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinLEdg4) & 0x80008000) != 0 ||
((MaxLEdg4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinLEdg5) & 0x80008000) != 0 ||
((MaxLEdg5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinLEdg6) & 0x80008000) != 0 ||
((MaxLEdg6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinLEdg7) & 0x80008000) != 0 ||
((MaxLEdg7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinLEdg8) & 0x80008000) != 0) { //-- rejection en z
if (((iFaceMinMax->Max[0] - myLEMinMax->Min[0]) & 0x80008000) != 0 ||
((myLEMinMax->Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - myLEMinMax->Min[1]) & 0x80008000) != 0 ||
((myLEMinMax->Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - myLEMinMax->Min[2]) & 0x80008000) != 0 ||
((myLEMinMax->Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - myLEMinMax->Min[3]) & 0x80008000) != 0 ||
((myLEMinMax->Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - myLEMinMax->Min[4]) & 0x80008000) != 0 ||
((myLEMinMax->Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - myLEMinMax->Min[5]) & 0x80008000) != 0 ||
((myLEMinMax->Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - myLEMinMax->Min[6]) & 0x80008000) != 0 ||
((myLEMinMax->Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - myLEMinMax->Min[7]) & 0x80008000) != 0) { //-- rejection en z
NextEdge();
return;
}
@@ -1182,22 +1047,22 @@ void HLRBRep_Data::NextInterference ()
// rejection of current wire
if (myFaceItr1.BeginningOfWire()) {
Standard_Address MinMaxWire = myFaceItr1.Wire()->MinMax();
if (((MaxWire1 - MinLEdg1) & 0x80008000) != 0 ||
((MaxLEdg1 - MinWire1) & 0x80008000) != 0 ||
((MaxWire2 - MinLEdg2) & 0x80008000) != 0 ||
((MaxLEdg2 - MinWire2) & 0x80008000) != 0 ||
((MaxWire3 - MinLEdg3) & 0x80008000) != 0 ||
((MaxLEdg3 - MinWire3) & 0x80008000) != 0 ||
((MaxWire4 - MinLEdg4) & 0x80008000) != 0 ||
((MaxLEdg4 - MinWire4) & 0x80008000) != 0 ||
((MaxWire5 - MinLEdg5) & 0x80008000) != 0 ||
((MaxLEdg5 - MinWire5) & 0x80008000) != 0 ||
((MaxWire6 - MinLEdg6) & 0x80008000) != 0 ||
((MaxLEdg6 - MinWire6) & 0x80008000) != 0 ||
((MaxWire7 - MinLEdg7) & 0x80008000) != 0 ||
((MaxLEdg7 - MinWire7) & 0x80008000) != 0 ||
((MaxWire8 - MinLEdg8) & 0x80008000) != 0) { //-- Rejection en Z
HLRAlgo_EdgesBlock::MinMaxIndices& MinMaxWire = myFaceItr1.Wire()->MinMax();
if (((MinMaxWire.Max[0] - myLEMinMax->Min[0]) & 0x80008000) != 0 ||
((myLEMinMax->Max[0] - MinMaxWire.Min[0]) & 0x80008000) != 0 ||
((MinMaxWire.Max[1] - myLEMinMax->Min[1]) & 0x80008000) != 0 ||
((myLEMinMax->Max[1] - MinMaxWire.Min[1]) & 0x80008000) != 0 ||
((MinMaxWire.Max[2] - myLEMinMax->Min[2]) & 0x80008000) != 0 ||
((myLEMinMax->Max[2] - MinMaxWire.Min[2]) & 0x80008000) != 0 ||
((MinMaxWire.Max[3] - myLEMinMax->Min[3]) & 0x80008000) != 0 ||
((myLEMinMax->Max[3] - MinMaxWire.Min[3]) & 0x80008000) != 0 ||
((MinMaxWire.Max[4] - myLEMinMax->Min[4]) & 0x80008000) != 0 ||
((myLEMinMax->Max[4] - MinMaxWire.Min[4]) & 0x80008000) != 0 ||
((MinMaxWire.Max[5] - myLEMinMax->Min[5]) & 0x80008000) != 0 ||
((myLEMinMax->Max[5] - MinMaxWire.Min[5]) & 0x80008000) != 0 ||
((MinMaxWire.Max[6] - myLEMinMax->Min[6]) & 0x80008000) != 0 ||
((myLEMinMax->Max[6] - MinMaxWire.Min[6]) & 0x80008000) != 0 ||
((MinMaxWire.Max[7] - myLEMinMax->Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
myFaceItr1.SkipWire();
continue;
}
@@ -1218,7 +1083,7 @@ void HLRBRep_Data::NextInterference ()
// Edge from the boundary
if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !(myFEDouble && !myFEOutLine)) {
// not a vertical edge and not a double Edge
Standard_Address MinMaxFEdg = ((HLRBRep_EdgeData*)myFEData)->MinMax();
HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxFEdg = &((HLRBRep_EdgeData*)myFEData)->MinMax();
//-- -----------------------------------------------------------------------
//-- Max - Min doit etre positif pour toutes les directions
//--
@@ -1236,21 +1101,21 @@ void HLRBRep_Data::NextInterference ()
NoIntersection(myLE,myFE) == Standard_False) {
if (((MaxFEdg1 - MinLEdg1) & 0x80008000) == 0 &&
((MaxLEdg1 - MinFEdg1) & 0x80008000) == 0 &&
((MaxFEdg2 - MinLEdg2) & 0x80008000) == 0 &&
((MaxLEdg2 - MinFEdg2) & 0x80008000) == 0 &&
((MaxFEdg3 - MinLEdg3) & 0x80008000) == 0 &&
((MaxLEdg3 - MinFEdg3) & 0x80008000) == 0 &&
((MaxFEdg4 - MinLEdg4) & 0x80008000) == 0 &&
((MaxLEdg4 - MinFEdg4) & 0x80008000) == 0 &&
((MaxFEdg5 - MinLEdg5) & 0x80008000) == 0 &&
((MaxLEdg5 - MinFEdg5) & 0x80008000) == 0 &&
((MaxFEdg6 - MinLEdg6) & 0x80008000) == 0 &&
((MaxLEdg6 - MinFEdg6) & 0x80008000) == 0 &&
((MaxFEdg7 - MinLEdg7) & 0x80008000) == 0 &&
((MaxLEdg7 - MinFEdg7) & 0x80008000) == 0 &&
((MaxFEdg8 - MinLEdg8) & 0x80008000) == 0) { //-- Rejection en Z
if (((MinMaxFEdg->Max[0] - myLEMinMax->Min[0]) & 0x80008000) == 0 &&
((myLEMinMax->Max[0] - MinMaxFEdg->Min[0]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[1] - myLEMinMax->Min[1]) & 0x80008000) == 0 &&
((myLEMinMax->Max[1] - MinMaxFEdg->Min[1]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[2] - myLEMinMax->Min[2]) & 0x80008000) == 0 &&
((myLEMinMax->Max[2] - MinMaxFEdg->Min[2]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[3] - myLEMinMax->Min[3]) & 0x80008000) == 0 &&
((myLEMinMax->Max[3] - MinMaxFEdg->Min[3]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[4] - myLEMinMax->Min[4]) & 0x80008000) == 0 &&
((myLEMinMax->Max[4] - MinMaxFEdg->Min[4]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[5] - myLEMinMax->Min[5]) & 0x80008000) == 0 &&
((myLEMinMax->Max[5] - MinMaxFEdg->Min[5]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[6] - myLEMinMax->Min[6]) & 0x80008000) == 0 &&
((myLEMinMax->Max[6] - MinMaxFEdg->Min[6]) & 0x80008000) == 0 &&
((MinMaxFEdg->Max[7] - myLEMinMax->Min[7]) & 0x80008000) == 0) { //-- Rejection en Z
// not rejected perform intersection
Standard_Boolean rej = Standard_False;
if (myLE == myFE) { // test if an auto-intersection is not usefull
@@ -1465,7 +1330,8 @@ void HLRBRep_Data::LocalFEGeometry2D (const Standard_Integer FE,
gp_Dir2d& Nm,
Standard_Real& Cu)
{
myFLProps.SetCurve(&(myEData(FE).ChangeGeometry()));
const HLRBRep_Curve* aCurve = &myEData(FE).ChangeGeometry();
myFLProps.SetCurve(aCurve);
myFLProps.SetParameter(Param);
if (!myFLProps.IsTangentDefined())
Standard_Failure::Raise("HLRBRep_Data::LocalGeometry2D");
@@ -1794,40 +1660,52 @@ void HLRBRep_Data::OrientOthEdge (const Standard_Integer I,
//function : Classify
//purpose :
//=======================================================================
namespace
{
#define REJECT1 \
VertMin[ 0] = (Standard_Integer)((myDeca[ 0]+TotMin[ 0])*mySurD[ 0]); \
VertMax[ 0] = (Standard_Integer)((myDeca[ 0]+TotMax[ 0])*mySurD[ 0]); \
VertMin[ 1] = (Standard_Integer)((myDeca[ 1]+TotMin[ 1])*mySurD[ 1]); \
VertMax[ 1] = (Standard_Integer)((myDeca[ 1]+TotMax[ 1])*mySurD[ 1]); \
VertMin[ 2] = (Standard_Integer)((myDeca[ 2]+TotMin[ 2])*mySurD[ 2]); \
VertMax[ 2] = (Standard_Integer)((myDeca[ 2]+TotMax[ 2])*mySurD[ 2]); \
VertMin[ 3] = (Standard_Integer)((myDeca[ 3]+TotMin[ 3])*mySurD[ 3]); \
VertMax[ 3] = (Standard_Integer)((myDeca[ 3]+TotMax[ 3])*mySurD[ 3]); \
VertMin[ 4] = (Standard_Integer)((myDeca[ 4]+TotMin[ 4])*mySurD[ 4]); \
VertMax[ 4] = (Standard_Integer)((myDeca[ 4]+TotMax[ 4])*mySurD[ 4]); \
VertMin[ 5] = (Standard_Integer)((myDeca[ 5]+TotMin[ 5])*mySurD[ 5]); \
VertMax[ 5] = (Standard_Integer)((myDeca[ 5]+TotMax[ 5])*mySurD[ 5]); \
VertMin[ 6] = (Standard_Integer)((myDeca[ 6]+TotMin[ 6])*mySurD[ 6]); \
VertMax[ 6] = (Standard_Integer)((myDeca[ 6]+TotMax[ 6])*mySurD[ 6]); \
VertMin[ 7] = (Standard_Integer)((myDeca[ 7]+TotMin[ 7])*mySurD[ 7]); \
VertMax[ 7] = (Standard_Integer)((myDeca[ 7]+TotMax[ 7])*mySurD[ 7]); \
VertMin[ 8] = (Standard_Integer)((myDeca[ 8]+TotMin[ 8])*mySurD[ 8]); \
VertMax[ 8] = (Standard_Integer)((myDeca[ 8]+TotMax[ 8])*mySurD[ 8]); \
VertMin[ 9] = (Standard_Integer)((myDeca[ 9]+TotMin[ 9])*mySurD[ 9]); \
VertMax[ 9] = (Standard_Integer)((myDeca[ 9]+TotMax[ 9])*mySurD[ 9]); \
VertMin[10] = (Standard_Integer)((myDeca[10]+TotMin[10])*mySurD[10]); \
VertMax[10] = (Standard_Integer)((myDeca[10]+TotMax[10])*mySurD[10]); \
VertMin[11] = (Standard_Integer)((myDeca[11]+TotMin[11])*mySurD[11]); \
VertMax[11] = (Standard_Integer)((myDeca[11]+TotMax[11])*mySurD[11]); \
VertMin[12] = (Standard_Integer)((myDeca[12]+TotMin[12])*mySurD[12]); \
VertMax[12] = (Standard_Integer)((myDeca[12]+TotMax[12])*mySurD[12]); \
VertMin[13] = (Standard_Integer)((myDeca[13]+TotMin[13])*mySurD[13]); \
VertMax[13] = (Standard_Integer)((myDeca[13]+TotMax[13])*mySurD[13]); \
VertMin[14] = (Standard_Integer)((myDeca[14]+TotMin[14])*mySurD[14]); \
VertMax[14] = (Standard_Integer)((myDeca[14]+TotMax[14])*mySurD[14]); \
VertMin[15] = (Standard_Integer)((myDeca[15]+TotMin[15])*mySurD[15]); \
VertMax[15] = (Standard_Integer)((myDeca[15]+TotMax[15])*mySurD[15]);
static void REJECT1(
const Standard_Real theDeca[],
const Standard_Real theTotMin[],
const Standard_Real theTotMax[],
const Standard_Real theSurD[],
HLRAlgo_EdgesBlock::MinMaxIndices& theVertMin,
HLRAlgo_EdgesBlock::MinMaxIndices& theVertMax)
{
theVertMin.Min[0] = (Standard_Integer)((theDeca[ 0]+theTotMin[ 0]) * theSurD[ 0]);
theVertMax.Min[0] = (Standard_Integer)((theDeca[ 0]+theTotMax[ 0]) * theSurD[ 0]);
theVertMin.Min[1] = (Standard_Integer)((theDeca[ 1]+theTotMin[ 1]) * theSurD[ 1]);
theVertMax.Min[1] = (Standard_Integer)((theDeca[ 1]+theTotMax[ 1]) * theSurD[ 1]);
theVertMin.Min[2] = (Standard_Integer)((theDeca[ 2]+theTotMin[ 2]) * theSurD[ 2]);
theVertMax.Min[2] = (Standard_Integer)((theDeca[ 2]+theTotMax[ 2]) * theSurD[ 2]);
theVertMin.Min[3] = (Standard_Integer)((theDeca[ 3]+theTotMin[ 3]) * theSurD[ 3]);
theVertMax.Min[3] = (Standard_Integer)((theDeca[ 3]+theTotMax[ 3]) * theSurD[ 3]);
theVertMin.Min[4] = (Standard_Integer)((theDeca[ 4]+theTotMin[ 4]) * theSurD[ 4]);
theVertMax.Min[4] = (Standard_Integer)((theDeca[ 4]+theTotMax[ 4]) * theSurD[ 4]);
theVertMin.Min[5] = (Standard_Integer)((theDeca[ 5]+theTotMin[ 5]) * theSurD[ 5]);
theVertMax.Min[5] = (Standard_Integer)((theDeca[ 5]+theTotMax[ 5]) * theSurD[ 5]);
theVertMin.Min[6] = (Standard_Integer)((theDeca[ 6]+theTotMin[ 6]) * theSurD[ 6]);
theVertMax.Min[6] = (Standard_Integer)((theDeca[ 6]+theTotMax[ 6]) * theSurD[ 6]);
theVertMin.Min[7] = (Standard_Integer)((theDeca[ 7]+theTotMin[ 7]) * theSurD[ 7]);
theVertMax.Min[7] = (Standard_Integer)((theDeca[ 7]+theTotMax[ 7]) * theSurD[ 7]);
theVertMin.Max[0] = (Standard_Integer)((theDeca[ 8]+theTotMin[ 8]) * theSurD[ 8]);
theVertMax.Max[0] = (Standard_Integer)((theDeca[ 8]+theTotMax[ 8]) * theSurD[ 8]);
theVertMin.Max[1] = (Standard_Integer)((theDeca[ 9]+theTotMin[ 9]) * theSurD[ 9]);
theVertMax.Max[1] = (Standard_Integer)((theDeca[ 9]+theTotMax[ 9]) * theSurD[ 9]);
theVertMin.Max[2] = (Standard_Integer)((theDeca[10]+theTotMin[10]) * theSurD[10]);
theVertMax.Max[2] = (Standard_Integer)((theDeca[10]+theTotMax[10]) * theSurD[10]);
theVertMin.Max[3] = (Standard_Integer)((theDeca[11]+theTotMin[11]) * theSurD[11]);
theVertMax.Max[3] = (Standard_Integer)((theDeca[11]+theTotMax[11]) * theSurD[11]);
theVertMin.Max[4] = (Standard_Integer)((theDeca[12]+theTotMin[12]) * theSurD[12]);
theVertMax.Max[4] = (Standard_Integer)((theDeca[12]+theTotMax[12]) * theSurD[12]);
theVertMin.Max[5] = (Standard_Integer)((theDeca[13]+theTotMin[13]) * theSurD[13]);
theVertMax.Max[5] = (Standard_Integer)((theDeca[13]+theTotMax[13]) * theSurD[13]);
theVertMin.Max[6] = (Standard_Integer)((theDeca[14]+theTotMin[14]) * theSurD[14]);
theVertMax.Max[6] = (Standard_Integer)((theDeca[14]+theTotMax[14]) * theSurD[14]);
theVertMin.Max[7] = (Standard_Integer)((theDeca[15]+theTotMin[15]) * theSurD[15]);
theVertMax.Max[7] = (Standard_Integer)((theDeca[15]+theTotMax[15]) * theSurD[15]);
}
}
TopAbs_State
HLRBRep_Data::Classify (const Standard_Integer E,
@@ -1839,7 +1717,7 @@ HLRBRep_Data::Classify (const Standard_Integer E,
(void)E; // avoid compiler warning
nbClassification++;
Standard_Integer VertMin[16],VertMax[16],MinMaxVert[16];
HLRAlgo_EdgesBlock::MinMaxIndices VertMin, VertMax, MinMaxVert;
Standard_Real TotMin[16],TotMax[16];
Standard_Integer i;
@@ -1856,35 +1734,27 @@ HLRBRep_Data::Classify (const Standard_Integer E,
//-- les rejections sont faites dans l intersecteur a moindre frais
//-- puisque la surface sera chargee
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tol,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
REJECT1;
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta, TotMin, TotMax);
HLRAlgo::EnlargeMinMax(tol, TotMin, TotMax);
REJECT1(myDeca, TotMin, TotMax, mySurD, VertMin, VertMax);
HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||
((MaxVert2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinVert3) & 0x80008000) != 0 ||
((MaxVert3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinVert4) & 0x80008000) != 0 ||
((MaxVert4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinVert5) & 0x80008000) != 0 ||
((MaxVert5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinVert6) & 0x80008000) != 0 ||
((MaxVert6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinVert7) & 0x80008000) != 0 ||
((MaxVert7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinVert8) & 0x80008000) != 0) { //-- Rejection en Z
HLRAlgo::EncodeMinMax(VertMin, VertMax, MinMaxVert);
if (((iFaceMinMax->Max[0] - MinMaxVert.Min[0]) & 0x80008000) != 0 ||
((MinMaxVert.Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - MinMaxVert.Min[1]) & 0x80008000) != 0 ||
((MinMaxVert.Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - MinMaxVert.Min[2]) & 0x80008000) != 0 ||
((MinMaxVert.Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - MinMaxVert.Min[3]) & 0x80008000) != 0 ||
((MinMaxVert.Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - MinMaxVert.Min[4]) & 0x80008000) != 0 ||
((MinMaxVert.Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - MinMaxVert.Min[5]) & 0x80008000) != 0 ||
((MinMaxVert.Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - MinMaxVert.Min[6]) & 0x80008000) != 0 ||
((MinMaxVert.Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - MinMaxVert.Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
return state;
}
}
@@ -1894,71 +1764,55 @@ HLRBRep_Data::Classify (const Standard_Integer E,
//-- les rejections sont faites dans l intersecteur a moindre frais
//-- puisque la surface sera chargee
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tol,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta, TotMin, TotMax);
HLRAlgo::EnlargeMinMax(tol, TotMin, TotMax);
REJECT1;
REJECT1(myDeca, TotMin, TotMax, mySurD, VertMin, VertMax);
HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||
((MaxVert2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinVert3) & 0x80008000) != 0 ||
((MaxVert3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinVert4) & 0x80008000) != 0 ||
((MaxVert4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinVert5) & 0x80008000) != 0 ||
((MaxVert5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinVert6) & 0x80008000) != 0 ||
((MaxVert6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinVert7) & 0x80008000) != 0 ||
((MaxVert7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinVert8) & 0x80008000) != 0) { //-- Rejection en Z
HLRAlgo::EncodeMinMax(VertMin, VertMax, MinMaxVert);
if (((iFaceMinMax->Max[0] - MinMaxVert.Min[0]) & 0x80008000) != 0 ||
((MinMaxVert.Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - MinMaxVert.Min[1]) & 0x80008000) != 0 ||
((MinMaxVert.Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - MinMaxVert.Min[2]) & 0x80008000) != 0 ||
((MinMaxVert.Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - MinMaxVert.Min[3]) & 0x80008000) != 0 ||
((MinMaxVert.Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - MinMaxVert.Min[4]) & 0x80008000) != 0 ||
((MinMaxVert.Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - MinMaxVert.Min[5]) & 0x80008000) != 0 ||
((MinMaxVert.Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - MinMaxVert.Min[6]) & 0x80008000) != 0 ||
((MinMaxVert.Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - MinMaxVert.Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
return state;
}
end = EC.Parameter3d(EC.LastParameter());
myProj.Project(EC.Value3D(end),xend,yend,zend);
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::UpdateMinMax(xend,yend,zend,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tol,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
HLRAlgo::UpdateMinMax(xend,yend,zend, TotMin, TotMax);
HLRAlgo::EnlargeMinMax(tol, TotMin, TotMax);
REJECT1;
REJECT1(myDeca, TotMin, TotMax, mySurD, VertMin, VertMax);
HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||
((MaxVert2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinVert3) & 0x80008000) != 0 ||
((MaxVert3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinVert4) & 0x80008000) != 0 ||
((MaxVert4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinVert5) & 0x80008000) != 0 ||
((MaxVert5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinVert6) & 0x80008000) != 0 ||
((MaxVert6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinVert7) & 0x80008000) != 0 ||
((MaxVert7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinVert8) & 0x80008000) != 0) { //-- Rejection en Z
HLRAlgo::EncodeMinMax(VertMin, VertMax, MinMaxVert);
if (((iFaceMinMax->Max[0] - MinMaxVert.Min[0]) & 0x80008000) != 0 ||
((MinMaxVert.Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - MinMaxVert.Min[1]) & 0x80008000) != 0 ||
((MinMaxVert.Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - MinMaxVert.Min[2]) & 0x80008000) != 0 ||
((MinMaxVert.Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - MinMaxVert.Min[3]) & 0x80008000) != 0 ||
((MinMaxVert.Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - MinMaxVert.Min[4]) & 0x80008000) != 0 ||
((MinMaxVert.Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - MinMaxVert.Min[5]) & 0x80008000) != 0 ||
((MinMaxVert.Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - MinMaxVert.Min[6]) & 0x80008000) != 0 ||
((MinMaxVert.Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - MinMaxVert.Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
return state;
}
sta = 0.4 * sta + 0.6 * end; // dangerous if it is the middle
@@ -1966,20 +1820,12 @@ HLRBRep_Data::Classify (const Standard_Integer E,
//-- les rejections sont faites dans l intersecteur a moindre frais
//-- puisque la surface sera chargee
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tol,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
REJECT1;
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta, TotMin, TotMax);
HLRAlgo::EnlargeMinMax(tol, TotMin, TotMax);
REJECT1(myDeca, TotMin, TotMax, mySurD, VertMin, VertMax);
HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
HLRAlgo::EncodeMinMax(VertMin, VertMax, MinMaxVert);
/*
#ifdef OCCT_DEBUG
{
@@ -2022,21 +1868,21 @@ HLRBRep_Data::Classify (const Standard_Integer E,
#endif
*/
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||
((MaxVert2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinVert3) & 0x80008000) != 0 ||
((MaxVert3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinVert4) & 0x80008000) != 0 ||
((MaxVert4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinVert5) & 0x80008000) != 0 ||
((MaxVert5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinVert6) & 0x80008000) != 0 ||
((MaxVert6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinVert7) & 0x80008000) != 0 ||
((MaxVert7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinVert8) & 0x80008000) != 0) { //-- Rejection en Z
if (((iFaceMinMax->Max[0] - MinMaxVert.Min[0]) & 0x80008000) != 0 ||
((MinMaxVert.Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - MinMaxVert.Min[1]) & 0x80008000) != 0 ||
((MinMaxVert.Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - MinMaxVert.Min[2]) & 0x80008000) != 0 ||
((MinMaxVert.Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - MinMaxVert.Min[3]) & 0x80008000) != 0 ||
((MinMaxVert.Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - MinMaxVert.Min[4]) & 0x80008000) != 0 ||
((MinMaxVert.Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - MinMaxVert.Min[5]) & 0x80008000) != 0 ||
((MinMaxVert.Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - MinMaxVert.Min[6]) & 0x80008000) != 0 ||
((MinMaxVert.Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - MinMaxVert.Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
return state;
}
}
@@ -2124,7 +1970,7 @@ TopAbs_State HLRBRep_Data::SimplClassify (const Standard_Integer /*E*/,
const Standard_Real p2)
{
nbClassification++;
Standard_Integer VertMin[16],VertMax[16],MinMaxVert[16];
HLRAlgo_EdgesBlock::MinMaxIndices VertMin, VertMax, MinMaxVert;
Standard_Real TotMin[16],TotMax[16];
Standard_Integer i;
@@ -2141,35 +1987,27 @@ TopAbs_State HLRBRep_Data::SimplClassify (const Standard_Integer /*E*/,
//-- les rejections sont faites dans l intersecteur a moindre frais
//-- puisque la surface sera chargee
HLRAlgo::InitMinMax(Precision::Infinite(),
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
HLRAlgo::EnlargeMinMax(tol,
(Standard_Address)TotMin,
(Standard_Address)TotMax);
REJECT1;
HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax);
HLRAlgo::UpdateMinMax(xsta,ysta,zsta, TotMin, TotMax);
HLRAlgo::EnlargeMinMax(tol, TotMin, TotMax);
REJECT1(myDeca, TotMin, TotMax, mySurD, VertMin, VertMax);
HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||
((MaxVert2 - MinFace2) & 0x80008000) != 0 ||
((MaxFace3 - MinVert3) & 0x80008000) != 0 ||
((MaxVert3 - MinFace3) & 0x80008000) != 0 ||
((MaxFace4 - MinVert4) & 0x80008000) != 0 ||
((MaxVert4 - MinFace4) & 0x80008000) != 0 ||
((MaxFace5 - MinVert5) & 0x80008000) != 0 ||
((MaxVert5 - MinFace5) & 0x80008000) != 0 ||
((MaxFace6 - MinVert6) & 0x80008000) != 0 ||
((MaxVert6 - MinFace6) & 0x80008000) != 0 ||
((MaxFace7 - MinVert7) & 0x80008000) != 0 ||
((MaxVert7 - MinFace7) & 0x80008000) != 0 ||
((MaxFace8 - MinVert8) & 0x80008000) != 0) { //-- Rejection en Z
HLRAlgo::EncodeMinMax(VertMin, VertMax, MinMaxVert);
if (((iFaceMinMax->Max[0] - MinMaxVert.Min[0]) & 0x80008000) != 0 ||
((MinMaxVert.Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[1] - MinMaxVert.Min[1]) & 0x80008000) != 0 ||
((MinMaxVert.Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[2] - MinMaxVert.Min[2]) & 0x80008000) != 0 ||
((MinMaxVert.Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[3] - MinMaxVert.Min[3]) & 0x80008000) != 0 ||
((MinMaxVert.Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[4] - MinMaxVert.Min[4]) & 0x80008000) != 0 ||
((MinMaxVert.Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[5] - MinMaxVert.Min[5]) & 0x80008000) != 0 ||
((MinMaxVert.Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[6] - MinMaxVert.Min[6]) & 0x80008000) != 0 ||
((MinMaxVert.Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
((iFaceMinMax->Max[7] - MinMaxVert.Min[7]) & 0x80008000) != 0) { //-- Rejection en Z
return TopAbs_OUT;
}
}

View File

@@ -50,6 +50,7 @@ class gp_Dir2d;
class HLRBRep_EdgeData;
class HLRBRep_FaceData;
class IntRes2d_IntersectionPoint;
class TableauRejection;
class HLRBRep_Data;
@@ -99,7 +100,7 @@ public:
TopTools_IndexedMapOfShape& FaceMap();
//! to compare with only non rejected edges.
Standard_EXPORT void InitBoundSort (const Standard_Address 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>.
@@ -228,9 +229,9 @@ private:
HLRBRep_FaceIterator myFaceItr1;
HLRBRep_FaceIterator myFaceItr2;
Standard_Integer iFace;
Standard_Address iFaceData;
HLRBRep_FaceData* iFaceData;
Standard_Address iFaceGeom;
Standard_Address iFaceMinMax;
HLRAlgo_EdgesBlock::MinMaxIndices* iFaceMinMax;
GeomAbs_SurfaceType iFaceType;
Standard_Boolean iFaceBack;
Standard_Boolean iFaceSimp;
@@ -246,9 +247,9 @@ private:
Standard_Boolean myLEInternal;
Standard_Boolean myLEDouble;
Standard_Boolean myLEIsoLine;
Standard_Address myLEData;
Standard_Address myLEGeom;
Standard_Address myLEMinMax;
HLRBRep_EdgeData* myLEData;
const HLRBRep_Curve* myLEGeom;
HLRAlgo_EdgesBlock::MinMaxIndices* myLEMinMax;
GeomAbs_CurveType myLEType;
Standard_ShortReal myLETol;
Standard_Integer myFE;
@@ -256,8 +257,8 @@ private:
Standard_Boolean myFEOutLine;
Standard_Boolean myFEInternal;
Standard_Boolean myFEDouble;
Standard_Address myFEData;
Standard_Address myFEGeom;
HLRBRep_EdgeData* myFEData;
HLRBRep_Curve* myFEGeom;
GeomAbs_CurveType myFEType;
Standard_ShortReal myFETol;
HLRBRep_Intersector myIntersector;
@@ -269,7 +270,7 @@ private:
Standard_Integer iInterf;
HLRAlgo_Interference myIntf;
Standard_Boolean myAboveIntf;
Standard_Address myReject;
TableauRejection* myReject;
};

View File

@@ -21,15 +21,6 @@
#include <HLRBRep_EdgeData.hxx>
#include <TopoDS_Edge.hxx>
//=======================================================================
//function : EdgeData
//purpose :
//=======================================================================
HLRBRep_EdgeData::HLRBRep_EdgeData () :
myFlags(0),
myHideCount(0)
{ Selected(Standard_True); }
//=======================================================================
//function : Set
//purpose :
@@ -66,28 +57,3 @@ void HLRBRep_EdgeData::Set (const Standard_Boolean Rg1L,
End ,(Standard_ShortReal)(ChangeGeometry().Curve().Resolution
((Standard_Real)TolEnd )));
}
//=======================================================================
//function : UpdateMinMax
//purpose :
//=======================================================================
void HLRBRep_EdgeData::UpdateMinMax (const Standard_Address TotMinMax)
{
myMinMax[ 0] = ((Standard_Integer*)TotMinMax)[ 0];
myMinMax[ 1] = ((Standard_Integer*)TotMinMax)[ 1];
myMinMax[ 2] = ((Standard_Integer*)TotMinMax)[ 2];
myMinMax[ 3] = ((Standard_Integer*)TotMinMax)[ 3];
myMinMax[ 4] = ((Standard_Integer*)TotMinMax)[ 4];
myMinMax[ 5] = ((Standard_Integer*)TotMinMax)[ 5];
myMinMax[ 6] = ((Standard_Integer*)TotMinMax)[ 6];
myMinMax[ 7] = ((Standard_Integer*)TotMinMax)[ 7];
myMinMax[ 8] = ((Standard_Integer*)TotMinMax)[ 8];
myMinMax[ 9] = ((Standard_Integer*)TotMinMax)[ 9];
myMinMax[10] = ((Standard_Integer*)TotMinMax)[10];
myMinMax[11] = ((Standard_Integer*)TotMinMax)[11];
myMinMax[12] = ((Standard_Integer*)TotMinMax)[12];
myMinMax[13] = ((Standard_Integer*)TotMinMax)[13];
myMinMax[14] = ((Standard_Integer*)TotMinMax)[14];
myMinMax[15] = ((Standard_Integer*)TotMinMax)[15];
}

View File

@@ -17,6 +17,8 @@
#ifndef _HLRBRep_EdgeData_HeaderFile
#define _HLRBRep_EdgeData_HeaderFile
#include <HLRAlgo_WiresBlock.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
@@ -27,7 +29,6 @@
#include <HLRBRep_Curve.hxx>
#include <Standard_ShortReal.hxx>
#include <Standard_Real.hxx>
#include <Standard_Address.hxx>
class TopoDS_Edge;
class HLRAlgo_EdgeStatus;
class HLRBRep_Curve;
@@ -40,9 +41,13 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT HLRBRep_EdgeData();
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;
@@ -109,9 +114,15 @@ public:
void VEnd (const Standard_Integer I);
Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax);
void UpdateMinMax (const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
{
myMinMax = theTotMinMax;
}
Standard_Address MinMax() const;
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax()
{
return myMinMax;
}
HLRAlgo_EdgeStatus& Status();
@@ -119,8 +130,11 @@ public:
const HLRBRep_Curve& Geometry() const;
Standard_Address Curve();
HLRBRep_Curve* Curve()
{
return &myGeometry;
}
Standard_ShortReal Tolerance() const;
protected:
@@ -148,7 +162,7 @@ private:
Standard_Integer myHideCount;
Standard_Integer myVSta;
Standard_Integer myVEnd;
Standard_Integer myMinMax[16];
HLRAlgo_EdgesBlock::MinMaxIndices myMinMax;
HLRAlgo_EdgeStatus myStatus;
HLRBRep_Curve myGeometry;
Standard_ShortReal myTolerance;

View File

@@ -310,14 +310,6 @@ inline Standard_Integer HLRBRep_EdgeData::VEnd () const
inline void HLRBRep_EdgeData::VEnd (const Standard_Integer I)
{ myVEnd = I; }
//=======================================================================
//function : MinMax
//purpose :
//=======================================================================
inline Standard_Address HLRBRep_EdgeData::MinMax () const
{ return (Standard_Address)&myMinMax; }
//=======================================================================
//function : Status
//purpose :
@@ -342,14 +334,6 @@ inline HLRBRep_Curve & HLRBRep_EdgeData::ChangeGeometry ()
inline const HLRBRep_Curve & HLRBRep_EdgeData::Geometry () const
{ return myGeometry; }
//=======================================================================
//function : Curve
//purpose :
//=======================================================================
inline Standard_Address HLRBRep_EdgeData::Curve ()
{ return ((Standard_Address)&myGeometry); }
//=======================================================================
//function : Tolerance
//purpose :

View File

@@ -44,40 +44,6 @@ extern Standard_Integer nbCal3Intersection; // curve-surface intersections
static Standard_Integer TRACE = Standard_True;
static Standard_Integer TRACE10 = Standard_True;
#define MinShBI1 MinMaxShBI[ 0]
#define MinShBI2 MinMaxShBI[ 1]
#define MinShBI3 MinMaxShBI[ 2]
#define MinShBI4 MinMaxShBI[ 3]
#define MinShBI5 MinMaxShBI[ 4]
#define MinShBI6 MinMaxShBI[ 5]
#define MinShBI7 MinMaxShBI[ 6]
#define MinShBI8 MinMaxShBI[ 7]
#define MaxShBI1 MinMaxShBI[ 8]
#define MaxShBI2 MinMaxShBI[ 9]
#define MaxShBI3 MinMaxShBI[10]
#define MaxShBI4 MinMaxShBI[11]
#define MaxShBI5 MinMaxShBI[12]
#define MaxShBI6 MinMaxShBI[13]
#define MaxShBI7 MinMaxShBI[14]
#define MaxShBI8 MinMaxShBI[15]
#define MinShBJ1 MinMaxShBJ[ 0]
#define MinShBJ2 MinMaxShBJ[ 1]
#define MinShBJ3 MinMaxShBJ[ 2]
#define MinShBJ4 MinMaxShBJ[ 3]
#define MinShBJ5 MinMaxShBJ[ 4]
#define MinShBJ6 MinMaxShBJ[ 5]
#define MinShBJ7 MinMaxShBJ[ 6]
#define MinShBJ8 MinMaxShBJ[ 7]
#define MaxShBJ1 MinMaxShBJ[ 8]
#define MaxShBJ2 MinMaxShBJ[ 9]
#define MaxShBJ3 MinMaxShBJ[10]
#define MaxShBJ4 MinMaxShBJ[11]
#define MaxShBJ5 MinMaxShBJ[12]
#define MaxShBJ6 MinMaxShBJ[13]
#define MaxShBJ7 MinMaxShBJ[14]
#define MaxShBJ8 MinMaxShBJ[15]
//=======================================================================
//function : HLRBRep_InternalAlgo
//purpose :
@@ -188,8 +154,8 @@ void HLRBRep_InternalAlgo::Update ()
myDS->Update(myProj);
Standard_Integer ShapMin[16],ShapMax[16],MinMaxShap[16];
Standard_Integer TheMin[16],TheMax[16];
HLRAlgo_EdgesBlock::MinMaxIndices ShapMin, ShapMax, MinMaxShap;
HLRAlgo_EdgesBlock::MinMaxIndices TheMin, TheMax;
HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray();
HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray();
@@ -201,37 +167,22 @@ void HLRBRep_InternalAlgo::Update ()
for (Standard_Integer e = e1; e <= e2; e++) {
HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
HLRAlgo::DecodeMinMax(ed.MinMax(),
(Standard_Address)TheMin,
(Standard_Address)TheMax);
HLRAlgo::DecodeMinMax(ed.MinMax(), TheMin, TheMax);
if (FirstTime) {
FirstTime = Standard_False;
HLRAlgo::CopyMinMax((Standard_Address)TheMin,
(Standard_Address)TheMax,
(Standard_Address)ShapMin,
(Standard_Address)ShapMax);
HLRAlgo::CopyMinMax(TheMin, TheMax, ShapMin, ShapMax);
}
else
HLRAlgo::AddMinMax((Standard_Address)TheMin,
(Standard_Address)TheMax,
(Standard_Address)ShapMin,
(Standard_Address)ShapMax);
HLRAlgo::AddMinMax(TheMin, TheMax, ShapMin, ShapMax);
}
for (Standard_Integer f = f1; f <= f2; f++) {
HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f);
HLRAlgo::DecodeMinMax(fd.Wires()->MinMax(),
(Standard_Address)TheMin,
(Standard_Address)TheMax);
HLRAlgo::AddMinMax((Standard_Address)TheMin,
(Standard_Address)TheMax,
(Standard_Address)ShapMin,
(Standard_Address)ShapMax);
HLRAlgo::DecodeMinMax(fd.Wires()->MinMax(), TheMin, TheMax);
HLRAlgo::AddMinMax(TheMin, TheMax, ShapMin, ShapMax);
}
HLRAlgo::EncodeMinMax((Standard_Address)ShapMin,
(Standard_Address)ShapMax,
(Standard_Address)MinMaxShap);
SB.UpdateMinMax((Standard_Address)MinMaxShap);
HLRAlgo::EncodeMinMax(ShapMin, ShapMax, MinMaxShap);
SB.UpdateMinMax(MinMaxShap);
}
}
}
@@ -676,24 +627,22 @@ void HLRBRep_InternalAlgo::Hide (const Standard_Integer I,
if (I == J) Hide(I);
else {
Standard_Integer* MinMaxShBI =
(Standard_Integer*)myShapes(I).MinMax();
Standard_Integer* MinMaxShBJ =
(Standard_Integer*)myShapes(J).MinMax();
if (((MaxShBJ1 - MinShBI1) & 0x80008000) == 0 &&
((MaxShBI1 - MinShBJ1) & 0x80008000) == 0 &&
((MaxShBJ2 - MinShBI2) & 0x80008000) == 0 &&
((MaxShBI2 - MinShBJ2) & 0x80008000) == 0 &&
((MaxShBJ3 - MinShBI3) & 0x80008000) == 0 &&
((MaxShBI3 - MinShBJ3) & 0x80008000) == 0 &&
((MaxShBJ4 - MinShBI4) & 0x80008000) == 0 &&
((MaxShBI4 - MinShBJ4) & 0x80008000) == 0 &&
((MaxShBJ5 - MinShBI5) & 0x80008000) == 0 &&
((MaxShBI5 - MinShBJ5) & 0x80008000) == 0 &&
((MaxShBJ6 - MinShBI6) & 0x80008000) == 0 &&
((MaxShBI6 - MinShBJ6) & 0x80008000) == 0 &&
((MaxShBJ7 - MinShBI7) & 0x80008000) == 0 &&
((MaxShBJ8 - MinShBI8) & 0x80008000) == 0) {
HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxShBI = &myShapes(I).MinMax();
HLRAlgo_EdgesBlock::MinMaxIndices* MinMaxShBJ = &myShapes(J).MinMax();
if (((MinMaxShBJ->Max[0] - MinMaxShBI->Min[0]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[0] - MinMaxShBJ->Min[0]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[1] - MinMaxShBI->Min[1]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[1] - MinMaxShBJ->Min[1]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[2] - MinMaxShBI->Min[2]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[2] - MinMaxShBJ->Min[2]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[3] - MinMaxShBI->Min[3]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[3] - MinMaxShBJ->Min[3]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[4] - MinMaxShBI->Min[4]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[4] - MinMaxShBJ->Min[4]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[5] - MinMaxShBI->Min[5]) & 0x80008000) == 0 &&
((MinMaxShBI->Max[5] - MinMaxShBJ->Min[5]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[6] - MinMaxShBI->Min[6]) & 0x80008000) == 0 &&
((MinMaxShBJ->Max[7] - MinMaxShBI->Min[7]) & 0x80008000) == 0) {
if (myDebug) {
cout << " hiding the shape " << I;
cout << " by the shape : " << J << endl;

View File

@@ -40,9 +40,9 @@
#include <StdFail_UndefinedDerivative.hxx>
#include <stdio.h>
#define PERF 0
//#define PERF
#if PERF
#ifdef PERF
static Standard_Integer NbIntersCS=0;
static Standard_Integer NbIntersCSVides=0;
static Standard_Integer NbIntersAuto=0;
@@ -64,7 +64,7 @@ static Standard_Integer NbIntersSimulate=0;
HLRBRep_Intersector::HLRBRep_Intersector () :
myPolyhedron(NULL)
{
#if PERF
#ifdef PERF
if(NbInters) {
printf("\n--------------------------------------");
printf("\nNbIntersSimulate : %6d",NbIntersSimulate);
@@ -99,7 +99,7 @@ void HLRBRep_Intersector::Perform (const Standard_Address A1,
const Standard_Real da1,
const Standard_Real db1)
{
#if PERF
#ifdef PERF
NbIntersAuto++;
#endif
@@ -361,7 +361,7 @@ void HLRBRep_Intersector::Perform (const Standard_Integer /*nA*/,
#if PERF
#ifdef PERF
NbInters++;
if(myIntersector.NbPoints()==1) {
if(myIntersector.NbSegments()==0) {
@@ -402,7 +402,7 @@ void HLRBRep_Intersector::SimulateOnePoint(const Standard_Address A1,
const Standard_Real u,
const Standard_Address A2,
const Standard_Real v) {
#if PERF
#ifdef PERF
NbIntersSimulate++;
#endif
Standard_Address myC1 = ((HLRBRep_EdgeData*) A1)->Curve();
@@ -435,7 +435,7 @@ void HLRBRep_Intersector::Load (Standard_Address& A)
{
mySurface = A;
if (myPolyhedron != NULL) {
delete (HLRBRep_ThePolyhedronOfInterCSurf*)myPolyhedron;
delete myPolyhedron;
myPolyhedron = NULL;
}
}
@@ -469,13 +469,11 @@ void HLRBRep_Intersector::Perform (const gp_Lin& L,
v2 = HLRBRep_SurfaceTool::LastVParameter(mySurface);
nbsu = HLRBRep_SurfaceTool::NbSamplesU(mySurface,u1,u2);
nbsv = HLRBRep_SurfaceTool::NbSamplesV(mySurface,v1,v2);
myPolyhedron = (Standard_Address)
(new HLRBRep_ThePolyhedronOfInterCSurf
(mySurface,nbsu,nbsv,u1,v1,u2,v2));
myPolyhedron =
new HLRBRep_ThePolyhedronOfInterCSurf(mySurface,nbsu,nbsv,u1,v1,u2,v2);
}
Standard_Real x0,y0,z0,x1,y1,z1,pmin,pmax;//,pp;
((HLRBRep_ThePolyhedronOfInterCSurf*)myPolyhedron)
->Bounding().Get(x0,y0,z0,x1,y1,z1);
myPolyhedron->Bounding().Get(x0,y0,z0,x1,y1,z1);
#if 0
pmax = pmin = ElCLib::Parameter(L, gp_Pnt((x1+x0)*0.5,
(y1+y0)*0.5,
@@ -520,7 +518,7 @@ void HLRBRep_Intersector::Perform (const gp_Lin& L,
}
}
#if PERF
#ifdef PERF
NbIntersCS++;
if(myCSIntersector.NbPoints()==0) {
NbIntersCSVides++;
@@ -631,7 +629,7 @@ HLRBRep_Intersector::CSSegment (const Standard_Integer N) const
void HLRBRep_Intersector::Destroy ()
{
if (myPolyhedron != NULL)
delete (HLRBRep_ThePolyhedronOfInterCSurf *)myPolyhedron;
delete myPolyhedron;
}
@@ -725,7 +723,7 @@ void HLRBRep_Intersector::Perform (const Standard_Integer nA,
#if PERF
#ifdef PERF
NbInters++;
if(myIntersector.NbPoints()==1) {
if(myIntersector.NbSegments()==0) {

View File

@@ -106,7 +106,7 @@ private:
HLRBRep_CInter myIntersector;
HLRBRep_InterCSurf myCSIntersector;
Standard_Address mySurface;
Standard_Address myPolyhedron;
HLRBRep_ThePolyhedronOfInterCSurf* myPolyhedron;
};

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,11 @@
#ifndef _HLRBRep_PolyAlgo_HeaderFile
#define _HLRBRep_PolyAlgo_HeaderFile
#include <HLRAlgo_PolyInternalNode.hxx>
#include <HLRAlgo_Array1OfTData.hxx>
#include <HLRAlgo_Array1OfPISeg.hxx>
#include <HLRAlgo_Array1OfPINod.hxx>
#include <Standard.hxx>
#include <Standard_Type.hxx>
@@ -33,10 +38,10 @@
#include <TColStd_Array1OfTransient.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Standard_Address.hxx>
#include <HLRAlgo_ListOfBPoint.hxx>
#include <TopTools_ListOfShape.hxx>
#include <GeomAbs_Shape.hxx>
class HLRAlgo_PolyAlgo;
class Geom_Surface;
class Standard_OutOfRange;
@@ -45,6 +50,7 @@ class HLRAlgo_Projector;
class TopoDS_Edge;
class HLRAlgo_PolyInternalData;
class HLRAlgo_EdgeStatus;
struct HLRAlgo_TriangleData;
class HLRBRep_PolyAlgo;
@@ -163,7 +169,13 @@ public:
void NextHide();
Standard_EXPORT void Hide (Standard_Address& Coordinates, 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();
@@ -171,7 +183,7 @@ public:
void NextShow();
Standard_EXPORT void Show (Standard_Address& Coordinates, 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.
@@ -200,45 +212,50 @@ private:
Standard_EXPORT void StoreShell (const TopoDS_Shape& Shape, Standard_Integer& iShell, TColStd_Array1OfTransient& Shell, const Standard_Boolean IsoledF, const Standard_Boolean IsoledE, TColStd_Array1OfInteger& ES, TColStd_Array1OfTransient& PD, TColStd_Array1OfTransient& PID, TopTools_MapOfShape& ShapeMap1, TopTools_MapOfShape& ShapeMap2);
Standard_EXPORT Standard_Boolean Normal (const Standard_Integer iNode, const Standard_Address Nod1Indices, const Standard_Address Nod1RValues, Standard_Address& TData, Standard_Address& PISeg, Standard_Address& PINod, const Standard_Boolean orient) const;
Standard_EXPORT Standard_Boolean Normal (const Standard_Integer iNode, HLRAlgo_PolyInternalNode::NodeIndices& theNodIndices, HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_Array1OfTData*& TData, HLRAlgo_Array1OfPISeg*& PISeg, HLRAlgo_Array1OfPINod*& PINod, const Standard_Boolean orient) const;
Standard_EXPORT Standard_Boolean AverageNormal (const Standard_Integer iNode, const Standard_Address Nod1Indices, Standard_Address& TData, Standard_Address& PISeg, Standard_Address& PINod, Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const;
Standard_EXPORT void AddNormalOnTriangle (const Standard_Integer iTri, const Standard_Integer iNode, Standard_Integer& jNode, Standard_Address& TData, Standard_Address& PINod, Standard_Real& X, Standard_Real& Y, Standard_Real& Z, Standard_Boolean& OK) const;
Standard_EXPORT Standard_Boolean AverageNormal (const Standard_Integer iNode, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices, HLRAlgo_Array1OfTData*& TData, HLRAlgo_Array1OfPISeg*& PISeg, HLRAlgo_Array1OfPINod*& PINod, Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const;
Standard_Boolean AverageNormal (const Standard_Integer iNode, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices, HLRAlgo_Array1OfTData*& TData, HLRAlgo_Array1OfPISeg*& PISeg, HLRAlgo_Array1OfPINod*& PINod, gp_XYZ& theNormal) const
{
return AverageNormal (iNode, theNodeIndices, TData, PISeg, PINod, theNormal.ChangeCoord(1), theNormal.ChangeCoord(2), theNormal.ChangeCoord(3));
}
Standard_EXPORT void AddNormalOnTriangle (const Standard_Integer iTri, const Standard_Integer iNode, Standard_Integer& jNode, HLRAlgo_Array1OfTData*& TData, HLRAlgo_Array1OfPINod*& PINod, Standard_Real& X, Standard_Real& Y, Standard_Real& Z, Standard_Boolean& OK) const;
Standard_EXPORT void InitBiPointsWithConnexity (const Standard_Integer e, TopoDS_Edge& E, HLRAlgo_ListOfBPoint& List, TColStd_Array1OfTransient& PID, TopTools_ListOfShape& LS, const Standard_Boolean connex);
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, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& 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, 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, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2) 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, const Standard_Address Nod1RValues, const Standard_Address 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 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, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& 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, 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, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& 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_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, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& 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 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 InsertOnOutLine (TColStd_Array1OfTransient& PID);
Standard_EXPORT void CheckFrBackTriangles (HLRAlgo_ListOfBPoint& List, TColStd_Array1OfTransient& PID);
Standard_EXPORT void FindEdgeOnTriangle (const Standard_Address Tri1Indices, const Standard_Integer ip1, const Standard_Integer ip2, Standard_Integer& jtrouv, Standard_Boolean& isDirect) 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 ChangeNode (const Standard_Integer ip1, const Standard_Integer ip2, const Standard_Address Nod1Indices, const Standard_Address Nod1RValues, const Standard_Address Nod2Indices, const Standard_Address Nod2RValues, const Standard_Real coef1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Boolean first, Standard_Address& TData, Standard_Address& PISeg, Standard_Address& PINod) const;
Standard_EXPORT void ChangeNode (const Standard_Integer ip1, const Standard_Integer ip2, HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices, HLRAlgo_PolyInternalNode::NodeData& Nod1RValues, HLRAlgo_PolyInternalNode::NodeIndices& Nod2Indices, HLRAlgo_PolyInternalNode::NodeData& Nod2RValues, const Standard_Real coef1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Boolean first, HLRAlgo_Array1OfTData*& TData, HLRAlgo_Array1OfPISeg*& PISeg, HLRAlgo_Array1OfPINod*& PINod) const;
Standard_EXPORT void UpdateAroundNode (const Standard_Integer iNode, const Standard_Address Nod1Indices, const Standard_Address TData, const Standard_Address PISeg, const Standard_Address PINod) const;
Standard_EXPORT void UpdateAroundNode (const Standard_Integer iNode, HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices, HLRAlgo_Array1OfTData* TData, HLRAlgo_Array1OfPISeg* PISeg, HLRAlgo_Array1OfPINod* PINod) const;
Standard_EXPORT void OrientTriangle (const Standard_Integer iTri, const Standard_Address Tri1Indices, const Standard_Address Nod1Indices, const Standard_Address Nod1RValues, const Standard_Address Nod2Indices, const Standard_Address Nod2RValues, const Standard_Address Nod3Indices, const Standard_Address Nod3RValues) 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, const Standard_Address Nod1Indices, Standard_Address& PISeg, Standard_Integer& iTri1, Standard_Integer& iTri2) 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 (const Standard_Address Nod1RValues, const Standard_Address Nod2RValues, Standard_Real& coef1, Standard_Boolean& moveP1) 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 (const Standard_Address Nod1RValues, const Standard_Address Nod2RValues, const Standard_Real coef1, Standard_Real& U3, Standard_Real& V3) 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 (const Standard_Address Nod1Indices, const Standard_Address Nod1RValues, const Standard_Address Nod2Indices, const Standard_Address Nod2RValues) 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& List, TColStd_Array1OfTransient& PID);
@@ -247,11 +264,26 @@ private:
Standard_EXPORT void UpdatePolyData (TColStd_Array1OfTransient& PD, TColStd_Array1OfTransient& PID, const Standard_Boolean closed);
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);
}
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
{
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;
void TIMultiply (gp_XYZ& thePoint, const Standard_Boolean VecPartOnly = Standard_False) const
{
TIMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly);
}
HLRAlgo_Projector myProj;
Standard_Real TMat[3][3];
Standard_Real TLoc[3];

View File

@@ -29,13 +29,6 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
#define PntX1 ((Standard_Real*)Coordinates)[0]
#define PntY1 ((Standard_Real*)Coordinates)[1]
#define PntZ1 ((Standard_Real*)Coordinates)[2]
#define PntX2 ((Standard_Real*)Coordinates)[3]
#define PntY2 ((Standard_Real*)Coordinates)[4]
#define PntZ2 ((Standard_Real*)Coordinates)[5]
//=======================================================================
//function : HLRBRep_PolyHLRToShape
//purpose :
@@ -53,7 +46,7 @@ void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A)
{
myAlgo = A;
myHideMode = Standard_True;
Standard_Real sta,end,XSta,YSta,ZSta,XEnd,YEnd,ZEnd,dx,dy;
Standard_Real sta,end;
Standard_ShortReal tolsta,tolend;
HLRAlgo_EdgeIterator It;
myBiPntVis.Clear();
@@ -62,21 +55,17 @@ void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A)
Standard_Boolean reg1,regn,outl,intl;
const gp_Trsf& T = myAlgo->Projector().Transformation();
HLRAlgo_EdgeStatus status;
Standard_Address Coordinates;
for (myAlgo->InitHide(); myAlgo->MoreHide(); myAlgo->NextHide()) {
myAlgo->Hide(Coordinates,status,S,reg1,regn,outl,intl);
XSta = PntX1;
YSta = PntY1;
ZSta = PntZ1;
XEnd = PntX2;
YEnd = PntY2;
ZEnd = PntZ2;
T.Transforms(XSta,YSta,ZSta);
T.Transforms(XEnd,YEnd,ZEnd);
dx = XEnd - XSta;
dy = YEnd - YSta;
if (sqrt(dx * dx + dy * dy) > 1.e-10) {
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();
@@ -84,8 +73,7 @@ void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A)
It.Visible(sta,tolsta,end,tolend);
myBiPntVis.Append
(HLRBRep_BiPnt2D
(XSta + sta * dx,YSta + sta * dy,
XSta + end * dx,YSta + end * dy,
(aSta2D + sta * aD, aSta2D + end * aD,
S,reg1,regn,outl,intl));
}
@@ -95,8 +83,7 @@ void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A)
It.Hidden(sta,tolsta,end,tolend);
myBiPntHid.Append
(HLRBRep_BiPnt2D
(XSta + sta * dx,YSta + sta * dy,
XSta + end * dx,YSta + end * dy,
(aSta2D + sta * aD, aSta2D + end * aD,
S,reg1,regn,outl,intl));
}
}
@@ -153,11 +140,9 @@ HLRBRep_PolyHLRToShape::InternalCompound (const Standard_Integer typ,
else {
const gp_Trsf& T = myAlgo->Projector().Transformation();
TopoDS_Shape SBP;
Standard_Real XSta,YSta,ZSta,XEnd,YEnd,ZEnd,dx,dy;
Standard_Address Coordinates;
for (myAlgo->InitShow(); myAlgo->MoreShow(); myAlgo->NextShow()) {
myAlgo->Show(Coordinates,SBP,reg1,regn,outl,intl);
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;
@@ -165,19 +150,14 @@ HLRBRep_PolyHLRToShape::InternalCompound (const Standard_Integer typ,
if (todraw)
if (!S.IsNull()) todraw = Map.Contains(SBP);
if (todraw) {
XSta = PntX1;
YSta = PntY1;
ZSta = PntZ1;
XEnd = PntX2;
YEnd = PntY2;
ZEnd = PntZ2;
T.Transforms(XSta,YSta,ZSta);
T.Transforms(XEnd,YEnd,ZEnd);
dx = XEnd - XSta;
dy = YEnd - YSta;
if (sqrt(dx * dx + dy * dy) > 1.e-10) {
B.Add(Result,BRepLib_MakeEdge2d(gp_Pnt2d(XSta,YSta),
gp_Pnt2d(XEnd,YEnd)));
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.Modulus() > 1.e-10) {
B.Add(Result,BRepLib_MakeEdge2d(aSta2D, aEnd2D));
added = Standard_True;
}
}

View File

@@ -112,14 +112,3 @@ void HLRBRep_ShapeBounds::Bounds (Standard_Integer& V1,
F1 = myFaceStart;
F2 = myFaceEnd;
}
//=======================================================================
//function : UpdateMinMax
//purpose :
//=======================================================================
void HLRBRep_ShapeBounds::UpdateMinMax (const Standard_Address TotMinMax)
{
for (Standard_Integer i = 0; i <= 15; i++)
myMinMax[i] = ((Standard_Integer*)TotMinMax)[i];
}

View File

@@ -17,12 +17,13 @@
#ifndef _HLRBRep_ShapeBounds_HeaderFile
#define _HLRBRep_ShapeBounds_HeaderFile
#include <HLRAlgo_EdgesBlock.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Address.hxx>
class HLRTopoBRep_OutLiner;
class MMgt_TShared;
@@ -60,9 +61,15 @@ public:
Standard_EXPORT void Bounds (Standard_Integer& V1, Standard_Integer& V2, Standard_Integer& E1, Standard_Integer& E2, Standard_Integer& F1, Standard_Integer& F2) const;
Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax);
void UpdateMinMax (const HLRAlgo_EdgesBlock::MinMaxIndices& theTotMinMax)
{
myMinMax = theTotMinMax;
}
Standard_Address MinMax() const;
HLRAlgo_EdgesBlock::MinMaxIndices& MinMax()
{
return myMinMax;
}
@@ -86,7 +93,7 @@ private:
Standard_Integer myEdgeEnd;
Standard_Integer myFaceStart;
Standard_Integer myFaceEnd;
Standard_Integer myMinMax[16];
HLRAlgo_EdgesBlock::MinMaxIndices myMinMax;
};

View File

@@ -72,11 +72,3 @@ inline void HLRBRep_ShapeBounds::NbOfIso (const Standard_Integer nbIso)
inline Standard_Integer HLRBRep_ShapeBounds::NbOfIso () const
{ return myNbIso; }
//=======================================================================
//function : MinMax
//purpose :
//=======================================================================
inline Standard_Address HLRBRep_ShapeBounds::MinMax () const
{ return (Standard_Address)&myMinMax; }

View File

@@ -93,7 +93,7 @@ HLRBRep_Surface::SideRowsOfPoles (const Standard_Real tol,
Standard_Real x0,y0,x,y,z;
Standard_Boolean result;
Standard_Real tole = (Standard_Real)tol;
const gp_Trsf& T = ((HLRAlgo_Projector*) myProj)->Transformation();
const gp_Trsf& T = myProj->Transformation();
for (iu = 1; iu <= nbuPoles; iu++) {
@@ -160,34 +160,34 @@ HLRBRep_Surface::IsSide (const Standard_Real tolF,
gp_Ax1 A = Pl.Axis();
Pt = A.Location();
D = A.Direction();
Pt.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
D .Transform(((HLRAlgo_Projector*) myProj)->Transformation());
if (((HLRAlgo_Projector*) myProj)->Perspective()) {
r = D.Z() * ((HLRAlgo_Projector*) myProj)->Focus() -
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() );
}
else r= D.Z();
return Abs(r) < toler;
}
else if (myType == GeomAbs_Cylinder) {
if (((HLRAlgo_Projector*) myProj)->Perspective()) return Standard_False;
if (myProj->Perspective()) return Standard_False;
gp_Cylinder Cyl = HLRBRep_BSurfaceTool::Cylinder(mySurf);
gp_Ax1 A = Cyl.Axis();
D = A.Direction();
D .Transform(((HLRAlgo_Projector*) myProj)->Transformation());
D .Transform(myProj->Transformation());
r = Sqrt(D.X() * D.X() + D.Y() * D.Y());
return r < toler;
}
else if (myType == GeomAbs_Cone) {
if (!((HLRAlgo_Projector*) myProj)->Perspective()) return Standard_False;
if (!myProj->Perspective()) return Standard_False;
gp_Cone Con = HLRBRep_BSurfaceTool::Cone(mySurf);
Pt = Con.Apex();
Pt.Transform(((HLRAlgo_Projector*) myProj)->Transformation());
Pt.Transform(myProj->Transformation());
Standard_Real tol = 0.001;
return Pt.IsEqual(gp_Pnt(0,0,((HLRAlgo_Projector*) myProj)->Focus()),tol);
return Pt.IsEqual(gp_Pnt(0,0,myProj->Focus()),tol);
}
else if (myType == GeomAbs_BezierSurface) {
if (((HLRAlgo_Projector*) myProj)->Perspective()) return Standard_False;
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);
@@ -195,7 +195,7 @@ HLRBRep_Surface::IsSide (const Standard_Real tolF,
return SideRowsOfPoles (tolF,nu,nv,Pnt);
}
else if (myType == GeomAbs_BSplineSurface) {
if (((HLRAlgo_Projector*) myProj)->Perspective()) return Standard_False;
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);
@@ -214,7 +214,7 @@ HLRBRep_Surface::IsSide (const Standard_Real tolF,
Standard_Boolean
HLRBRep_Surface::IsAbove (const Standard_Boolean back,
const Standard_Address A,
const HLRBRep_Curve* A,
const Standard_Real tol) const
{
Standard_Boolean planar = (myType == GeomAbs_Plane);
@@ -224,22 +224,20 @@ HLRBRep_Surface::IsAbove (const Standard_Boolean back,
Pl.Coefficients(a,b,c,d);
Standard_Real u,u1,u2,dd,x,y,z;
gp_Pnt P;
u1 = ((HLRBRep_Curve*)A)->Parameter3d
(((HLRBRep_Curve*)A)->FirstParameter());
u2 = ((HLRBRep_Curve*)A)->Parameter3d
(((HLRBRep_Curve*)A)->LastParameter());
u1 = A->Parameter3d(A->FirstParameter());
u2 = A->Parameter3d(A->LastParameter());
u=u1;
((HLRBRep_Curve*)A)->D0(u,P);
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 (((HLRBRep_Curve*)A)->GetType() != GeomAbs_Line) {
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;
((HLRBRep_Curve*)A)->D0(u,P);
A->D0(u,P);
P.Coord(x,y,z);
dd = a*x + b*y + c*z + d;
if (back) dd = -dd;
@@ -247,7 +245,7 @@ HLRBRep_Surface::IsAbove (const Standard_Boolean back,
}
}
u = u2;
((HLRBRep_Curve*)A)->D0(u,P);
A->D0(u,P);
P.Coord(x,y,z);
dd = a*x + b*y + c*z + d;
if (back) dd = -dd;

View File

@@ -17,13 +17,14 @@
#ifndef _HLRBRep_Surface_HeaderFile
#define _HLRBRep_Surface_HeaderFile
#include <HLRBRep_Curve.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <Standard_Address.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
@@ -56,7 +57,10 @@ public:
//! Creates an undefined surface with no face loaded.
Standard_EXPORT HLRBRep_Surface();
void Projector (const Standard_Address Proj);
void Projector (const HLRAlgo_Projector* Proj)
{
myProj = Proj;
}
//! Returns the 3D Surface.
BRepAdaptor_Surface& Surface();
@@ -67,7 +71,7 @@ public:
//! 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 Standard_Address A, const Standard_Real tolC) const;
Standard_EXPORT Standard_Boolean IsAbove (const Standard_Boolean back, const HLRBRep_Curve* A, const Standard_Real tolC) const;
Standard_Real FirstUParameter() const;
@@ -187,7 +191,7 @@ private:
BRepAdaptor_Surface mySurf;
GeomAbs_SurfaceType myType;
Standard_Address myProj;
const HLRAlgo_Projector* myProj;
};

View File

@@ -17,15 +17,6 @@
#include <BRepAdaptor_Surface.hxx>
#include <HLRBRep_BSurfaceTool.hxx>
//=======================================================================
//function : Projector
//purpose :
//=======================================================================
inline void
HLRBRep_Surface::Projector(const Standard_Address Proj)
{ myProj = Proj; }
//=======================================================================
//function : Surface
//purpose :