mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
49
src/TopCnx/TopCnx.cdl
Executable file
49
src/TopCnx/TopCnx.cdl
Executable file
@@ -0,0 +1,49 @@
|
||||
-- File: TopCnx.cdl
|
||||
-- Created: Tue Aug 11 18:08:51 1992
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@phylox>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
|
||||
package TopCnx
|
||||
|
||||
---Purpose: This algorithm provides algorithms to computes
|
||||
-- transitions when many interferences occurs at the
|
||||
-- same place on a shape.
|
||||
--
|
||||
-- An interference is an intersection on a shape (i.e
|
||||
-- a vertex on an edge or an edge on a face) with
|
||||
-- data about the transition (how the shape is
|
||||
-- crossing the boundary where the intersection
|
||||
-- occurs).
|
||||
--
|
||||
-- There are three algorithms to process
|
||||
-- interferences :
|
||||
--
|
||||
-- * EdgeFaceTransition : To process interferences on
|
||||
-- an adge crossing other edges on the boundary of a
|
||||
-- face.
|
||||
--
|
||||
-- * EdgeSolidTransition : To process interferences
|
||||
-- on an edge crossing faces and edges on the
|
||||
-- boundary of a solid.
|
||||
--
|
||||
-- * FaceSolidTransition : To process interferences
|
||||
-- on a face crossing other faces on the boundary of
|
||||
-- a solid.
|
||||
--
|
||||
-- This package relies on the TopTrans package for
|
||||
-- the geometric computations.
|
||||
|
||||
uses
|
||||
Standard,
|
||||
gp,
|
||||
TopAbs,
|
||||
TopTrans
|
||||
|
||||
is
|
||||
class EdgeFaceTransition;
|
||||
---Purpose: Algorithm to compute cumulated transitions on an
|
||||
-- edge crossing the boundary of a face.
|
||||
|
||||
end TopCnx;
|
75
src/TopCnx/TopCnx_EdgeFaceTransition.cdl
Executable file
75
src/TopCnx/TopCnx_EdgeFaceTransition.cdl
Executable file
@@ -0,0 +1,75 @@
|
||||
-- File: EdgeFaceTransition.cdl
|
||||
-- Created: Tue Aug 11 18:17:52 1992
|
||||
-- Author: Remi LEQUETTE
|
||||
-- <rle@phylox>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
|
||||
|
||||
|
||||
class EdgeFaceTransition from TopCnx
|
||||
|
||||
---Purpose: TheEdgeFaceTransition is an algorithm to compute
|
||||
-- the cumulated transition for interferences on an
|
||||
-- edge.
|
||||
|
||||
uses
|
||||
|
||||
Boolean from Standard,
|
||||
Real from Standard,
|
||||
Integer from Standard,
|
||||
|
||||
Pnt from gp,
|
||||
Dir from gp,
|
||||
|
||||
State from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
|
||||
CurveTransition from TopTrans
|
||||
|
||||
is
|
||||
Create returns EdgeFaceTransition from TopCnx;
|
||||
---Purpose: Creates an empty algorithm.
|
||||
|
||||
Reset( me : in out;
|
||||
Tgt : Dir from gp; -- Tangent at this point
|
||||
Norm : Dir from gp; -- Normal vector at this point
|
||||
Curv : Real from Standard) -- Curvature at this point
|
||||
---Purpose: Initialize the algorithm with the local
|
||||
-- description of the edge.
|
||||
is static;
|
||||
|
||||
Reset( me : in out;
|
||||
Tgt : in Dir from gp) -- Tangent at this point
|
||||
---Purpose: Initialize the algorithm with a linear Edge.
|
||||
is static;
|
||||
|
||||
AddInterference(me : in out;
|
||||
Tole : Real from Standard; -- Cosine tolerance
|
||||
Tang : Dir from gp; -- Tangent on curve for this point
|
||||
Norm : Dir from gp; -- Normal vector at this point
|
||||
Curv : Real from Standard; -- Curvature at this point
|
||||
Or : Orientation from TopAbs; -- Orientation on the curve
|
||||
Tr : Orientation from TopAbs; -- Transition
|
||||
BTr : Orientation from TopAbs) -- Boundary transition
|
||||
---Purpose: Add a curve element to the boundary. Or is the
|
||||
-- orientation of the interference on the boundary
|
||||
-- curve. Tr is the transition of the interference.
|
||||
-- BTr is the boundary transition of the
|
||||
-- interference.
|
||||
is static;
|
||||
|
||||
Transition(me) returns Orientation from TopAbs
|
||||
---Purpose: Returns the current cumulated transition.
|
||||
is static;
|
||||
|
||||
BoundaryTransition(me) returns Orientation from TopAbs
|
||||
---Purpose: Returns the current cumulated BoundaryTransition.
|
||||
is static;
|
||||
|
||||
fields
|
||||
myCurveTransition : CurveTransition from TopTrans;
|
||||
nbBoundForward : Integer from Standard;
|
||||
nbBoundReversed : Integer from Standard;
|
||||
|
||||
end EdgeFaceTransition;
|
122
src/TopCnx/TopCnx_EdgeFaceTransition.cxx
Executable file
122
src/TopCnx/TopCnx_EdgeFaceTransition.cxx
Executable file
@@ -0,0 +1,122 @@
|
||||
// File: TopCnx_EdgeFaceTransition.cxx
|
||||
// Created: Wed Aug 12 17:08:45 1992
|
||||
// Author: Remi LEQUETTE
|
||||
// <rle@phylox>
|
||||
|
||||
|
||||
#include <TopCnx_EdgeFaceTransition.ixx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TopCnx_EdgeFaceTransition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopCnx_EdgeFaceTransition::TopCnx_EdgeFaceTransition() :
|
||||
nbBoundForward(0),
|
||||
nbBoundReversed(0)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt,
|
||||
const gp_Dir& Norm,
|
||||
const Standard_Real Curv)
|
||||
{
|
||||
myCurveTransition.Reset(Tgt,Norm,Curv);
|
||||
nbBoundForward = nbBoundReversed = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt)
|
||||
{
|
||||
myCurveTransition.Reset(Tgt);
|
||||
nbBoundForward = nbBoundReversed = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddInterference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopCnx_EdgeFaceTransition::AddInterference(const Standard_Real Tole,
|
||||
const gp_Dir& Tang,
|
||||
const gp_Dir& Norm,
|
||||
const Standard_Real Curv,
|
||||
const TopAbs_Orientation Or,
|
||||
const TopAbs_Orientation Tr,
|
||||
const TopAbs_Orientation BTr)
|
||||
{
|
||||
myCurveTransition.Compare(Tole,Tang,Norm,Curv,Tr,Or);
|
||||
switch (BTr) {
|
||||
|
||||
case TopAbs_FORWARD :
|
||||
nbBoundForward++;
|
||||
break;
|
||||
|
||||
case TopAbs_REVERSED :
|
||||
nbBoundReversed++;
|
||||
break;
|
||||
|
||||
case TopAbs_INTERNAL :
|
||||
case TopAbs_EXTERNAL :
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Transition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation TopCnx_EdgeFaceTransition::Transition()const
|
||||
{
|
||||
TopAbs_State Bef = myCurveTransition.StateBefore();
|
||||
TopAbs_State Aft = myCurveTransition.StateAfter();
|
||||
if (Bef == TopAbs_IN) {
|
||||
if (Aft == TopAbs_IN )
|
||||
return TopAbs_INTERNAL;
|
||||
else if (Aft == TopAbs_OUT)
|
||||
return TopAbs_REVERSED;
|
||||
else
|
||||
cout << "\n*** Complex Transition : unprocessed state"<<endl;
|
||||
}
|
||||
else if (Bef == TopAbs_OUT) {
|
||||
if (Aft == TopAbs_IN )
|
||||
return TopAbs_FORWARD;
|
||||
else if (Aft == TopAbs_OUT)
|
||||
return TopAbs_EXTERNAL;
|
||||
else
|
||||
cout << "\n*** Complex Transition : unprocessed state"<<endl;
|
||||
}
|
||||
else
|
||||
cout << "\n*** Complex Transition : unprocessed state"<<endl;
|
||||
return TopAbs_INTERNAL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BoundaryTransition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation TopCnx_EdgeFaceTransition::BoundaryTransition()const
|
||||
{
|
||||
if (nbBoundForward > nbBoundReversed)
|
||||
return TopAbs_FORWARD;
|
||||
else if (nbBoundForward < nbBoundReversed)
|
||||
return TopAbs_REVERSED;
|
||||
else if ((nbBoundReversed % 2) == 0)
|
||||
return TopAbs_EXTERNAL;
|
||||
else
|
||||
return TopAbs_EXTERNAL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user