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

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,45 +0,0 @@
-- Created on: 1999-10-11
-- Created by: Atelier CAS2000
-- Copyright (c) 1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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

@@ -1,143 +0,0 @@
-- Created on: 1998-01-29
-- Created by: Laurent BOURESCHE
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 SecHArray1 from ChFiDS
is deferred;
end LocalOperation;

View File

@@ -14,4 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepFilletAPI_LocalOperation.ixx>
#include <BRepFilletAPI_LocalOperation.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>

View File

@@ -0,0 +1,124 @@
// Created on: 1998-01-29
// Created by: Laurent BOURESCHE
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFilletAPI_LocalOperation_HeaderFile
#define _BRepFilletAPI_LocalOperation_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <ChFiDS_SecHArray1.hxx>
class TopoDS_Edge;
class TopoDS_Vertex;
//! Construction of fillets on the edges of a Shell.
class BRepFilletAPI_LocalOperation : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Adds a contour in the builder (builds a
//! contour of tangent edges).
Standard_EXPORT virtual void Add (const TopoDS_Edge& E) = 0;
//! Reset the contour of index IC, there is nomore
//! information in the contour.
Standard_EXPORT virtual void ResetContour (const Standard_Integer IC) = 0;
//! Number of contours.
Standard_EXPORT virtual Standard_Integer NbContours() const = 0;
//! Returns the index of the contour containing the edge
//! E, returns 0 if E doesn't belong to any contour.
Standard_EXPORT virtual Standard_Integer Contour (const TopoDS_Edge& E) const = 0;
//! Number of Edges in the contour I.
Standard_EXPORT virtual Standard_Integer NbEdges (const Standard_Integer I) const = 0;
//! Returns the Edge J in the contour I.
Standard_EXPORT virtual const TopoDS_Edge& Edge (const Standard_Integer I, const Standard_Integer J) const = 0;
//! remove the contour containing the Edge E.
Standard_EXPORT virtual void Remove (const TopoDS_Edge& E) = 0;
//! returns the length the contour of index IC.
Standard_EXPORT virtual Standard_Real Length (const Standard_Integer IC) const = 0;
//! Returns the first Vertex of the contour of index IC.
Standard_EXPORT virtual TopoDS_Vertex FirstVertex (const Standard_Integer IC) const = 0;
//! Returns the last Vertex of the contour of index IC.
Standard_EXPORT virtual TopoDS_Vertex LastVertex (const Standard_Integer IC) const = 0;
//! returns the abscissa of the vertex V on
//! the contour of index IC.
Standard_EXPORT virtual Standard_Real Abscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const = 0;
//! returns the relative abscissa([0.,1.]) of the
//! vertex V on the contour of index IC.
Standard_EXPORT virtual Standard_Real RelativeAbscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const = 0;
//! returns true if the contour of index IC is closed
//! an tangent.
Standard_EXPORT virtual Standard_Boolean ClosedAndTangent (const Standard_Integer IC) const = 0;
//! returns true if the contour of index IC is closed
Standard_EXPORT virtual Standard_Boolean Closed (const Standard_Integer IC) const = 0;
//! 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.
Standard_EXPORT virtual void Reset() = 0;
Standard_EXPORT virtual void Simulate (const Standard_Integer IC) = 0;
Standard_EXPORT virtual Standard_Integer NbSurf (const Standard_Integer IC) const = 0;
Standard_EXPORT virtual Handle(ChFiDS_SecHArray1) Sect (const Standard_Integer IC, const Standard_Integer IS) const = 0;
protected:
private:
};
#endif // _BRepFilletAPI_LocalOperation_HeaderFile

View File

@@ -1,397 +0,0 @@
-- Created on: 1995-06-22
-- Created by: Flore Lantheaume
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 SecHArray1 from ChFiDS;
fields
myBuilder : ChBuilder from ChFi3d;
myMap : MapOfShape from TopTools;
end MakeChamfer;

View File

@@ -14,13 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepFilletAPI_MakeChamfer.ixx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <ChFiDS_Spine.hxx>
#include <StdFail_NotDone.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopOpeBRepBuild_HBuilder.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <ChFiDS_Spine.hxx>
#include <TopExp_Explorer.hxx>
//=======================================================================
//function : BRepFilletAPI_MakeChamfer

View File

