1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +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,121 +0,0 @@
-- Created on: 1995-06-12
-- Created by: Joelle CHAUVET
-- 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.
-- Modified: Tue Oct 15 10:12:02 1996
-- Add ChFi2d_TangencyError (PRO3529)
-- Modified: Tue Oct 22 09:23:11 1996
-- Add ChFi2d_FirstEdgeDegenerated, ChFi2d_LastEdgeDegenerated,
-- ChFi2d_BothEdgesDegenerated (PRO4896)
-- Modified: Fri Sep 25 09:38:04 1998
-- ChFi2d_NotAuthorized is used if the edges are not
-- lines or circles (BUC60288)
package ChFi2d
---Purpose: This package contains the algorithms used to build
-- fillets or chamfers on planar wire.
--
-- This package provides two algorithms for 2D fillets:
-- ChFi2d_Builder - it constructs a fillet or chamfer
-- for linear and circular edges of a face.
-- ChFi2d_FilletAPI - it encapsulates two algorithms:
-- ChFi2d_AnaFilletAlgo - analytical constructor of the fillet.
-- It works only for linear and circular edges,
-- having a common point.
-- ChFi2d_FilletAlgo - iteration recursive method constructing
-- the fillet edge for any type of edges including
-- ellipses and b-splines.
-- The edges may even have no common point.
-- ChFi2d_ChamferAPI - an algoroithm for construction of chamfers
-- between two linear edges of a plane.
--
-- The algorithms ChFi2d_AnaFilletAlgo and ChFi2d_FilletAlgo may be used directly
-- or via the interface class ChFi2d_FilletAPI.
uses
TopoDS,
TopTools,
gp
is
enumeration ConstructionError is
---Purpose: error that can occur during the
-- fillet construction on planar wire
NotPlanar,
---Purpose: the face is not planar
NoFace,
---Purpose: the face is null
InitialisationError,
---Purpose: the two faces used for the initialisation are
-- uncompatible.
ParametersError,
---Purpose: the parameters as distances or angle for
-- chamfer are less or equal to zero.
Ready,
---Purpose: the initialization has been succesfull.
IsDone,
ComputationError,
---Purpose: the algorithm could not find a solution.
ConnexionError,
---Purpose: the vertex given to locate the fillet or the
-- chamfer is not connected to 2 edges.
TangencyError,
---Purpose: the two edges connected to the vertex are tangent.
FirstEdgeDegenerated,
---Purpose: the first edge is degenerated.
LastEdgeDegenerated,
---Purpose: the last edge is degenerated.
BothEdgesDegenerated,
---Purpose: the two edges are degenerated.
NotAuthorized
---Purpose: One or the two edges connected to the vertex
-- is a fillet or a chamfer
-- One or the two edges connected to the vertex
-- is not a line or a circle
end ConstructionError;
class Builder;
CommonVertex( E1, E2 : Edge from TopoDS;
V : out Vertex from TopoDS)
returns Boolean
is private;
---Warning: <V> has sense only if the value <True> is returned
FindConnectedEdges( F : Face from TopoDS;
V : Vertex from TopoDS;
E1, E2 : out Edge from TopoDS)
returns ConstructionError from ChFi2d
is private;
---Warning: <E1> and <E2> has sense only if the returned value
-- is <IsDone>
end ChFi2d;

View File

@@ -14,13 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ChFi2d.ixx>
#include <ChFi2d.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
//=======================================================================
//function : CommonVertex

86
src/ChFi2d/ChFi2d.hxx Normal file
View File

