1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +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:
dln 2014-03-12 12:09:23 +04:00 committed by bugmaster
parent ebc93ae74f
commit 47cbf13472
33 changed files with 1041 additions and 1155 deletions

View File

@ -27,7 +27,8 @@ uses
Geom2d, Geom2d,
gp, gp,
TopoDS, TopoDS,
TopTools TopTools,
Bisector
is is
class Explorer; class Explorer;
@ -35,8 +36,10 @@ is
-- bisecting locus from a Wire, a Face, or a set of -- bisecting locus from a Wire, a Face, or a set of
-- curves from Geom2d. -- curves from Geom2d.
class BisectingLocus instantiates BisectingLocus from MAT2d class BisectingLocus;
(Explorer from BRepMAT2d); ---Purpose: Constuction of the map of the bisector locus on a
-- set of geometrys from Geom2d.
---Purpose: the map of bisecting locus. ---Purpose: the map of bisecting locus.
class LinkTopoBilo; class LinkTopoBilo;

View File

@ -14,8 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class BisectingLocus from MAT2d (Explorer as any) class BisectingLocus from BRepMAT2d
-- as SketchExplorer from MAT2d
---Purpose : BisectingLocus generates and contains the Bisecting_Locus ---Purpose : BisectingLocus generates and contains the Bisecting_Locus
-- of a set of lines from Geom2d, defined by <ExploSet>. -- of a set of lines from Geom2d, defined by <ExploSet>.
@ -48,7 +47,7 @@ generic class BisectingLocus from MAT2d (Explorer as any)
-- --
-- The map of bisecting locus is described by a graph. -- The map of bisecting locus is described by a graph.
-- - The BasicsElements correspond to elements on -- - The BasicsElements correspond to elements on
-- the figure described by the Explorer. -- the figure described by the Explorer from BRepMAT2d.
-- - The Arcs correspond to the bisectors. -- - The Arcs correspond to the bisectors.
-- - The Nodes are the extremities of the arcs. -- - The Nodes are the extremities of the arcs.
@ -63,15 +62,16 @@ uses
Bisec from Bisector, Bisec from Bisector,
Geometry from Geom2d, Geometry from Geom2d,
Pnt2d from gp, Pnt2d from gp,
Tool2d from MAT2d Tool2d from MAT2d,
Explorer from BRepMAT2d
is is
Create returns BisectingLocus from MAT2d; Create returns BisectingLocus from BRepMAT2d;
---Category: Construction. ---Category: Construction.
Compute (me : in out ; Compute (me : in out ;
anExplo : in out Explorer; anExplo : in out Explorer from BRepMAT2d;
LineIndex : Integer = 1; LineIndex : Integer = 1;
aSide : Side from MAT = MAT_Left ) aSide : Side from MAT = MAT_Left )
--- Purpose : Computation of the Bisector_Locus in a set of Lines --- Purpose : Computation of the Bisector_Locus in a set of Lines
@ -161,9 +161,3 @@ fields
end BisectingLocus; end BisectingLocus;

View File