@@ -0,0 +1,292 @@
// Created on: 1995-06-22
// Created by: Flore Lantheaume
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFilletAPI_MakeChamfer_HeaderFile
#define _BRepFilletAPI_MakeChamfer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <ChFi3d_ChBuilder.hxx>
#include <TopTools_MapOfShape.hxx>
#include <BRepFilletAPI_LocalOperation.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
#include <ChFiDS_SecHArray1.hxx>
class StdFail_NotDone;
class TopoDS_Shape;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Vertex;
class TopOpeBRepBuild_HBuilder;
//! 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.
class BRepFilletAPI_MakeChamfer : public BRepFilletAPI_LocalOperation
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes an algorithm for computing chamfers on the shape S.
//! The edges on which chamfers are built are defined using the Add function.
Standard_EXPORT BRepFilletAPI_MakeChamfer(const TopoDS_Shape& S);
//! 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
Standard_EXPORT void Add (const TopoDS_Edge& E);
//! 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.
Standard_EXPORT void Add (const Standard_Real Dis, const TopoDS_Edge& E, const TopoDS_Face& F);
//! 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.
Standard_EXPORT void SetDist (const Standard_Real Dis, const Standard_Integer IC, const TopoDS_Face& F);
Standard_EXPORT void GetDist (const Standard_Integer IC, Standard_Real& Dis) const;
//! 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 ) ).
Standard_EXPORT void Add (const Standard_Real Dis1, const Standard_Real Dis2, const TopoDS_Edge& E, const TopoDS_Face& F);
//! 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.
Standard_EXPORT void SetDists (const Standard_Real Dis1, const Standard_Real Dis2, const Standard_Integer IC, const TopoDS_Face& F);
//! 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.
Standard_EXPORT void Dists (const Standard_Integer IC, Standard_Real& Dis1, Standard_Real& Dis2) const;
//! 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 ) ).
Standard_EXPORT void AddDA (const Standard_Real Dis, const Standard_Real Angle, const TopoDS_Edge& E, const TopoDS_Face& F);
//! set the distance <Dis> and <Angle> of the fillet
//! contour of index <IC> in the DS with <Dis> on <F>.
//! if the face <F> is not one of common faces
//! of an edge of the contour <IC>
Standard_EXPORT void SetDistAngle (const Standard_Real Dis, const Standard_Real Angle, const Standard_Integer IC, const TopoDS_Face& F);
//! gives the distances <Dis> and <Angle> of the fillet
//! contour of index <IC> in the DS
Standard_EXPORT void GetDistAngle (const Standard_Integer IC, Standard_Real& Dis, Standard_Real& Angle, Standard_Boolean& DisOnFace1) const;
//! return True if chamfer symetric false else.
Standard_EXPORT Standard_Boolean IsSymetric (const Standard_Integer IC) const;
//! return True if chamfer is made with two distances false else.
Standard_EXPORT Standard_Boolean IsTwoDistances (const Standard_Integer IC) const;
//! return True if chamfer is made with distance and angle false else.
Standard_EXPORT Standard_Boolean IsDistanceAngle (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT void ResetContour (const Standard_Integer IC);
//! Returns the number of contours generated using the
//! Add function in the internal data structure of this algorithm.
Standard_EXPORT Standard_Integer NbContours() const;
//! 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.
Standard_EXPORT Standard_Integer Contour (const TopoDS_Edge& E) const;
//! 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.
Standard_EXPORT Standard_Integer NbEdges (const Standard_Integer I) const;
//! 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.
Standard_EXPORT const TopoDS_Edge& Edge (const Standard_Integer I, const Standard_Integer J) const;
//! 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.
Standard_EXPORT void Remove (const TopoDS_Edge& E);
//! 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.
Standard_EXPORT Standard_Real Length (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT TopoDS_Vertex FirstVertex (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT TopoDS_Vertex LastVertex (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT Standard_Real Abscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const;
//! 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.
Standard_EXPORT Standard_Real RelativeAbscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const;
//! 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.
Standard_EXPORT Standard_Boolean ClosedAndTangent (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT Standard_Boolean Closed (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! 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.
Standard_EXPORT void Reset();
//! Returns the internal filleting algorithm.
Standard_EXPORT Handle(TopOpeBRepBuild_HBuilder) Builder() const;
//! Returns the list of shapes generated from the
//! shape <EorV>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& EorV) Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <F>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& F) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& F) Standard_OVERRIDE;
Standard_EXPORT void Simulate (const Standard_Integer IC);
Standard_EXPORT Standard_Integer NbSurf (const Standard_Integer IC) const;
Standard_EXPORT Handle(ChFiDS_SecHArray1) Sect (const Standard_Integer IC, const Standard_Integer IS) const;
protected:
private:
ChFi3d_ChBuilder myBuilder;
TopTools_MapOfShape myMap;
};
#endif // _BRepFilletAPI_MakeChamfer_HeaderFile

View File

@@ -1,536 +0,0 @@
-- Created on: 1994-06-17
-- Created by: Modeling
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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 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 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

@@ -14,22 +14,30 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Precision.hxx>
#include <BRepFilletAPI_MakeFillet.ixx>
#include <TopExp_Explorer.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <ChFiDS_Spine.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <ChFiDS_ErrorStatus.hxx>
#include <ChFiDS_Spine.hxx>
#include <Geom_Surface.hxx>
#include <Law_Function.hxx>
#include <Law_Interpol.hxx>
#include <Law_Linear.hxx>
#include <Law_S.hxx>
#include <Law_Interpol.hxx>
#include <Precision.hxx>
#include <Standard_NoSuchObject.hxx>
#include <StdFail_NotDone.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopOpeBRepBuild_HBuilder.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//=======================================================================
//function : BRepFilletAPI_MakeFillet
//purpose :
//=======================================================================
BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(const TopoDS_Shape& S,
const ChFi3d_FilletShape FShape):
myBuilder(S,FShape)

View File

@@ -0,0 +1,394 @@
// Created on: 1994-06-17
// Created by: Modeling
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFilletAPI_MakeFillet_HeaderFile
#define _BRepFilletAPI_MakeFillet_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <ChFi3d_FilBuilder.hxx>
#include <TopTools_MapOfShape.hxx>
#include <BRepFilletAPI_LocalOperation.hxx>
#include <ChFi3d_FilletShape.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
#include <ChFiDS_SecHArray1.hxx>
#include <ChFiDS_ErrorStatus.hxx>
class StdFail_NotDone;
class Standard_NoSuchObject;
class TopoDS_Shape;
class TopoDS_Edge;
class Law_Function;
class TopoDS_Vertex;
class TopOpeBRepBuild_HBuilder;
class Geom_Surface;
//! 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.
class BRepFilletAPI_MakeFillet : public BRepFilletAPI_LocalOperation
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepFilletAPI_MakeFillet(const TopoDS_Shape& S, const ChFi3d_FilletShape FShape = ChFi3d_Rational);
Standard_EXPORT void 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);
//! 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.
Standard_EXPORT void SetContinuity (const GeomAbs_Shape InternalContinuity, const Standard_Real AngularTolerance);
//! Adds a fillet contour in the builder (builds a
//! contour of tangent edges).
//! The Radius must be set after.
Standard_EXPORT void Add (const TopoDS_Edge& E);
//! Adds a fillet description in the builder
//! - builds a contour of tangent edges,
//! - sets the radius.
Standard_EXPORT void Add (const Standard_Real Radius, const TopoDS_Edge& E);
//! 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.
Standard_EXPORT void Add (const Standard_Real R1, const Standard_Real R2, const TopoDS_Edge& E);
//! Adds a fillet description in the builder
//! - builds a contour of tangent edges,
//! - sest the radius evolution law.
Standard_EXPORT void Add (const Handle(Law_Function)& L, const TopoDS_Edge& E);
//! 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.
Standard_EXPORT void Add (const TColgp_Array1OfPnt2d& UandR, const TopoDS_Edge& E);
//! 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.
Standard_EXPORT void SetRadius (const Standard_Real Radius, const Standard_Integer IC, const Standard_Integer IinC);
//! 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.
Standard_EXPORT void SetRadius (const Standard_Real R1, const Standard_Real R2, const Standard_Integer IC, const Standard_Integer IinC);
//! 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.
Standard_EXPORT void SetRadius (const Handle(Law_Function)& L, const Standard_Integer IC, const Standard_Integer IinC);
//! 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.
Standard_EXPORT void SetRadius (const TColgp_Array1OfPnt2d& UandR, const Standard_Integer IC, const Standard_Integer IinC);
//! 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.
Standard_EXPORT void ResetContour (const Standard_Integer IC);
//! 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.
Standard_EXPORT Standard_Boolean IsConstant (const Standard_Integer IC);
//! 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.
Standard_EXPORT Standard_Real Radius (const Standard_Integer IC);
//! 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.
Standard_EXPORT Standard_Boolean IsConstant (const Standard_Integer IC, const TopoDS_Edge& E);
//! 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.
Standard_EXPORT Standard_Real Radius (const Standard_Integer IC, const TopoDS_Edge& E);
//! Assigns Radius as the radius of the fillet on the edge E
Standard_EXPORT void SetRadius (const Standard_Real Radius, const Standard_Integer IC, const TopoDS_Edge& E);
Standard_EXPORT void SetRadius (const Standard_Real Radius, const Standard_Integer IC, const TopoDS_Vertex& V);
Standard_EXPORT Standard_Boolean GetBounds (const Standard_Integer IC, const TopoDS_Edge& E, Standard_Real& F, Standard_Real& L);
Standard_EXPORT Handle(Law_Function) GetLaw (const Standard_Integer IC, const TopoDS_Edge& E);
Standard_EXPORT void SetLaw (const Standard_Integer IC, const TopoDS_Edge& E, const Handle(Law_Function)& L);
//! Assigns FShape as the type of fillet shape built by this algorithm.
Standard_EXPORT void SetFilletShape (const ChFi3d_FilletShape FShape);
//! Returns the type of fillet shape built by this algorithm.
Standard_EXPORT ChFi3d_FilletShape GetFilletShape() const;
//! Returns the number of contours generated using the
//! Add function in the internal data structure of this algorithm.
Standard_EXPORT Standard_Integer NbContours() const;
//! 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.
Standard_EXPORT Standard_Integer Contour (const TopoDS_Edge& E) const;
//! 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.
Standard_EXPORT Standard_Integer NbEdges (const Standard_Integer I) const;
//! 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.
Standard_EXPORT const TopoDS_Edge& Edge (const Standard_Integer I, const Standard_Integer J) const;
//! 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.
Standard_EXPORT void Remove (const TopoDS_Edge& E);
//! 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.
Standard_EXPORT Standard_Real Length (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT TopoDS_Vertex FirstVertex (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT TopoDS_Vertex LastVertex (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT Standard_Real Abscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const;
//! 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.
Standard_EXPORT Standard_Real RelativeAbscissa (const Standard_Integer IC, const TopoDS_Vertex& V) const;
//! 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.
Standard_EXPORT Standard_Boolean ClosedAndTangent (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT Standard_Boolean Closed (const Standard_Integer IC) const;
//! 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.
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
//! 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.
Standard_EXPORT void Reset();
//! Returns the internal topology building algorithm.
Standard_EXPORT Handle(TopOpeBRepBuild_HBuilder) Builder() const;
//! Returns the list of shapes generated from the
//! shape <EorV>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& EorV) Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <F>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& F) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& F) Standard_OVERRIDE;
//! returns the number of surfaces
//! after the shape creation.
Standard_EXPORT Standard_Integer NbSurfaces() const;
//! Return the faces created for surface <I>.
Standard_EXPORT const TopTools_ListOfShape& NewFaces (const Standard_Integer I);
Standard_EXPORT void Simulate (const Standard_Integer IC);
Standard_EXPORT Standard_Integer NbSurf (const Standard_Integer IC) const;
Standard_EXPORT Handle(ChFiDS_SecHArray1) Sect (const Standard_Integer IC, const Standard_Integer IS) const;
//! Returns the number of contours where the computation
//! of the fillet failed
Standard_EXPORT Standard_Integer NbFaultyContours() const;
//! 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
Standard_EXPORT Standard_Integer FaultyContour (const Standard_Integer I) const;
//! returns the number of surfaces which have been
//! computed on the contour IC
Standard_EXPORT Standard_Integer NbComputedSurfaces (const Standard_Integer IC) const;
//! returns the surface number IS concerning the contour IC
Standard_EXPORT Handle(Geom_Surface) ComputedSurface (const Standard_Integer IC, const Standard_Integer IS) const;
//! returns the number of vertices where the computation failed
Standard_EXPORT Standard_Integer NbFaultyVertices() const;
//! returns the vertex where the computation failed
Standard_EXPORT TopoDS_Vertex FaultyVertex (const Standard_Integer IV) const;
//! 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
Standard_EXPORT Standard_Boolean HasResult() const;
//! if (HasResult()) returns the partial result
Standard_EXPORT TopoDS_Shape BadShape() const;
//! 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
Standard_EXPORT ChFiDS_ErrorStatus StripeStatus (const Standard_Integer IC) const;
protected:
private:
ChFi3d_FilBuilder myBuilder;
TopTools_MapOfShape myMap;
};
#endif // _BRepFilletAPI_MakeFillet_HeaderFile

View File

@@ -1,332 +0,0 @@
-- Created on: 1995-08-31
-- Created by: Remi LEQUETTE
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
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

@@ -14,13 +14,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepFilletAPI_MakeFillet2d.ixx>
#include <BRepFilletAPI_MakeFillet2d.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : BRepFilletAPI_MakeFillet2d
//purpose :
//=======================================================================
BRepFilletAPI_MakeFillet2d::BRepFilletAPI_MakeFillet2d()
{
}

View File

@@ -0,0 +1,310 @@
// Created on: 1995-08-31
// Created by: Remi LEQUETTE
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFilletAPI_MakeFillet2d_HeaderFile
#define _BRepFilletAPI_MakeFillet2d_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <ChFi2d_Builder.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Standard_Integer.hxx>
#include <TopTools_ListOfShape.hxx>
#include <ChFi2d_ConstructionError.hxx>
class TopoDS_Face;
class TopoDS_Edge;
class TopoDS_Vertex;
class TopoDS_Shape;
//! 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.
class BRepFilletAPI_MakeFillet2d : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepFilletAPI_MakeFillet2d();
//! 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.
Standard_EXPORT BRepFilletAPI_MakeFillet2d(const TopoDS_Face& F);
//! 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.
Standard_EXPORT void Init (const TopoDS_Face& F);
//! 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> .
Standard_EXPORT void Init (const TopoDS_Face& RefFace, const TopoDS_Face& ModFace);
//! 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.
Standard_EXPORT TopoDS_Edge AddFillet (const TopoDS_Vertex& V, const Standard_Real Radius);
//! 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.
Standard_EXPORT TopoDS_Edge ModifyFillet (const TopoDS_Edge& Fillet, const Standard_Real Radius);
//! 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.
Standard_EXPORT TopoDS_Vertex RemoveFillet (const TopoDS_Edge& Fillet);
//! 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.
Standard_EXPORT TopoDS_Edge AddChamfer (const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2);
//! 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.
Standard_EXPORT TopoDS_Edge AddChamfer (const TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real D, const Standard_Real Ang);
//! 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.
Standard_EXPORT TopoDS_Edge ModifyChamfer (const TopoDS_Edge& Chamfer, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2);
//! 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.
Standard_EXPORT TopoDS_Edge ModifyChamfer (const TopoDS_Edge& Chamfer, const TopoDS_Edge& E, const Standard_Real D, const Standard_Real Ang);
//! 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.
Standard_EXPORT TopoDS_Vertex RemoveChamfer (const TopoDS_Edge& Chamfer);
//! 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.
Standard_Boolean IsModified (const TopoDS_Edge& E) const;
//! Returns the table of fillets on the face modified by this algorithm.
const TopTools_SequenceOfShape& FilletEdges() const;
//! Returns the number of fillets on the face modified by this algorithm.
Standard_Integer NbFillet() const;
//! Returns the table of chamfers on the face modified by this algorithm.
const TopTools_SequenceOfShape& ChamferEdges() const;
//! Returns the number of chamfers on the face modified by this algorithm.
Standard_Integer NbChamfer() const;
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
//! returns the number of new curves
//! after the shape creation.
Standard_EXPORT Standard_Integer NbCurves() const;
//! Return the Edges created for curve I.
Standard_EXPORT const TopTools_ListOfShape& NewEdges (const Standard_Integer I);
Standard_Boolean HasDescendant (const TopoDS_Edge& E) const;
//! 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.
const TopoDS_Edge& DescendantEdge (const TopoDS_Edge& E) const;
//! 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.
Standard_EXPORT const TopoDS_Edge& BasisEdge (const TopoDS_Edge& E) const;
ChFi2d_ConstructionError Status() const;
//! Update the result and set the Done flag
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
protected:
private:
ChFi2d_Builder myMakeChFi2d;
};
#include <BRepFilletAPI_MakeFillet2d.lxx>
#endif // _BRepFilletAPI_MakeFillet2d_HeaderFile

9
src/BRepFilletAPI/FILES Normal file
View File

@@ -0,0 +1,9 @@
BRepFilletAPI_LocalOperation.cxx
BRepFilletAPI_LocalOperation.hxx
BRepFilletAPI_MakeChamfer.cxx
BRepFilletAPI_MakeChamfer.hxx
BRepFilletAPI_MakeFillet.cxx
BRepFilletAPI_MakeFillet.hxx
BRepFilletAPI_MakeFillet2d.cxx
BRepFilletAPI_MakeFillet2d.hxx
BRepFilletAPI_MakeFillet2d.lxx