@@ -0,0 +1,86 @@
// Created on: 1995-06-12
// Created by: Joelle CHAUVET
// 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 _ChFi2d_HeaderFile
#define _ChFi2d_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <ChFi2d_ConstructionError.hxx>
class TopoDS_Edge;
class TopoDS_Vertex;
class TopoDS_Face;
class ChFi2d_Builder;
//! This package contains the algorithms used to build
//! fillets or chamfers on planar wire.
//!
//! This package provides two algorithms for 2D fillets:
//! ChFi2d_Builder - it constructs a fillet or chamfer
//! for linear and circular edges of a face.
//! ChFi2d_FilletAPI - it encapsulates two algorithms:
//! ChFi2d_AnaFilletAlgo - analytical constructor of the fillet.
//! It works only for linear and circular edges,
//! having a common point.
//! ChFi2d_FilletAlgo - iteration recursive method constructing
//! the fillet edge for any type of edges including
//! ellipses and b-splines.
//! The edges may even have no common point.
//! ChFi2d_ChamferAPI - an algoroithm for construction of chamfers
//! between two linear edges of a plane.
//!
//! The algorithms ChFi2d_AnaFilletAlgo and ChFi2d_FilletAlgo may be used directly
//! or via the interface class ChFi2d_FilletAPI.
class ChFi2d
{
public:
DEFINE_STANDARD_ALLOC
protected:
private:
Standard_EXPORT static Standard_Boolean CommonVertex (const TopoDS_Edge& E1, const TopoDS_Edge& E2, TopoDS_Vertex& V);
Standard_EXPORT static ChFi2d_ConstructionError FindConnectedEdges (const TopoDS_Face& F, const TopoDS_Vertex& V, TopoDS_Edge& E1, TopoDS_Edge& E2);
friend class ChFi2d_Builder;
};
#endif // _ChFi2d_HeaderFile

View File

