1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
-- File: BRepFilletAPI.cdl
-- Created: Mon Oct 11 16:05:10 1999
-- Author: Atelier CAS2000
-- <cas@h2ox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1999
package BRepFilletAPI
uses
TColgp,
GeomAbs,
Geom,
TopoDS,
TopTools,
BRepBuilderAPI,
ChFiDS,
ChFi3d,
ChFi2d,
TopOpeBRepBuild,
Law
is
--
-- Local Operations
--
deferred class LocalOperation ; --- inherits MakeShape from BRepBuilderAPI
class MakeFillet ; --- inherits LocalOperation from BRepFilletAPI
class MakeChamfer ; --- inherits LocalOperation from BRepFilletAPI
class MakeFillet2d ; --- inherits inherits MakeShape from BRepBuilderAPI
end;

View File

@@ -0,0 +1,133 @@
-- File: BRepFilletAPI_LocalOperation.cdl
-- Created: Thu Jan 29 14:05:20 1998
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1998
deferred class LocalOperation from BRepFilletAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Construction of fillets on the edges of a Shell.
uses
Shape from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
ListOfShape from TopTools,
SecHArray1 from ChFiDS
is
------------------------------------------------------------------
--- Add d contour
------------------------------------------------------------------
Add(me : in out; E : Edge from TopoDS)
---Purpose: Adds a contour in the builder (builds a
-- contour of tangent edges).
---Level: Public
is deferred;
ResetContour(me : in out;
IC : Integer from Standard)
---Purpose: Reset the contour of index IC, there is nomore
-- information in the contour.
---Level: Public
is deferred;
NbContours(me)
---Purpose: Number of contours.
---Level: Advanced
returns Integer from Standard is deferred;
Contour(me; E : Edge from TopoDS)
---Purpose: Returns the index of the contour containing the edge
-- E, returns 0 if E doesn't belong to any contour.
---Level: Public
returns Integer from Standard is deferred;
NbEdges(me; I : Integer from Standard)
---Purpose: Number of Edges in the contour I.
--
---Level: Advanced
returns Integer from Standard
is deferred;
Edge(me; I,J : Integer from Standard)
---Purpose: Returns the Edge J in the contour I.
--
---C++: return const &
---Level: Advanced
returns Edge from TopoDS
is deferred;
Remove(me : in out; E : Edge from TopoDS)
---Purpose: remove the contour containing the Edge E.
---Level: Advanced
is deferred;
Length(me; IC : Integer from Standard) returns Real from Standard
---Purpose: returns the length the contour of index IC.
is deferred;
FirstVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the first Vertex of the contour of index IC.
---Level: Advanced
is deferred;
LastVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the last Vertex of the contour of index IC.
---Level: Advanced
is deferred;
Abscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: returns the abscissa of the vertex V on
-- the contour of index IC.
is deferred;
RelativeAbscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: returns the relative abscissa([0.,1.]) of the
-- vertex V on the contour of index IC.
is deferred;
ClosedAndTangent(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: returns true if the contour of index IC is closed
-- an tangent.
is deferred;
Closed(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: returns true if the contour of index IC is closed
is deferred;
Reset(me : in out)
---Purpose: Reset all the fields updated by Build operation and
-- leave the algorithm in the same state than before
-- build call. It allows contours and radius
-- modifications to build the result another time.
---Level: Advanced
is deferred;
-------------------------------
---Methods for quick simulation
-------------------------------
Simulate(me : in out; IC : Integer from Standard)
is deferred;
NbSurf(me; IC : Integer from Standard)
returns Integer from Standard
is deferred;
Sect(me; IC, IS : Integer from Standard)
returns mutable SecHArray1 from ChFiDS
is deferred;
end LocalOperation;

View File

@@ -0,0 +1,7 @@
// File: BRepFilletAPI_LocalOperation.cxx
// Created: Mon Feb 2 14:44:00 1998
// Author: Jean Yves LEBEY
// <jyl@langdox.paris1.matra-dtv.fr>
#include <BRepFilletAPI_LocalOperation.ixx>

View File

@@ -0,0 +1,388 @@
-- File: BRepFilletAPI_MakeChamfer.cdl
-- Created: Thu Jun 22 12:16:38 1995
-- Author: Flore Lantheaume
-- <fla@phylox>
---Copyright: Matra Datavision 1995
class MakeChamfer from BRepFilletAPI inherits LocalOperation from BRepFilletAPI
---Purpose: Describes functions to build chamfers on edges of a shell or solid.
-- Chamfered Edge of a Shell or Solid
-- A MakeChamfer object provides a framework for:
-- - initializing the construction algorithm with a given shape,
-- - acquiring the data characterizing the chamfers,
-- - building the chamfers and constructing the resulting shape, and
-- - consulting the result.
uses
Vertex from TopoDS,
Edge from TopoDS,
Face from TopoDS,
Shape from TopoDS,
ChBuilder from ChFi3d,
MapOfShape from TopTools,
ListOfShape from TopTools,
SecHArray1 from ChFiDS,
HBuilder from TopOpeBRepBuild,
ShapeModification from BRepBuilderAPI
raises
NotDone from StdFail
is
Create(S: Shape from TopoDS) returns MakeChamfer from BRepFilletAPI;
---Purpose: Initializes an algorithm for computing chamfers on the shape S.
-- The edges on which chamfers are built are defined using the Add function.
Add(me:in out; E: Edge from TopoDS)
---Purpose: Adds edge E to the table of edges used by this
-- algorithm to build chamfers, where the parameters
-- of the chamfer must be set after the
--contour is added using the function SetDists
-- The Add function results in a contour being built by
-- propagation from the edge E (i.e. the contour contains at
-- least this edge). This contour is composed of edges of
-- the shape which are tangential to one another and
-- which delimit two series of tangential faces, with one
-- series of faces being located on either side of the contour.
-- Warning
-- Nothing is done if edge E or the face F does not belong to the initial shape.
is static;
Add(me:in out;
Dis : Real from Standard;
E : Edge from TopoDS;
F : Face from TopoDS)
---Purpose: Adds edge E to the table of edges used by this
-- algorithm to build chamfers, where
-- the parameters of the chamfer are given by the two
-- distances Dis1 and Dis2; the face F identifies the side
-- where Dis1 is measured.
-- The Add function results in a contour being built by
-- propagation from the edge E (i.e. the contour contains at
-- least this edge). This contour is composed of edges of
-- the shape which are tangential to one another and
-- which delimit two series of tangential faces, with one
-- series of faces being located on either side of the contour.
-- Warning
-- Nothing is done if edge E or the face F does not belong to the initial shape.
is static;
SetDist(me: in out;
Dis : Real from Standard;
IC : Integer from Standard;
F : Face from TopoDS)
---Purpose: Sets the distances Dis1 and Dis2 which give the
-- parameters of the chamfer along the contour of index
-- IC generated using the Add function in the internal
-- data structure of this algorithm. The face F identifies
-- the side where Dis1 is measured.
-- Warning
-- Nothing is done if either the edge E or the face F
-- does not belong to the initial shape.
is static;
GetDist(me;
IC : Integer from Standard;
Dis : out Real from Standard)
is static;
Add(me:in out;
Dis1, Dis2 : Real;
E: Edge from TopoDS;
F: Face from TopoDS)
---Purpose: Adds a fillet contour in the builder (builds a
-- contour of tangent edges to <E> and sets the two
-- distances <Dis1> and <Dis2> ( parameters of the chamfer ) ).
---Level: Public
is static;
SetDists(me: in out;
Dis1, Dis2 : Real from Standard;
IC : Integer from Standard;
F : Face from TopoDS)
---Purpose: Sets the distances Dis1 and Dis2 which give the
-- parameters of the chamfer along the contour of index
-- IC generated using the Add function in the internal
-- data structure of this algorithm. The face F identifies
-- the side where Dis1 is measured.
-- Warning
-- Nothing is done if either the edge E or the face F
-- does not belong to the initial shape.
is static;
Dists(me;
IC : Integer from Standard;
Dis1, Dis2 : out Real from Standard)
is static;
---Purpose: Returns the distances Dis1 and Dis2 which give the
-- parameters of the chamfer along the contour of index IC
-- in the internal data structure of this algorithm.
-- Warning
-- -1. is returned if IC is outside the bounds of the table of contours.
AddDA(me:in out;
Dis : Real from Standard;
Angle : Real from Standard;
E : Edge from TopoDS;
F : Face from TopoDS)
---Purpose: Adds a fillet contour in the builder (builds a
-- contour of tangent edges to <E> and sets the
-- distance <Dis1> and angle <Angle> ( parameters of the chamfer ) ).
---Level: Public
is static;
SetDistAngle(me : in out;
Dis : Real from Standard;
Angle : Real from Standard;
IC : Integer from Standard;
F : Face from TopoDS)
---Purpose: set the distance <Dis> and <Angle> of the fillet
-- contour of index <IC> in the DS with <Dis> on <F>.
---Purpose: if the face <F> is not one of common faces
-- of an edge of the contour <IC>
is static;
GetDistAngle(me ;
IC : Integer from Standard;
Dis : in out Real from Standard;
Angle : in out Real from Standard;
DisOnFace1 : in out Boolean from Standard)
---Purpose: gives the distances <Dis> and <Angle> of the fillet
-- contour of index <IC> in the DS
is static;
IsSymetric(me;
IC : Integer from Standard)
---Purpose: return True if chamfer symetric false else.
returns Boolean from Standard is static;
IsTwoDistances(me;
IC : Integer from Standard)
---Purpose: return True if chamfer is made with two distances false else.
returns Boolean from Standard is static;
IsDistanceAngle(me;
IC : Integer from Standard)
---Purpose: return True if chamfer is made with distance and angle false else.
returns Boolean from Standard is static;
ResetContour(me : in out;
IC : Integer from Standard)
---Purpose: Erases the chamfer parameters on the contour of
-- index IC in the internal data structure of this algorithm.
-- Use the SetDists function to reset this data.
-- Warning
-- Nothing is done if IC is outside the bounds of the table of contours.
is static;
NbContours(me)
---Purpose: Returns the number of contours generated using the
-- Add function in the internal data structure of this algorithm.
returns Integer from Standard is static;
Contour(me; E : Edge from TopoDS )
---Purpose: Returns the index of the contour in the internal data
-- structure of this algorithm, which contains the edge E of the shape.
-- This function returns 0 if the edge E does not belong to any contour.
-- Warning
-- This index can change if a contour is removed from the
-- internal data structure of this algorithm using the function Remove.
returns Integer from Standard is static;
NbEdges(me; I : Integer from Standard)
---Purpose: Returns the number of edges in the contour of index I in
-- the internal data structure of this algorithm.
-- Warning
-- Returns 0 if I is outside the bounds of the table of contours.
returns Integer from Standard
is static;
Edge(me; I,J : Integer from Standard)
---Purpose: Returns the edge of index J in the contour of index I in
-- the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if:
-- - I is outside the bounds of the table of contours, or
-- - J is outside the bounds of the table of edges of the contour of index I.
---C++: return const &
returns Edge from TopoDS
is static;
Remove(me : in out; E : Edge from TopoDS)
---Purpose: Removes the contour in the internal data structure of
-- this algorithm which contains the edge E of the shape.
-- Warning
-- Nothing is done if the edge E does not belong to the
-- contour in the internal data structure of this algorithm.
is static;
Length(me; IC : Integer from Standard) returns Real from Standard
---Purpose: Returns the length of the contour of index IC in the
-- internal data structure of this algorithm.
-- Warning
-- Returns -1. if IC is outside the bounds of the table of contours.
is static;
FirstVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the first vertex of the contour of index IC
-- in the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if IC is outside the bounds of the table of contours.
is static;
LastVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the last vertex of the contour of index IC
-- in the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if IC is outside the bounds of the table of contours.
is static;
Abscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: Returns the curvilinear abscissa of the vertex V on the
-- contour of index IC in the internal data structure of this algorithm.
-- Warning
-- Returns -1. if:
-- - IC is outside the bounds of the table of contours, or
-- - V is not on the contour of index IC.
is static;
RelativeAbscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: Returns the relative curvilinear abscissa (i.e. between 0
-- and 1) of the vertex V on the contour of index IC in the
-- internal data structure of this algorithm.
-- Warning
-- Returns -1. if:
-- - IC is outside the bounds of the table of contours, or
-- - V is not on the contour of index IC.
is static;
ClosedAndTangent(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: eturns true if the contour of index IC in the internal
-- data structure of this algorithm is closed and tangential at the point of closure.
-- Warning
-- Returns false if IC is outside the bounds of the table of contours.
is static;
Closed(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: Returns true if the contour of index IC in the internal
-- data structure of this algorithm is closed.
-- Warning
-- Returns false if IC is outside the bounds of the table of contours.
is static;
Build(me: in out)
---Purpose: Builds the chamfers on all the contours in the internal
-- data structure of this algorithm and constructs the resulting shape.
-- Use the function IsDone to verify that the chamfered
-- shape is built. Use the function Shape to retrieve the chamfered shape.
-- Warning
-- The construction of chamfers implements highly complex
-- construction algorithms. Consequently, there may be
-- instances where the algorithm fails, for example if the
-- data defining the parameters of the chamfer is not
-- compatible with the geometry of the initial shape. There
-- is no initial analysis of errors and these only become
-- evident at the construction stage.
-- Additionally, in the current software release, the following
-- cases are not handled:
-- - the end point of the contour is the point of
-- intersection of 4 or more edges of the shape, or
-- - the intersection of the chamfer with a face which
-- limits the contour is not fully contained in this face.
is redefined;
Reset(me : in out)
---Purpose: Reinitializes this algorithm, thus canceling the effects of the Build function.
-- This function allows modifications to be made to the
-- contours and chamfer parameters in order to rebuild the shape.
is static;
Builder(me) returns HBuilder from TopOpeBRepBuild
---Purpose: Returns the internal filleting algorithm.
---Level: Advanced
is static;
-------------------------------------------
-- Methods usefull for historical utilities --
-------------------------------------------
Generated (me: in out; EorV : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <EorV>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
Modified (me: in out; F : Shape from TopoDS)
---Purpose: Returns the list of shapes modified from the shape
-- <F>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
IsDeleted (me: in out; F : Shape from TopoDS)
returns Boolean
is redefined virtual;
-------------------------------
---Methods for quick simulation
-------------------------------
Simulate(me : in out;
IC : Integer from Standard);
NbSurf(me; IC : Integer from Standard)
returns Integer from Standard;
Sect(me; IC, IS : Integer from Standard)
returns mutable SecHArray1 from ChFiDS;
fields
myBuilder : ChBuilder from ChFi3d;
myMap : MapOfShape from TopTools;
end MakeChamfer;

View File

@@ -0,0 +1,488 @@
// File: BRepFilletAPI_MakeChamfer.cxx
// Created: Thu Jun 22 13:49:13 1995
// Author: Flore Lantheaume
// <fla@phylox>
#include <BRepFilletAPI_MakeChamfer.ixx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <ChFiDS_Spine.hxx>
#include <TopExp_Explorer.hxx>
//=======================================================================
//function : BRepFilletAPI_MakeChamfer
//purpose :
//=======================================================================
BRepFilletAPI_MakeChamfer::BRepFilletAPI_MakeChamfer(const TopoDS_Shape &S):myBuilder(S)
{
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Add(const TopoDS_Edge &E )
{
myBuilder.Add(E);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Add(const Standard_Real Dis,
const TopoDS_Edge &E,
const TopoDS_Face &F)
{
myBuilder.Add(Dis, E, F);
}
//=======================================================================
//function : SetDist
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::SetDist(const Standard_Real Dis,
const Standard_Integer IC,
const TopoDS_Face &F)
{
myBuilder.SetDist(Dis, IC, F);
}
//=======================================================================
//function : GetDist
//purpose :
//================================================================
void BRepFilletAPI_MakeChamfer::GetDist(const Standard_Integer IC,
Standard_Real& Dis) const
{
myBuilder.GetDist(IC, Dis);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Add(const Standard_Real Dis1,
const Standard_Real Dis2,
const TopoDS_Edge &E,
const TopoDS_Face &F)
{
myBuilder.Add(Dis1,Dis2,E,F);
}
//=======================================================================
//function : SetDists
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::SetDists(const Standard_Real Dis1,
const Standard_Real Dis2,
const Standard_Integer IC,
const TopoDS_Face &F)
{
myBuilder.SetDists(Dis1,Dis2,IC,F);
}
//=======================================================================
//function : Dists
//purpose :
//================================================================
void BRepFilletAPI_MakeChamfer::Dists(const Standard_Integer IC,
Standard_Real& Dis1,
Standard_Real& Dis2) const
{
Standard_Real temp1, temp2;
myBuilder.Dists(IC,temp1,temp2);
Dis1 = temp1;
Dis2 = temp2;
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::AddDA(const Standard_Real Dis,
const Standard_Real Angle,
const TopoDS_Edge &E,
const TopoDS_Face &F)
{
myBuilder.AddDA(Dis, Angle, E, F);
}
//=======================================================================
//function : SetDist
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::SetDistAngle(const Standard_Real Dis,
const Standard_Real Angle,
const Standard_Integer IC,
const TopoDS_Face &F)
{
myBuilder.SetDistAngle(Dis, Angle, IC, F);
}
//=======================================================================
//function : GetDistAngle
//purpose :
//================================================================
void BRepFilletAPI_MakeChamfer::GetDistAngle(const Standard_Integer IC,
Standard_Real& Dis,
Standard_Real& Angle,
Standard_Boolean& DisOnFace1) const
{
myBuilder.GetDistAngle(IC, Dis, Angle, DisOnFace1);
}
//=======================================================================
//function : IsSymetric
//purpose :
//===============================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::IsSymetric(const Standard_Integer IC) const
{
ChFiDS_ChamfMethod ChamfMeth = myBuilder.IsChamfer(IC);
Standard_Boolean ret = Standard_False;
if (ChamfMeth == ChFiDS_Sym) ret = Standard_True;
return ret;
}
//=======================================================================
//function : IsTwoDistances
//purpose :
//===============================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::IsTwoDistances(const Standard_Integer IC) const
{
ChFiDS_ChamfMethod ChamfMeth = myBuilder.IsChamfer(IC);
Standard_Boolean ret = Standard_False;
if (ChamfMeth == ChFiDS_TwoDist) ret = Standard_True;
return ret;
}
//=======================================================================
//function : IsDistanceAngle
//purpose :
//===============================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::IsDistanceAngle(const Standard_Integer IC) const
{
ChFiDS_ChamfMethod ChamfMeth = myBuilder.IsChamfer(IC);
Standard_Boolean ret = Standard_False;
if (ChamfMeth == ChFiDS_DistAngle) ret = Standard_True;
return ret;
}
//=======================================================================
//function : ResetContour
//purpose :
//===============================================================
void BRepFilletAPI_MakeChamfer::ResetContour(const Standard_Integer IC)
{
myBuilder.ResetContour(IC);
}
//=======================================================================
//function : NbContours
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeChamfer::NbContours()const
{
return myBuilder.NbElements();
}
//=======================================================================
//function : Contour
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeChamfer::Contour(const TopoDS_Edge &E)const
{
return myBuilder.Contains(E);
}
//=======================================================================
//function : NbEdges
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeChamfer::NbEdges(const Standard_Integer I)const
{
const Handle(ChFiDS_Spine)& Spine = myBuilder.Value(I);
return (Spine->NbEdges());
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepFilletAPI_MakeChamfer::Edge(const Standard_Integer I,
const Standard_Integer J)const
{
const Handle(ChFiDS_Spine)& Spine = myBuilder.Value(I);
const TopoDS_Edge& E = Spine->Edges(J);
return E;
}
//=======================================================================
//function : Remove
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Remove(const TopoDS_Edge& E)
{
myBuilder.Remove(E);
}
//=======================================================================
//function : Length
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeChamfer::Length(const Standard_Integer IC)const
{
return myBuilder.Length(IC);
}
//=======================================================================
//function : FirstVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeChamfer::FirstVertex(const Standard_Integer IC)const
{
return myBuilder.FirstVertex(IC);
}
//=======================================================================
//function : LastVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeChamfer::LastVertex(const Standard_Integer IC)const
{
return myBuilder.LastVertex(IC);
}
//=======================================================================
//function : Abscissa
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeChamfer::Abscissa(const Standard_Integer IC,
const TopoDS_Vertex& V)const
{
return myBuilder.Abscissa(IC,V);
}
//=======================================================================
//function : RelativeAbscissa
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeChamfer::RelativeAbscissa(const Standard_Integer IC,
const TopoDS_Vertex& V)const
{
return myBuilder.RelativeAbscissa(IC,V);
}
//=======================================================================
//function : ClosedAndTangent
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::ClosedAndTangent
(const Standard_Integer IC)const
{
return myBuilder.ClosedAndTangent(IC);
}
//=======================================================================
//function : Closed
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::Closed
(const Standard_Integer IC)const
{
return myBuilder.Closed(IC);
}
//=======================================================================
//function : Builder
//purpose :
//=======================================================================
Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeChamfer::Builder()const
{
return myBuilder.Builder();
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Build()
{
myBuilder.Compute();
if (myBuilder.IsDone()){
Done();
myShape = myBuilder.Shape();
//creation of the Map.
TopExp_Explorer ex;
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) {
myMap.Add(ex.Current());
}
}
}
//=======================================================================
//function : Reset
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Reset()
{
NotDone();
myBuilder.Reset();
myMap.Clear();
}
//=======================================================================
//function : Generated
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeChamfer::Generated
(const TopoDS_Shape& EorV)
{
return myBuilder.Generated(EorV);
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeChamfer::Modified
(const TopoDS_Shape& F)
{
myGenerated.Clear();
if (myBuilder.Builder()->IsSplit(F, TopAbs_OUT)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_OUT));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
if (myBuilder.Builder()->IsSplit(F, TopAbs_IN)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_IN));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
if (myBuilder.Builder()->IsSplit(F, TopAbs_ON)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_ON));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
return myGenerated;
}
//=======================================================================
//function : IsDeleted
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeChamfer::IsDeleted(const TopoDS_Shape& F)
{
if (myMap.Contains(F) ||
myBuilder.Builder()->IsSplit (F, TopAbs_OUT) ||
myBuilder.Builder()->IsSplit (F, TopAbs_IN) ||
myBuilder.Builder()->IsSplit (F, TopAbs_ON))
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : Simulate
//purpose :
//=======================================================================
void BRepFilletAPI_MakeChamfer::Simulate(const Standard_Integer IC)
{
myBuilder.Simulate(IC);
}
//=======================================================================
//function : NbSurf
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeChamfer::NbSurf(const Standard_Integer IC)const
{
return myBuilder.NbSurf(IC);
}
//=======================================================================
//function : Sect
//purpose :
//=======================================================================
Handle(ChFiDS_SecHArray1) BRepFilletAPI_MakeChamfer::Sect(const Standard_Integer IC,
const Standard_Integer IS)const
{
return myBuilder.Sect(IC, IS);
}

View File

@@ -0,0 +1,527 @@
-- File: BRepFilletAPI_MakeFillet.cdl
-- Created: Fri Jun 17 13:39:07 1994
-- Author: Modeling
-- <modeling@phylox>
---Copyright: Matra Datavision 1994
class MakeFillet from BRepFilletAPI inherits LocalOperation from BRepFilletAPI
---Purpose: Describes functions to build fillets on the broken edges of a shell or solid.
-- A MakeFillet object provides a framework for:
-- - initializing the construction algorithm with a given shape,
-- - acquiring the data characterizing the fillets,
-- - building the fillets and constructing the resulting shape, and
-- - consulting the result.
uses
Array1OfPnt2d from TColgp,
Shape from GeomAbs,
Surface from Geom ,
Shape from TopoDS,
Face from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Function from Law,
ListOfShape from TopTools,
SecHArray1 from ChFiDS,
ErrorStatus from ChFiDS,
FilBuilder from ChFi3d,
FilletShape from ChFi3d,
HBuilder from TopOpeBRepBuild,
MapOfShape from TopTools,
ShapeModification from BRepBuilderAPI
raises
NotDone from StdFail ,
NoSuchObject from Standard
is
Create(S : Shape from TopoDS;
FShape: FilletShape from ChFi3d = ChFi3d_Rational)
---Purpose: Initializes the computation of the fillets.
-- <FShape> sets the type of fillet surface. The
-- default value is ChFi3d_Rational (classical nurbs
-- representation of circles). ChFi3d_QuasiAngular
-- corresponds to a nurbs representation of circles
-- which parameterisation matches the circle one.
-- ChFi3d_Polynomial corresponds to a polynomial
-- representation of circles.
---Level: Public
returns MakeFillet from BRepFilletAPI;
SetParams(me : in out;
Tang, Tesp, T2d, TApp3d, TolApp2d, Fleche: Real from Standard)
---Level: Advanced
is static;
SetContinuity(me : in out;
InternalContinuity : Shape from GeomAbs;
AngularTolerance : Real);
---Purpose: Changes the parameters of continiuity
-- InternalContinuity to produce fillet'surfaces with
-- an continuity Ci (i=0,1 or 2).
-- By defaultInternalContinuity = GeomAbs_C1.
-- AngularTolerance is the G1 tolerance between fillet
-- and support'faces.
Add(me : in out; E : Edge from TopoDS)
---Purpose: Adds a fillet contour in the builder (builds a
-- contour of tangent edges).
-- The Radius must be set after.
--
---Level: Public
is static;
Add(me : in out; Radius : Real; E : Edge from TopoDS)
---Purpose: Adds a fillet description in the builder
-- - builds a contour of tangent edges,
-- - sets the radius.
--
---Level: Public
is static;
Add(me : in out; R1,R2 : Real; E : Edge from TopoDS)
---Purpose: Adds a fillet description in the builder
-- - builds a contour of tangent edges,
-- - sets a linear radius evolution law between
-- the first and last vertex of the spine.
--
---Level: Public
is static;
Add(me : in out; L : Function from Law; E : Edge from TopoDS)
---Purpose: Adds a fillet description in the builder
-- - builds a contour of tangent edges,
-- - sest the radius evolution law.
--
---Level: Public
is static;
Add(me : in out; UandR : Array1OfPnt2d from TColgp; E : Edge from TopoDS)
---Purpose: Adds a fillet description in the builder
-- - builds a contour of tangent edges,
-- - sets the radius evolution law interpolating the values
-- given in the array UandR :
--
-- p2d.X() = relative parameter on the spine [0,1]
-- p2d.Y() = value of the radius.
--
---Level: Public
is static;
SetRadius(me : in out;
Radius : Real from Standard;
IC : Integer from Standard;
IinC : Integer from Standard)
---Purpose: Sets the parameters of the fillet
-- along the contour of index IC generated using the Add function
-- in the internal data structure of
-- this algorithm, where Radius is the radius of the fillet.
is static;
SetRadius(me : in out;
R1,R2 : Real from Standard;
IC : Integer from Standard;
IinC : Integer from Standard)
---Purpose: Sets the parameters of the fillet
-- along the contour of index IC generated using the Add function
-- in the internal data structure of this algorithm, where the radius of the
-- fillet evolves according to a linear evolution law defined
-- from R1 to R2, between the first and last vertices of the contour of index IC.
is static;
SetRadius(me : in out;
L : Function from Law;
IC : Integer from Standard;
IinC : Integer from Standard)
---Purpose: Sets the parameters of the fillet
-- along the contour of index IC generated using the Add function
-- in the internal data structure of this algorithm, where the radius of the
-- fillet evolves according to the evolution law L, between the
-- first and last vertices of the contour of index IC.
is static;
SetRadius(me : in out;
UandR : Array1OfPnt2d from TColgp;
IC : Integer from Standard;
IinC : Integer from Standard)
---Purpose: Sets the parameters of the fillet
-- along the contour of index IC generated using the Add function
-- in the internal data structure of this algorithm,
-- where the radius of the fillet evolves according to the evolution law
-- which interpolates the set of parameter and radius pairs given
-- in the array UandR as follows:
-- - the X coordinate of a point in UandR defines a
-- relative parameter on the contour (i.e. a parameter between 0 and 1),
-- - the Y coordinate of a point in UandR gives the
-- corresponding value of the radius, and the radius evolves
-- between the first and last vertices of the contour of index IC.
is static;
ResetContour(me : in out;
IC : Integer from Standard)
---Purpose: Erases the radius information on the contour of index
-- IC in the internal data structure of this algorithm.
-- Use the SetRadius function to reset this data.
-- Warning
-- Nothing is done if IC is outside the bounds of the table of contours.
is static;
IsConstant(me : in out;
IC : Integer from Standard)
returns Boolean from Standard
---Purpose: Returns true if the radius of the fillet along the contour of index IC
-- in the internal data structure of this algorithm is constant,
-- Warning
-- False is returned if IC is outside the bounds of the table
-- of contours or if E does not belong to the contour of index IC.
is static;
Radius(me : in out;
IC : Integer from Standard)
returns Real from Standard
---Purpose: Returns the radius of the fillet along the contour of index IC in the
-- internal data structure of this algorithm
-- Warning
-- - Use this function only if the radius is constant.
-- - -1. is returned if IC is outside the bounds of the
-- table of contours or if E does not belong to the contour of index IC.
is static;
IsConstant(me : in out;
IC : Integer from Standard;
E : Edge from TopoDS)
returns Boolean from Standard
---Purpose: Returns true if the radius of the fillet along the edge E of the
-- contour of index IC in the internal data structure of
-- this algorithm is constant.
-- Warning
-- False is returned if IC is outside the bounds of the table
-- of contours or if E does not belong to the contour of index IC.
is static;
Radius(me : in out;
IC : Integer from Standard;
E : Edge from TopoDS)
returns Real from Standard
---Purpose: Returns the radius of the fillet along the edge E of the contour of index
-- IC in the internal data structure of this algorithm.
-- Warning
-- - Use this function only if the radius is constant.
-- - -1 is returned if IC is outside the bounds of the
-- table of contours or if E does not belong to the contour of index IC.
is static;
SetRadius(me : in out;
Radius : Real;
IC : Integer from Standard;
E : Edge from TopoDS)
---Purpose: Assigns Radius as the radius of the fillet on the edge E
is static;
SetRadius(me : in out;
Radius : Real;
IC : Integer from Standard;
V : Vertex from TopoDS)
--Purpose: Assigns Radius as the radius of the fillet on the vertex V.
-- These two functions are only used on contours where
-- the radius has not been defined. They enable radius
-- values to be assigned locally either to points on the
-- contour (in particular, the first and last vertices) or to
-- portions of the contour. During construction of the fillet,
-- an interpolation using the given values is carried out.
-- Warning
-- Nothing is done if:
-- - the edge E does not belong to the contour of index IC, or
-- - IC is outside the bound of the table of contours, or
is static;
GetBounds(me : in out;
IC : Integer from Standard;
E : Edge from TopoDS;
F,L : out Real from Standard)
returns Boolean from Standard;
GetLaw(me : in out;
IC : Integer from Standard;
E : Edge from TopoDS)
returns mutable Function from Law;
SetLaw(me : in out;
IC : Integer from Standard;
E : Edge from TopoDS;
L : Function from Law);
------------------------------------------------------------------
SetFilletShape(me: in out; FShape: FilletShape from ChFi3d)
---Purpose: Assigns FShape as the type of fillet shape built by this algorithm.
is static;
GetFilletShape(me)
---Purpose: Returns the type of fillet shape built by this algorithm.
returns FilletShape from ChFi3d
is static;
NbContours(me)
---Purpose: Returns the number of contours generated using the
-- Add function in the internal data structure of this algorithm.
returns Integer from Standard is static;
Contour(me; E : Edge from TopoDS)
---Purpose: Returns the index of the contour in the internal data
-- structure of this algorithm which contains the edge E of the shape.
-- This function returns 0 if the edge E does not belong to any contour.
-- Warning
-- This index can change if a contour is removed from the
-- internal data structure of this algorithm using the function Remove.
returns Integer from Standard is static;
NbEdges(me; I : Integer from Standard)
---Purpose: Returns the number of edges in the contour of index I in
-- the internal data structure of this algorithm.
-- Warning
-- Returns 0 if I is outside the bounds of the table of contours.
returns Integer from Standard
is static;
Edge(me; I,J : Integer from Standard)
---Purpose: Returns the edge of index J in the contour of index I in
-- the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if:
-- - I is outside the bounds of the table of contours, or
-- - J is outside the bounds of the table of edges of the index I contour.
---C++: return const &
returns Edge from TopoDS
is static;
Remove(me : in out; E : Edge from TopoDS)
---Purpose: Removes the contour in the internal data structure of
-- this algorithm which contains the edge E of the shape.
-- Warning
-- Nothing is done if the edge E does not belong to the
-- contour in the internal data structure of this algorithm.
is static;
Length(me; IC : Integer from Standard) returns Real from Standard
---Purpose: Returns the length of the contour of index IC in the
-- internal data structure of this algorithm.
-- Warning
-- Returns -1. if IC is outside the bounds of the table of contours.
is static;
FirstVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the first vertex of the contour of index IC
-- in the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if IC is outside the bounds of the table of contours.
is static;
LastVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
---Purpose: Returns the last vertex of the contour of index IC
-- in the internal data structure of this algorithm.
-- Warning
-- Returns a null shape if IC is outside the bounds of the table of contours.
is static;
Abscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: Returns the curvilinear abscissa of the vertex V on the
-- contour of index IC in the internal data structure of this algorithm.
-- Warning
-- Returns -1. if:
-- - IC is outside the bounds of the table of contours, or
-- - V is not on the contour of index IC.
is static;
RelativeAbscissa(me;
IC : Integer from Standard;
V : Vertex from TopoDS)
returns Real from Standard
---Purpose: Returns the relative curvilinear abscissa (i.e. between 0
-- and 1) of the vertex V on the contour of index IC in the
-- internal data structure of this algorithm.
-- Warning
-- Returns -1. if:
-- - IC is outside the bounds of the table of contours, or
-- - V is not on the contour of index IC.
is static;
ClosedAndTangent(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: Returns true if the contour of index IC in the internal
-- data structure of this algorithm is closed and tangential
-- at the point of closure.
-- Warning
-- Returns false if IC is outside the bounds of the table of contours.
is static;
Closed(me; IC : Integer from Standard)
returns Boolean from Standard
---Purpose: Returns true if the contour of index IC in the internal
-- data structure of this algorithm is closed.
-- Warning
-- Returns false if IC is outside the bounds of the table of contours.
is static;
Build(me : in out)
is redefined;
---Purpose: Builds the fillets on all the contours in the internal data
-- structure of this algorithm and constructs the resulting shape.
-- Use the function IsDone to verify that the filleted shape
-- is built. Use the function Shape to retrieve the filleted shape.
-- Warning
-- The construction of fillets implements highly complex
-- construction algorithms. Consequently, there may be
-- instances where the algorithm fails, for example if the
-- data defining the radius of the fillet is not compatible
-- with the geometry of the initial shape. There is no initial
-- analysis of errors and they only become evident at the
-- construction stage.
-- Additionally, in the current software release, the
-- following cases are not handled:
-- - the end point of the contour is the point of
-- intersection of 4 or more edges of the shape, or
-- - the intersection of the fillet with a face which limits
-- the contour is not fully contained in this face.
Reset(me : in out)
---Purpose: Reinitializes this algorithm, thus canceling the effects of the Build function.
-- This function allows modifications to be made to the
-- contours and fillet parameters in order to rebuild the shape.
is static;
Builder(me) returns HBuilder from TopOpeBRepBuild
---Purpose: Returns the internal topology building algorithm.
---Level: Advanced
is static;
-------------------------------------------
-- Methods usefull for historical utilities --
-------------------------------------------
Generated (me: in out; EorV : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <EorV>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
Modified (me: in out; F : Shape from TopoDS)
---Purpose: Returns the list of shapes modified from the shape
-- <F>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
IsDeleted (me: in out; F : Shape from TopoDS)
returns Boolean
is redefined virtual;
-------------------------------------------
-- Methods usefull for BRepCtx utilities --
-------------------------------------------
NbSurfaces(me)
---Purpose: returns the number of surfaces
-- after the shape creation.
---Level: Public
returns Integer from Standard;
NewFaces(me: in out; I: Integer)
---Purpose: Return the faces created for surface <I>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools;
-------------------------------
---Methods for quick simulation
-------------------------------
Simulate(me : in out;
IC : Integer from Standard);
NbSurf(me; IC : Integer from Standard)
returns Integer from Standard;
Sect(me; IC, IS : Integer from Standard)
returns mutable SecHArray1 from ChFiDS;
-------------------------------------
--- Methods for managing errors
-------------------------------------
NbFaultyContours(me)
---Purpose: Returns the number of contours where the computation
-- of the fillet failed
returns Integer from Standard is static;
FaultyContour(me; I : Integer from Standard)
---Purpose: for each I in [1.. NbFaultyContours] returns the index IC of
-- the contour where the computation of the fillet failed.
-- the method NbEdges(IC) gives the number of edges in the contour IC
-- the method Edge(IC,ie) gives the edge number ie of the contour IC
returns Integer from Standard is static;
NbComputedSurfaces(me; IC : Integer from Standard)
---Purpose: returns the number of surfaces which have been
-- computed on the contour IC
returns Integer from Standard is static;
ComputedSurface(me; IC, IS : Integer from Standard)
---Purpose: returns the surface number IS concerning the contour IC
returns Surface from Geom is static;
NbFaultyVertices(me)
---Purpose: returns the number of vertices where the computation failed
returns Integer from Standard is static;
FaultyVertex(me; IV : Integer from Standard)
---Purpose: returns the vertex where the computation failed
returns Vertex from TopoDS is static;
HasResult(me) returns Boolean from Standard is static;
---Purpose: returns true if a part of the result has been computed
-- if the filling in a corner failed a shape with a hole is returned
BadShape(me) returns Shape from TopoDS
---Purpose: if (HasResult()) returns the partial result
raises NoSuchObject from Standard
is static;
StripeStatus(me;IC : Integer from Standard) returns ErrorStatus from ChFiDS
---Purpose: returns the status concerning the contour IC in case of error
-- ChFiDS_Ok : the computation is Ok
-- ChFiDS_StartsolFailure : the computation can't start, perhaps the
-- the radius is too big
-- ChFiDS_TwistedSurface : the computation failed because of a twisted
-- surface
-- ChFiDS_WalkingFailure : there is a problem in the walking
-- ChFiDS_Error: other error different from above
is static;
fields
myBuilder : FilBuilder from ChFi3d;
myMap : MapOfShape from TopTools;
end MakeFillet;

View File

@@ -0,0 +1,743 @@
// File: BRepFilletAPI_MakeFillet.cxx
// Created: Fri Jun 17 15:45:31 1994
// Author: Modeling
// <modeling@phylox>
#include <Precision.hxx>
#include <BRepFilletAPI_MakeFillet.ixx>
#include <TopExp_Explorer.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <ChFiDS_Spine.hxx>
#include <ChFiDS_ErrorStatus.hxx>
#include <Law_Linear.hxx>
#include <Law_S.hxx>
#include <Law_Interpol.hxx>
//=======================================================================
//function : BRepFilletAPI_MakeFillet
//purpose :
//=======================================================================
BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(const TopoDS_Shape& S,
const ChFi3d_FilletShape FShape):
myBuilder(S,FShape)
{
}
//=======================================================================
//function : SetParams
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetParams(const Standard_Real Tang,
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
{
myBuilder.SetParams(Tang,Tesp, T2d, TApp3d, TolApp2d, Fleche);
}
//=======================================================================
//function : SetContinuity
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetContinuity(
const GeomAbs_Shape InternalContinuity,
const Standard_Real AngleTol)
{
myBuilder.SetContinuity(InternalContinuity, AngleTol );
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Add(const TopoDS_Edge& E)
{
myBuilder.Add(E);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Add(const Standard_Real Radius,
const TopoDS_Edge& E)
{
//myBuilder.Add(Radius,E);
myBuilder.Add(E);
Standard_Integer IinC;
Standard_Integer IC = myBuilder.Contains(E, IinC);
if (IC)
SetRadius( Radius, IC, IinC );
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Add(const Standard_Real R1,
const Standard_Real R2,
const TopoDS_Edge& E)
{
myBuilder.Add(E);
Standard_Integer IinC;
Standard_Integer IC = myBuilder.Contains(E, IinC);
if (IC)
SetRadius(R1,R2,IC,IinC);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Add(const Handle(Law_Function)& L,
const TopoDS_Edge& E)
{
//myBuilder.Add(L,E);
myBuilder.Add(E);
Standard_Integer IinC;
Standard_Integer IC = myBuilder.Contains(E, IinC);
if (IC)
SetRadius(L,IC,IinC);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Add(const TColgp_Array1OfPnt2d& UandR,
const TopoDS_Edge& E)
{
myBuilder.Add(E);
Standard_Integer IinC;
Standard_Integer IC = myBuilder.Contains(E, IinC);
if (IC)
SetRadius( UandR, IC, IinC );
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const Standard_Real Radius,
const Standard_Integer IC,
const Standard_Integer IinC)
{
gp_XY FirstUandR( 0., Radius ), LastUandR( 1., Radius );
myBuilder.SetRadius( FirstUandR, IC, IinC );
myBuilder.SetRadius( LastUandR, IC, IinC );
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const Standard_Real R1,
const Standard_Real R2,
const Standard_Integer IC,
const Standard_Integer IinC)
{
Standard_Real r1, r2;
if(Abs(R1-R2) < Precision::Confusion())
r1 = r2 = (R1+R2)*0.5;
else
{
r1 = R1;
r2 = R2;
}
gp_XY FirstUandR( 0., r1 ), LastUandR( 1., r2 );
myBuilder.SetRadius( FirstUandR, IC, IinC );
myBuilder.SetRadius( LastUandR, IC, IinC );
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const Handle(Law_Function)& L,
const Standard_Integer IC,
const Standard_Integer IinC)
{
myBuilder.SetRadius(L,IC,IinC);
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const TColgp_Array1OfPnt2d& UandR,
const Standard_Integer IC,
const Standard_Integer IinC)
{
if(UandR.Length() == 1)
SetRadius( UandR(UandR.Lower()).Y(), IC, IinC );
else if(UandR.Length() == 2)
SetRadius( UandR(UandR.Lower()).Y(), UandR(UandR.Upper()).Y(), IC, IinC );
else{
Standard_Real Uf = UandR(UandR.Lower()).X();
Standard_Real Ul = UandR(UandR.Upper()).X();
for(Standard_Integer i = UandR.Lower(); i <= UandR.Upper(); i++){
Standard_Real Ucur = UandR(i).X();
Ucur = ( Ucur - Uf ) / ( Ul - Uf );
gp_XY newUandR( Ucur, UandR(i).Y() );
myBuilder.SetRadius( newUandR, IC, IinC );
}
}
}
//=======================================================================
//function : IsConstant
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::IsConstant(const Standard_Integer IC)
{
return myBuilder.IsConstant(IC);
}
//=======================================================================
//function : Radius
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeFillet::Radius(const Standard_Integer IC)
{
return myBuilder.Radius(IC);
}
//=======================================================================
//function : ResetContour
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::ResetContour(const Standard_Integer IC)
{
myBuilder.ResetContour(IC);
}
//=======================================================================
//function : IsConstant
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::IsConstant(const Standard_Integer IC,
const TopoDS_Edge& E)
{
return myBuilder.IsConstant(IC,E);
}
//=======================================================================
//function : Radius
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeFillet::Radius(const Standard_Integer IC,
const TopoDS_Edge& E)
{
return myBuilder.Radius(IC,E);
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const Standard_Real Radius,
const Standard_Integer IC,
const TopoDS_Edge& E)
{
myBuilder.SetRadius(Radius,IC,E);
}
//=======================================================================
//function : GetBounds
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::GetBounds(const Standard_Integer IC,
const TopoDS_Edge& E,
Standard_Real& F,
Standard_Real& L)
{
return myBuilder.GetBounds(IC,E,F,L);
}
//=======================================================================
//function : GetLaw
//purpose :
//=======================================================================
Handle(Law_Function) BRepFilletAPI_MakeFillet::GetLaw(const Standard_Integer IC,
const TopoDS_Edge& E)
{
return myBuilder.GetLaw(IC,E);
}
//=======================================================================
//function : SetLaw
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetLaw(const Standard_Integer IC,
const TopoDS_Edge& E,
const Handle(Law_Function)& L)
{
myBuilder.SetLaw(IC,E, L);
}
//=======================================================================
//function : SetRadius
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetRadius(const Standard_Real Radius,
const Standard_Integer IC,
const TopoDS_Vertex& V)
{
myBuilder.SetRadius(Radius,IC,V);
}
//=======================================================================
//function : SetFilletShape
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::SetFilletShape(const ChFi3d_FilletShape FShape)
{
myBuilder.SetFilletShape(FShape);
}
//=======================================================================
//function : GetFilletShape
//purpose :
//=======================================================================
ChFi3d_FilletShape BRepFilletAPI_MakeFillet::GetFilletShape() const
{
return myBuilder.GetFilletShape();
}
//=======================================================================
//function : NbContours
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbContours()const
{
return myBuilder.NbElements();
}
//=======================================================================
//function : Contour
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::Contour(const TopoDS_Edge& E)const
{
return myBuilder.Contains(E);
}
//=======================================================================
//function : NbEdges
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbEdges(const Standard_Integer I)const
{
const Handle(ChFiDS_Spine)& Spine = myBuilder.Value(I);
Standard_Integer n = Spine->NbEdges();
return n;
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepFilletAPI_MakeFillet::Edge(const Standard_Integer I,
const Standard_Integer J)const
{
const Handle(ChFiDS_Spine)& Spine = myBuilder.Value(I);
const TopoDS_Edge& S = Spine->Edges(J);
return S;
}
//=======================================================================
//function : Remove
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Remove(const TopoDS_Edge& E)
{
myBuilder.Remove(E);
}
//=======================================================================
//function : Length
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeFillet::Length(const Standard_Integer IC)const
{
return myBuilder.Length(IC);
}
//=======================================================================
//function : FirstVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeFillet::FirstVertex(const Standard_Integer IC)const
{
return myBuilder.FirstVertex(IC);
}
//=======================================================================
//function : LastVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeFillet::LastVertex(const Standard_Integer IC)const
{
return myBuilder.LastVertex(IC);
}
//=======================================================================
//function : Abscissa
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeFillet::Abscissa(const Standard_Integer IC,
const TopoDS_Vertex& V)const
{
return myBuilder.Abscissa(IC,V);
}
//=======================================================================
//function : RelativeAbscissa
//purpose :
//=======================================================================
Standard_Real BRepFilletAPI_MakeFillet::RelativeAbscissa(const Standard_Integer IC,
const TopoDS_Vertex& V)const
{
return myBuilder.RelativeAbscissa(IC,V);
}
//=======================================================================
//function : ClosedAndTangent
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::ClosedAndTangent
(const Standard_Integer IC)const
{
return myBuilder.ClosedAndTangent(IC);
}
//=======================================================================
//function : Closed
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::Closed
(const Standard_Integer IC)const
{
return myBuilder.Closed(IC);
}
//=======================================================================
//function : Builder
//purpose :
//=======================================================================
Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeFillet::Builder()const
{
return myBuilder.Builder();
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Build()
{
myBuilder.Compute();
if(myBuilder.IsDone()) {
Done();
myShape = myBuilder.Shape();
// creation of the Map.
TopExp_Explorer ex;
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) {
myMap.Add(ex.Current());
}
}
}
//=======================================================================
//function : Reset
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Reset()
{
NotDone();
myBuilder.Reset();
myMap.Clear();
}
//=======================================================================
//function : NbSurfaces
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbSurfaces() const
{
return (myBuilder.Builder()->DataStructure())->NbSurfaces();
}
//=======================================================================
//function : NewFaces
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeFillet::NewFaces
(const Standard_Integer I)
{
return (*(TopTools_ListOfShape*)&(myBuilder.Builder()->NewFaces(I)));
}
//=======================================================================
//function : Simulate
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet::Simulate(const Standard_Integer IC)
{
myBuilder.Simulate(IC);
}
//=======================================================================
//function : NbSurf
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbSurf(const Standard_Integer IC)const
{
return myBuilder.NbSurf(IC);
}
//=======================================================================
//function : Sect
//purpose :
//=======================================================================
Handle(ChFiDS_SecHArray1) BRepFilletAPI_MakeFillet::Sect(const Standard_Integer IC,
const Standard_Integer IS)const
{
return myBuilder.Sect(IC, IS);
}
//=======================================================================
//function : Generated
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeFillet::Generated
(const TopoDS_Shape& EorV)
{
return myBuilder.Generated(EorV);
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeFillet::Modified
(const TopoDS_Shape& F)
{
myGenerated.Clear();
if (myBuilder.Builder()->IsSplit(F, TopAbs_OUT)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_OUT));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
if (myBuilder.Builder()->IsSplit(F, TopAbs_IN)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_IN));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
if (myBuilder.Builder()->IsSplit(F, TopAbs_ON)) {
TopTools_ListIteratorOfListOfShape It(myBuilder.Builder()->Splits(F, TopAbs_ON));
for(;It.More();It.Next()) {
myGenerated.Append(It.Value());
}
}
return myGenerated;
}
//=======================================================================
//function : IsDeleted
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::IsDeleted(const TopoDS_Shape& F)
{
if (myMap.Contains(F) ||
myBuilder.Builder()->IsSplit (F, TopAbs_OUT) ||
myBuilder.Builder()->IsSplit (F, TopAbs_IN) ||
myBuilder.Builder()->IsSplit (F, TopAbs_ON))
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : NbFaultyContours
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbFaultyContours() const
{
return myBuilder.NbFaultyContours();
}
//=======================================================================
//function : FaultyContour
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::FaultyContour(const Standard_Integer I) const
{
return myBuilder.FaultyContour(I);
}
//=======================================================================
//function : NbComputedSurfaces
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbComputedSurfaces(const Standard_Integer IC) const
{
return myBuilder.NbComputedSurfaces (IC);
}
//=======================================================================
//function : ComputedSurface
//purpose :
//=======================================================================
Handle(Geom_Surface) BRepFilletAPI_MakeFillet::ComputedSurface(const Standard_Integer IC,
const Standard_Integer IS) const
{
return myBuilder.ComputedSurface(IC,IS);
}
//=======================================================================
//function : NbFaultyVertices
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet::NbFaultyVertices() const
{
return myBuilder.NbFaultyVertices();
}
//=======================================================================
//function : FaultyVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeFillet::FaultyVertex(const Standard_Integer IV) const
{
return myBuilder.FaultyVertex(IV);
}
//=======================================================================
//function : HasResult
//purpose :
//=======================================================================
Standard_Boolean BRepFilletAPI_MakeFillet::HasResult() const
{
return myBuilder.HasResult();
}
//=======================================================================
//function : BadShape
//purpose :
//=======================================================================
TopoDS_Shape BRepFilletAPI_MakeFillet::BadShape()const
{
return myBuilder.BadShape();
}
//=======================================================================
//function : StripeStatus
//purpose :
//=======================================================================
ChFiDS_ErrorStatus BRepFilletAPI_MakeFillet::StripeStatus(const Standard_Integer IC)const
{
return myBuilder.StripeStatus(IC);
}

View File

@@ -0,0 +1,324 @@
-- File: BRepFilletAPI_MakeFillet2d.cdl
-- Created: Thu Aug 31 14:18:16 1995
-- Author: Remi LEQUETTE
-- <rle@mentox>
---Copyright: Matra Datavision 1995
class MakeFillet2d from BRepFilletAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build fillets and chamfers on the
-- vertices of a planar face.
-- Fillets and Chamfers on the Vertices of a Planar Face
-- A MakeFillet2d object provides a framework for:
-- - initializing the construction algorithm with a given face,
-- - acquiring the data characterizing the fillets and chamfers,
-- - building the fillets and chamfers, and constructing the
-- resulting shape, and
-- - consulting the result.
-- Warning
-- Only segments of straight lines and arcs of circles are
-- treated. BSplines are not processed.
uses
Builder from ChFi2d,
ConstructionError from ChFi2d,
Face from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Shape from TopoDS,
ShapeModification from BRepBuilderAPI,
SequenceOfShape from TopTools,
ListOfShape from TopTools
is
Create returns MakeFillet2d from BRepFilletAPI;
---Purpose: Initializes an empty algorithm for computing fillets and
-- chamfers. The face on which the fillets and
-- chamfers are built is defined using the Init function.
-- The vertices on which fillets or chamfers are built are
-- defined using the AddFillet or AddChamfer function.
-- Warning
-- The status of the initialization, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_Ready if the initialization is correct,
-- - ChFi2d_NotPlanar if F is not planar,
-- - ChFi2d_NoFace if F is a null face.
Create ( F : Face ) returns MakeFillet2d from BRepFilletAPI;
---Purpose: Initializes an algorithm for computing fillets and chamfers on the face F.
-- The vertices on which fillets or chamfers are built are
-- defined using the AddFillet or AddChamfer function.
-- Warning
-- The status of the initialization, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_Ready if the initialization is correct,
-- - ChFi2d_NotPlanar if F is not planar,
-- - ChFi2d_NoFace if F is a null face.
Init( me : in out; F : Face );
---Purpose: Initializes this algorithm for constructing fillets or
-- chamfers with the face F.
-- Warning
-- The status of the initialization, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_Ready if the initialization is correct,
-- - ChFi2d_NotPlanar if F is not planar,
-- - ChFi2d_NoFace if F is a null face.
Init( me : in out; RefFace, ModFace : Face );
---Purpose: This initialize method allow to init the builder
-- from a face <RefFace> and another face <ModFace>
-- which derive from <RefFace>. This is usefull to
-- modify a fillet or a chamfer already created on
-- <ModFace> .
AddFillet ( me : in out; V : Vertex; Radius : Real ) returns Edge;
---Purpose: Adds a fillet of radius Radius between the two edges
-- adjacent to the vertex V on the face modified by this
-- algorithm. The two edges do not need to be rectilinear.
-- This function returns the fillet and builds the resulting face.
-- Warning
-- The status of the construction, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_IsDone if the fillet is built,
-- - ChFi2d_ConnexionError if V does not belong to the initial face,
-- - ChFi2d_ComputationError if Radius is too large
-- to build a fillet between the two adjacent edges,
-- - ChFi2d_NotAuthorized
-- - if one of the two edges connected to V is a fillet or chamfer, or
-- - if a curve other than a straight line or an arc of a
-- circle is used as E, E1 or E2.
-- Do not use the returned fillet if the status of the construction is not ChFi2d_IsDone.
-- Exceptions
-- Standard_NegativeValue if Radius is less than or equal to zero.
ModifyFillet ( me : in out; Fillet : Edge; Radius : Real)
returns Edge;
---Purpose: Assigns the radius Radius to the fillet Fillet already
-- built on the face modified by this algorithm.
-- This function returns the new fillet and modifies the existing face.
-- Warning
-- The status of the construction, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_IsDone if the new fillet is built,
-- - ChFi2d_ConnexionError if Fillet does not
-- belong to the existing face,
-- - ChFi2d_ComputationError if Radius is too
-- large to build a fillet between the two adjacent edges.
-- Do not use the returned fillet if the status of the
-- construction is not ChFi2d_IsDone.
-- Exceptions
-- Standard_NegativeValue if Radius is less than or equal to zero.
RemoveFillet( me : in out; Fillet : Edge)
returns Vertex;
---Purpose: Removes the fillet Fillet already built on the face
-- modified by this algorithm.
-- This function returns the vertex connecting the two
-- adjacent edges of Fillet and modifies the existing face.
-- Warning
-- - The returned vertex is only valid if the Status
-- function returns ChFi2d_IsDone.
-- - A null vertex is returned if the edge Fillet does not
-- belong to the initial face.
AddChamfer ( me : in out; E1, E2 : Edge; D1, D2 : Real )
returns Edge;
---Purpose: Adds a chamfer on the face modified by this algorithm
-- between the two adjacent edges E1 and E2, where
-- the extremities of the chamfer are on E1 and E2 at
-- distances D1 and D2 respectively
-- In cases where the edges are not rectilinear, distances
-- are measured using the curvilinear abscissa of the
-- edges and the angle is measured with respect to the
-- tangent at the corresponding point.
-- The angle Ang is given in radians.
-- This function returns the chamfer and builds the resulting face.
AddChamfer ( me : in out; E : Edge; V : Vertex; D, Ang : Real )
returns Edge;
---Purpose: Adds a chamfer on the face modified by this algorithm
-- between the two edges connected by the vertex V,
-- where E is one of the two edges. The chamfer makes
-- an angle Ang with E and one of its extremities is on
-- E at distance D from V.
-- In cases where the edges are not rectilinear, distances
-- are measured using the curvilinear abscissa of the
-- edges and the angle is measured with respect to the
-- tangent at the corresponding point.
-- The angle Ang is given in radians.
-- This function returns the chamfer and builds the resulting face.
-- Warning
-- The status of the construction, as given by the Status function, can
-- be one of the following:
-- - ChFi2d_IsDone if the chamfer is built,
-- - ChFi2d_ParametersError if D1, D2, D or Ang is less than or equal to zero,
-- - ChFi2d_ConnexionError if:
-- - the edge E, E1 or E2 does not belong to the initial face, or
-- - the edges E1 and E2 are not adjacent, or
-- - the vertex V is not one of the limit points of the edge E,
-- - ChFi2d_ComputationError if the parameters of the chamfer
-- are too large to build a chamfer between the two adjacent edges,
-- - ChFi2d_NotAuthorized if:
-- - the edge E1, E2 or one of the two edges connected to V is a fillet or chamfer, or
-- - a curve other than a straight line or an arc of a circle is used as E, E1 or E2.
-- Do not use the returned chamfer if
-- the status of the construction is not ChFi2d_IsDone.
ModifyChamfer ( me : in out; Chamfer : Edge;
E1 : Edge; E2 : Edge; D1, D2 : Real)
returns Edge;
---Purpose: Modifies the chamfer Chamfer on the face modified
-- by this algorithm, where:
-- E1 and E2 are the two adjacent edges on which
-- Chamfer is already built; the extremities of the new
-- chamfer are on E1 and E2 at distances D1 and D2 respectively.
ModifyChamfer ( me : in out; Chamfer, E : Edge; D, Ang : Real)
returns Edge;
---Purpose: Modifies the chamfer Chamfer on the face modified
-- by this algorithm, where:
-- E is one of the two adjacent edges on which
-- Chamfer is already built; the new chamfer makes
-- an angle Ang with E and one of its extremities is
-- on E at distance D from the vertex on which the chamfer is built.
-- In cases where the edges are not rectilinear, the
-- distances are measured using the curvilinear abscissa
-- of the edges and the angle is measured with respect
-- to the tangent at the corresponding point.
-- The angle Ang is given in radians.
-- This function returns the new chamfer and modifies the existing face.
-- Warning
-- The status of the construction, as given by the Status
-- function, can be one of the following:
-- - ChFi2d_IsDone if the chamfer is built,
-- - ChFi2d_ParametersError if D1, D2, D or Ang is less than or equal to zero,
-- - ChFi2d_ConnexionError if:
-- - the edge E, E1, E2 or Chamfer does not belong
-- to the existing face, or
-- - the edges E1 and E2 are not adjacent,
-- - ChFi2d_ComputationError if the parameters of
-- the chamfer are too large to build a chamfer
-- between the two adjacent edges,
-- - ChFi2d_NotAuthorized if E1 or E2 is a fillet or chamfer.
-- Do not use the returned chamfer if the status of the
-- construction is not ChFi2d_IsDone.
RemoveChamfer( me : in out; Chamfer : Edge)
returns Vertex;
---Purpose: Removes the chamfer Chamfer already built on the face
-- modified by this algorithm.
-- This function returns the vertex connecting the two
-- adjacent edges of Chamfer and modifies the existing face.
-- Warning
-- - The returned vertex is only valid if the Status
-- function returns ChFi2d_IsDone.
-- - A null vertex is returned if the edge Chamfer does
-- not belong to the initial face.
----------------------------------------------
-- Results
----------------------------------------------
IsModified( me; E : Edge ) returns Boolean;
---Purpose: Returns true if the edge E on the face modified by this
-- algorithm is chamfered or filleted.
-- Warning
-- Returns false if E does not belong to the face modified by this algorithm.
---C++: inline
FilletEdges( me ) returns SequenceOfShape;
---Purpose: Returns the table of fillets on the face modified by this algorithm.
---C++: return const &
---C++: inline
NbFillet( me ) returns Integer;
---Purpose: Returns the number of fillets on the face modified by this algorithm.
---C++: inline
ChamferEdges( me ) returns SequenceOfShape;
---Purpose: Returns the table of chamfers on the face modified by this algorithm.
---C++: return const &
---C++: inline
NbChamfer( me ) returns Integer;
---Purpose: Returns the number of chamfers on the face modified by this algorithm.
---C++: inline
-------------------------------------------
-- Methods usefull for historical utilities --
-------------------------------------------
Modified (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes modified from the shape
-- <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is redefined virtual;
NbCurves(me)
---Purpose: returns the number of new curves
-- after the shape creation.
---Level: Public
returns Integer from Standard;
NewEdges(me: in out; I: Integer from Standard)
---Purpose: Return the Edges created for curve I.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools;
HasDescendant( me; E : Edge) returns Boolean;
---C++: inline
DescendantEdge( me; E : Edge) returns Edge;
---Purpose: Returns the chamfered or filleted edge built from the
-- edge E on the face modified by this algorithm. If E has
-- not been modified, this function returns E.
-- Exceptions
-- Standard_NoSuchObject if the edge E does not
-- belong to the initial face.
---C++: return const &
---C++: inline
BasisEdge( me; E : Edge) returns Edge;
---Purpose: Returns the basis edge on the face modified by this
-- algorithm from which the chamfered or filleted edge E is
-- built. If E has not been modified, this function returns E.
-- Warning
-- E is returned if it does not belong to the initial face.
---C++: return const &
Status(me) returns ConstructionError from ChFi2d;
---C++: inline
Build(me : in out)
---Purpose: Update the result and set the Done flag
---Level: Public
is redefined;
fields
myMakeChFi2d : Builder from ChFi2d;
end MakeFillet2d;

View File

@@ -0,0 +1,193 @@
// File: BRepFilletAPI_MakeFillet2d.cxx
// Created: Thu Aug 31 15:04:34 1995
// Author: Remi LEQUETTE
// <rle@mentox>
#include <BRepFilletAPI_MakeFillet2d.ixx>
//=======================================================================
//function : BRepFilletAPI_MakeFillet2d
//purpose :
//=======================================================================
BRepFilletAPI_MakeFillet2d::BRepFilletAPI_MakeFillet2d()
{
}
//=======================================================================
//function : BRepFilletAPI_MakeFillet2d
//purpose :
//=======================================================================
BRepFilletAPI_MakeFillet2d::BRepFilletAPI_MakeFillet2d(const TopoDS_Face& F)
{
myMakeChFi2d.Init(F);
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet2d::Init(const TopoDS_Face& F)
{
myMakeChFi2d.Init(F);
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet2d::Init(const TopoDS_Face& RefFace, const TopoDS_Face& ModFace)
{
myMakeChFi2d.Init(RefFace, ModFace);
}
//=======================================================================
//function : AddFillet
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddFillet(const TopoDS_Vertex& V, const Standard_Real Radius)
{
return myMakeChFi2d.AddFillet(V, Radius);
}
//=======================================================================
//function : ModifyFillet
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyFillet(const TopoDS_Edge& Fillet, const Standard_Real Radius)
{
return myMakeChFi2d.ModifyFillet(Fillet, Radius);
}
//=======================================================================
//function : RemoveFillet
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeFillet2d::RemoveFillet(const TopoDS_Edge& Fillet)
{
return myMakeChFi2d.RemoveFillet(Fillet);
}
//=======================================================================
//function : AddChamfer
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddChamfer(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2)
{
return myMakeChFi2d.AddChamfer(E1, E2, D1, D2);
}
//=======================================================================
//function : AddChamfer
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::AddChamfer(const TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real D, const Standard_Real Ang)
{
return myMakeChFi2d.AddChamfer(E, V, D, Ang);
}
//=======================================================================
//function : ModifyChamfer
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyChamfer(const TopoDS_Edge& Chamfer, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2)
{
return myMakeChFi2d.ModifyChamfer(Chamfer, E1, E2, D1, D2);
}
//=======================================================================
//function : ModifyChamfer
//purpose :
//=======================================================================
TopoDS_Edge BRepFilletAPI_MakeFillet2d::ModifyChamfer(const TopoDS_Edge& Chamfer, const TopoDS_Edge& E, const Standard_Real D, const Standard_Real Ang)
{
return myMakeChFi2d.ModifyChamfer(Chamfer, E, D, Ang);
}
//=======================================================================
//function : RemoveChamfer
//purpose :
//=======================================================================
TopoDS_Vertex BRepFilletAPI_MakeFillet2d::RemoveChamfer(const TopoDS_Edge& Chamfer)
{
return myMakeChFi2d.RemoveChamfer(Chamfer);
}
//=======================================================================
//function : BasisEdge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepFilletAPI_MakeFillet2d::BasisEdge(const TopoDS_Edge& E) const
{
return myMakeChFi2d.BasisEdge(E);
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepFilletAPI_MakeFillet2d::Build()
{
// test if the operation is done
if (Status() == ChFi2d_IsDone) {
Done();
myShape = myMakeChFi2d.Result();
}
else
NotDone();
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeFillet2d::Modified(const TopoDS_Shape& E)
{
myGenerated.Clear();
myGenerated.Append(DescendantEdge(TopoDS::Edge(E)));
return myGenerated;
}
//=======================================================================
//function : NbCurves
//purpose :
//=======================================================================
Standard_Integer BRepFilletAPI_MakeFillet2d::NbCurves() const
{
return NbFillet() + NbChamfer();
}
//=======================================================================
//function : NewEdges
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepFilletAPI_MakeFillet2d::NewEdges(const Standard_Integer I)
{
myGenerated.Clear();
if (I <= NbFillet())
myGenerated.Append(FilletEdges()(I));
else
myGenerated.Append(ChamferEdges()(I-NbFillet()));
return myGenerated;
}

View File

@@ -0,0 +1,85 @@
// File: BRepFilletAPI_MakeFillet2d.lxx
// Created: Thu Aug 31 15:07:45 1995
// Author: Remi LEQUETTE
// <rle@mentox>
//=======================================================================
//function : IsModified
//purpose :
//=======================================================================
inline Standard_Boolean BRepFilletAPI_MakeFillet2d::IsModified(const TopoDS_Edge& E) const
{
return myMakeChFi2d.IsModified(E);
}
//=======================================================================
//function : FilletEdges
//purpose :
//=======================================================================
inline const TopTools_SequenceOfShape& BRepFilletAPI_MakeFillet2d::FilletEdges() const
{
return myMakeChFi2d.FilletEdges();
}
//=======================================================================
//function : NbFillet
//purpose :
//=======================================================================
inline Standard_Integer BRepFilletAPI_MakeFillet2d::NbFillet() const
{
return myMakeChFi2d.NbFillet();
}
//=======================================================================
//function : ChamferEdges
//purpose :
//=======================================================================
inline const TopTools_SequenceOfShape& BRepFilletAPI_MakeFillet2d::ChamferEdges() const
{
return myMakeChFi2d.ChamferEdges();
}
//=======================================================================
//function : NbChamfer
//purpose :
//=======================================================================
inline Standard_Integer BRepFilletAPI_MakeFillet2d::NbChamfer() const
{
return myMakeChFi2d.NbChamfer();
}
//=======================================================================
//function : HasDescendant
//purpose :
//=======================================================================
inline Standard_Boolean BRepFilletAPI_MakeFillet2d::HasDescendant(const TopoDS_Edge& E) const
{
return myMakeChFi2d.HasDescendant(E);
}
//=======================================================================
//function : DescendantEdge
//purpose :
//=======================================================================
inline const TopoDS_Edge& BRepFilletAPI_MakeFillet2d::DescendantEdge(const TopoDS_Edge& E) const
{
return myMakeChFi2d.DescendantEdge(E);
}
//=======================================================================
//function : Status
//purpose :
//=======================================================================
inline ChFi2d_ConstructionError BRepFilletAPI_MakeFillet2d::Status() const
{
return myMakeChFi2d.Status();
}