@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
# include <BRepMAT2d_BisectingLocus.ixx>
# include <MAT2d_Mat2d.hxx> # include <MAT2d_Mat2d.hxx>
# include <MAT2d_Tool2d.hxx> # include <MAT2d_Tool2d.hxx>
# include <MAT2d_Circuit.hxx> # include <MAT2d_Circuit.hxx>
@ -40,10 +42,10 @@ static void CutSketch (MAT2d_SequenceOfSequenceOfGeometry& Figure,
//============================================================================= //=============================================================================
//function : MAT2d_BisectingLocus //function : BRepMAT2d_BisectingLocus
//purpose : Constructeur vide. //purpose : Constructeur vide.
//============================================================================= //=============================================================================
MAT2d_BisectingLocus::MAT2d_BisectingLocus() BRepMAT2d_BisectingLocus::BRepMAT2d_BisectingLocus()
{ {
} }
@ -53,7 +55,7 @@ MAT2d_BisectingLocus::MAT2d_BisectingLocus()
//purpose : Calcul de la carte des lieux bisecteurs sur le contour defini par //purpose : Calcul de la carte des lieux bisecteurs sur le contour defini par
// <anExplo>. // <anExplo>.
//============================================================================= //=============================================================================
void MAT2d_BisectingLocus::Compute( Explorer& anExplo, void BRepMAT2d_BisectingLocus::Compute( BRepMAT2d_Explorer& anExplo,
const Standard_Integer IndexLine, const Standard_Integer IndexLine,
const MAT_Side aSide ) const MAT_Side aSide )
{ {
@ -150,7 +152,7 @@ void MAT2d_BisectingLocus::Compute( Explorer& anExplo,
//function : RenumerationAndFusion //function : RenumerationAndFusion
//purpose : //purpose :
//============================================================================= //=============================================================================
void MAT2d_BisectingLocus::RenumerationAndFusion void BRepMAT2d_BisectingLocus::RenumerationAndFusion
(const Standard_Integer ILine, (const Standard_Integer ILine,
const Standard_Integer LengthLine, const Standard_Integer LengthLine,
Standard_Integer& IndexLast, Standard_Integer& IndexLast,
@ -191,7 +193,7 @@ void MAT2d_BisectingLocus::RenumerationAndFusion
//function : IsDone //function : IsDone
//Purpose : //Purpose :
//============================================================================= //=============================================================================
Standard_Boolean MAT2d_BisectingLocus::IsDone() const Standard_Boolean BRepMAT2d_BisectingLocus::IsDone() const
{ {
return isDone; return isDone;
} }
@ -200,7 +202,7 @@ Standard_Boolean MAT2d_BisectingLocus::IsDone() const
//function : Graph //function : Graph
// //
//============================================================================= //=============================================================================
Handle(MAT_Graph) MAT2d_BisectingLocus::Graph() const Handle(MAT_Graph) BRepMAT2d_BisectingLocus::Graph() const
{ {
return theGraph; return theGraph;
} }
@ -209,7 +211,7 @@ Handle(MAT_Graph) MAT2d_BisectingLocus::Graph() const
//function : NumberOfContours //function : NumberOfContours
// //
//============================================================================= //=============================================================================
Standard_Integer MAT2d_BisectingLocus::NumberOfContours () const Standard_Integer BRepMAT2d_BisectingLocus::NumberOfContours () const
{ {
return nbContours; return nbContours;
} }
@ -218,7 +220,7 @@ Standard_Integer MAT2d_BisectingLocus::NumberOfContours () const
//function : NumberOfElts //function : NumberOfElts
// //
//============================================================================= //=============================================================================
Standard_Integer MAT2d_BisectingLocus::NumberOfElts Standard_Integer BRepMAT2d_BisectingLocus::NumberOfElts
(const Standard_Integer IndLine) const (const Standard_Integer IndLine) const
{ {
return theTool.Circuit()->LineLength(IndLine); return theTool.Circuit()->LineLength(IndLine);
@ -228,7 +230,7 @@ Standard_Integer MAT2d_BisectingLocus::NumberOfElts
//function : NumberOfSect //function : NumberOfSect
// //
//============================================================================= //=============================================================================
Standard_Integer MAT2d_BisectingLocus::NumberOfSections Standard_Integer BRepMAT2d_BisectingLocus::NumberOfSections
(const Standard_Integer IndLine, (const Standard_Integer IndLine,
const Standard_Integer Index ) const Standard_Integer Index )
const const
@ -241,7 +243,7 @@ Standard_Integer MAT2d_BisectingLocus::NumberOfSections
//function : BasicElt //function : BasicElt
// //
//============================================================================= //=============================================================================
Handle(MAT_BasicElt) MAT2d_BisectingLocus::BasicElt Handle(MAT_BasicElt) BRepMAT2d_BisectingLocus::BasicElt
(const Standard_Integer IndLine, (const Standard_Integer IndLine,
const Standard_Integer Index ) const Standard_Integer Index )
const const
@ -260,7 +262,7 @@ Handle(MAT_BasicElt) MAT2d_BisectingLocus::BasicElt
//function : GeomBis //function : GeomBis
// //
//============================================================================= //=============================================================================
Bisector_Bisec MAT2d_BisectingLocus::GeomBis (const Handle(MAT_Arc)& anArc, Bisector_Bisec BRepMAT2d_BisectingLocus::GeomBis (const Handle(MAT_Arc)& anArc,
Standard_Boolean& Reverse) Standard_Boolean& Reverse)
const const
{ {
@ -285,7 +287,7 @@ const
//function : GeomElt //function : GeomElt
// //
//============================================================================= //=============================================================================
Handle(Geom2d_Geometry) MAT2d_BisectingLocus::GeomElt Handle(Geom2d_Geometry) BRepMAT2d_BisectingLocus::GeomElt
(const Handle(MAT_BasicElt)& aBasicElt) const (const Handle(MAT_BasicElt)& aBasicElt) const
{ {
return theTool.GeomElt(aBasicElt->GeomIndex()); return theTool.GeomElt(aBasicElt->GeomIndex());
@ -296,7 +298,7 @@ Handle(Geom2d_Geometry) MAT2d_BisectingLocus::GeomElt
//function : GeomElt //function : GeomElt
// //
//============================================================================= //=============================================================================
gp_Pnt2d MAT2d_BisectingLocus::GeomElt(const Handle(MAT_Node)& aNode) const gp_Pnt2d BRepMAT2d_BisectingLocus::GeomElt(const Handle(MAT_Node)& aNode) const
{ {
return theTool.GeomPnt(aNode->GeomIndex()); return theTool.GeomPnt(aNode->GeomIndex());
} }

View File

@ -119,7 +119,7 @@
#include <IntAna_QuadQuadGeo.hxx> #include <IntAna_QuadQuadGeo.hxx>
#include <IntAna2d_AnaIntersection.hxx> #include <IntAna2d_AnaIntersection.hxx>
#include <IntRes2d_IntersectionPoint.hxx> #include <IntRes2d_IntersectionPoint.hxx>
#include <IntPatch_ThePWalkingInter.hxx> #include <IntWalk_PWalking.hxx>
#include <IntPatch_WLine.hxx> #include <IntPatch_WLine.hxx>
#include <Geom2dInt_GInter.hxx> #include <Geom2dInt_GInter.hxx>
#include <GeomInt_WLApprox.hxx> #include <GeomInt_WLApprox.hxx>
@ -3314,7 +3314,7 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
//Builder, so they are reestimated as much as possible. //Builder, so they are reestimated as much as possible.
Standard_Real fleche = 1.e-3 * pdeb.Distance(pfin); Standard_Real fleche = 1.e-3 * pdeb.Distance(pfin);
Standard_Real tolap = 1.e-7; Standard_Real tolap = 1.e-7;
IntPatch_ThePWalkingInter IntWalk_PWalking
IntKK(S1,S2,tol3d,tol3d,fleche,Step); IntKK(S1,S2,tol3d,tol3d,fleche,Step);
//The extremities of the intersection (Pardeb,Parfin) are known, //The extremities of the intersection (Pardeb,Parfin) are known,

View File

@ -24,14 +24,11 @@ package Geom2dInt
-- --
uses Standard, gp, TColStd, GeomAbs, Geom2d, Adaptor3d,Adaptor2d, IntCurve uses Standard, gp, TColStd, GeomAbs, Geom2d, Adaptor3d, Adaptor2d, IntCurve
is is
generic class CurveTool; class Geom2dCurveTool;
class Geom2dCurveTool instantiates CurveTool from Geom2dInt
(Curve2d from Adaptor2d);
class GInter instantiates IntCurveCurveGen from IntCurve class GInter instantiates IntCurveCurveGen from IntCurve
(Curve2d from Adaptor2d, (Curve2d from Adaptor2d,

View File

@ -14,12 +14,11 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class CurveTool from Geom2dInt ( class Geom2dCurveTool from Geom2dInt
IntCurveCurve as any)
---Purpose: This class provides a CurveTool as < CurveTool from IntCurve >
-- from a Tool as < CurveTool from Adaptor3d > . ---Purpose: This class provides a Geom2dCurveTool as < Geom2dCurveTool from IntCurve >
-- from a Tool as < Geom2dCurveTool from Adaptor3d > .
uses uses
@ -31,21 +30,22 @@ uses
Parab2d from gp, Parab2d from gp,
Hypr2d from gp, Hypr2d from gp,
Array1OfReal from TColStd, Array1OfReal from TColStd,
CurveType from GeomAbs CurveType from GeomAbs,
Curve2d from Adaptor2d
is is
GetType(myclass; C: IntCurveCurve) GetType(myclass; C: Curve2d from Adaptor2d)
---C++: inline ---C++: inline
returns CurveType from GeomAbs; returns CurveType from GeomAbs;
IsComposite(myclass; C: IntCurveCurve) IsComposite(myclass; C: Curve2d from Adaptor2d)
---C++: inline ---C++: inline
returns Boolean from Standard; returns Boolean from Standard;
Line(myclass; C: IntCurveCurve) Line(myclass; C: Curve2d from Adaptor2d)
---Purpose: Returns the Lin2d from gp corresponding to the curve C. ---Purpose: Returns the Lin2d from gp corresponding to the curve C.
-- This method is called only when TheType returns -- This method is called only when TheType returns
@ -54,7 +54,7 @@ is
returns Lin2d from gp; returns Lin2d from gp;
Circle(myclass; C: IntCurveCurve) Circle(myclass; C: Curve2d from Adaptor2d)
---Purpose: Returns the Circ2d from gp corresponding to the curve C. ---Purpose: Returns the Circ2d from gp corresponding to the curve C.
-- This method is called only when TheType returns -- This method is called only when TheType returns
@ -63,7 +63,7 @@ is
returns Circ2d from gp; returns Circ2d from gp;
Ellipse(myclass; C: IntCurveCurve) Ellipse(myclass; C: Curve2d from Adaptor2d)
---Purpose: Returns the Elips2d from gp corresponding to the curve C. ---Purpose: Returns the Elips2d from gp corresponding to the curve C.
-- This method is called only when TheType returns -- This method is called only when TheType returns
@ -72,7 +72,7 @@ is
returns Elips2d from gp; returns Elips2d from gp;
Parabola(myclass; C: IntCurveCurve) Parabola(myclass; C: Curve2d from Adaptor2d)
---Purpose: Returns the Parab2d from gp corresponding to the curve C. ---Purpose: Returns the Parab2d from gp corresponding to the curve C.
-- This method is called only when TheType returns -- This method is called only when TheType returns
@ -81,7 +81,7 @@ is
returns Parab2d from gp; returns Parab2d from gp;
Hyperbola(myclass; C: IntCurveCurve) Hyperbola(myclass; C: Curve2d from Adaptor2d)
---Purpose: Returns the Hypr2d from gp corresponding to the curve C. ---Purpose: Returns the Hypr2d from gp corresponding to the curve C.
-- This method is called only when TheType returns -- This method is called only when TheType returns
@ -93,73 +93,73 @@ is
-- The following method are used only when TheType returns IntCurve_Other. -- The following method are used only when TheType returns IntCurve_Other.
EpsX (myclass; C: IntCurveCurve) EpsX (myclass; C: Curve2d from Adaptor2d)
---C++: inline ---C++: inline
returns Real; returns Real;
EpsX (myclass; C: IntCurveCurve; EpsX (myclass; C: Curve2d from Adaptor2d;
Eps_XYZ : Real from Standard) Eps_XYZ : Real from Standard)
---C++: inline ---C++: inline
returns Real; returns Real;
NbSamples(myclass; C: IntCurveCurve) NbSamples(myclass; C: Curve2d from Adaptor2d)
returns Integer; returns Integer;
NbSamples(myclass; C: IntCurveCurve; U0,U1: Real from Standard) NbSamples(myclass; C: Curve2d from Adaptor2d; U0,U1: Real from Standard)
returns Integer; returns Integer;
FirstParameter(myclass; C:IntCurveCurve) FirstParameter(myclass; C:Curve2d from Adaptor2d)
---C++: inline ---C++: inline
returns Real; returns Real;
LastParameter(myclass; C:IntCurveCurve) LastParameter(myclass; C:Curve2d from Adaptor2d)
---C++: inline ---C++: inline
returns Real; returns Real;
Value (myclass; C: IntCurveCurve; X: Real) Value (myclass; C: Curve2d from Adaptor2d; X: Real)
---C++: inline ---C++: inline
returns Pnt2d from gp; returns Pnt2d from gp;
D0 (myclass; C: IntCurveCurve; U: Real ; D0 (myclass; C: Curve2d from Adaptor2d; U: Real ;
P: out Pnt2d); P: out Pnt2d);
---C++: inline ---C++: inline
D1 (myclass; C: IntCurveCurve; U: Real ; D1 (myclass; C: Curve2d from Adaptor2d; U: Real ;
P: out Pnt2d; T: out Vec2d); P: out Pnt2d; T: out Vec2d);
---C++: inline ---C++: inline
D2 (myclass; C: IntCurveCurve; U: Real ; D2 (myclass; C: Curve2d from Adaptor2d; U: Real ;
P: out Pnt2d; T,N: out Vec2d); P: out Pnt2d; T,N: out Vec2d);
---C++: inline ---C++: inline
D3 (myclass; C: IntCurveCurve; U: Real ; D3 (myclass; C: Curve2d from Adaptor2d; U: Real ;
P: out Pnt2d; T,N,V: out Vec2d); P: out Pnt2d; T,N,V: out Vec2d);
---C++: inline ---C++: inline
DN(myclass; C: IntCurveCurve; U: Real ; DN(myclass; C: Curve2d from Adaptor2d; U: Real ;
N: Integer from Standard) N: Integer from Standard)
returns Vec2d; returns Vec2d;
---C++: inline ---C++: inline
NbIntervals(myclass ; C: IntCurveCurve) NbIntervals(myclass ; C: Curve2d from Adaptor2d)
---Purpose : output the number of interval of continuity C2 of ---Purpose : output the number of interval of continuity C2 of
-- the curve -- the curve
---C++: inline ---C++: inline
returns Integer from Standard; returns Integer from Standard;
Intervals (myclass; C: IntCurveCurve Intervals (myclass; C: Curve2d from Adaptor2d
; Tab : out Array1OfReal from TColStd); ; Tab : out Array1OfReal from TColStd);
---Purpose: compute Tab. ---Purpose: compute Tab.
---C++: inline ---C++: inline
GetInterval (myclass; C: IntCurveCurve GetInterval (myclass; C: Curve2d from Adaptor2d
; Index : Integer from Standard ; Index : Integer from Standard
; Tab : Array1OfReal from TColStd ; Tab : Array1OfReal from TColStd
; U1, U2 : out Real from Standard); ; U1, U2 : out Real from Standard);
@ -167,11 +167,11 @@ is
-- used if Type == Composite. -- used if Type == Composite.
---C++: inline ---C++: inline
Degree(myclass; C : IntCurveCurve) returns Integer from Standard; Degree(myclass; C : Curve2d from Adaptor2d) returns Integer from Standard;
---C++: inline ---C++: inline
end CurveTool; end Geom2dCurveTool;

View File

@ -14,14 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <Geom2dInt_Geom2dCurveTool.ixx>
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <Geom2d_BezierCurve.hxx> #include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx> #include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_BezierCurve.hxx> #include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx> #include <Geom2d_BSplineCurve.hxx>
#include <Adaptor2d_Curve2d.hxx>
//============================================================ //============================================================
Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C, Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d& C,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real U1) { const Standard_Real U1) {
GeomAbs_CurveType typC = C.GetType(); GeomAbs_CurveType typC = C.GetType();
@ -51,7 +55,7 @@ Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C,
return((Standard_Integer)nbs); return((Standard_Integer)nbs);
} }
//============================================================ //============================================================
Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C) { Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d& C) {
GeomAbs_CurveType typC = C.GetType(); GeomAbs_CurveType typC = C.GetType();
static Standard_Real nbsOther = 10.0; static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther; Standard_Real nbs = nbsOther;

View File

@ -14,8 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include IntCurveCurve_hxx
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx> #include <GeomAbs_Shape.hxx>
@ -26,52 +24,53 @@
#include <gp_Hypr2d.hxx> #include <gp_Hypr2d.hxx>
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
#include <Adaptor2d_Curve2d.hxx>
#define IS_C2_COMPOSITE 0 #define IS_C2_COMPOSITE 0
//============================================================ //============================================================
inline GeomAbs_CurveType Geom2dInt_CurveTool::GetType(const IntCurveCurve& C) { inline GeomAbs_CurveType Geom2dInt_Geom2dCurveTool::GetType(const Adaptor2d_Curve2d& C) {
return(C.GetType()); return(C.GetType());
} }
//============================================================ //============================================================
inline gp_Lin2d Geom2dInt_CurveTool::Line (const IntCurveCurve& C) { inline gp_Lin2d Geom2dInt_Geom2dCurveTool::Line (const Adaptor2d_Curve2d& C) {
return(C.Line()); return(C.Line());
} }
//============================================================ //============================================================
inline gp_Circ2d Geom2dInt_CurveTool::Circle (const IntCurveCurve& C) { inline gp_Circ2d Geom2dInt_Geom2dCurveTool::Circle (const Adaptor2d_Curve2d& C) {
return(C.Circle()); return(C.Circle());
} }
//============================================================ //============================================================
inline gp_Elips2d Geom2dInt_CurveTool::Ellipse (const IntCurveCurve& C) { inline gp_Elips2d Geom2dInt_Geom2dCurveTool::Ellipse (const Adaptor2d_Curve2d& C) {
return(C.Ellipse()); return(C.Ellipse());
} }
//============================================================ //============================================================
inline gp_Parab2d Geom2dInt_CurveTool::Parabola (const IntCurveCurve& C) { inline gp_Parab2d Geom2dInt_Geom2dCurveTool::Parabola (const Adaptor2d_Curve2d& C) {
return(C.Parabola()); return(C.Parabola());
} }
//============================================================ //============================================================
inline gp_Hypr2d Geom2dInt_CurveTool::Hyperbola (const IntCurveCurve& C) { inline gp_Hypr2d Geom2dInt_Geom2dCurveTool::Hyperbola (const Adaptor2d_Curve2d& C) {
return(C.Hyperbola()); return(C.Hyperbola());
} }
//============================================================ //============================================================
inline gp_Pnt2d Geom2dInt_CurveTool::Value (const IntCurveCurve& C, inline gp_Pnt2d Geom2dInt_Geom2dCurveTool::Value (const Adaptor2d_Curve2d& C,
const Standard_Real U) { const Standard_Real U) {
return(C.Value(U)); return(C.Value(U));
} }
//============================================================ //============================================================
inline void Geom2dInt_CurveTool::D0(const IntCurveCurve& C, inline void Geom2dInt_Geom2dCurveTool::D0(const Adaptor2d_Curve2d& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P) { gp_Pnt2d& P) {
C.D0(U,P); C.D0(U,P);
} }
//============================================================ //============================================================
inline void Geom2dInt_CurveTool::D1 (const IntCurveCurve& C, inline void Geom2dInt_Geom2dCurveTool::D1 (const Adaptor2d_Curve2d& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& T) { gp_Vec2d& T) {
C.D1(U,P,T); C.D1(U,P,T);
} }
//============================================================ //============================================================
inline void Geom2dInt_CurveTool::D2 (const IntCurveCurve& C, inline void Geom2dInt_Geom2dCurveTool::D2 (const Adaptor2d_Curve2d& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& T, gp_Vec2d& T,
@ -81,7 +80,7 @@ inline void Geom2dInt_CurveTool::D2 (const IntCurveCurve& C,
} }
//============================================================ //============================================================
inline void Geom2dInt_CurveTool::D3 (const IntCurveCurve& C, inline void Geom2dInt_Geom2dCurveTool::D3 (const Adaptor2d_Curve2d& C,
const Standard_Real U, const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& T, gp_Vec2d& T,
@ -91,7 +90,7 @@ inline void Geom2dInt_CurveTool::D3 (const IntCurveCurve& C,
C.D3(U,P,T,N,V); C.D3(U,P,T,N,V);
} }
//============================================================ //============================================================
inline gp_Vec2d Geom2dInt_CurveTool::DN(const Adaptor2d_Curve2d& C, inline gp_Vec2d Geom2dInt_Geom2dCurveTool::DN(const Adaptor2d_Curve2d& C,
const Standard_Real U, const Standard_Real U,
const Standard_Integer N) const Standard_Integer N)
{ {
@ -99,25 +98,25 @@ inline gp_Vec2d Geom2dInt_CurveTool::DN(const Adaptor2d_Curve2d& C,
} }
//============================================================ //============================================================
inline Standard_Real Geom2dInt_CurveTool::FirstParameter (const IntCurveCurve& C) { inline Standard_Real Geom2dInt_Geom2dCurveTool::FirstParameter (const Adaptor2d_Curve2d& C) {
return(C.FirstParameter()); return(C.FirstParameter());
} }
//============================================================ //============================================================
inline Standard_Real Geom2dInt_CurveTool::LastParameter (const IntCurveCurve& C) { inline Standard_Real Geom2dInt_Geom2dCurveTool::LastParameter (const Adaptor2d_Curve2d& C) {
return(C.LastParameter()); return(C.LastParameter());
} }
//============================================================ //============================================================
//== tolerance used by mathemetical algorithms //== tolerance used by mathemetical algorithms
//== //==
inline Standard_Real Geom2dInt_CurveTool::EpsX (const IntCurveCurve& ) { inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& ) {
return(1.0e-10); return(1.0e-10);
} }
//------------------------------------------------------------ //------------------------------------------------------------
inline Standard_Real Geom2dInt_CurveTool::EpsX (const IntCurveCurve& C,const Standard_Real Eps_XYZ) { inline Standard_Real Geom2dInt_Geom2dCurveTool::EpsX (const Adaptor2d_Curve2d& C,const Standard_Real Eps_XYZ) {
return(C.Resolution(Eps_XYZ)); return(C.Resolution(Eps_XYZ));
} }
//============================================================ //============================================================
inline void Geom2dInt_CurveTool::Intervals(const IntCurveCurve& C, inline void Geom2dInt_Geom2dCurveTool::Intervals(const Adaptor2d_Curve2d& C,
TColStd_Array1OfReal& Tab) { TColStd_Array1OfReal& Tab) {
#if IS_C2_COMPOSITE #if IS_C2_COMPOSITE
C.Intervals(Tab,GeomAbs_C2); C.Intervals(Tab,GeomAbs_C2);
@ -126,8 +125,8 @@ inline void Geom2dInt_CurveTool::Intervals(const IntCurveCurve& C,
#endif #endif
} }
//============================================================ //============================================================
//inline void Geom2dInt_CurveTool::GetInterval(const IntCurveCurve& C, //inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& C,
inline void Geom2dInt_CurveTool::GetInterval(const IntCurveCurve& , inline void Geom2dInt_Geom2dCurveTool::GetInterval(const Adaptor2d_Curve2d& ,
const Standard_Integer i, const Standard_Integer i,
const TColStd_Array1OfReal& Tab, const TColStd_Array1OfReal& Tab,
Standard_Real& a, Standard_Real& a,
@ -136,7 +135,7 @@ inline void Geom2dInt_CurveTool::GetInterval(const IntCurveCurve& ,
b = Tab.Value(i+1); b = Tab.Value(i+1);
} }
//============================================================ //============================================================
inline Standard_Integer Geom2dInt_CurveTool::NbIntervals(const IntCurveCurve& C) { inline Standard_Integer Geom2dInt_Geom2dCurveTool::NbIntervals(const Adaptor2d_Curve2d& C) {
Standard_Integer N=1; Standard_Integer N=1;
#if IS_C2_COMPOSITE #if IS_C2_COMPOSITE
N = C.NbIntervals(GeomAbs_C2); N = C.NbIntervals(GeomAbs_C2);
@ -147,7 +146,7 @@ inline Standard_Integer Geom2dInt_CurveTool::NbIntervals(const IntCurveCurve& C)
} }
//============================================================ //============================================================
inline Standard_Integer Geom2dInt_CurveTool::Degree(const IntCurveCurve& C) inline Standard_Integer Geom2dInt_Geom2dCurveTool::Degree(const Adaptor2d_Curve2d& C)
{ {
return C.Degree(); return C.Degree();
} }

View File

@ -48,6 +48,11 @@ is
class RLine; -- inherits Line from IntPatch class RLine; -- inherits Line from IntPatch
class ArcFunction; class ArcFunction;
class InterferencePolyhedron;
---Purpose: Compute the interference between two polyhedron. Points
-- of intersection , polylines of intersection and zones of
-- tangence.
-- implicite/implicite -- implicite/implicite
@ -141,16 +146,6 @@ is
TopolTool from Adaptor3d, TopolTool from Adaptor3d,
ArcFunction from IntPatch); ArcFunction from IntPatch);
class TheInterfPolyhedron instantiates InterferencePolyhedron from Intf(
Polyhedron from IntPatch,
PolyhedronTool from IntPatch,
Polyhedron from IntPatch,
PolyhedronTool from IntPatch);
class ThePWalkingInter instantiates PWalking from IntWalk(
HSurface from Adaptor3d,
HSurfaceTool from Adaptor3d);
alias SearchPnt is InterferencePolygon2d from Intf; alias SearchPnt is InterferencePolygon2d from Intf;
class CSFunction instantiates ZerCOnSSParFunc from IntImp class CSFunction instantiates ZerCOnSSParFunc from IntImp

View File

@ -14,12 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class InterferencePolyhedron from Intf class InterferencePolyhedron from IntPatch inherits Interference from Intf
(Polyhedron1 as any;
ToolPolyhe1 as any;
Polyhedron2 as any;
ToolPolyhe2 as any)
inherits Interference from Intf
---Purpose: Computes the interference between two polyhedra or the ---Purpose: Computes the interference between two polyhedra or the
-- self interference of a polyhedron. -- self interference of a polyhedron.
@ -32,43 +27,45 @@ uses Pnt from gp,
SectionLine from Intf, SectionLine from Intf,
SeqOfSectionLine from Intf, SeqOfSectionLine from Intf,
TangentZone from Intf, TangentZone from Intf,
SeqOfTangentZone from Intf SeqOfTangentZone from Intf,
Polyhedron from IntPatch,
PolyhedronTool from IntPatch
is is
-- Interface : -- Interface :
Create returns InterferencePolyhedron from Intf; Create returns InterferencePolyhedron from IntPatch;
---Purpose: Constructs an empty interference of Polyhedron. ---Purpose: Constructs an empty interference of Polyhedron.
Create (Obje1 : in Polyhedron1; Create (Obje1 : in Polyhedron from IntPatch;
Obje2 : in Polyhedron2) Obje2 : in Polyhedron from IntPatch)
returns InterferencePolyhedron from Intf; returns InterferencePolyhedron from IntPatch;
---Purpose: Constructs and computes an interference between the two ---Purpose: Constructs and computes an interference between the two
-- Polyhedra. -- Polyhedra.
Create (Obje : in Polyhedron1) Create (Obje : in Polyhedron from IntPatch)
returns InterferencePolyhedron from Intf; returns InterferencePolyhedron from IntPatch;
---Purpose: Constructs and computes the self interference of a ---Purpose: Constructs and computes the self interference of a
-- Polyhedron. -- Polyhedron.
Perform (me : in out; Perform (me : in out;
Obje1 : in Polyhedron1; Obje1 : in Polyhedron from IntPatch;
Obje2 : in Polyhedron2); Obje2 : in Polyhedron from IntPatch);
---Purpose: Computes the interference between the two Polyhedra. ---Purpose: Computes the interference between the two Polyhedra.
Perform (me : in out; Perform (me : in out;
Obje : in Polyhedron1); Obje : in Polyhedron from IntPatch);
---Purpose: Computes the self interference of a Polyhedron. ---Purpose: Computes the self interference of a Polyhedron.
-- Implementation : -- Implementation :
Interference (me : in out; Interference (me : in out;
Obje1 : in Polyhedron1) Obje1 : in Polyhedron from IntPatch)
is private; is private;
Interference (me : in out; Interference (me : in out;
Obje1 : in Polyhedron1; Obje1 : in Polyhedron from IntPatch;
Obje2 : in Polyhedron2) Obje2 : in Polyhedron from IntPatch)
is private; is private;
---Purpose: Compares the bounding volumes between the facets of <Obje1> ---Purpose: Compares the bounding volumes between the facets of <Obje1>
-- and the facets of <Obje2> and intersects the facets when the -- and the facets of <Obje2> and intersects the facets when the
@ -76,9 +73,9 @@ is
Intersect (me : in out; Intersect (me : in out;
TriF : in Integer from Standard; TriF : in Integer from Standard;
Obje1 : in Polyhedron1; Obje1 : in Polyhedron from IntPatch;
TriS : in Integer from Standard; TriS : in Integer from Standard;
Obje2 : in Polyhedron2) Obje2 : in Polyhedron from IntPatch)
is private; is private;
---Purpose: Computes the intersection between the facet <Tri1> of ---Purpose: Computes the intersection between the facet <Tri1> of
-- <FirstPol> and the facet <Tri2> of <SecondPol>. -- <FirstPol> and the facet <Tri2> of <SecondPol>.
@ -86,9 +83,9 @@ is
TangentZoneValue TangentZoneValue
(me; (me;
TheTZ : in out TangentZone from Intf; TheTZ : in out TangentZone from Intf;
Obje1 : Polyhedron1; Obje1 : Polyhedron from IntPatch;
Tri1 : Integer from Standard; Tri1 : Integer from Standard;
Obje2 : Polyhedron2; Obje2 : Polyhedron from IntPatch;
Tri2 : Integer from Standard) Tri2 : Integer from Standard)
returns Boolean from Standard returns Boolean from Standard
is private; is private;
@ -96,8 +93,8 @@ is
-- <FirstPol> and the facet <Tri2> of <SecondPol>. -- <FirstPol> and the facet <Tri2> of <SecondPol>.
CoupleCharacteristics (me: in out; CoupleCharacteristics (me: in out;
FirstPol: Polyhedron1; FirstPol: Polyhedron from IntPatch;
SeconPol: Polyhedron2) is private; SeconPol: Polyhedron from IntPatch) is private;
fields fields
OI : Integer from Standard[3]; -- index des sommets de l objet OI : Integer from Standard[3]; -- index des sommets de l objet
TI : Integer from Standard[3]; -- index des sommets du tool TI : Integer from Standard[3]; -- index des sommets du tool

View File

@ -14,6 +14,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <IntPatch_InterferencePolyhedron.ixx>
#include <IntPatch_Polyhedron.hxx>
#include <IntPatch_PolyhedronTool.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -32,27 +37,27 @@
static const int Pourcent3[9] = {0, 1, 2, 0, 1, 2, 0, 1, 2}; static const int Pourcent3[9] = {0, 1, 2, 0, 1, 2, 0, 1, 2};
//======================================================================= //=======================================================================
//function : Intf_InterferencePolyhedron //function : IntPatch_InterferencePolyhedron
//purpose : Empty constructor. //purpose : Empty constructor.
//======================================================================= //=======================================================================
Intf_InterferencePolyhedron::Intf_InterferencePolyhedron () IntPatch_InterferencePolyhedron::IntPatch_InterferencePolyhedron ()
: Intf_Interference(Standard_False) : Intf_Interference(Standard_False)
{} {}
//======================================================================= //=======================================================================
//function : Intf_InterferencePolyhedron //function : IntPatch_InterferencePolyhedron
//purpose : //purpose :
//======================================================================= //=======================================================================
Intf_InterferencePolyhedron::Intf_InterferencePolyhedron IntPatch_InterferencePolyhedron::IntPatch_InterferencePolyhedron
(const Polyhedron1& FirstPol, const Polyhedron2& SeconPol) (const IntPatch_Polyhedron& FirstPol, const IntPatch_Polyhedron& SeconPol)
: Intf_Interference(Standard_False) : Intf_Interference(Standard_False)
{ {
if (!ToolPolyhe1::Bounding(FirstPol).IsOut if (!IntPatch_PolyhedronTool::Bounding(FirstPol).IsOut
(ToolPolyhe2::Bounding(SeconPol))) { (IntPatch_PolyhedronTool::Bounding(SeconPol))) {
Tolerance=ToolPolyhe1::DeflectionOverEstimation(FirstPol)+ Tolerance=IntPatch_PolyhedronTool::DeflectionOverEstimation(FirstPol)+
ToolPolyhe2::DeflectionOverEstimation(SeconPol); IntPatch_PolyhedronTool::DeflectionOverEstimation(SeconPol);
if (Tolerance==0.) if (Tolerance==0.)
Tolerance=Epsilon(1000.); Tolerance=Epsilon(1000.);
Interference(FirstPol, SeconPol); Interference(FirstPol, SeconPol);
@ -60,15 +65,15 @@ Intf_InterferencePolyhedron::Intf_InterferencePolyhedron
} }
//======================================================================= //=======================================================================
//function : Intf_InterferencePolyhedron //function : IntPatch_InterferencePolyhedron
//purpose : //purpose :
//======================================================================= //=======================================================================
Intf_InterferencePolyhedron::Intf_InterferencePolyhedron IntPatch_InterferencePolyhedron::IntPatch_InterferencePolyhedron
(const Polyhedron1& Objet) (const IntPatch_Polyhedron& Objet)
: Intf_Interference(Standard_True) : Intf_Interference(Standard_True)
{ {
Tolerance=ToolPolyhe1::DeflectionOverEstimation(Objet)*2; Tolerance=IntPatch_PolyhedronTool::DeflectionOverEstimation(Objet)*2;
if (Tolerance==0.) if (Tolerance==0.)
Tolerance=Epsilon(1000.); Tolerance=Epsilon(1000.);
Interference(Objet,Objet); //-- lbr le 5 juillet 96 Interference(Objet,Objet); //-- lbr le 5 juillet 96
@ -80,14 +85,14 @@ Intf_InterferencePolyhedron::Intf_InterferencePolyhedron
//purpose : //purpose :
//======================================================================= //=======================================================================
void Intf_InterferencePolyhedron::Perform void IntPatch_InterferencePolyhedron::Perform
(const Polyhedron1& FirstPol, const Polyhedron2& SeconPol) (const IntPatch_Polyhedron& FirstPol, const IntPatch_Polyhedron& SeconPol)
{ {
SelfInterference(Standard_False); SelfInterference(Standard_False);
if (!ToolPolyhe1::Bounding(FirstPol).IsOut if (!IntPatch_PolyhedronTool::Bounding(FirstPol).IsOut
(ToolPolyhe2::Bounding(SeconPol))) { (IntPatch_PolyhedronTool::Bounding(SeconPol))) {
Tolerance=ToolPolyhe1::DeflectionOverEstimation(FirstPol)+ Tolerance=IntPatch_PolyhedronTool::DeflectionOverEstimation(FirstPol)+
ToolPolyhe2::DeflectionOverEstimation(SeconPol); IntPatch_PolyhedronTool::DeflectionOverEstimation(SeconPol);
if (Tolerance==0.) if (Tolerance==0.)
Tolerance=Epsilon(1000.); Tolerance=Epsilon(1000.);
Interference(FirstPol, SeconPol); Interference(FirstPol, SeconPol);
@ -99,11 +104,11 @@ void Intf_InterferencePolyhedron::Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void Intf_InterferencePolyhedron::Perform void IntPatch_InterferencePolyhedron::Perform
(const Polyhedron1& Objet) (const IntPatch_Polyhedron& Objet)
{ {
SelfInterference(Standard_True); SelfInterference(Standard_True);
Tolerance=ToolPolyhe1::DeflectionOverEstimation(Objet)*2; Tolerance=IntPatch_PolyhedronTool::DeflectionOverEstimation(Objet)*2;
if (Tolerance==0.) if (Tolerance==0.)
Tolerance=Epsilon(1000.); Tolerance=Epsilon(1000.);
Interference(Objet); Interference(Objet);
@ -115,16 +120,16 @@ void Intf_InterferencePolyhedron::Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
void Intf_InterferencePolyhedron::Interference void IntPatch_InterferencePolyhedron::Interference
(const Polyhedron1&) (const IntPatch_Polyhedron&)
{} {}
void Intf_InterferencePolyhedron::Interference void IntPatch_InterferencePolyhedron::Interference
(const Polyhedron1& FirstPol, const Polyhedron2& SeconPol) (const IntPatch_Polyhedron& FirstPol, const IntPatch_Polyhedron& SeconPol)
{ {
Standard_Boolean gridOnFirst=Standard_True; Standard_Boolean gridOnFirst=Standard_True;
Standard_Integer NbTrianglesFirstPol = ToolPolyhe1::NbTriangles(FirstPol); Standard_Integer NbTrianglesFirstPol = IntPatch_PolyhedronTool::NbTriangles(FirstPol);
Standard_Integer NbTrianglesSecondPol = ToolPolyhe2::NbTriangles(SeconPol); Standard_Integer NbTrianglesSecondPol = IntPatch_PolyhedronTool::NbTriangles(SeconPol);
Standard_Integer iFirst, iSecon; Standard_Integer iFirst, iSecon;
//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------
@ -140,10 +145,10 @@ void Intf_InterferencePolyhedron::Interference
if(NbTrianglesFirstPol > NbTrianglesSecondPol+NbTrianglesSecondPol) gridOnFirst=Standard_False; if(NbTrianglesFirstPol > NbTrianglesSecondPol+NbTrianglesSecondPol) gridOnFirst=Standard_False;
Standard_Real vol1,vol2,Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; Standard_Real vol1,vol2,Xmin, Ymin, Zmin, Xmax, Ymax, Zmax;
ToolPolyhe1::Bounding(FirstPol).Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); IntPatch_PolyhedronTool::Bounding(FirstPol).Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
vol1 = (Xmax-Xmin)*(Ymax-Ymin)*(Zmax-Zmin); vol1 = (Xmax-Xmin)*(Ymax-Ymin)*(Zmax-Zmin);
ToolPolyhe1::Bounding(SeconPol).Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); IntPatch_PolyhedronTool::Bounding(SeconPol).Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
vol2 = (Xmax-Xmin)*(Ymax-Ymin)*(Zmax-Zmin); vol2 = (Xmax-Xmin)*(Ymax-Ymin)*(Zmax-Zmin);
if(vol1> 8.0*vol2) gridOnFirst=Standard_False; if(vol1> 8.0*vol2) gridOnFirst=Standard_False;
@ -152,13 +157,13 @@ void Intf_InterferencePolyhedron::Interference
if (gridOnFirst) { if (gridOnFirst) {
Bnd_BoundSortBox TheGridFirst; Bnd_BoundSortBox TheGridFirst;
TheGridFirst.Initialize(ToolPolyhe1::Bounding(FirstPol), TheGridFirst.Initialize(IntPatch_PolyhedronTool::Bounding(FirstPol),
ToolPolyhe1::ComponentsBounding(FirstPol)); IntPatch_PolyhedronTool::ComponentsBounding(FirstPol));
for (iSecon=1; iSecon<=NbTrianglesSecondPol; iSecon++) { for (iSecon=1; iSecon<=NbTrianglesSecondPol; iSecon++) {
TColStd_ListIteratorOfListOfInteger iLoI(TheGridFirst.Compare TColStd_ListIteratorOfListOfInteger iLoI(TheGridFirst.Compare
(ToolPolyhe2::ComponentsBounding(SeconPol)->Value(iSecon))); (IntPatch_PolyhedronTool::ComponentsBounding(SeconPol)->Value(iSecon)));
while (iLoI.More()) { while (iLoI.More()) {
iFirst=iLoI.Value(); iFirst=iLoI.Value();
if (SelfIntf) { if (SelfIntf) {
@ -174,13 +179,13 @@ void Intf_InterferencePolyhedron::Interference
else { else {
Bnd_BoundSortBox TheGridSecond; Bnd_BoundSortBox TheGridSecond;
TheGridSecond.Initialize(ToolPolyhe2::Bounding(SeconPol), TheGridSecond.Initialize(IntPatch_PolyhedronTool::Bounding(SeconPol),
ToolPolyhe2::ComponentsBounding(SeconPol)); IntPatch_PolyhedronTool::ComponentsBounding(SeconPol));
for (iFirst=1; iFirst<=NbTrianglesFirstPol; iFirst++) { for (iFirst=1; iFirst<=NbTrianglesFirstPol; iFirst++) {
TColStd_ListIteratorOfListOfInteger TColStd_ListIteratorOfListOfInteger
iLoI(TheGridSecond.Compare iLoI(TheGridSecond.Compare
(ToolPolyhe1::ComponentsBounding(FirstPol)->Value(iFirst))); (IntPatch_PolyhedronTool::ComponentsBounding(FirstPol)->Value(iFirst)));
while (iLoI.More()) { while (iLoI.More()) {
iSecon=iLoI.Value(); iSecon=iLoI.Value();
@ -202,12 +207,12 @@ void Intf_InterferencePolyhedron::Interference
//purpose : Intersection of two triangles issue from two Polyhedron. //purpose : Intersection of two triangles issue from two Polyhedron.
//======================================================================= //=======================================================================
void Intf_InterferencePolyhedron::Intersect void IntPatch_InterferencePolyhedron::Intersect
(const Standard_Integer Tri1, const Polyhedron1& FirstPol, (const Standard_Integer Tri1, const IntPatch_Polyhedron& FirstPol,
const Standard_Integer Tri2, const Polyhedron2& SeconPol) const Standard_Integer Tri2, const IntPatch_Polyhedron& SeconPol)
{ {
ToolPolyhe1::Triangle(FirstPol, Tri1,OI[0],OI[1],OI[2]); IntPatch_PolyhedronTool::Triangle(FirstPol, Tri1,OI[0],OI[1],OI[2]);
ToolPolyhe2::Triangle(SeconPol, Tri2,TI[0],TI[1],TI[2]); IntPatch_PolyhedronTool::Triangle(SeconPol, Tri2,TI[0],TI[1],TI[2]);
// If there is an intersection of a polyhedron with itself, the // If there is an intersection of a polyhedron with itself, the
// intersections are excluded // intersections are excluded
@ -236,18 +241,18 @@ void Intf_InterferencePolyhedron::Intersect
// Equation of the triangle plane of the objet // Equation of the triangle plane of the objet
gp_XYZ ONor; // Normal vector. gp_XYZ ONor; // Normal vector.
Standard_Real Odp; // Polar Distance. Standard_Real Odp; // Polar Distance.
Intf::PlaneEquation(ToolPolyhe1::Point(FirstPol, OI[0]), Intf::PlaneEquation(IntPatch_PolyhedronTool::Point(FirstPol, OI[0]),
ToolPolyhe1::Point(FirstPol, OI[1]), IntPatch_PolyhedronTool::Point(FirstPol, OI[1]),
ToolPolyhe1::Point(FirstPol, OI[2]), IntPatch_PolyhedronTool::Point(FirstPol, OI[2]),
ONor, Odp); ONor, Odp);
// Equation of the triangle plane of the tool // Equation of the triangle plane of the tool
gp_XYZ TNor; // Normal vector. gp_XYZ TNor; // Normal vector.
Standard_Real Tdp; // Polar distance. Standard_Real Tdp; // Polar distance.
Intf::PlaneEquation(ToolPolyhe2::Point(SeconPol, TI[0]), Intf::PlaneEquation(IntPatch_PolyhedronTool::Point(SeconPol, TI[0]),
ToolPolyhe2::Point(SeconPol, TI[1]), IntPatch_PolyhedronTool::Point(SeconPol, TI[1]),
ToolPolyhe2::Point(SeconPol, TI[2]), IntPatch_PolyhedronTool::Point(SeconPol, TI[2]),
TNor, Tdp); TNor, Tdp);
@ -256,15 +261,15 @@ void Intf_InterferencePolyhedron::Intersect
// Distance of the plane of the triangle from the object by three points of SeconPol // Distance of the plane of the triangle from the object by three points of SeconPol
Standard_Real dfOpT[3]; Standard_Real dfOpT[3];
dfOpT[0]=ONor*(ToolPolyhe2::Point(SeconPol, TI[0]).XYZ())-Odp; dfOpT[0]=ONor*(IntPatch_PolyhedronTool::Point(SeconPol, TI[0]).XYZ())-Odp;
dfOpT[1]=ONor*(ToolPolyhe2::Point(SeconPol, TI[1]).XYZ())-Odp; dfOpT[1]=ONor*(IntPatch_PolyhedronTool::Point(SeconPol, TI[1]).XYZ())-Odp;
dfOpT[2]=ONor*(ToolPolyhe2::Point(SeconPol, TI[2]).XYZ())-Odp; dfOpT[2]=ONor*(IntPatch_PolyhedronTool::Point(SeconPol, TI[2]).XYZ())-Odp;
// Distance of the plane of the triangle from the tool by three points of FirstPol // Distance of the plane of the triangle from the tool by three points of FirstPol
Standard_Real dpOfT[3]; Standard_Real dpOfT[3];
dpOfT[0]=TNor*(ToolPolyhe1::Point(FirstPol, OI[0]).XYZ())-Tdp; dpOfT[0]=TNor*(IntPatch_PolyhedronTool::Point(FirstPol, OI[0]).XYZ())-Tdp;
dpOfT[1]=TNor*(ToolPolyhe1::Point(FirstPol, OI[1]).XYZ())-Tdp; dpOfT[1]=TNor*(IntPatch_PolyhedronTool::Point(FirstPol, OI[1]).XYZ())-Tdp;
dpOfT[2]=TNor*(ToolPolyhe1::Point(FirstPol, OI[2]).XYZ())-Tdp; dpOfT[2]=TNor*(IntPatch_PolyhedronTool::Point(FirstPol, OI[2]).XYZ())-Tdp;
// Values defining the couple of triangle dpOpT, dpOeT, deOpT // Values defining the couple of triangle dpOpT, dpOeT, deOpT
CoupleCharacteristics(FirstPol, SeconPol); CoupleCharacteristics(FirstPol, SeconPol);
@ -318,7 +323,7 @@ void Intf_InterferencePolyhedron::Intersect
//for (iObj=0; iObj<3; iObj++) { //for (iObj=0; iObj<3; iObj++) {
// for (iToo=0; iToo<3; iToo++) { // for (iToo=0; iToo<3; iToo++) {
// if (dpOpT[iObj][iToo] <= floatGap) { // if (dpOpT[iObj][iToo] <= floatGap) {
// piOT.Append(Intf_SectionPoint(ToolPolyhe1::Point(FirstPol, OI[iObj]), // piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]),
// Intf_VERTEX, OI[iObj], 0, 0., // Intf_VERTEX, OI[iObj], 0, 0.,
// Intf_VERTEX, TI[iToo], 0, 0., // Intf_VERTEX, TI[iToo], 0, 0.,
// Incidence)); // Incidence));
@ -334,7 +339,7 @@ void Intf_InterferencePolyhedron::Intersect
for (iObj=0; iObj<3; iObj++) { for (iObj=0; iObj<3; iObj++) {
for (iToo=0; iToo<3; iToo++) { for (iToo=0; iToo<3; iToo++) {
if (dpOpT[iObj][iToo] <= floatGap) { if (dpOpT[iObj][iToo] <= floatGap) {
piOT.Append(Intf_SectionPoint(ToolPolyhe1::Point(FirstPol, OI[iObj]), piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]),
Intf_VERTEX, OI[iObj], 0, 0., Intf_VERTEX, OI[iObj], 0, 0.,
Intf_VERTEX, TI[iToo], 0, 0., Intf_VERTEX, TI[iToo], 0, 0.,
Incidence)); Incidence));
@ -359,7 +364,7 @@ void Intf_InterferencePolyhedron::Intersect
dpOpT[iObj][inext]); dpOpT[iObj][inext]);
if (TI[iToo]>TI[inext]) parT[iToo]=1.-parT[iToo]; if (TI[iToo]>TI[inext]) parT[iToo]=1.-parT[iToo];
piOT.Append(Intf_SectionPoint piOT.Append(Intf_SectionPoint
(ToolPolyhe1::Point(FirstPol, OI[iObj]), (IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]),
Intf_VERTEX, OI[iObj], 0, 0., Intf_VERTEX, OI[iObj], 0, 0.,
Intf_EDGE, Min(TI[iToo],TI[inext]), Intf_EDGE, Min(TI[iToo],TI[inext]),
Max(TI[iToo],TI[inext]), parT[iToo], Max(TI[iToo],TI[inext]), parT[iToo],
@ -387,7 +392,7 @@ void Intf_InterferencePolyhedron::Intersect
dpOpT[inext][iToo]); dpOpT[inext][iToo]);
if (OI[iObj]>OI[inext]) parO[iObj]=1.-parO[iObj]; if (OI[iObj]>OI[inext]) parO[iObj]=1.-parO[iObj];
piOT.Append(Intf_SectionPoint piOT.Append(Intf_SectionPoint
(ToolPolyhe2::Point(SeconPol, TI[iToo]), (IntPatch_PolyhedronTool::Point(SeconPol, TI[iToo]),
Intf_EDGE, Min(OI[iObj],OI[inext]), Intf_EDGE, Min(OI[iObj],OI[inext]),
Max(OI[iObj],OI[inext]), parO[iObj], Max(OI[iObj],OI[inext]), parO[iObj],
Intf_VERTEX, TI[iToo], 0, 0., Intf_VERTEX, TI[iToo], 0, 0.,
@ -406,7 +411,7 @@ void Intf_InterferencePolyhedron::Intersect
for (iToo=0; iToo<3; iToo++) { for (iToo=0; iToo<3; iToo++) {
if (parT[iToo]!=0.) { if (parT[iToo]!=0.) {
if (Abs(dfOpT[iToo]) <= floatGap) { if (Abs(dfOpT[iToo]) <= floatGap) {
piOT.Append(Intf_SectionPoint(ToolPolyhe2::Point(SeconPol, TI[iToo]), piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol, TI[iToo]),
Intf_FACE, Tri1, 0, 0., Intf_FACE, Tri1, 0, 0.,
Intf_VERTEX, TI[iToo], 0, 0., Intf_VERTEX, TI[iToo], 0, 0.,
Incidence)); Incidence));
@ -421,7 +426,7 @@ void Intf_InterferencePolyhedron::Intersect
for (iObj=0; iObj<3; iObj++) { for (iObj=0; iObj<3; iObj++) {
if (parO[iObj]!=0.) { if (parO[iObj]!=0.) {
if (Abs(dpOfT[iObj]) <= floatGap) { if (Abs(dpOfT[iObj]) <= floatGap) {
piOT.Append(Intf_SectionPoint(ToolPolyhe1::Point(FirstPol, OI[iObj]), piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]),
Intf_VERTEX, OI[iObj], 0, 0., Intf_VERTEX, OI[iObj], 0, 0.,
Intf_FACE, Tri2, 0, 0., Intf_FACE, Tri2, 0, 0.,
Incidence)); Incidence));
@ -451,7 +456,7 @@ void Intf_InterferencePolyhedron::Intersect
Standard_Real div=(dpOeT[inext][iToo]-dpOeT[iObj][iToo]); Standard_Real div=(dpOeT[inext][iToo]-dpOeT[iObj][iToo]);
if(div>floatGap || div<-floatGap) { if(div>floatGap || div<-floatGap) {
parO[iObj]=dpOeT[inext][iToo]/div; parO[iObj]=dpOeT[inext][iToo]/div;
piO=(ToolPolyhe1::Point(FirstPol,OI[inext]).XYZ()) + piO=(IntPatch_PolyhedronTool::Point(FirstPol,OI[inext]).XYZ()) +
(voo[iObj].Reversed()*parO[iObj]); (voo[iObj].Reversed()*parO[iObj]);
} }
else else
@ -462,7 +467,7 @@ void Intf_InterferencePolyhedron::Intersect
if(div>floatGap || div<-floatGap) { if(div>floatGap || div<-floatGap) {
parO[iObj]=dpOeT[iObj][iToo]/ parO[iObj]=dpOeT[iObj][iToo]/
(dpOeT[iObj][iToo]-dpOeT[inext][iToo]);; (dpOeT[iObj][iToo]-dpOeT[inext][iToo]);;
piO=(ToolPolyhe1::Point(FirstPol,OI[iObj]).XYZ()) + piO=(IntPatch_PolyhedronTool::Point(FirstPol,OI[iObj]).XYZ()) +
(voo[iObj]*parO[iObj]); (voo[iObj]*parO[iObj]);
} }
else else
@ -472,7 +477,7 @@ void Intf_InterferencePolyhedron::Intersect
Standard_Real div=(deOpT[iObj][jnext]-deOpT[iObj][iToo]); Standard_Real div=(deOpT[iObj][jnext]-deOpT[iObj][iToo]);
if(div>floatGap || div<-floatGap) { if(div>floatGap || div<-floatGap) {
parT[iToo]=deOpT[iObj][jnext]/div; parT[iToo]=deOpT[iObj][jnext]/div;
piT=(ToolPolyhe2::Point(SeconPol,TI[jnext]).XYZ()) + piT=(IntPatch_PolyhedronTool::Point(SeconPol,TI[jnext]).XYZ()) +
(vtt[iToo].Reversed()*parT[iToo]); (vtt[iToo].Reversed()*parT[iToo]);
} }
else else
@ -482,7 +487,7 @@ void Intf_InterferencePolyhedron::Intersect
Standard_Real div=(deOpT[iObj][iToo]-deOpT[iObj][jnext]); Standard_Real div=(deOpT[iObj][iToo]-deOpT[iObj][jnext]);
if(div>floatGap || div<-floatGap) { if(div>floatGap || div<-floatGap) {
parT[iToo]=deOpT[iObj][iToo]/div; parT[iToo]=deOpT[iObj][iToo]/div;
piT=(ToolPolyhe2::Point(SeconPol,TI[iToo]).XYZ()) + piT=(IntPatch_PolyhedronTool::Point(SeconPol,TI[iToo]).XYZ()) +
(vtt[iToo]*parT[iToo]); (vtt[iToo]*parT[iToo]);
} }
else else
@ -517,7 +522,7 @@ void Intf_InterferencePolyhedron::Intersect
lg=dpOfT[iObj]/(dpOfT[iObj]-dpOfT[inext]); lg=dpOfT[iObj]/(dpOfT[iObj]-dpOfT[inext]);
if (lg>0. && lg<1.) { if (lg>0. && lg<1.) {
parO[iObj]=lg; parO[iObj]=lg;
piO=(ToolPolyhe1::Point(FirstPol, OI[iObj]).XYZ())+ piO=(IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]).XYZ())+
(voo[iObj]*parO[iObj]); (voo[iObj]*parO[iObj]);
if (OI[iObj]>OI[inext]) parO[iObj]=1.-parO[iObj]; if (OI[iObj]>OI[inext]) parO[iObj]=1.-parO[iObj];
piOT.Append( piOT.Append(
@ -537,7 +542,7 @@ void Intf_InterferencePolyhedron::Intersect
lg=dfOpT[iToo]/(dfOpT[iToo]-dfOpT[jnext]); lg=dfOpT[iToo]/(dfOpT[iToo]-dfOpT[jnext]);
if (lg>0. && lg<1.) { if (lg>0. && lg<1.) {
parT[iToo]=lg; parT[iToo]=lg;
piO=(ToolPolyhe2::Point(SeconPol, TI[iToo]).XYZ())+ piO=(IntPatch_PolyhedronTool::Point(SeconPol, TI[iToo]).XYZ())+
(vtt[iToo]*parT[iToo]); (vtt[iToo]*parT[iToo]);
if (TI[iToo]>TI[jnext]) parT[iToo]=1.-parT[iToo]; if (TI[iToo]>TI[jnext]) parT[iToo]=1.-parT[iToo];
piOT.Append(Intf_SectionPoint piOT.Append(Intf_SectionPoint
@ -604,7 +609,7 @@ void Intf_InterferencePolyhedron::Intersect
if (parO[2]==0.) pedg=2; if (parO[2]==0.) pedg=2;
} }
if (pivo>=0 && pedg>=0) { if (pivo>=0 && pedg>=0) {
ToolPolyhe1::TriConnex(FirstPol, Tri1,OI[pivo],OI[pedg],pivo,pedg); IntPatch_PolyhedronTool::TriConnex(FirstPol, Tri1,OI[pivo],OI[pedg],pivo,pedg);
if (pivo > Tri1) { if (pivo > Tri1) {
nbpiOT=0; nbpiOT=0;
ideb=-1; // On a deja trouve celle ci ideb=-1; // On a deja trouve celle ci
@ -625,7 +630,7 @@ void Intf_InterferencePolyhedron::Intersect
if (parT[2]==0.) pedg=2; if (parT[2]==0.) pedg=2;
} }
if (pivo>=0 && pedg>=0) { if (pivo>=0 && pedg>=0) {
ToolPolyhe2::TriConnex(SeconPol, Tri2,TI[pivo],TI[pedg],pivo,pedg); IntPatch_PolyhedronTool::TriConnex(SeconPol, Tri2,TI[pivo],TI[pedg],pivo,pedg);
if (pivo > Tri2) { if (pivo > Tri2) {
nbpiOT=0; nbpiOT=0;
ideb=-1; // It has been already found ideb=-1; // It has been already found
@ -691,12 +696,12 @@ void Intf_InterferencePolyhedron::Intersect
Standard_Real d=piOT(-ideb).Pnt().Distance(piOT(-ifin).Pnt()); Standard_Real d=piOT(-ideb).Pnt().Distance(piOT(-ifin).Pnt());
if(d<Tolerance) { if(d<Tolerance) {
Insert(piOT(-ideb), piOT(-ifin)); Insert(piOT(-ideb), piOT(-ifin));
//-- cout<<"Insertion Point Intf_InterferencePolyhedron 1,2 d="<<d<<" Tol="<<Tolerance<<" num:"<<++nisp<<endl; //-- cout<<"Insertion Point IntPatch_InterferencePolyhedron 1,2 d="<<d<<" Tol="<<Tolerance<<" num:"<<++nisp<<endl;
//-- piOT(-ideb).Dump(1); piOT(-ifin).Dump(0); //-- piOT(-ideb).Dump(1); piOT(-ifin).Dump(0);
//-- cout<<"point p"<<++nisp<<" "<<piOT(-ideb).Pnt().X()<<" "<<piOT(-ideb).Pnt().Y()<<" "<<piOT(-ideb).Pnt().Z()<<endl; //-- cout<<"point p"<<++nisp<<" "<<piOT(-ideb).Pnt().X()<<" "<<piOT(-ideb).Pnt().Y()<<" "<<piOT(-ideb).Pnt().Z()<<endl;
} }
else { else {
//-- cout<<"Insertion Point Intf_InterferencePolyhedron 1,2 d="<<d<<" Tol="<<Tolerance<<" NON INSERE "<<endl; //-- cout<<"Insertion Point IntPatch_InterferencePolyhedron 1,2 d="<<d<<" Tol="<<Tolerance<<" NON INSERE "<<endl;
} }
} }
} }
@ -723,11 +728,11 @@ void Intf_InterferencePolyhedron::Intersect
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue
(Intf_TangentZone& TheTZ, (Intf_TangentZone& TheTZ,
const Polyhedron1& FirstPol, const IntPatch_Polyhedron& FirstPol,
const Standard_Integer Tri1, const Standard_Integer Tri1,
const Polyhedron2& SeconPol, const IntPatch_Polyhedron& SeconPol,
const Standard_Integer Tri2) const const Standard_Integer Tri2) const
{ {
// Potential tangent Zone ! // Potential tangent Zone !
@ -753,7 +758,7 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
for (nou=0; nou<=2; nou++) { for (nou=0; nou<=2; nou++) {
nou2=Pourcent3[nou+1]; nou2=Pourcent3[nou+1];
if (dpOpT[nob][nou]<=Tolerance) { if (dpOpT[nob][nou]<=Tolerance) {
Tpi.Append(Intf_SectionPoint(ToolPolyhe1::Point(FirstPol, OI[nob]), Tpi.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[nob]),
Intf_VERTEX, OI[nob], 0, 0., Intf_VERTEX, OI[nob], 0, 0.,
Intf_VERTEX, TI[nou], 0, 0., Intf_VERTEX, TI[nou], 0, 0.,
1.)); 1.));
@ -766,7 +771,7 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
if (dpOpT[nob][nou]+dpOpT[nob][nou2]<vtt[nou].Modulus()) { if (dpOpT[nob][nou]+dpOpT[nob][nou2]<vtt[nou].Modulus()) {
par=dpOpT[nob][nou]/(dpOpT[nob][nou]+dpOpT[nob][nou2]); par=dpOpT[nob][nou]/(dpOpT[nob][nou]+dpOpT[nob][nou2]);
if (TI[nou]>TI[nou2]) par=1.-par; if (TI[nou]>TI[nou2]) par=1.-par;
Tpi.Append(Intf_SectionPoint (ToolPolyhe1::Point(FirstPol, OI[nob]), Tpi.Append(Intf_SectionPoint (IntPatch_PolyhedronTool::Point(FirstPol, OI[nob]),
Intf_VERTEX, OI[nob], 0, 0., Intf_VERTEX, OI[nob], 0, 0.,
Intf_EDGE, Min(TI[nou], TI[nou2]), Intf_EDGE, Min(TI[nou], TI[nou2]),
Max(TI[nou], TI[nou2]), par, Max(TI[nou], TI[nou2]), par,
@ -778,11 +783,11 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
} }
} }
if (tOP[nob]==Intf_EXTERNAL) { if (tOP[nob]==Intf_EXTERNAL) {
if (Intf::Contain(ToolPolyhe2::Point(SeconPol, TI[0]), if (Intf::Contain(IntPatch_PolyhedronTool::Point(SeconPol, TI[0]),
ToolPolyhe2::Point(SeconPol, TI[1]), IntPatch_PolyhedronTool::Point(SeconPol, TI[1]),
ToolPolyhe2::Point(SeconPol, TI[2]), IntPatch_PolyhedronTool::Point(SeconPol, TI[2]),
ToolPolyhe1::Point(FirstPol, OI[nob]))) { IntPatch_PolyhedronTool::Point(FirstPol, OI[nob]))) {
Tpi.Append(Intf_SectionPoint(ToolPolyhe1::Point(FirstPol, OI[nob]), Tpi.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[nob]),
Intf_VERTEX, OI[nob], 0, 0., Intf_VERTEX, OI[nob], 0, 0.,
Intf_FACE, Tri2, 0, 0., Intf_FACE, Tri2, 0, 0.,
1.)); 1.));
@ -805,7 +810,7 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
if (dpOpT[nob][nou]+dpOpT[nob2][nou]<voo[nob].Modulus()) { if (dpOpT[nob][nou]+dpOpT[nob2][nou]<voo[nob].Modulus()) {
par=dpOpT[nob][nou]/(dpOpT[nob][nou]+dpOpT[nob2][nou]); par=dpOpT[nob][nou]/(dpOpT[nob][nou]+dpOpT[nob2][nou]);
if (OI[nob]>OI[nob2]) par=1.-par; if (OI[nob]>OI[nob2]) par=1.-par;
Tpi.Append(Intf_SectionPoint(ToolPolyhe2::Point(SeconPol,TI[nou]), Tpi.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol,TI[nou]),
Intf_EDGE, Min(OI[nob], OI[nob2]), Intf_EDGE, Min(OI[nob], OI[nob2]),
Max(OI[nob], OI[nob2]), par, Max(OI[nob], OI[nob2]), par,
Intf_VERTEX, TI[nou], 0, 0., 1.)); Intf_VERTEX, TI[nou], 0, 0., 1.));
@ -816,11 +821,11 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
} }
} }
if (tTP[nou]==Intf_EXTERNAL) { if (tTP[nou]==Intf_EXTERNAL) {
if (Intf::Contain(ToolPolyhe1::Point(FirstPol, OI[0]), if (Intf::Contain(IntPatch_PolyhedronTool::Point(FirstPol, OI[0]),
ToolPolyhe1::Point(FirstPol, OI[1]), IntPatch_PolyhedronTool::Point(FirstPol, OI[1]),
ToolPolyhe1::Point(FirstPol, OI[2]), IntPatch_PolyhedronTool::Point(FirstPol, OI[2]),
ToolPolyhe2::Point(SeconPol, TI[nou]))) { IntPatch_PolyhedronTool::Point(SeconPol, TI[nou]))) {
Tpi.Append(Intf_SectionPoint(ToolPolyhe2::Point(SeconPol, TI[nou]), Tpi.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol, TI[nou]),
Intf_FACE, Tri1, 0, 0., Intf_FACE, Tri1, 0, 0.,
Intf_VERTEX, TI[nou], 0, 0., Intf_VERTEX, TI[nou], 0, 0.,
1.)); 1.));
@ -867,7 +872,7 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
else { else {
parO[nbpInt]=dpOeT[nob][nou]/(dpOeT[nob][nou]-dpOeT[nob2][nou]); parO[nbpInt]=dpOeT[nob][nou]/(dpOeT[nob][nou]-dpOeT[nob2][nou]);
parT[nbpInt]=deOpT[nob][nou]/(deOpT[nob][nou]-deOpT[nob][nou2]); parT[nbpInt]=deOpT[nob][nou]/(deOpT[nob][nou]-deOpT[nob][nou2]);
gp_Pnt lepi=ToolPolyhe2::Point(SeconPol, TI[nou]).Translated gp_Pnt lepi=IntPatch_PolyhedronTool::Point(SeconPol, TI[nou]).Translated
(gp_Vec(vtt[nou]*parT[nbpInt])); (gp_Vec(vtt[nou]*parT[nbpInt]));
if (OI[nob]>OI[nob2]) parO[nbpInt]=1.-parO[nbpInt]; if (OI[nob]>OI[nob2]) parO[nbpInt]=1.-parO[nbpInt];
if (TI[nou]>TI[nou2]) parT[nbpInt]=1.-parT[nbpInt]; if (TI[nou]>TI[nou2]) parT[nbpInt]=1.-parT[nbpInt];
@ -919,18 +924,18 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
//purpose : //purpose :
//======================================================================= //=======================================================================
void Intf_InterferencePolyhedron::CoupleCharacteristics (const Polyhedron1& FirstPol, void IntPatch_InterferencePolyhedron::CoupleCharacteristics (const IntPatch_Polyhedron& FirstPol,
const Polyhedron2& SeconPol) const IntPatch_Polyhedron& SeconPol)
{ {
Standard_Integer n1, n2; Standard_Integer n1, n2;
Standard_Real lg; Standard_Real lg;
for (n1=0; n1<3; n1++) { for (n1=0; n1<3; n1++) {
n2=Pourcent3[n1+1]; n2=Pourcent3[n1+1];
voo[n1]=ToolPolyhe1::Point(FirstPol, OI[n2]).XYZ()- voo[n1]=IntPatch_PolyhedronTool::Point(FirstPol, OI[n2]).XYZ()-
ToolPolyhe1::Point(FirstPol, OI[n1]).XYZ(); IntPatch_PolyhedronTool::Point(FirstPol, OI[n1]).XYZ();
vtt[n1]=ToolPolyhe2::Point(SeconPol, TI[n2]).XYZ()- vtt[n1]=IntPatch_PolyhedronTool::Point(SeconPol, TI[n2]).XYZ()-
ToolPolyhe2::Point(SeconPol, TI[n1]).XYZ(); IntPatch_PolyhedronTool::Point(SeconPol, TI[n1]).XYZ();
} }
gp_XYZ vvec=(voo[0]^voo[1])+(voo[1]^voo[2])+(voo[2]^voo[0]); gp_XYZ vvec=(voo[0]^voo[1])+(voo[1]^voo[2])+(voo[2]^voo[0]);
@ -942,8 +947,8 @@ void Intf_InterferencePolyhedron::CoupleCharacteristics (const Polyhedron1& Firs
for (n2=0; n2<3; n2++) { for (n2=0; n2<3; n2++) {
gp_XYZ vto=ToolPolyhe1::Point(FirstPol, OI[n1]).XYZ()- gp_XYZ vto=IntPatch_PolyhedronTool::Point(FirstPol, OI[n1]).XYZ()-
ToolPolyhe2::Point(SeconPol, TI[n2]).XYZ(); IntPatch_PolyhedronTool::Point(SeconPol, TI[n2]).XYZ();
dpOpT[n1][n2]=vto.Modulus(); dpOpT[n1][n2]=vto.Modulus();
lg=vtt[n2].Modulus(); lg=vtt[n2].Modulus();

View File

@ -19,8 +19,8 @@
#include <IntPatch_PrmPrmIntersection.ixx> #include <IntPatch_PrmPrmIntersection.ixx>
#include <IntPatch_TheInterfPolyhedron.hxx> #include <IntPatch_InterferencePolyhedron.hxx>
#include <IntPatch_ThePWalkingInter.hxx> #include <IntWalk_PWalking.hxx>
#include <IntPatch_WLine.hxx> #include <IntPatch_WLine.hxx>
#include <IntPatch_RstInt.hxx> #include <IntPatch_RstInt.hxx>
@ -143,7 +143,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
const Standard_Real Deflection, const Standard_Real Deflection,
const Standard_Real Increment) const Standard_Real Increment)
{ {
IntPatch_TheInterfPolyhedron Interference(Poly1,Poly2); IntPatch_InterferencePolyhedron Interference(Poly1,Poly2);
empt = Standard_True; empt = Standard_True;
done = Standard_True; done = Standard_True;
SLin.Clear(); SLin.Clear();
@ -158,7 +158,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
TColStd_Array1OfReal StartParams(1,4); TColStd_Array1OfReal StartParams(1,4);
IntPatch_ThePWalkingInter PW( Surf1, Surf2, TolTangency, Epsilon, Deflection, Increment ); IntWalk_PWalking PW( Surf1, Surf2, TolTangency, Epsilon, Deflection, Increment );
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
Standard_Real incidence; Standard_Real incidence;
@ -538,7 +538,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
const Standard_Real Deflection, const Standard_Real Deflection,
const Standard_Real Increment) const Standard_Real Increment)
{ {
IntPatch_TheInterfPolyhedron Interference(Poly1); IntPatch_InterferencePolyhedron Interference(Poly1);
empt = Standard_True; empt = Standard_True;
done = Standard_True; done = Standard_True;
SLin.Clear(); SLin.Clear();
@ -553,7 +553,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
Standard_Real pu1,pu2,pv1,pv2; Standard_Real pu1,pu2,pv1,pv2;
TColStd_Array1OfReal StartParams(1,4); TColStd_Array1OfReal StartParams(1,4);
IntPatch_ThePWalkingInter PW(Surf1,Surf1,TolTangency,Epsilon,Deflection,Increment); IntWalk_PWalking PW(Surf1,Surf1,TolTangency,Epsilon,Deflection,Increment);
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
Standard_Real incidence; Standard_Real incidence;
@ -995,7 +995,7 @@ Handle_IntPatch_Line IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor3
V2(Low) = v2; V2(Low) = v2;
AC(Low) =0.0; AC(Low) =0.0;
IntPatch_ThePWalkingInter PW(Surf1,Surf2,0.000001,0.000001,0.001,0.001); IntWalk_PWalking PW(Surf1,Surf2,0.000001,0.000001,0.001,0.001);
Standard_Integer i; Standard_Integer i;
for(i=Low+1; i<=High; i++) for(i=Low+1; i<=High; i++)
@ -1340,7 +1340,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
gp_Pnt Point3dDebut,Point3dFin; gp_Pnt Point3dDebut,Point3dFin;
TColStd_Array1OfReal StartParams(1,4); TColStd_Array1OfReal StartParams(1,4);
IntPatch_ThePWalkingInter PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment); IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment);
IntSurf_ListIteratorOfListOfPntOn2S IterLOP2(LOfPnts); IntSurf_ListIteratorOfListOfPntOn2S IterLOP2(LOfPnts);
for(; IterLOP2.More(); IterLOP2.Next() ){ for(; IterLOP2.More(); IterLOP2.Next() ){
@ -1639,7 +1639,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
// nIncrement/=0.5*MaxOscill; // nIncrement/=0.5*MaxOscill;
// } // }
IntPatch_ThePWalkingInter PW(Surf1,Surf2, IntWalk_PWalking PW(Surf1,Surf2,
TolTangency, TolTangency,
Epsilon, Epsilon,
Deflection, Deflection,
@ -1964,7 +1964,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
gp_Pnt Point3dDebut,Point3dFin; gp_Pnt Point3dDebut,Point3dFin;
TColStd_Array1OfReal StartParams(1,4); TColStd_Array1OfReal StartParams(1,4);
IntPatch_ThePWalkingInter PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment); IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,Increment);
if(nbLigSec>=1) if(nbLigSec>=1)
{ {
@ -2663,7 +2663,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
//if(MaxOscill>10) //if(MaxOscill>10)
//nIncrement/=0.5*MaxOscill; //nIncrement/=0.5*MaxOscill;
IntPatch_ThePWalkingInter PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,nIncrement); IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,nIncrement);
Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant
Standard_Real dminiPointLigne; Standard_Real dminiPointLigne;
Standard_Boolean HasStartPoint,RejetLigne; Standard_Boolean HasStartPoint,RejetLigne;

View File

@ -4,9 +4,5 @@ IntWalk_IWalking_3.gxx
IntWalk_IWalking_4.gxx IntWalk_IWalking_4.gxx
IntWalk_IWalking_5.gxx IntWalk_IWalking_5.gxx
IntWalk_IWalking_6.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_VectorOfInteger.hxx
IntWalk_VectorOfWalkingData.hxx IntWalk_VectorOfWalkingData.hxx

View File

@ -29,7 +29,7 @@ package IntWalk
-- All the methods of the classes of this package are Internal. -- All the methods of the classes of this package are Internal.
-- --
uses uses
Standard, MMgt, TCollection, TColStd, gp, math, StdFail, IntSurf, IntImp Standard, MMgt, TCollection, TColStd, gp, math, StdFail, IntSurf, IntImp, Adaptor3d
is is
@ -58,7 +58,11 @@ is
--algorithm/solution for a marching on intersection between --algorithm/solution for a marching on intersection between
-- 2 biparametric surfaces -- 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; end IntWalk;

View File

@ -14,10 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class PWalking from IntWalk ( class PWalking from IntWalk
ThePSurface as any;
ThePSurfaceTool as any)
---Purpose: This class implements an algorithm to determine the ---Purpose: This class implements an algorithm to determine the
-- intersection between 2 parametrized surfaces, marching from -- intersection between 2 parametrized surfaces, marching from
@ -33,21 +30,21 @@ uses XY from gp,
LineOn2S from IntSurf, LineOn2S from IntSurf,
Dir from gp, Dir from gp,
Dir2d from gp, Dir2d from gp,
Pnt from gp Pnt from gp,
TheInt2S from IntWalk,
HSurface from Adaptor3d,
HSurfaceTool from Adaptor3d
raises OutOfRange from Standard, raises OutOfRange from Standard,
NotDone from StdFail NotDone from StdFail
class TheInt2S instantiates Int2S from IntImp
(ThePSurface, ThePSurfaceTool);
is is
Create ( Caro1 , Create ( Caro1 ,
Caro2 : ThePSurface ; Caro2 : HSurface from Adaptor3d ;
TolTangency, TolTangency,
Epsilon, Epsilon,
Deflection, Deflection,
@ -73,7 +70,7 @@ is
Create ( Caro1 , Create ( Caro1 ,
Caro2 : ThePSurface ; Caro2 : HSurface from Adaptor3d ;
TolTangency, TolTangency,
Epsilon, Epsilon,
Deflection, Deflection,
@ -259,7 +256,7 @@ theDirectionFlag: Boolean from Standard)
is private; is private;
DistanceMinimizeByGradient( me : in out; DistanceMinimizeByGradient( me : in out;
theASurf1 , theASurf2 : ThePSurface ; theASurf1 , theASurf2 : HSurface from Adaptor3d ;
theU1, theV1, theU2, theV2: out Real from Standard; theU1, theV1, theU2, theV2: out Real from Standard;
theStep0U1V1: Real from Standard = 1.0e-6; theStep0U1V1: Real from Standard = 1.0e-6;
theStep0U2V2: Real from Standard = 1.0e-6) theStep0U2V2: Real from Standard = 1.0e-6)
@ -269,7 +266,7 @@ theDirectionFlag: Boolean from Standard)
-- initial point. -- initial point.
DistanceMinimizeByExtrema(me : in out; DistanceMinimizeByExtrema(me : in out;
theASurf1 : ThePSurface ; theASurf1 : HSurface from Adaptor3d ;
theP0 : Pnt from gp; theP0 : Pnt from gp;
theU0, theV0: out Real from Standard; theU0, theV0: out Real from Standard;
theStep0U: Real from Standard = 1.0; theStep0U: Real from Standard = 1.0;
@ -280,7 +277,7 @@ theDirectionFlag: Boolean from Standard)
-- initial point. -- initial point.
SeekPointOnBoundary(me : in out; SeekPointOnBoundary(me : in out;
theASurf1 , theASurf2 : ThePSurface ; theASurf1 , theASurf2 : HSurface from Adaptor3d ;
theU1, theV1, theU2, theV2: Real from Standard; theU1, theV1, theU2, theV2: Real from Standard;
isTheFirst : Boolean from Standard) isTheFirst : Boolean from Standard)
returns Boolean from Standard returns Boolean from Standard
@ -290,7 +287,7 @@ theDirectionFlag: Boolean from Standard)
PutToBoundary( me : in out; PutToBoundary( me : in out;
theASurf1 , theASurf2 : ThePSurface) theASurf1 , theASurf2 : HSurface from Adaptor3d)
-- Tries to extend existing intersection line -- Tries to extend existing intersection line
-- (as set of points) to surface's boundaries, -- (as set of points) to surface's boundaries,
-- if it is possibly. -- if it is possibly.
@ -301,7 +298,7 @@ theDirectionFlag: Boolean from Standard)
SeekAdditionalPoints( me : in out; SeekAdditionalPoints( me : in out;
theASurf1 , theASurf2 : ThePSurface; theASurf1 , theASurf2 : HSurface from Adaptor3d;
theMinNbPoints : Integer from Standard) theMinNbPoints : Integer from Standard)
returns Boolean from Standard; returns Boolean from Standard;
-- Unites and correctly coordinates of work of -- Unites and correctly coordinates of work of
@ -351,7 +348,7 @@ fields
firstd1 : Dir2d from gp; firstd1 : Dir2d from gp;
firstd2 : Dir2d from gp; firstd2 : Dir2d from gp;
myIntersectionOn2S : TheInt2S ; myIntersectionOn2S : TheInt2S from IntWalk;
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard; STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
STATIC_PRECEDENT_INFLEXION : Integer from Standard; STATIC_PRECEDENT_INFLEXION : Integer from Standard;
end PWalking; end PWalking;

View File

@ -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>

View File

@ -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;
}
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -101,11 +101,6 @@ is
-- line and a polyhedron. Points of intersection and zones -- line and a polyhedron. Points of intersection and zones
-- of tangence. -- of tangence.
generic class InterferencePolyhedron;
---Purpose: Compute the interference between two polyhedron. Points
-- of intersection , polylines of intersection and zones of
-- tangence.
--- Package Methods : --- Package Methods :
-- --

View File

@ -23,11 +23,6 @@ uses
is is
generic class Mat;
--- Purpose: The Algorithm of Computation of the Map of
-- bisecting locus.
-------------------------------------------------- --------------------------------------------------
-- Classes of exploration of the Bisecting Locus. -- Classes of exploration of the Bisecting Locus.
-------------------------------------------------- --------------------------------------------------

View File

@ -36,17 +36,16 @@ is
deferred class SketchExplorer; deferred class SketchExplorer;
---Purpose: SletchExplorer contains an iterator on a set of geometrys ---Purpose: SletchExplorer contains an iterator on a set of geometrys
-- from Geom2d. It's use by BisectingLocus. -- from Geom2d. It's use by BisectingLocus.
generic class BisectingLocus;
---Purpose: Constuction of the map of the bisector locus on a
-- set of geometrys from Geom2d.
class Tool2d; class Tool2d;
---Purpose: Tool2d contains the geometrys of the map. Tool2d ---Purpose: Tool2d contains the geometrys of the map. Tool2d
-- contains the set of the geometric's methode used for -- contains the set of the geometric's methode used for
-- the map's computation. -- the map's computation.
class Mat2d instantiates Mat from MAT (Tool2d); class Mat2d;
--- Purpose: The Algorithm of Computation of the Map of
-- bisecting locus.
class Connexion; class Connexion;
---Purpose: a Connexion links two lines. ---Purpose: a Connexion links two lines.

View File

@ -14,7 +14,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Mat from MAT (Tool as any) class Mat2d from MAT2d
---Purpose: this class contains the generic algoritm of ---Purpose: this class contains the generic algoritm of
-- computation of the bisecting locus. -- computation of the bisecting locus.
@ -22,20 +22,21 @@ generic class Mat from MAT (Tool as any)
uses uses
Side from MAT, Side from MAT,
Bisector from MAT, Bisector from MAT,
ListOfEdge from MAT, ListOfEdge from MAT,
ListOfBisector from MAT, ListOfBisector from MAT,
DataMapOfIntegerBisector from MAT, DataMapOfIntegerBisector from MAT,
DataMapOfIntegerInteger from TColStd DataMapOfIntegerInteger from TColStd,
Tool2d from MAT2d
is is
Create Create
---Purpose: Empty construtor. ---Purpose: Empty construtor.
returns Mat from MAT; returns Mat2d from MAT2d;
--- Category : Computation. --- Category : Computation.
CreateMat(me : in out ; aTool : in out Tool) CreateMat(me : in out ; aTool : in out Tool2d from MAT2d)
---Purpose: Algoritm of computation of the bisecting locus. ---Purpose: Algoritm of computation of the bisecting locus.
is static; is static;
@ -55,7 +56,7 @@ is
Intersect( me : in out ; Intersect( me : in out ;
atool : in out Tool ; atool : in out Tool2d from MAT2d;
aside : Integer ; aside : Integer ;
noofbisectorstoremove: in out Integer ; noofbisectorstoremove: in out Integer ;
bisector1 : mutable Bisector from MAT; bisector1 : mutable Bisector from MAT;
@ -105,4 +106,4 @@ fields
thecurrentindex : Integer; thecurrentindex : Integer;
isDone : Boolean; isDone : Boolean;
end Mat; end Mat2d;

View File

@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <MAT2d_Mat2d.ixx>
#include <MAT_Edge.hxx> #include <MAT_Edge.hxx>
#include <MAT_ListOfEdge.hxx> #include <MAT_ListOfEdge.hxx>
#include <MAT_Bisector.hxx> #include <MAT_Bisector.hxx>
@ -22,13 +24,14 @@
#include <TColStd_Array1OfInteger.hxx> #include <TColStd_Array1OfInteger.hxx>
#include <MAT_DataMapOfIntegerBisector.hxx> #include <MAT_DataMapOfIntegerBisector.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <MAT2d_Tool2d.hxx>
//======================================================================== //========================================================================
// function : MAT_Mat // function : MAT2d_Mat2d
// purpose : // purpose :
//======================================================================== //========================================================================
MAT_Mat::MAT_Mat() MAT2d_Mat2d::MAT2d_Mat2d()
{ {
thenumberofbisectors = 0; thenumberofbisectors = 0;
thenumberofedges = 0; thenumberofedges = 0;
@ -117,7 +120,7 @@ MAT_Mat::MAT_Mat()
// dans la boucle. // dans la boucle.
// //
//======================================================================== //========================================================================
void MAT_Mat::CreateMat(Tool& atool) void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
{ {
#ifdef ICONTINUE #ifdef ICONTINUE
@ -775,7 +778,7 @@ void MAT_Mat::CreateMat(Tool& atool)
// function : LoadBisectorsToRemove // function : LoadBisectorsToRemove
// purpose : Chargement des bisectrices a effacer. // purpose : Chargement des bisectrices a effacer.
//======================================================================== //========================================================================
void MAT_Mat::LoadBisectorsToRemove void MAT2d_Mat2d::LoadBisectorsToRemove
( Standard_Integer& noofbisectorstoremove, ( Standard_Integer& noofbisectorstoremove,
const Standard_Real distance1, const Standard_Real distance1,
const Standard_Real distance2, const Standard_Real distance2,
@ -842,7 +845,7 @@ void MAT_Mat::LoadBisectorsToRemove
// Si <aside=2> Intersection de <secondbisector> avec ses // Si <aside=2> Intersection de <secondbisector> avec ses
// descendants les plus a gauche et les plus a droite. // descendants les plus a gauche et les plus a droite.
//========================================================================v //========================================================================v
void MAT_Mat::Intersect( Tool& atool, void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool,
const Standard_Integer aside, const Standard_Integer aside,
Standard_Integer& noofbisectortoremove, Standard_Integer& noofbisectortoremove,
const Handle(MAT_Bisector)& firstbisector, const Handle(MAT_Bisector)& firstbisector,
@ -933,7 +936,7 @@ void MAT_Mat::Intersect( Tool& atool,
// function : Init // function : Init
// purpose : // purpose :
//======================================================================== //========================================================================
void MAT_Mat::Init() void MAT2d_Mat2d::Init()
{ {
roots->First(); roots->First();
} }
@ -942,7 +945,7 @@ void MAT_Mat::Init()
// function : More // function : More
// purpose : // purpose :
//======================================================================== //========================================================================
Standard_Boolean MAT_Mat::More() const Standard_Boolean MAT2d_Mat2d::More() const
{ {
return roots->More(); return roots->More();
} }
@ -951,7 +954,7 @@ Standard_Boolean MAT_Mat::More() const
// function : Next // function : Next
// purpose : // purpose :
//======================================================================== //========================================================================
void MAT_Mat::Next() void MAT2d_Mat2d::Next()
{ {
roots->Next(); roots->Next();
} }
@ -960,7 +963,7 @@ void MAT_Mat::Next()
// function : Bisector // function : Bisector
// purpose : // purpose :
//======================================================================== //========================================================================
Handle(MAT_Bisector) MAT_Mat::Bisector() const Handle(MAT_Bisector) MAT2d_Mat2d::Bisector() const
{ {
return roots->Current(); return roots->Current();
} }
@ -969,7 +972,7 @@ Handle(MAT_Bisector) MAT_Mat::Bisector() const
// function : NumberOfBisectors // function : NumberOfBisectors
// purpose : // purpose :
//======================================================================== //========================================================================
Standard_Integer MAT_Mat::NumberOfBisectors() const Standard_Integer MAT2d_Mat2d::NumberOfBisectors() const
{ {
return thenumberofbisectors; return thenumberofbisectors;
} }
@ -978,7 +981,7 @@ Standard_Integer MAT_Mat::NumberOfBisectors() const
// function : SemiInfinite // function : SemiInfinite
// purpose : // purpose :
//======================================================================== //========================================================================
Standard_Boolean MAT_Mat::SemiInfinite() const Standard_Boolean MAT2d_Mat2d::SemiInfinite() const
{ {
return semiInfinite; return semiInfinite;
} }
@ -987,7 +990,7 @@ Standard_Boolean MAT_Mat::SemiInfinite() const
// function : IsDone // function : IsDone
// purpose : // purpose :
//======================================================================== //========================================================================
Standard_Boolean MAT_Mat::IsDone() const Standard_Boolean MAT2d_Mat2d::IsDone() const
{ {
return isDone; return isDone;
} }

View File

@ -32,9 +32,7 @@ is
-- Element, generic Elem, and instance for Transient -- Element, generic Elem, and instance for Transient
class DataInfo; -- used in Elem : this one is for Transient class DataInfo; -- used in Elem : this one is for Transient
deferred class Element; deferred class Element;
generic class Elem; class TransientElem;
class TransientElem instantiates Elem
(Transient, MapTransientHasher from TColStd, DataInfo);
class ElemHasher; class ElemHasher;

View File

@ -14,31 +14,30 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class Elem from MoniTool class TransientElem from MoniTool inherits Element
(TheKey as any;
TheHasher as any;
TheInfo as any)
inherits Element
---Purpose : an Elem defines an Element for a specific input class ---Purpose : an TransientElem defines an Element for a specific input class
-- its definition includes the value of the Key to be mapped, -- its definition includes the value of the Key to be mapped,
-- and the HashCoder associated to the class of the Key -- and the HashCoder associated to the class of the Key
-- --
-- TheKey defines the class to be keyed -- Transient from Standard defines the class to be keyed
-- TheHasher is the associated Hasher -- MapTransientHasher from TColStd is the associated Hasher
-- TheInfo is an additionnal class which helps to provide -- DataInfo from MoniTool is an additionnal class which helps to provide
-- informations on the value (template : see DataInfo) -- informations on the value (template : see DataInfo)
uses CString uses CString,
Transient from Standard,
MapTransientHasher from TColStd,
DataInfo from MoniTool
is is
Create (akey : any TheKey) returns mutable Elem; Create (akey : any Transient from Standard) returns mutable TransientElem;
---Purpose : Creates a Elem with a Value. This Value can then not be ---Purpose : Creates a TransientElem with a Value. This Value can then not be
-- changed. It is used by the Hasher to compute the HashCode, -- changed. It is used by the Hasher to compute the HashCode,
-- which will then be stored for an immediate reading. -- which will then be stored for an immediate reading.
Value (me) returns any TheKey is static; Value (me) returns any Transient from Standard is static;
---Purpose : Returns the contained value ---Purpose : Returns the contained value
---C++ : return const & ---C++ : return const &
@ -57,6 +56,6 @@ is
fields fields
theval : TheKey; theval : Transient from Standard;
end Elem; end TransientElem;

View File

@ -11,31 +11,35 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
//#include <MoniTool_Elem.ixx> #include <MoniTool_TransientElem.ixx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <MoniTool_DataInfo.hxx>
MoniTool_Elem::MoniTool_Elem (const TheKey& akey) MoniTool_TransientElem::MoniTool_TransientElem (const Handle(Standard_Transient)& akey)
: theval (akey) : theval (akey)
{ SetHashCode ( TheHasher::HashCode (akey, IntegerLast() ) ); } { SetHashCode ( TColStd_MapTransientHasher::HashCode (akey, IntegerLast() ) ); }
const TheKey& MoniTool_Elem::Value () const const Handle_Standard_Transient& MoniTool_TransientElem::Value () const
{ return theval; } { return theval; }
Standard_Boolean MoniTool_Elem::Equates Standard_Boolean MoniTool_TransientElem::Equates
(const Handle(MoniTool_Element)& other) const (const Handle(MoniTool_Element)& other) const
{ {
if (other.IsNull()) return Standard_False; if (other.IsNull()) return Standard_False;
if (GetHashCode() != other->GetHashCode()) return Standard_False; if (GetHashCode() != other->GetHashCode()) return Standard_False;
if (other->DynamicType() != DynamicType()) return Standard_False; if (other->DynamicType() != DynamicType()) return Standard_False;
Handle(MoniTool_Elem) another = Handle(MoniTool_Elem)::DownCast(other); Handle(MoniTool_TransientElem) another = Handle(MoniTool_TransientElem)::DownCast(other);
// return (theval == another->Value()); // return (theval == another->Value());
return TheHasher::IsEqual (theval,another->Value()); return TColStd_MapTransientHasher::IsEqual (theval,another->Value());
} }
Handle(Standard_Type) MoniTool_Elem::ValueType () const Handle(Standard_Type) MoniTool_TransientElem::ValueType () const
{ return TheInfo::Type(theval); } { return MoniTool_DataInfo::Type(theval); }
Standard_CString MoniTool_Elem::ValueTypeName () const Standard_CString MoniTool_TransientElem::ValueTypeName () const
{ return TheInfo::TypeName(theval); } { return MoniTool_DataInfo::TypeName(theval); }

View File

@ -35,7 +35,6 @@ is
deferred class Binder; deferred class Binder;
class VoidBinder; class VoidBinder;
generic class SimpleBinder;
class SimpleBinderOfTransient; class SimpleBinderOfTransient;
class BinderOfTransientInteger; class BinderOfTransientInteger;
class TransientListBinder; class TransientListBinder;

View File

@ -1,48 +0,0 @@
// 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 <Transfer_SimpleBinder.ixx> classe generique
// "TheResult" identifie la classe donnee en parametre du Resultat
Transfer_SimpleBinder::Transfer_SimpleBinder () { }
Transfer_SimpleBinder::Transfer_SimpleBinder (const TheResult& res)
: theres (res)
{ SetResultPresent(); }
// Standard_Boolean Transfer_SimpleBinder::IsMultiple() const
// { return Standard_False; }
Handle(Standard_Type) Transfer_SimpleBinder::ResultType () const
{ return TheInfo::Type (theres); } // correspond a "STANDARD_TYPE(TheResult)"
Standard_CString Transfer_SimpleBinder::ResultTypeName () const
{ return TheInfo::TypeName (theres); } // correspond a "STANDARD_TYPE(TheResult)"
void Transfer_SimpleBinder::SetResult (const TheResult& res)
{
SetResultPresent();
theres = res;
}
const TheResult& Transfer_SimpleBinder::Result () const
{ return theres; }
TheResult& Transfer_SimpleBinder::CResult ()
{ SetResultPresent(); return theres; }

View File

@ -29,8 +29,7 @@ is
-- class Analyzer; -- class Analyzer;
class ShapeInfo; class ShapeInfo;
class BinderOfShape instantiates SimpleBinder from Transfer class BinderOfShape;
(Shape from TopoDS, ShapeInfo);
class ShapeBinder; class ShapeBinder;
class ShapeListBinder; class ShapeListBinder;

View File

@ -14,34 +14,32 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
generic class SimpleBinder from Transfer class BinderOfShape from TransferBRep inherits Binder from Transfer
(TheResult as any; -- any : avoid Transient classes
TheInfo as any) -- template : DataInfo
inherits Binder
---Purpose : Allows direct binding between a starting Object and the Result ---Purpose : Allows direct binding between a starting Object and the Result
-- of its transfer when it is Unique. -- of its transfer when it is Unique.
-- The Result itself is defined as a formal parameter <TheResult> -- The Result itself is defined as a formal parameter <Shape from TopoDS>
-- Warning : While it is possible to instantiate SimpleBinder with any Type -- Warning : While it is possible to instantiate BinderOfShape with any Type
-- for the Result, it is not advisable to instantiate it with -- for the Result, it is not advisable to instantiate it with
-- Transient Classes, because such Results are directly known and -- Transient Classes, because such Results are directly known and
-- managed by TransferProcess & Co, through -- managed by TransferProcess & Co, through
-- SimpleBinderOfTransient : this class looks like instantiation -- SimpleBinderOfTransient : this class looks like instantiation
-- of SimpleBinder, but its method ResultType -- of BinderOfShape, but its method ResultType
-- is adapted (reads DynamicType of the Result) -- is adapted (reads DynamicType of the Result)
uses CString, Type uses CString,
Type,
Shape from TopoDS,
ShapeInfo from TransferBRep
raises TransferFailure raises TransferFailure
is is
Create returns mutable SimpleBinder; Create returns mutable BinderOfShape;
---Purpose : normal standard constructor, creates an empty SimpleBinder ---Purpose : normal standard constructor, creates an empty BinderOfShape
Create (res : any TheResult) returns mutable SimpleBinder; Create (res : any Shape from TopoDS) returns mutable BinderOfShape;
---Purpose : constructor which in the same time defines the result ---Purpose : constructor which in the same time defines the result
-- IsMultiple (me) returns Boolean; -- IsMultiple (me) returns Boolean;
@ -51,23 +49,23 @@ is
ResultType (me) returns Type; ResultType (me) returns Type;
---Purpose : Returns the Type permitted for the Result, i.e. the Type ---Purpose : Returns the Type permitted for the Result, i.e. the Type
-- of the Parameter Class <TheResult> (statically defined) -- of the Parameter Class <Shape from TopoDS> (statically defined)
ResultTypeName (me) returns CString; ResultTypeName (me) returns CString;
---Purpose : Returns the Type Name computed for the Result (dynamic) ---Purpose : Returns the Type Name computed for the Result (dynamic)
SetResult (me : mutable; res : any TheResult) SetResult (me : mutable; res : any Shape from TopoDS)
---Purpose : Defines the Result ---Purpose : Defines the Result
raises TransferFailure; raises TransferFailure;
-- Error if the Result is already used (see class Binder) -- Error if the Result is already used (see class Binder)
Result (me) returns any TheResult Result (me) returns any Shape from TopoDS
---Purpose : Returns the defined Result, if there is one ---Purpose : Returns the defined Result, if there is one
raises TransferFailure; raises TransferFailure;
-- Error if the Result is not defined (see class Binder) -- Error if the Result is not defined (see class Binder)
---C++ : return const & ---C++ : return const &
CResult (me : mutable) returns any TheResult; CResult (me : mutable) returns any Shape from TopoDS;
---Purpose : Returns the defined Result, if there is one, and allows to ---Purpose : Returns the defined Result, if there is one, and allows to
-- change it (avoids Result + SetResult). -- change it (avoids Result + SetResult).
-- Admits that Result can be not yet defined -- Admits that Result can be not yet defined
@ -76,6 +74,6 @@ is
fields fields
theres : TheResult; theres : Shape from TopoDS;
end SimpleBinder; end BinderOfShape;

View File

@ -0,0 +1,47 @@
// 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 <TransferBRep_BinderOfShape.ixx>
#include <TransferBRep_ShapeInfo.hxx>
TransferBRep_BinderOfShape::TransferBRep_BinderOfShape (){ }
TransferBRep_BinderOfShape::TransferBRep_BinderOfShape (const TopoDS_Shape& res)
: theres (res)
{ SetResultPresent(); }
// Standard_Boolean TransferBRep_BinderOfShape::IsMultiple() const
// { return Standard_False; }
Handle(Standard_Type) TransferBRep_BinderOfShape::ResultType () const
{ return TransferBRep_ShapeInfo::Type (theres); } // correspond a "STANDARD_TYPE(TopoDS_Shape)"
Standard_CString TransferBRep_BinderOfShape::ResultTypeName () const
{ return TransferBRep_ShapeInfo::TypeName (theres); } // correspond a "STANDARD_TYPE(TopoDS_Shape)"
void TransferBRep_BinderOfShape::SetResult (const TopoDS_Shape& res)
{
SetResultPresent();
theres = res;
}
const TopoDS_Shape& TransferBRep_BinderOfShape::Result () const
{ return theres; }
TopoDS_Shape& TransferBRep_BinderOfShape::CResult ()
{ SetResultPresent(); return theres; }