@@ -1,295 +0,0 @@
-- Created on: 1995-06-12
-- Created by: Joelle CHAUVET
-- 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.
-- Modified: Tue Oct 22 09:23:11 1996
-- add new method BuildNewEdge with special flag IsDegenerated (PRO4896)
class Builder from ChFi2d
---Purpose: This class contains the algorithm used to build
-- fillet on planar wire.
uses
Face from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
ConstructionError from ChFi2d,
SequenceOfShape from TopTools,
DataMapOfShapeShape from TopTools,
Pln from gp,
Real from Standard,
Boolean from Standard
is
Create ;
Create ( F : Face );
---Purpose: The face <F> can be build on a closed or an open
-- wire.
Init( me : in out; F : Face );
Init( me : in out; RefFace, ModFace : Face );
AddFillet ( me : in out; V : Vertex; Radius : Real ) returns Edge;
---Purpose: Add a fillet of radius <Radius> on the wire
-- between the two edges connected to the vertex <V>.
-- <AddFillet> returns the fillet edge. The returned
-- edge has sense only if the status <status> is
-- <IsDone>
ModifyFillet ( me : in out; Fillet : Edge; Radius : Real)
returns Edge;
---Purpose: modify the fillet radius and return the new fillet
-- edge. this edge has sense only if the status
-- <status> is <IsDone>.
RemoveFillet( me : in out; Fillet : Edge)
returns Vertex;
---Purpose: removes the fillet <Fillet> and returns the vertex
-- connecting the two adjacent edges to this fillet.
AddChamfer ( me : in out; E1, E2 : Edge; D1, D2 : Real )
returns Edge;
---Purpose: Add a chamfer on the wire between the two edges
-- connected <E1> and <E2>. <AddChamfer> returns the
-- chamfer edge. This edge has sense only if the
-- status <status> is <IsDone>.
AddChamfer ( me : in out; E : Edge; V : Vertex; D, Ang : Real )
returns Edge;
---Purpose: Add a chamfer on the wire between the two edges
-- connected to the vertex <V>. The chamfer will make
-- an angle <Ang> with the edge <E>, and one of its
-- extremities will be on <E> at distance <D>. The
-- returned edge has sense only if the status
-- <status> is <IsDone>.
-- Warning: The value of <Ang> must be expressed in Radian.
ModifyChamfer ( me : in out; Chamfer : Edge;
E1 : Edge; E2 : Edge; D1, D2 : Real)
returns Edge;
---Purpose: modify the chamfer <Chamfer> and returns the new
-- chamfer edge.
-- This edge as sense only if the status <status> is
-- <IsDone>.
ModifyChamfer ( me : in out; Chamfer, E : Edge; D, Ang : Real)
returns Edge;
---Purpose: modify the chamfer <Chamfer> and returns the new
-- chamfer edge. This edge as sense only if the
-- status <status> is <IsDone>.
-- Warning: The value of <Ang> must be expressed in Radian.
RemoveChamfer( me : in out; Chamfer : Edge)
returns Vertex;
---Purpose: removes the chamfer <Chamfer> and returns the
-- vertex connecting the two adjacent edges to this
-- chamfer.
Result( me ) returns Face;
---Purpose: returns the modified face
---C++: inline
IsModified( me; E : Edge ) returns Boolean;
---C++: inline
FilletEdges( me ) returns SequenceOfShape;
---Purpose: returns the list of new edges
---C++: return const &
---C++: inline
NbFillet( me ) returns Integer;
---C++: inline
ChamferEdges( me ) returns SequenceOfShape;
---Purpose: returns the list of new edges
---C++: return const &
---C++: inline
NbChamfer( me ) returns Integer;
---C++: inline
HasDescendant( me; E : Edge) returns Boolean;
---C++: inline
DescendantEdge( me; E : Edge) returns Edge;
---Purpose: returns the modified edge if <E> has descendant or
-- <E> in the other case.
---C++: return const &
---C++: inline
BasisEdge( me; E : Edge) returns Edge;
---Purpose: Returns the parent edge of <E>
-- Warning: If <E>is a basis edge, the returned edge would be
-- equal to <E>
---C++: return const &
Status(me) returns ConstructionError from ChFi2d;
---C++: inline
ComputeFillet ( me : in out; V : Vertex; E1, E2 : Edge; Radius : Real;
TrimE1, TrimE2, Fillet : out Edge)
is private;
---Purpose: Is internaly used by <AddFillet>.
-- Warning: <TrimE1>, <TrimE2>, <Fillet> has sense only if the
-- status <status> is equal to <IsDone>
ComputeChamfer ( me : in out; V : Vertex; E1, E2 : Edge;
D1, D2 : Real;
TrimE1, TrimE2, Chamfer : out Edge)
is private;
---Purpose: Is internaly used by <AddChamfer>. The chamfer is
-- computed from a vertex, two edges and two
-- distances
-- Warning: <TrimE1>, <TrimE2> and <Chamfer> has sense only if
-- if the status <status> is equal to <IsDone>
ComputeChamfer ( me : in out; V : Vertex; E1 : Edge; D, Ang : Real;
E2 : Edge; TrimE1, TrimE2, Chamfer : out Edge)
is private;
---Purpose: Is internaly used by <AddChamfer>. The chamfer is
-- computed from an edge, a vertex, a distance
-- and an angle
-- Warning: <TrimE1>, <TrimE2>, and <Chamfer> has
-- sense only if the status <status> is equal to
-- <IsDone>
BuildFilletEdge(me : in out; V : Vertex; AdjEdge1, AdjEdge2 : Edge;
Radius : Real;
NewExtr1, NewExtr2 : out Vertex)
returns Edge
is private;
---Purpose: Is internaly used by <ComputeFillet>.
-- <NewExtr1> and <NewExtr2> will contains the new
-- extremities of <AdjEdge1> and <AdjEdge2>
-- Warning: The returned edge has sense only if the status
-- <status> is equal to <IsDone>
-- or to one of those specific cases :
-- <FirstEdgeDegenerated>
-- <LastEdgeDegenerated>
-- <BothEdgesDegenerated>
BuildChamferEdge(me : in out; V : Vertex; AdjEdge1, AdjEdge2 : Edge;
D1, D2 : Real;
NewExtr1, NewExtr2 : out Vertex)
returns Edge
is private;
---Purpose: Is internaly used by <ComputeFillet>.
-- <NewExtr1> and <NewExtr2> will contains the new
-- extremities of <AdjEdge1> and <AdjEdge2>
-- Warning: The returned edge has sense only if the status
-- <status> is equal to <IsDone>
BuildChamferEdge(me : in out; V : Vertex; AdjEdge2 : Edge;
D, Ang : Real;
AdjEdge1 : Edge; NewExtr1, NewExtr2 : out Vertex)
returns Edge
is private;
---Purpose: Is internaly used by <ComputeFillet>.
-- <NewExtr1> and <NewExtr2> will contains the new
-- extremities of <AdjEdge1> and <AdjEdge2>
-- Warning: The returned edge has sense only if the status
-- <status> is equal to <IsDone>
BuildNewWire ( me : in out; OldE1, OldE2, E1, Fillet, E2 : Edge)
is private;
---Purpose: replaces in the new face <newFace> <OldE1> and
-- <OldE2> by <E1>, <Fillet> and <E2>
-- or by <Fillet> and <E2> if <E1> is degenerated
-- or by <E1> and <Fillet> if <E2> is degenerated
-- or by <Fillet> if <E1> and <E2> are degenerated .
BuildNewEdge ( me ; E1 : Edge; OldExtr, NewExtr : Vertex)
returns Edge
is private;
---Purpose: Changes <OldExtr> of <E1> by <NewExtr>
BuildNewEdge ( me ; E1 : Edge; OldExtr, NewExtr : Vertex;
IsDegenerated : out Boolean)
returns Edge
is private;
---Purpose: Changes <OldExtr> of <E1> by <NewExtr>
-- returns E1 and IsDegenerated = Standard_True
-- if the new edge is degenerated
UpDateHistory( me : in out; E1, E2, TrimE1, TrimE2, NewEdge : Edge;
Id : Integer)
is private;
---Purpose: Writes <NewEdge> in <fillets> if <Id> is equal to
-- 1, or in <chamfers> if <Id> is Equal to 2.
-- Writes the modifications in <history> :
-- <TrimE1> is given by <E1>, <TrimE2> by <E2>
-- if <TrimE1> and <TrimE2> are not degenerated.
UpDateHistory( me : in out; E1, E2, TrimE1, TrimE2 : Edge)
is private;
---Purpose: Writes the modifications in <history> . <TrimE1>
-- is given by <E1>, <TrimE2> by <E2>.
IsAFillet( me; E : Edge) returns Boolean is private;
IsAChamfer( me; E : Edge) returns Boolean is private;
fields
status : ConstructionError from ChFi2d;
refFace : Face from TopoDS;
newFace : Face from TopoDS;
fillets : SequenceOfShape from TopTools;
chamfers : SequenceOfShape from TopTools;
history : DataMapOfShapeShape from TopTools;
end Builder;

