mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
24
src/Geom2dHatch/Geom2dHatch.cdl
Executable file
24
src/Geom2dHatch/Geom2dHatch.cdl
Executable file
@@ -0,0 +1,24 @@
|
||||
-- File: Geom2dHacth.cdl
|
||||
-- Created: Thu Feb 3 11:04:48 1994
|
||||
-- Author: Jean Marc LACHAUME
|
||||
-- <jml@phylox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
package Geom2dHatch
|
||||
|
||||
uses
|
||||
Geom2dAdaptor ,
|
||||
Geom2dInt ,
|
||||
gp ,
|
||||
HatchGen
|
||||
|
||||
is
|
||||
|
||||
class Intersector ;
|
||||
|
||||
class Hatcher instantiates Hatcher from HatchGen
|
||||
(Curve from Geom2dAdaptor,
|
||||
Curve from Geom2dAdaptor,
|
||||
Intersector from Geom2dHatch) ;
|
||||
|
||||
end Geom2dHatch ;
|
127
src/Geom2dHatch/Geom2dHatch_Intersector.cdl
Executable file
127
src/Geom2dHatch/Geom2dHatch_Intersector.cdl
Executable file
@@ -0,0 +1,127 @@
|
||||
-- File: Geom2dHatch_Intersector.cdl
|
||||
-- Created: Wed Mar 23 11:16:39 1994
|
||||
-- Author: Jean Marc LACHAUME
|
||||
-- <jml@phylox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
class Intersector from Geom2dHatch
|
||||
|
||||
inherits GInter from Geom2dInt
|
||||
|
||||
uses
|
||||
|
||||
Curve from Geom2dAdaptor,
|
||||
Lin2d from gp,
|
||||
Dir2d from gp
|
||||
|
||||
is
|
||||
|
||||
Create (Confusion : Real from Standard ;
|
||||
Tangency : Real from Standard)
|
||||
|
||||
---Purpose: Creates an intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Intersector from Geom2dHatch ;
|
||||
|
||||
|
||||
ConfusionTolerance (me)
|
||||
|
||||
---Purpose: Returns the confusion tolerance of the
|
||||
-- intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
SetConfusionTolerance (me : in out ;
|
||||
Confusion : Real from Standard)
|
||||
|
||||
---Purpose: Sets the confusion tolerance of the intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
TangencyTolerance (me)
|
||||
|
||||
---Purpose: Returns the tangency tolerance of the
|
||||
-- intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
SetTangencyTolerance (me : in out ;
|
||||
Tangency : Real from Standard)
|
||||
|
||||
---Purpose: Sets the tangency tolerance of the intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Intersect (me : in out ; C1 : Curve from Geom2dAdaptor ;
|
||||
C2 : Curve from Geom2dAdaptor )
|
||||
|
||||
---Purpose: Intersects the curves C1 and C2.
|
||||
-- The results are retreived by the usual methods
|
||||
-- described in IntRes2d_Intersection.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static ;
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
---- M e t h o d s u s e d b y t h e C l a s s i f i e r 2 d ---
|
||||
-------------------------------------------------------------------------
|
||||
Create
|
||||
|
||||
---Purpose: Creates an intersector.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Intersector from Geom2dHatch ;
|
||||
|
||||
Perform(me : in out;
|
||||
L : Lin2d from gp;
|
||||
P : Real from Standard;
|
||||
Tol : Real from Standard;
|
||||
E : Curve from Geom2dAdaptor) -- en fait in out
|
||||
|
||||
---Purpose: Performs the intersection between the 2d line
|
||||
-- segment (<L>, <P>) and the Curve <E>. The line
|
||||
-- segment is the part of the 2d line <L> of
|
||||
-- parameter range [0, <P>] (P is positive and can be
|
||||
-- RealLast()). Tol is the Tolerance on the segment.
|
||||
-- The order is relevant, the first argument is the
|
||||
-- segment, the second the Edge.
|
||||
is static;
|
||||
|
||||
LocalGeometry(me;
|
||||
E : Curve from Geom2dAdaptor;
|
||||
U : Real from Standard;
|
||||
T : out Dir2d from gp;
|
||||
N : out Dir2d from gp;
|
||||
C : out Real)
|
||||
|
||||
---Purpose: Returns in <T>, <N> and <C> the tangent, normal
|
||||
-- and curvature of the edge <E> at parameter value
|
||||
-- <U>.
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myConfusionTolerance : Real from Standard ;
|
||||
myTangencyTolerance : Real from Standard ;
|
||||
|
||||
end Intersector from Geom2dHatch ;
|
89
src/Geom2dHatch/Geom2dHatch_Intersector.cxx
Executable file
89
src/Geom2dHatch/Geom2dHatch_Intersector.cxx
Executable file
@@ -0,0 +1,89 @@
|
||||
// File: Geom2dHatch_Intersector.cxx
|
||||
// Created: Wed Mar 23 11:29:17 1994
|
||||
// Author: Jean Marc LACHAUME
|
||||
// <jml@phylox>
|
||||
|
||||
|
||||
#include <Geom2dHatch_Intersector.ixx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Geom2dLProp_CLProps2d.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Geom2dHatch_Intersector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Geom2dHatch_Intersector::Geom2dHatch_Intersector() :
|
||||
myConfusionTolerance(0.0),
|
||||
myTangencyTolerance(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Intersector::Perform(const gp_Lin2d& L,
|
||||
const Standard_Real P,
|
||||
const Standard_Real Tol,
|
||||
const Geom2dAdaptor_Curve& C)
|
||||
{
|
||||
|
||||
//Standard_Real pfbid,plbid;
|
||||
IntRes2d_Domain DL;
|
||||
if(P!=RealLast())
|
||||
DL.SetValues(L.Location(),0.,Tol,ElCLib::Value(P,L),P,Tol);
|
||||
else
|
||||
DL.SetValues(L.Location(),0.,Tol,Standard_True);
|
||||
|
||||
IntRes2d_Domain DE(C.Value(C.FirstParameter()),
|
||||
C.FirstParameter(),Precision::PIntersection(),
|
||||
C.Value(C.LastParameter()),
|
||||
C.LastParameter(),Precision::PIntersection());
|
||||
|
||||
Handle(Geom2d_Line) GL= new Geom2d_Line(L);
|
||||
Geom2dAdaptor_Curve CGA(GL);
|
||||
void *ptrpoureviterlesproblemesdeconst = (void *)(&C);
|
||||
|
||||
Geom2dInt_GInter Inter(CGA,
|
||||
DL,
|
||||
*((Geom2dAdaptor_Curve *)ptrpoureviterlesproblemesdeconst),
|
||||
DE,
|
||||
Precision::PConfusion(),
|
||||
Precision::PIntersection());
|
||||
this->SetValues(Inter);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LocalGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Intersector::LocalGeometry(const Geom2dAdaptor_Curve& E,
|
||||
const Standard_Real U,
|
||||
gp_Dir2d& Tang,
|
||||
gp_Dir2d& Norm,
|
||||
Standard_Real& C) const
|
||||
{
|
||||
//Standard_Real f,l;
|
||||
Geom2dLProp_CLProps2d Prop(E.Curve(),U,2,Precision::PConfusion());
|
||||
|
||||
if(!Prop.IsTangentDefined()) return;
|
||||
|
||||
Prop.Tangent(Tang);
|
||||
C = Prop.Curvature();
|
||||
if (C > Precision::PConfusion() && C<RealLast())
|
||||
Prop.Normal(Norm);
|
||||
else
|
||||
Norm.SetCoord(Tang.Y(),-Tang.X());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
80
src/Geom2dHatch/Geom2dHatch_Intersector.lxx
Executable file
80
src/Geom2dHatch/Geom2dHatch_Intersector.lxx
Executable file
@@ -0,0 +1,80 @@
|
||||
// File: Geom2dHatch_Intersector.lxx
|
||||
// Created: Wed Mar 23 11:29:27 1994
|
||||
// Author: Jean Marc LACHAUME
|
||||
// <jml@phylox>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Intersector
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
inline Geom2dHatch_Intersector::Geom2dHatch_Intersector
|
||||
(const Standard_Real Confusion,
|
||||
const Standard_Real Tangency) :
|
||||
Geom2dInt_GInter () ,
|
||||
myConfusionTolerance (Confusion) ,
|
||||
myTangencyTolerance (Tangency)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ConfusionTolerance
|
||||
// Purpose : Returns the confusion tolerance of the intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Geom2dHatch_Intersector::ConfusionTolerance
|
||||
() const
|
||||
{
|
||||
return myConfusionTolerance ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : SetConfusionTolerance
|
||||
// Purpose : Sets the confusion tolerance of the intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline void Geom2dHatch_Intersector::SetConfusionTolerance
|
||||
(const Standard_Real Confusion)
|
||||
{
|
||||
myConfusionTolerance = Confusion ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TangencyTolerance
|
||||
// Purpose : Returns the tangency tolerance of the intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Geom2dHatch_Intersector::TangencyTolerance
|
||||
() const
|
||||
{
|
||||
return myTangencyTolerance ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : SetTangencyTolerance
|
||||
// Purpose : Sets the tangency tolerance of the intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline void Geom2dHatch_Intersector::SetTangencyTolerance
|
||||
(const Standard_Real Tangency)
|
||||
{
|
||||
myTangencyTolerance = Tangency ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Intersect
|
||||
// Purpose : Intersects the curves C1 and C2.
|
||||
//=======================================================================
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
|
||||
inline void Geom2dHatch_Intersector::Intersect
|
||||
(const Geom2dAdaptor_Curve& C1,
|
||||
const Geom2dAdaptor_Curve& C2)
|
||||
{
|
||||
Geom2dInt_GInter::Perform(C1,
|
||||
C2,
|
||||
myConfusionTolerance, myTangencyTolerance) ;
|
||||
|
||||
}
|
Reference in New Issue
Block a user