mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024727: Convertation of the generic classes to the non-generic. Part 3
1) Generic class "Intf_InterferencePolyhedron" from "Intf" package converted to the non-generic class and moved to the "IntPatch" package. Name of this class was changed to "IntPatch_InterferencePolyhedron". 2) Generic class "MoniTool_Elem" from "MoniTool" package converted to the non-generic class "MoniTool_TransientElem". 3) Generic class "IntWalk_PWalking" from "IntWalk" package converted to the non-generic class. And internal class "TheInt2S" of "IntWalk_PWalking" moved from IntWalk_PWalking.cdl to IntWalk.cdl for correct building. Also several "*.cxx" files of this class merged to one ".cxx". 4) Generic class "Transfer_SimpleBinder" from "Transfer" package converted to the non-generic class and moved to the "TransferBRep" package. Name of this class was changed to "TransferBRep_BinderOfShape". 5) Generic class "Geom2dInt_CurveTool" from "Geom2dInt" package converted to the non-generic class "Geom2dInt_Geom2dCurveTool". 6) Generic class "MAT2d_BisectingLocus" from "MAT2d" package converted to the non-generic class and moved to the "BRepMAT2d" package. Name of this class was changed to "BRepMAT2d_BisectingLocus". 7) Generic class "MAT_Mat" from "MAT" package converted to the non-generic class and moved to the "MAT2d" package. Name of this class was changed to "MAT2d_Mat2d".
This commit is contained in:
@@ -4,9 +4,5 @@ IntWalk_IWalking_3.gxx
|
||||
IntWalk_IWalking_4.gxx
|
||||
IntWalk_IWalking_5.gxx
|
||||
IntWalk_IWalking_6.gxx
|
||||
IntWalk_PWalking_1.gxx
|
||||
IntWalk_PWalking_2.gxx
|
||||
IntWalk_PWalking_3.gxx
|
||||
IntWalk_PWalking_4.gxx
|
||||
IntWalk_VectorOfInteger.hxx
|
||||
IntWalk_VectorOfWalkingData.hxx
|
||||
|
@@ -29,7 +29,7 @@ package IntWalk
|
||||
-- All the methods of the classes of this package are Internal.
|
||||
--
|
||||
uses
|
||||
Standard, MMgt, TCollection, TColStd, gp, math, StdFail, IntSurf, IntImp
|
||||
Standard, MMgt, TCollection, TColStd, gp, math, StdFail, IntSurf, IntImp, Adaptor3d
|
||||
|
||||
is
|
||||
|
||||
@@ -58,7 +58,11 @@ is
|
||||
--algorithm/solution for a marching on intersection between
|
||||
-- 2 biparametric surfaces
|
||||
|
||||
generic class PWalking, TheInt2S;
|
||||
class PWalking;
|
||||
|
||||
--internal of PWalking
|
||||
class TheInt2S instantiates Int2S from IntImp
|
||||
(HSurface from Adaptor3d, HSurfaceTool from Adaptor3d);
|
||||
|
||||
|
||||
end IntWalk;
|
||||
|
@@ -14,10 +14,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class PWalking from IntWalk (
|
||||
ThePSurface as any;
|
||||
ThePSurfaceTool as any)
|
||||
|
||||
class PWalking from IntWalk
|
||||
|
||||
---Purpose: This class implements an algorithm to determine the
|
||||
-- intersection between 2 parametrized surfaces, marching from
|
||||
@@ -33,21 +30,21 @@ uses XY from gp,
|
||||
LineOn2S from IntSurf,
|
||||
Dir from gp,
|
||||
Dir2d from gp,
|
||||
Pnt from gp
|
||||
Pnt from gp,
|
||||
TheInt2S from IntWalk,
|
||||
HSurface from Adaptor3d,
|
||||
HSurfaceTool from Adaptor3d
|
||||
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
class TheInt2S instantiates Int2S from IntImp
|
||||
(ThePSurface, ThePSurfaceTool);
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create ( Caro1 ,
|
||||
Caro2 : ThePSurface ;
|
||||
Caro2 : HSurface from Adaptor3d ;
|
||||
TolTangency,
|
||||
Epsilon,
|
||||
Deflection,
|
||||
@@ -73,7 +70,7 @@ is
|
||||
|
||||
|
||||
Create ( Caro1 ,
|
||||
Caro2 : ThePSurface ;
|
||||
Caro2 : HSurface from Adaptor3d ;
|
||||
TolTangency,
|
||||
Epsilon,
|
||||
Deflection,
|
||||
@@ -259,7 +256,7 @@ theDirectionFlag: Boolean from Standard)
|
||||
is private;
|
||||
|
||||
DistanceMinimizeByGradient( me : in out;
|
||||
theASurf1 , theASurf2 : ThePSurface ;
|
||||
theASurf1 , theASurf2 : HSurface from Adaptor3d ;
|
||||
theU1, theV1, theU2, theV2: out Real from Standard;
|
||||
theStep0U1V1: Real from Standard = 1.0e-6;
|
||||
theStep0U2V2: Real from Standard = 1.0e-6)
|
||||
@@ -269,7 +266,7 @@ theDirectionFlag: Boolean from Standard)
|
||||
-- initial point.
|
||||
|
||||
DistanceMinimizeByExtrema(me : in out;
|
||||
theASurf1 : ThePSurface ;
|
||||
theASurf1 : HSurface from Adaptor3d ;
|
||||
theP0 : Pnt from gp;
|
||||
theU0, theV0: out Real from Standard;
|
||||
theStep0U: Real from Standard = 1.0;
|
||||
@@ -280,7 +277,7 @@ theDirectionFlag: Boolean from Standard)
|
||||
-- initial point.
|
||||
|
||||
SeekPointOnBoundary(me : in out;
|
||||
theASurf1 , theASurf2 : ThePSurface ;
|
||||
theASurf1 , theASurf2 : HSurface from Adaptor3d ;
|
||||
theU1, theV1, theU2, theV2: Real from Standard;
|
||||
isTheFirst : Boolean from Standard)
|
||||
returns Boolean from Standard
|
||||
@@ -290,7 +287,7 @@ theDirectionFlag: Boolean from Standard)
|
||||
|
||||
|
||||
PutToBoundary( me : in out;
|
||||
theASurf1 , theASurf2 : ThePSurface)
|
||||
theASurf1 , theASurf2 : HSurface from Adaptor3d)
|
||||
-- Tries to extend existing intersection line
|
||||
-- (as set of points) to surface's boundaries,
|
||||
-- if it is possibly.
|
||||
@@ -301,7 +298,7 @@ theDirectionFlag: Boolean from Standard)
|
||||
|
||||
|
||||
SeekAdditionalPoints( me : in out;
|
||||
theASurf1 , theASurf2 : ThePSurface;
|
||||
theASurf1 , theASurf2 : HSurface from Adaptor3d;
|
||||
theMinNbPoints : Integer from Standard)
|
||||
returns Boolean from Standard;
|
||||
-- Unites and correctly coordinates of work of
|
||||
@@ -351,7 +348,7 @@ fields
|
||||
firstd1 : Dir2d from gp;
|
||||
firstd2 : Dir2d from gp;
|
||||
|
||||
myIntersectionOn2S : TheInt2S ;
|
||||
myIntersectionOn2S : TheInt2S from IntWalk;
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
|
||||
STATIC_PRECEDENT_INFLEXION : Integer from Standard;
|
||||
end PWalking;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntWalk_StatusDeflection.hxx>
|
||||
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <IntImp_ComputeTangence.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
#include <IntWalk_PWalking_1.gxx>
|
||||
#include <IntWalk_PWalking_2.gxx>
|
||||
#include <IntWalk_PWalking_3.gxx>
|
||||
#include <IntWalk_PWalking_4.gxx>
|
@@ -1,138 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-- I n t W a l k _ P W a l k i n g _ 2 . g x x
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
void IntWalk_PWalking::
|
||||
RepartirOuDiviser(Standard_Boolean& DejaReparti,
|
||||
IntImp_ConstIsoparametric& ChoixIso,
|
||||
Standard_Boolean& Arrive)
|
||||
|
||||
// at the neighborhood of a point, there is a fail of marching
|
||||
// it is required to divide the steps to try to continue
|
||||
// if the step is too small if we are on border
|
||||
// restart in another direction if it was not done, otherwise stop
|
||||
|
||||
{
|
||||
// Standard_Integer i;
|
||||
if (Arrive) { //restart in the other direction
|
||||
if (!DejaReparti ) {
|
||||
Arrive = Standard_False;
|
||||
DejaReparti = Standard_True;
|
||||
previousPoint = line->Value(1);
|
||||
previoustg = Standard_False;
|
||||
previousd1 = firstd1;
|
||||
previousd2 = firstd2;
|
||||
previousd = tgdir;
|
||||
indextg = line->NbPoints();
|
||||
tgdir.Reverse();
|
||||
line->Reverse();
|
||||
|
||||
//-- printf("\nIntWalk_PWalking_2.gxx Reverse %3d\n",indextg);
|
||||
sensCheminement = -1;
|
||||
tgfirst = tglast;
|
||||
tglast = Standard_False;
|
||||
ChoixIso = choixIsoSav;
|
||||
#if 0
|
||||
pasuv[0]=pasSav[0];
|
||||
pasuv[1]=pasSav[1];
|
||||
pasuv[2]=pasSav[2];
|
||||
pasuv[3]=pasSav[3];
|
||||
#else
|
||||
Standard_Real u1,v1,u2,v2;
|
||||
Standard_Real U1,V1,U2,V2;
|
||||
Standard_Integer nn=line->NbPoints();
|
||||
if(nn>2) {
|
||||
line->Value(nn).Parameters(u1,v1,u2,v2);
|
||||
line->Value(nn-1).Parameters(U1,V1,U2,V2);
|
||||
pasuv[0]=Abs(u1-U1);
|
||||
pasuv[1]=Abs(v1-V1);
|
||||
pasuv[2]=Abs(u2-U2);
|
||||
pasuv[3]=Abs(v2-V2);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( pasuv[0]*0.5 < ResoU1
|
||||
&& pasuv[1]*0.5 < ResoV1
|
||||
&& pasuv[2]*0.5 < ResoU2
|
||||
&& pasuv[3]*0.5 < ResoV2
|
||||
) {
|
||||
if (!previoustg) {
|
||||
tglast = Standard_True; // IS IT ENOUGH ????
|
||||
}
|
||||
|
||||
if (!DejaReparti) { //restart in the other direction
|
||||
DejaReparti = Standard_True;
|
||||
previousPoint = line->Value(1);
|
||||
previoustg = Standard_False;
|
||||
previousd1 = firstd1;
|
||||
previousd2 = firstd2;
|
||||
previousd = tgdir;
|
||||
indextg = line->NbPoints();
|
||||
tgdir.Reverse();
|
||||
line->Reverse();
|
||||
|
||||
//-- printf("\nIntWalk_PWalking_2.gxx Reverse %3d\n",indextg);
|
||||
|
||||
sensCheminement = -1;
|
||||
tgfirst = tglast;
|
||||
tglast = Standard_False;
|
||||
ChoixIso = choixIsoSav;
|
||||
|
||||
#if 0
|
||||
pasuv[0]=pasSav[0];
|
||||
pasuv[1]=pasSav[1];
|
||||
pasuv[2]=pasSav[2];
|
||||
pasuv[3]=pasSav[3];
|
||||
#else
|
||||
Standard_Real u1,v1,u2,v2;
|
||||
Standard_Real U1,V1,U2,V2;
|
||||
Standard_Integer nn=line->NbPoints();
|
||||
if(nn>2) {
|
||||
line->Value(nn).Parameters(u1,v1,u2,v2);
|
||||
line->Value(nn-1).Parameters(U1,V1,U2,V2);
|
||||
pasuv[0]=Abs(u1-U1);
|
||||
pasuv[1]=Abs(v1-V1);
|
||||
pasuv[2]=Abs(u2-U2);
|
||||
pasuv[3]=Abs(v2-V2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else Arrive = Standard_True;
|
||||
}
|
||||
else {
|
||||
pasuv[0]*=0.5;
|
||||
pasuv[1]*=0.5;
|
||||
pasuv[2]*=0.5;
|
||||
pasuv[3]*=0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,297 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//#define DEBUG 0
|
||||
|
||||
namespace {
|
||||
//OCC431(apo): modified ->
|
||||
static const Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
|
||||
|
||||
static const Standard_Real d = 7.0;
|
||||
}
|
||||
|
||||
IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
|
||||
|
||||
// test if vector is observed by calculating an increase of vector
|
||||
// or the previous point and its tangent, the new calculated point and its
|
||||
// tangent; it is possible to find a cube passing by the 2 points and having as a
|
||||
// derivative the tangents of the intersection
|
||||
// calculate the point with parameter 0.5 on cube=p1
|
||||
// calculate the medium point of 2 points of intersection=p2
|
||||
// if arrow/2<=||p1p2||<= arrow consider that the vector is observed
|
||||
// otherwise adjust the step depending on the ratio ||p1p2||/vector
|
||||
// and the previous step
|
||||
// test if in 2 tangent planes of surfaces there is no too great angle2d
|
||||
// grand : if yes divide the step
|
||||
// test if there is no change of side
|
||||
//
|
||||
{
|
||||
if(line->NbPoints() ==1 ) {
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=STATIC_PRECEDENT_INFLEXION=0;
|
||||
}
|
||||
|
||||
IntWalk_StatusDeflection Status = IntWalk_OK;
|
||||
Standard_Real FlecheCourante ,Ratio;
|
||||
|
||||
|
||||
const IntSurf_PntOn2S& CurrentPoint = myIntersectionOn2S.Point();
|
||||
//==================================================================================
|
||||
//========= S t o p o n p o i n t ============
|
||||
//==================================================================================
|
||||
if (myIntersectionOn2S.IsTangent()) {
|
||||
return IntWalk_ArretSurPoint;
|
||||
}
|
||||
|
||||
const gp_Dir& TgCourante = myIntersectionOn2S.Direction();
|
||||
|
||||
//==================================================================================
|
||||
//========= R i s k o f i n f l e x i o n p o i n t ============
|
||||
//==================================================================================
|
||||
if (TgCourante.Dot(previousd)<0) {
|
||||
//------------------------------------------------------------
|
||||
//-- Risk of inflexion point : Divide the step by 2
|
||||
//-- Initialize STATIC_PRECEDENT_INFLEXION so that
|
||||
//-- at the next call to return Pas_OK if there is no
|
||||
//-- more risk of the point of inflexion
|
||||
//------------------------------------------------------------
|
||||
|
||||
pasuv[0]*=0.5;
|
||||
pasuv[1]*=0.5;
|
||||
pasuv[2]*=0.5;
|
||||
pasuv[3]*=0.5;
|
||||
STATIC_PRECEDENT_INFLEXION+=3;
|
||||
if (pasuv[0] < ResoU1 && pasuv[1] <ResoV1 && pasuv[2] <ResoU2 && pasuv[3] < ResoV2)
|
||||
return IntWalk_ArretSurPointPrecedent;
|
||||
else
|
||||
return IntWalk_PasTropGrand;
|
||||
}
|
||||
|
||||
else {
|
||||
if(STATIC_PRECEDENT_INFLEXION > 0) {
|
||||
STATIC_PRECEDENT_INFLEXION -- ;
|
||||
return IntWalk_OK;
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
//========= D e t e c t c o n f u s e d P o in t s ===========
|
||||
//==================================================================================
|
||||
|
||||
Standard_Real Dist = previousPoint.Value().
|
||||
SquareDistance(CurrentPoint.Value());
|
||||
|
||||
|
||||
if (Dist < tolconf*tolconf ) {
|
||||
pasuv[0] = Max(5.*ResoU1,Min(1.5*pasuv[0],pasInit[0]));
|
||||
pasuv[1] = Max(5.*ResoV1,Min(1.5*pasuv[1],pasInit[1]));
|
||||
pasuv[2] = Max(5.*ResoU2,Min(1.5*pasuv[2],pasInit[2]));
|
||||
pasuv[3] = Max(5.*ResoV2,Min(1.5*pasuv[3],pasInit[3]));
|
||||
Status = IntWalk_PointConfondu;
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
Standard_Real Up1,Vp1,Uc1,Vc1,Du1,Dv1,AbsDu1,AbsDu2,AbsDv1,AbsDv2;
|
||||
Standard_Real Up2,Vp2,Uc2,Vc2,Du2,Dv2;
|
||||
|
||||
previousPoint.Parameters(Up1,Vp1,Up2,Vp2);
|
||||
CurrentPoint.Parameters(Uc1,Vc1,Uc2,Vc2);
|
||||
|
||||
Du1 = Uc1 - Up1; Dv1 = Vc1 - Vp1;
|
||||
Du2 = Uc2 - Up2; Dv2 = Vc2 - Vp2;
|
||||
|
||||
AbsDu1 = Abs(Du1);
|
||||
AbsDu2 = Abs(Du2);
|
||||
AbsDv1 = Abs(Dv1);
|
||||
AbsDv2 = Abs(Dv2);
|
||||
//=================================================================================
|
||||
//==== S t e p o f p r o g r e s s i o n (between previous and Current) =======
|
||||
//=================================================================================
|
||||
if ( AbsDu1 < ResoU1 && AbsDv1 < ResoV1
|
||||
&& AbsDu2 < ResoU2 && AbsDv2 < ResoV2) {
|
||||
pasuv[0] = ResoU1; pasuv[1] = ResoV1; pasuv[2] = ResoU2; pasuv[3] = ResoV2;
|
||||
return(IntWalk_ArretSurPointPrecedent);
|
||||
}
|
||||
//==================================================================================
|
||||
|
||||
Standard_Real tolArea = 100.0;
|
||||
if (ResoU1 < Precision::PConfusion() ||
|
||||
ResoV1 < Precision::PConfusion() ||
|
||||
ResoU2 < Precision::PConfusion() ||
|
||||
ResoV2 < Precision::PConfusion() )
|
||||
tolArea = tolArea*2.0;
|
||||
|
||||
Standard_Real Cosi1, CosRef1, Ang1, AngRef1, ResoUV1, Duv1, d1, tolCoeff1;
|
||||
Standard_Real Cosi2, CosRef2, Ang2, AngRef2, ResoUV2, Duv2, d2, tolCoeff2;
|
||||
Cosi1 = Du1*previousd1.X() + Dv1*previousd1.Y();
|
||||
Cosi2 = Du2*previousd2.X() + Dv2*previousd2.Y();
|
||||
Duv1 = Du1*Du1 + Dv1*Dv1;
|
||||
Duv2 = Du2*Du2 + Dv2*Dv2;
|
||||
ResoUV1 = ResoU1*ResoU1 + ResoV1*ResoV1;
|
||||
ResoUV2 = ResoU2*ResoU2 + ResoV2*ResoV2;
|
||||
//
|
||||
//modified by NIZNHY-PKV Wed Nov 13 12:25:44 2002 f
|
||||
//
|
||||
Standard_Real aMinDiv2=Precision::Confusion();
|
||||
aMinDiv2=aMinDiv2*aMinDiv2;
|
||||
//
|
||||
d1=d;
|
||||
if (Duv1>aMinDiv2) {
|
||||
d1 = Abs(ResoUV1/Duv1);
|
||||
d1 = Min(Sqrt(d1)*tolArea, d);
|
||||
}
|
||||
//d1 = Abs(ResoUV1/Duv1);
|
||||
//d1 = Min(Sqrt(d1)*tolArea,d);
|
||||
//modified by NIZNHY-PKV Wed Nov 13 12:34:30 2002 t
|
||||
tolCoeff1 = Exp(d1);
|
||||
//
|
||||
//modified by NIZNHY-PKV Wed Nov 13 12:34:43 2002 f
|
||||
d2=d;
|
||||
if (Duv2>aMinDiv2) {
|
||||
d2 = Abs(ResoUV2/Duv2);
|
||||
d2 = Min(Sqrt(d2)*tolArea,d);
|
||||
}
|
||||
//d2 = Abs(ResoUV2/Duv2);
|
||||
//d2 = Min(Sqrt(d2)*tolArea,d);
|
||||
//modified by NIZNHY-PKV Wed Nov 13 12:34:53 2002 t
|
||||
tolCoeff2 = Exp(d2);
|
||||
CosRef1 = CosRef2D/tolCoeff1;
|
||||
CosRef2 = CosRef2D/tolCoeff2;
|
||||
//
|
||||
//==================================================================================
|
||||
//== The points are not confused : ==
|
||||
//== D e t e c t t h e S t o p a t p r e v i o u s p o i n t ==
|
||||
//== N o t T o o G r e a t (angle in space UV) ==
|
||||
//== C h a n g e o f s i d e ==
|
||||
//==================================================================================
|
||||
if (Status != IntWalk_PointConfondu) {
|
||||
if(Cosi1*Cosi1 < CosRef1*Duv1 || Cosi2*Cosi2 < CosRef2*Duv2) {
|
||||
pasuv[0]*=0.5; pasuv[1]*=0.5; pasuv[2]*=0.5; pasuv[3]*=0.5;
|
||||
if (pasuv[0]<ResoU1 && pasuv[1]<ResoV1 && pasuv[2]<ResoU2 && pasuv[3]<ResoV2) {
|
||||
return(IntWalk_ArretSurPointPrecedent);
|
||||
}
|
||||
else {
|
||||
pasuv[0]*=0.5; pasuv[1]*=0.5; pasuv[2]*=0.5; pasuv[3]*=0.5;
|
||||
return(IntWalk_PasTropGrand);
|
||||
}
|
||||
}
|
||||
const gp_Dir2d& Tg2dcourante1 = myIntersectionOn2S.DirectionOnS1();
|
||||
const gp_Dir2d& Tg2dcourante2 = myIntersectionOn2S.DirectionOnS2();
|
||||
Cosi1 = Du1*Tg2dcourante1.X() + Dv1*Tg2dcourante1.Y();
|
||||
Cosi2 = Du2*Tg2dcourante2.X() + Dv2*Tg2dcourante2.Y();
|
||||
Ang1 = Abs(previousd1.Angle(Tg2dcourante1));
|
||||
Ang2 = Abs(previousd2.Angle(Tg2dcourante2));
|
||||
AngRef1 = AngRef2D*tolCoeff1;
|
||||
AngRef2 = AngRef2D*tolCoeff2;
|
||||
//-------------------------------------------------------
|
||||
//-- Test : Angle too great in space UV -----
|
||||
//-- Change of side -----
|
||||
//-------------------------------------------------------
|
||||
if(Cosi1*Cosi1 < CosRef1*Duv1 || Cosi2*Cosi2 < CosRef2*Duv2 || Ang1 > AngRef1 || Ang2 > AngRef2) {
|
||||
pasuv[0]*=0.5; pasuv[1]*=0.5; pasuv[2]*=0.5; pasuv[3]*=0.5;
|
||||
if (pasuv[0]<ResoU1 && pasuv[1]<ResoV1 && pasuv[2]<ResoU2 && pasuv[3]<ResoV2)
|
||||
return(IntWalk_ArretSurPoint);
|
||||
else
|
||||
return(IntWalk_PasTropGrand);
|
||||
}
|
||||
}
|
||||
//<-OCC431(apo)
|
||||
//==================================================================================
|
||||
//== D e t e c t i o n o f : Step Too Small
|
||||
//== STEP TOO Great
|
||||
//==================================================================================
|
||||
|
||||
//---------------------------------------
|
||||
//-- Estimate of the vector --
|
||||
//---------------------------------------
|
||||
FlecheCourante =
|
||||
Sqrt(Abs((previousd.XYZ()-TgCourante.XYZ()).SquareModulus()*Dist))/8.;
|
||||
|
||||
if ( FlecheCourante<= fleche*0.5) { //-- Current step too small
|
||||
if(FlecheCourante>1e-16) {
|
||||
Ratio = 0.5*(fleche/FlecheCourante);
|
||||
}
|
||||
else {
|
||||
Ratio = 10.0;
|
||||
}
|
||||
Standard_Real pasSu1 = pasuv[0];
|
||||
Standard_Real pasSv1 = pasuv[1];
|
||||
Standard_Real pasSu2 = pasuv[2];
|
||||
Standard_Real pasSv2 = pasuv[3];
|
||||
|
||||
//-- In case if
|
||||
//-- a point at U+DeltaU is required, ....
|
||||
//-- return a point at U + Epsilon
|
||||
//-- Epsilon << DeltaU.
|
||||
|
||||
if(pasuv[0]< AbsDu1) pasuv[0] = AbsDu1;
|
||||
if(pasuv[1]< AbsDv1) pasuv[1] = AbsDv1;
|
||||
if(pasuv[2]< AbsDu2) pasuv[2] = AbsDu2;
|
||||
if(pasuv[3]< AbsDv2) pasuv[3] = AbsDv2;
|
||||
|
||||
if(pasuv[0]<ResoU1) pasuv[0]=ResoU1;
|
||||
if(pasuv[1]<ResoV1) pasuv[1]=ResoV1;
|
||||
if(pasuv[2]<ResoU2) pasuv[2]=ResoU2;
|
||||
if(pasuv[3]<ResoV2) pasuv[3]=ResoV2;
|
||||
//-- if(Ratio>10.0 ) { Ratio=10.0; }
|
||||
Standard_Real R1,R = pasInit[0]/pasuv[0];
|
||||
R1= pasInit[1]/pasuv[1]; if(R1<R) R=R1;
|
||||
R1= pasInit[2]/pasuv[2]; if(R1<R) R=R1;
|
||||
R1= pasInit[3]/pasuv[3]; if(R1<R) R=R1;
|
||||
if(Ratio > R) Ratio=R;
|
||||
pasuv[0] = Min(Ratio*pasuv[0],pasInit[0]);
|
||||
pasuv[1] = Min(Ratio*pasuv[1],pasInit[1]);
|
||||
pasuv[2] = Min(Ratio*pasuv[2],pasInit[2]);
|
||||
pasuv[3] = Min(Ratio*pasuv[3],pasInit[3]);
|
||||
if (pasuv[0] != pasSu1 || pasuv[2] != pasSu2||
|
||||
pasuv[1] != pasSv1 || pasuv[3] != pasSv2) {
|
||||
if(++STATIC_BLOCAGE_SUR_PAS_TROP_GRAND > 5) {
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0;
|
||||
return IntWalk_PasTropGrand;
|
||||
}
|
||||
}
|
||||
if(Status == IntWalk_OK) {
|
||||
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=0;
|
||||
//-- Try to increase the step
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
else { //-- CurrentVector > vector*0.5
|
||||
if (FlecheCourante > fleche) { //-- Current step too Great
|
||||
Ratio = fleche/FlecheCourante;
|
||||
pasuv[0] = Ratio*pasuv[0];
|
||||
pasuv[1] = Ratio*pasuv[1];
|
||||
pasuv[2] = Ratio*pasuv[2];
|
||||
pasuv[3] = Ratio*pasuv[3];
|
||||
//if(++STATIC_BLOCAGE_SUR_PAS_TROP_GRAND > 5) {
|
||||
// STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0;
|
||||
return IntWalk_PasTropGrand;
|
||||
//}
|
||||
}
|
||||
else { //-- vector/2 < CurrentVector <= vector
|
||||
Ratio = 0.75 * (fleche / FlecheCourante);
|
||||
}
|
||||
}
|
||||
pasuv[0] = Max(5.*ResoU1,Min(Min(Ratio*AbsDu1,pasuv[0]),pasInit[0]));
|
||||
pasuv[1] = Max(5.*ResoV1,Min(Min(Ratio*AbsDv1,pasuv[1]),pasInit[1]));
|
||||
pasuv[2] = Max(5.*ResoU2,Min(Min(Ratio*AbsDu2,pasuv[2]),pasInit[2]));
|
||||
pasuv[3] = Max(5.*ResoV2,Min(Min(Ratio*AbsDv2,pasuv[3]),pasInit[3]));
|
||||
if(Status == IntWalk_OK) STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=0;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,176 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//--
|
||||
//-- Modif of 5 October 94 (LBR)
|
||||
//-- if(Trouve) ...
|
||||
//-- outpasses a border, Duv[.] = -1 -1 -1 -1
|
||||
//-- keep the same iso limited (see if(k!=1) )
|
||||
//--
|
||||
|
||||
//-- Modif of 8 July 96 (LBR)
|
||||
//-- simplify processing of auto-intersections.
|
||||
//-- Idea : Test closed loop in 3d and in 2d.
|
||||
//--
|
||||
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
|
||||
Standard_Boolean IntWalk_PWalking::
|
||||
TestArret(const Standard_Boolean DejaReparti,
|
||||
TColStd_Array1OfReal& Param,
|
||||
IntImp_ConstIsoparametric& ChoixIso)
|
||||
|
||||
//
|
||||
// test if the point of intersection set by these parameters remains in the
|
||||
// natural domain of each square.
|
||||
// if the point outpasses reframe to find the best iso (border)
|
||||
// that intersects easiest the other square
|
||||
// otherwise test if closed line is present
|
||||
//
|
||||
{
|
||||
Standard_Real Uvd[4],Uvf[4],Epsuv[4],Duv[4],Uvp[4],dv,dv2,ParC[4];
|
||||
Standard_Real DPc,DPb;
|
||||
Standard_Integer i = 0, k = 0;
|
||||
Epsuv[0] = ResoU1;
|
||||
Epsuv[1] = ResoV1;
|
||||
Epsuv[2] = ResoU2;
|
||||
Epsuv[3] = ResoV2;
|
||||
previousPoint.Parameters(Uvp[0],Uvp[1],Uvp[2],Uvp[3]);
|
||||
|
||||
Standard_Real SolParam[4];
|
||||
myIntersectionOn2S.Point().Parameters(SolParam[0],SolParam[1],SolParam[2],SolParam[3]);
|
||||
|
||||
Standard_Boolean Trouve = Standard_False;
|
||||
|
||||
Uvd[0]=Um1; Uvf[0]=UM1; Uvd[1]=Vm1; Uvf[1]=VM1;
|
||||
Uvd[2]=Um2; Uvf[2]=UM2; Uvd[3]=Vm2; Uvf[3]=VM2;
|
||||
|
||||
Standard_Integer im1;
|
||||
for ( i = 1,im1 = 0;i<=4;i++,im1++) {
|
||||
switch(i) {
|
||||
case 1: k=2; break;
|
||||
case 2: k=1; break;
|
||||
case 3: k=4; break;
|
||||
case 4: k=3; break;
|
||||
}
|
||||
if (Param(i) < (Uvd[im1]-Epsuv[im1]) ||
|
||||
SolParam[im1] < (Uvd[im1]-Epsuv[im1])) //-- Current ----- Bound Inf ----- Previous
|
||||
{
|
||||
Trouve = Standard_True; //--
|
||||
DPc = Uvp[im1]-Param(i); //-- Previous - Current
|
||||
DPb = Uvp[im1]-Uvd[im1]; //-- Previous - Bound Inf
|
||||
ParC[im1] = Uvd[im1]; //-- ParamCorrige
|
||||
dv = Param(k)-Uvp[k-1]; //-- Current - Previous (other Direction)
|
||||
dv2 = dv*dv;
|
||||
if(dv2>RealEpsilon()) { //-- Progress at the other Direction ?
|
||||
Duv[im1] = DPc*DPb + dv2;
|
||||
Duv[im1] = Duv[im1]*Duv[im1]/(DPc*DPc+dv2)/(DPb*DPb+dv2);
|
||||
}
|
||||
else {
|
||||
Duv[im1]=-1.0; //-- If no progress, do not change
|
||||
} //-- the choice of iso
|
||||
}
|
||||
else if (Param(i) > (Uvf[im1] + Epsuv[im1]) ||
|
||||
SolParam[im1] > (Uvf[im1] + Epsuv[im1]))//-- Previous ----- Bound Sup ----- Current
|
||||
{
|
||||
Trouve = Standard_True; //--
|
||||
DPc = Param(i)-Uvp[im1]; //-- Current - Previous
|
||||
DPb = Uvf[im1]-Uvp[im1]; //-- Bound Sup - Previous
|
||||
ParC[im1] = Uvf[im1]; //-- Param Corrige
|
||||
dv = Param(k)-Uvp[k-1]; //-- Current - Previous (other Direction)
|
||||
dv2 = dv*dv;
|
||||
if(dv2>RealEpsilon()) { //-- Progress in other Direction ?
|
||||
Duv[im1] = DPc*DPb + dv2;
|
||||
Duv[im1] = Duv[im1]*Duv[im1]/(DPc*DPc+dv2)/(DPb*DPb+dv2);
|
||||
}
|
||||
else {
|
||||
Duv[im1]=-1.0; //-- If no progress, do not change
|
||||
} //-- the choice of iso
|
||||
}
|
||||
else {
|
||||
Duv[im1]= -1.;
|
||||
ParC[im1]=Param(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (Trouve) {
|
||||
//--------------------------------------------------
|
||||
//-- One of Parameters u1,v1,u2,v2 is outside of --
|
||||
//-- the natural limits. --
|
||||
//-- Find the best direction of --
|
||||
//-- progress and reframe the parameters. --
|
||||
//--------------------------------------------------
|
||||
Standard_Real ddv = -1.0;
|
||||
k=-1;
|
||||
for (i=0;i<=3;i++) {
|
||||
Param(i+1) = ParC[i];
|
||||
if(Duv[i]>ddv) {
|
||||
ddv = Duv[i];
|
||||
k=i;
|
||||
}
|
||||
}
|
||||
if(k!=-1) {
|
||||
ChoixIso = ChoixRef[k];
|
||||
}
|
||||
else {
|
||||
if((ParC[0]<=Uvd[0]+Epsuv[0]) || (ParC[0]>=Uvf[0]-Epsuv[0])) {
|
||||
ChoixIso = IntImp_UIsoparametricOnCaro1;
|
||||
}
|
||||
else if((ParC[1]<=Uvd[1]+Epsuv[1]) || (ParC[1]>=Uvf[1]-Epsuv[1])) {
|
||||
ChoixIso = IntImp_VIsoparametricOnCaro1;
|
||||
}
|
||||
else if((ParC[2]<=Uvd[2]+Epsuv[2]) || (ParC[2]>=Uvf[2]-Epsuv[2])) {
|
||||
ChoixIso = IntImp_UIsoparametricOnCaro2;
|
||||
}
|
||||
else if((ParC[3]<=Uvd[3]+Epsuv[3]) || (ParC[3]>=Uvf[3]-Epsuv[3])) {
|
||||
ChoixIso = IntImp_VIsoparametricOnCaro2;
|
||||
}
|
||||
}
|
||||
close = Standard_False;
|
||||
return Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!DejaReparti) { // find if line closed
|
||||
|
||||
Standard_Real u,v;
|
||||
const IntSurf_PntOn2S& POn2S1=line->Value(1);
|
||||
//On S1
|
||||
POn2S1.ParametersOnS1(u,v);
|
||||
gp_Pnt2d P1uvS1(u,v);
|
||||
previousPoint.ParametersOnS1(u,v);
|
||||
gp_Pnt2d PrevuvS1(u,v);
|
||||
myIntersectionOn2S.Point().ParametersOnS1(u,v);
|
||||
gp_Pnt2d myIntersuvS1(u,v);
|
||||
Standard_Boolean close2dS1 = (P1uvS1.XY()-PrevuvS1.XY())*
|
||||
(P1uvS1.XY()-myIntersuvS1.XY()) < 0.0;
|
||||
//On S2
|
||||
POn2S1.ParametersOnS2(u,v);
|
||||
gp_Pnt2d P1uvS2(u,v);
|
||||
previousPoint.ParametersOnS2(u,v);
|
||||
gp_Pnt2d PrevuvS2(u,v);
|
||||
myIntersectionOn2S.Point().ParametersOnS2(u,v);
|
||||
gp_Pnt2d myIntersuvS2(u,v);
|
||||
Standard_Boolean close2dS2 = (P1uvS2.XY()-PrevuvS2.XY())*
|
||||
(P1uvS2.XY()-myIntersuvS2.XY()) < 0.0;
|
||||
|
||||
close = close2dS1 && close2dS2;
|
||||
return close;
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user