View File

@@ -14,58 +14,48 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ChFi2d.hxx>
#include <ChFi2d_Builder.ixx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <ChFi2d.hxx>
#include <ChFi2d_Builder.hxx>
#include <ElCLib.hxx>
#include <GccEnt_Position.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dGcc_Circ2d2TanRad.hxx>
#include <Geom2dGcc_QualifiedCurve.hxx>
#include <Geom2dInt_GInter.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2dInt_GInter.hxx>
#include <Geom2dGcc_Circ2d2TanRad.hxx>
#include <Geom2dGcc_QualifiedCurve.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Vec2d.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <Precision.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
static Standard_Boolean IsIssuedFrom(const TopoDS_Edge& E,
const TopTools_IndexedMapOfShape& Map,

View File

@@ -0,0 +1,236 @@
// Created on: 1995-06-12
// Created by: Joelle CHAUVET
// 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 _ChFi2d_Builder_HeaderFile
#define _ChFi2d_Builder_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <ChFi2d_ConstructionError.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class TopoDS_Face;
class TopoDS_Edge;
class TopoDS_Vertex;
//! This class contains the algorithm used to build
//! fillet on planar wire.
class ChFi2d_Builder
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ChFi2d_Builder();
//! The face <F> can be build on a closed or an open
//! wire.
Standard_EXPORT ChFi2d_Builder(const TopoDS_Face& F);
Standard_EXPORT void Init (const TopoDS_Face& F);
Standard_EXPORT void Init (const TopoDS_Face& RefFace, const TopoDS_Face& ModFace);
//! Add a fillet of radius <Radius> on the wire
//! between the two edges connected to the vertex <V>.
//! <AddFillet> returns the fillet edge. The returned
//! edge has sense only if the status <status> is
//! <IsDone>
Standard_EXPORT TopoDS_Edge AddFillet (const TopoDS_Vertex& V, const Standard_Real Radius);
//! modify the fillet radius and return the new fillet
//! edge. this edge has sense only if the status
//! <status> is <IsDone>.
Standard_EXPORT TopoDS_Edge ModifyFillet (const TopoDS_Edge& Fillet, const Standard_Real Radius);
//! removes the fillet <Fillet> and returns the vertex
//! connecting the two adjacent edges to this fillet.
Standard_EXPORT TopoDS_Vertex RemoveFillet (const TopoDS_Edge& Fillet);
//! Add a chamfer on the wire between the two edges
//! connected <E1> and <E2>. <AddChamfer> returns the
//! chamfer edge. This edge has sense only if the
//! status <status> is <IsDone>.
Standard_EXPORT TopoDS_Edge AddChamfer (const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2);
//! Add a chamfer on the wire between the two edges
//! connected to the vertex <V>. The chamfer will make
//! an angle <Ang> with the edge <E>, and one of its
//! extremities will be on <E> at distance <D>. The
//! returned edge has sense only if the status
//! <status> is <IsDone>.
//! Warning: The value of <Ang> must be expressed in Radian.
Standard_EXPORT TopoDS_Edge AddChamfer (const TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real D, const Standard_Real Ang);
//! modify the chamfer <Chamfer> and returns the new
//! chamfer edge.
//! This edge as sense only if the status <status> is
//! <IsDone>.
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);
//! modify the chamfer <Chamfer> and returns the new
//! chamfer edge. This edge as sense only if the
//! status <status> is <IsDone>.
//! Warning: The value of <Ang> must be expressed in Radian.
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> and returns the
//! vertex connecting the two adjacent edges to this
//! chamfer.
Standard_EXPORT TopoDS_Vertex RemoveChamfer (const TopoDS_Edge& Chamfer);
//! returns the modified face
TopoDS_Face Result() const;
Standard_Boolean IsModified (const TopoDS_Edge& E) const;
//! returns the list of new edges
const TopTools_SequenceOfShape& FilletEdges() const;
Standard_Integer NbFillet() const;
//! returns the list of new edges
const TopTools_SequenceOfShape& ChamferEdges() const;
Standard_Integer NbChamfer() const;
Standard_Boolean HasDescendant (const TopoDS_Edge& E) const;
//! returns the modified edge if <E> has descendant or
//! <E> in the other case.
const TopoDS_Edge& DescendantEdge (const TopoDS_Edge& E) const;
//! Returns the parent edge of <E>
//! Warning: If <E>is a basis edge, the returned edge would be
//! equal to <E>
Standard_EXPORT const TopoDS_Edge& BasisEdge (const TopoDS_Edge& E) const;
ChFi2d_ConstructionError Status() const;
protected:
private:
//! Is internaly used by <AddFillet>.
//! Warning: <TrimE1>, <TrimE2>, <Fillet> has sense only if the
//! status <status> is equal to <IsDone>
Standard_EXPORT void ComputeFillet (const TopoDS_Vertex& V, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real Radius, TopoDS_Edge& TrimE1, TopoDS_Edge& TrimE2, TopoDS_Edge& Fillet);
//! Is internaly used by <AddChamfer>. The chamfer is
//! computed from a vertex, two edges and two
//! distances
//! Warning: <TrimE1>, <TrimE2> and <Chamfer> has sense only if
//! if the status <status> is equal to <IsDone>
Standard_EXPORT void ComputeChamfer (const TopoDS_Vertex& V, const TopoDS_Edge& E1, const TopoDS_Edge& E2, const Standard_Real D1, const Standard_Real D2, TopoDS_Edge& TrimE1, TopoDS_Edge& TrimE2, TopoDS_Edge& Chamfer);
//! Is internaly used by <AddChamfer>. The chamfer is
//! computed from an edge, a vertex, a distance
//! and an angle
//! Warning: <TrimE1>, <TrimE2>, and <Chamfer> has
//! sense only if the status <status> is equal to
//! <IsDone>
Standard_EXPORT void ComputeChamfer (const TopoDS_Vertex& V, const TopoDS_Edge& E1, const Standard_Real D, const Standard_Real Ang, const TopoDS_Edge& E2, TopoDS_Edge& TrimE1, TopoDS_Edge& TrimE2, TopoDS_Edge& Chamfer);
//! Is internaly used by <ComputeFillet>.
//! <NewExtr1> and <NewExtr2> will contains the new
//! extremities of <AdjEdge1> and <AdjEdge2>
//! Warning: The returned edge has sense only if the status
//! <status> is equal to <IsDone>
//! or to one of those specific cases :
//! <FirstEdgeDegenerated>
//! <LastEdgeDegenerated>
//! <BothEdgesDegenerated>
Standard_EXPORT TopoDS_Edge BuildFilletEdge (const TopoDS_Vertex& V, const TopoDS_Edge& AdjEdge1, const TopoDS_Edge& AdjEdge2, const Standard_Real Radius, TopoDS_Vertex& NewExtr1, TopoDS_Vertex& NewExtr2);
//! Is internaly used by <ComputeFillet>.
//! <NewExtr1> and <NewExtr2> will contains the new
//! extremities of <AdjEdge1> and <AdjEdge2>
//! Warning: The returned edge has sense only if the status
//! <status> is equal to <IsDone>
Standard_EXPORT TopoDS_Edge BuildChamferEdge (const TopoDS_Vertex& V, const TopoDS_Edge& AdjEdge1, const TopoDS_Edge& AdjEdge2, const Standard_Real D1, const Standard_Real D2, TopoDS_Vertex& NewExtr1, TopoDS_Vertex& NewExtr2);
//! Is internaly used by <ComputeFillet>.
//! <NewExtr1> and <NewExtr2> will contains the new
//! extremities of <AdjEdge1> and <AdjEdge2>
//! Warning: The returned edge has sense only if the status
//! <status> is equal to <IsDone>
Standard_EXPORT TopoDS_Edge BuildChamferEdge (const TopoDS_Vertex& V, const TopoDS_Edge& AdjEdge2, const Standard_Real D, const Standard_Real Ang, const TopoDS_Edge& AdjEdge1, TopoDS_Vertex& NewExtr1, TopoDS_Vertex& NewExtr2);
//! replaces in the new face <newFace> <OldE1> and
//! <OldE2> by <E1>, <Fillet> and <E2>
//! or by <Fillet> and <E2> if <E1> is degenerated
//! or by <E1> and <Fillet> if <E2> is degenerated
//! or by <Fillet> if <E1> and <E2> are degenerated .
Standard_EXPORT void BuildNewWire (const TopoDS_Edge& OldE1, const TopoDS_Edge& OldE2, const TopoDS_Edge& E1, const TopoDS_Edge& Fillet, const TopoDS_Edge& E2);
//! Changes <OldExtr> of <E1> by <NewExtr>
Standard_EXPORT TopoDS_Edge BuildNewEdge (const TopoDS_Edge& E1, const TopoDS_Vertex& OldExtr, const TopoDS_Vertex& NewExtr) const;
//! Changes <OldExtr> of <E1> by <NewExtr>
//! returns E1 and IsDegenerated = Standard_True
//! if the new edge is degenerated
Standard_EXPORT TopoDS_Edge BuildNewEdge (const TopoDS_Edge& E1, const TopoDS_Vertex& OldExtr, const TopoDS_Vertex& NewExtr, Standard_Boolean& IsDegenerated) const;
//! Writes <NewEdge> in <fillets> if <Id> is equal to
//! 1, or in <chamfers> if <Id> is Equal to 2.
//! Writes the modifications in <history> :
//! <TrimE1> is given by <E1>, <TrimE2> by <E2>
//! if <TrimE1> and <TrimE2> are not degenerated.
Standard_EXPORT void UpDateHistory (const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& TrimE1, const TopoDS_Edge& TrimE2, const TopoDS_Edge& NewEdge, const Standard_Integer Id);
//! Writes the modifications in <history> . <TrimE1>
//! is given by <E1>, <TrimE2> by <E2>.
Standard_EXPORT void UpDateHistory (const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& TrimE1, const TopoDS_Edge& TrimE2);
Standard_EXPORT Standard_Boolean IsAFillet (const TopoDS_Edge& E) const;
Standard_EXPORT Standard_Boolean IsAChamfer (const TopoDS_Edge& E) const;
ChFi2d_ConstructionError status;
TopoDS_Face refFace;
TopoDS_Face newFace;
TopTools_SequenceOfShape fillets;
TopTools_SequenceOfShape chamfers;
TopTools_DataMapOfShapeShape history;
};
#include <ChFi2d_Builder.lxx>
#endif // _ChFi2d_Builder_HeaderFile

View File

@@ -20,52 +20,43 @@
// des droites ou des cercles; fonction IsLineOrCircle
// (BUC60288)
#include <ChFi2d.hxx>
#include <ChFi2d_Builder.ixx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <ChFi2d.hxx>
#include <ChFi2d_Builder.hxx>
#include <ElCLib.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dInt_GInter.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAPI.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2dInt_GInter.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <Precision.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
gp_Pnt ComputePoint(const TopoDS_Vertex& V,const TopoDS_Edge& E,
const Standard_Real D1, Standard_Real& Param1);

View File

@@ -0,0 +1,45 @@
// Created on: 1995-06-12
// Created by: Joelle CHAUVET
// 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 _ChFi2d_ConstructionError_HeaderFile
#define _ChFi2d_ConstructionError_HeaderFile
//! error that can occur during the
//! fillet construction on planar wire//! the face is not planar//! the face is null//! the two faces used for the initialisation are
//! uncompatible.//! the parameters as distances or angle for
//! chamfer are less or equal to zero.//! the initialization has been succesfull.//! the algorithm could not find a solution.//! the vertex given to locate the fillet or the
//! chamfer is not connected to 2 edges.//! the two edges connected to the vertex are tangent.//! the first edge is degenerated.//! the last edge is degenerated.//! the two edges are degenerated.//! One or the two edges connected to the vertex
//! is a fillet or a chamfer
//! One or the two edges connected to the vertex
//! is not a line or a circle
enum ChFi2d_ConstructionError
{
ChFi2d_NotPlanar,
ChFi2d_NoFace,
ChFi2d_InitialisationError,
ChFi2d_ParametersError,
ChFi2d_Ready,
ChFi2d_IsDone,
ChFi2d_ComputationError,
ChFi2d_ConnexionError,
ChFi2d_TangencyError,
ChFi2d_FirstEdgeDegenerated,
ChFi2d_LastEdgeDegenerated,
ChFi2d_BothEdgesDegenerated,
ChFi2d_NotAuthorized
};
#endif // _ChFi2d_ConstructionError_HeaderFile

View File

@@ -1,9 +1,15 @@
ChFi2d_Builder_0.cxx
ChFi2d_FilletAlgo.hxx
ChFi2d_FilletAlgo.cxx
ChFi2d_AnaFilletAlgo.hxx
ChFi2d.cxx
ChFi2d.hxx
ChFi2d_AnaFilletAlgo.cxx
ChFi2d_ChamferAPI.hxx
ChFi2d_AnaFilletAlgo.hxx
ChFi2d_Builder.cxx
ChFi2d_Builder.hxx
ChFi2d_Builder.lxx
ChFi2d_Builder_0.cxx
ChFi2d_ChamferAPI.cxx
ChFi2d_FilletAPI.hxx
ChFi2d_ChamferAPI.hxx
ChFi2d_ConstructionError.hxx
ChFi2d_FilletAlgo.cxx
ChFi2d_FilletAlgo.hxx
ChFi2d_FilletAPI.cxx
ChFi2d_FilletAPI.hxx