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

Integration of OCCT 6.5.0 from SVN

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

View File

@@ -0,0 +1,319 @@
-- File: BRepBuilderAPI.cdl
-- Created: Tue Jul 6 17:29:03 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
package BRepBuilderAPI
---Purpose: The BRepBuilderAPI package provides an Application
-- Programming Interface for the BRep topology data
-- structure.
--
-- The API is a set of classes aiming to provide :
--
-- * High level and simple calls for the most common
-- operations.
--
-- * Keeping an access on the low-level
-- implementation of high-level calls.
--
-- * Examples of programming of high-level operations
-- from low-level operations.
--
-- * A complete coverage of modelling :
--
-- - Creating vertices ,edges, faces, solids.
--
-- - Sweeping operations.
--
-- - Boolean operations.
--
-- - Global properties computation.
--
--
-- The API provides classes to build objects:
--
-- * The constructors of the classes provides the
-- different constructions methods.
--
-- * The class keeps as fields the different tools
-- used to build the object.
--
-- * The class provides a casting method to get
-- automatically the result with a function-like
-- call.
--
-- For example to make a vertex <V> from a point <P>
-- one can writes :
--
-- V = BRepBuilderAPI_MakeVertex(P);
--
-- or
--
-- BRepBuilderAPI_MakeVertex MV(P);
-- V = MV.Vertex();
--
--
-- For tolerances a default precision is used which
-- can be changed by the packahe method
-- BRepBuilderAPI::Precision.
--
-- For error handling the BRepBuilderAPI commands raise only
-- the NotDone error. When Done is false on a command
-- the error description can be asked to the command.
--
-- In theory the comands can be called with any
-- arguments, argument checking is performed by the
-- command.
uses
Standard,
StdFail,
gp,
GeomAbs,
Geom2d,
Geom,
TopAbs,
TopoDS,
TopTools,
TopLoc,
BRep,
BRepLib,
BRepTools,
TColStd,
TColgp
is
enumeration EdgeError is
---Purpose: Indicates the outcome of the
-- construction of an edge, i.e. whether it has been successful or
-- not, as explained below:
-- - BRepBuilderAPI_EdgeDone No error occurred; The edge is
-- correctly built.
-- - BRepBuilderAPI_PointProjectionFailed No parameters were given but
-- the projection of the 3D points on the curve failed. This
-- happens when the point distance to the curve is greater than
-- the precision value.
-- - BRepBuilderAPI_ParameterOutOfRange
-- The given parameters are not in the parametric range
-- C->FirstParameter(), C->LastParameter()
-- - BRepBuilderAPI_DifferentPointsOnClosedCurve
-- The two vertices or points are the extremities of a closed
-- curve but have different locations.
-- - BRepBuilderAPI_PointWithInfiniteParameter
-- A finite coordinate point was associated with an infinite
-- parameter (see the Precision package for a definition of infinite values).
-- - BRepBuilderAPI_DifferentsPointAndParameter
-- The distance between the 3D point and the point evaluated
-- on the curve with the parameter is greater than the precision.
-- - BRepBuilderAPI_LineThroughIdenticPoints
-- Two identical points were given to define a line (construction
-- of an edge without curve); gp::Resolution is used for the confusion test.
EdgeDone,
PointProjectionFailed,
ParameterOutOfRange,
DifferentPointsOnClosedCurve,
PointWithInfiniteParameter,
DifferentsPointAndParameter,
LineThroughIdenticPoints
end EdgeError;
enumeration WireError is
---Purpose: Indicates the outcome of wire
-- construction, i.e. whether it is successful or not, as explained below:
-- - BRepBuilderAPI_WireDone No
-- error occurred. The wire is correctly built.
-- - BRepBuilderAPI_EmptyWire No
-- initialization of the algorithm. Only an empty constructor was used.
-- - BRepBuilderAPI_DisconnectedWire
-- The last edge which you attempted to add was not connected to the wire.
-- - BRepBuilderAPI_NonManifoldWire
-- The wire with some singularity.
WireDone,
EmptyWire,
DisconnectedWire,
NonManifoldWire
end WireError;
enumeration FaceError is
---Purpose: Indicates the outcome of the
-- construction of a face, i.e. whether it has been successful or
-- not, as explained below:
-- - BRepBuilderAPI_FaceDone No error occurred. The face is
-- correctly built.
-- - BRepBuilderAPI_NoFace No initialization of the
-- algorithm; only an empty constructor was used.
-- - BRepBuilderAPI_NotPlanar
-- No surface was given and the wire was not planar.
-- - BRepBuilderAPI_CurveProjectionFailed
-- Not used so far.
-- - BRepBuilderAPI_ParametersOutOfRange
-- The parameters given to limit the surface are out of its bounds.
FaceDone,
NoFace,
NotPlanar,
CurveProjectionFailed,
ParametersOutOfRange
end FaceError;
enumeration ShellError is
---Purpose: Indicates the outcome of the construction of a face, i.e.
-- whether it is successful or not, as explained below:
-- - BRepBuilderAPI_ShellDone No error occurred.
-- The shell is correctly built.
-- - BRepBuilderAPI_EmptyShell No initialization of
-- the algorithm: only an empty constructor was used.
-- - BRepBuilderAPI_DisconnectedShell not yet used
-- - BRepBuilderAPI_ShellParametersOutOfRange
-- The parameters given to limit the surface are out of its bounds.
ShellDone,
EmptyShell,
DisconnectedShell,
ShellParametersOutOfRange
end ShellError;
enumeration PipeError is
---Purpose: Errors that can occur at (shell)pipe construction.
PipeDone, -- no error
PipeNotDone, -- Error with status unknown
PlaneNotIntersectGuide,
ImpossibleContact -- Impossible to rotat the section like the rotated section
-- have conact with the guide.
end PipeError;
enumeration ShapeModification is
---Purpose: Lists the possible types of modification to a shape
-- following a topological operation: Preserved, Deleted,
-- Trimmed, Merged or BoundaryModified.
-- This enumeration enables you to assign a "state" to the
-- different shapes that are on the list of operands for
-- each API function. The MakeShape class then uses this
-- to determine what has happened to the shapes which
-- constitute the list of operands.
Preserved,
Deleted,
Trimmed,
Merged,
BoundaryModified
end ShapeModification;
enumeration TransitionMode is
---Purpose: Option to manage discontinuities in Sweep
Transformed,
RightCorner,
RoundCorner
end TransitionMode;
deferred class Command;
---Purpose: Root class for all BRepBuilderAPI commands.
deferred class MakeShape;
---Purpose: Root class for all shape constructions.
--
-- Construction of topology from geometry
--
class MakeVertex;
class MakeEdge;
class MakeEdge2d;
class MakePolygon;
class MakeFace;
-- Construction of Shape through sections.
class FindPlane;
--
-- Construction of Shape from several shapes
--
class Sewing;
---Purpose: Provides a tool to
-- - identify contigous boundaries (for control
-- of continuity: C0, C1, ...)
-- - assemble contigous shapes into one shape.
--
-- Construction of composite topologies
--
class MakeWire;
class MakeShell;
class MakeSolid;
--
-- Shape modification (constant topology)
--
deferred class ModifyShape;
class Transform;
class NurbsConvert ;
---Purpose: converts all 3D analytical representation of surfaces
-- and curves to NURBS execpt for Planes
--
class GTransform;
class Copy;
class Collect;
--
-- Default plane for 2d edges.
--
Plane(P : Plane from Geom);
---Purpose: Sets the current plane.
---Level: Public
Plane returns Plane from Geom;
---Purpose: Returns the current plane.
--
---C++: return const &
---Level: Public
--
-- Default precison methods.
-- The default precision is initialized with Precision::Confusion()
--
Precision(P : Real from Standard);
---Purpose: Sets the default precision. The current Precision
-- is returned.
---Level: Public
Precision returns Real from Standard;
---Purpose: Returns the default precision.
---Level: Public
end BRepBuilderAPI;

View File

@@ -0,0 +1,64 @@
// File: BRepBuilderAPI.cxx
// Created: Wed Oct 13 08:38:28 1999
// Author: Atelier CAS2000
// <cas@brunox.paris1.matra-dtv.fr>
#include <BRepBuilderAPI.ixx>
#include <BRepLib.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Compound.hxx>
#include <gp.hxx>
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
void BRepBuilderAPI::Plane(const Handle(Geom_Plane)& P)
{
BRepLib::Plane(P);
}
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
const Handle(Geom_Plane)& BRepBuilderAPI::Plane()
{
return BRepLib::Plane();
}
//=======================================================================
//function : Precision
//purpose :
//=======================================================================
void BRepBuilderAPI::Precision(const Standard_Real P)
{
BRepLib::Precision(P);
}
//=======================================================================
//function : Precision
//purpose :
//=======================================================================
Standard_Real BRepBuilderAPI::Precision()
{
return BRepLib::Precision();
}

View File

@@ -0,0 +1,49 @@
-- File: BRepBuilderAPI_Collect.cdl
-- Created: Tue Apr 9 10:14:16 1996
-- Author: Yves FRICAUD
-- <yfr@stylox>
---Copyright: Matra Datavision 1996
class Collect from BRepBuilderAPI
---Purpose:
uses
Shape from TopoDS,
DataMapOfShapeListOfShape from TopTools,
MapOfShape from TopTools,
MakeShape from BRepBuilderAPI
is
Create returns Collect from BRepBuilderAPI;
Add (me : in out; SI : Shape from TopoDS ;
MKS : in out MakeShape from BRepBuilderAPI );
---Purpose:
AddGenerated (me : in out; S : Shape from TopoDS ;
Gen : Shape from TopoDS );
---Purpose:
AddModif (me : in out; S : Shape from TopoDS ;
Mod : Shape from TopoDS );
---Purpose:
Filter (me : in out; SF : Shape from TopoDS );
---Purpose:
Modification (me) returns DataMapOfShapeListOfShape from TopTools;
---C++: return const &
Generated (me) returns DataMapOfShapeListOfShape from TopTools;
---C++: return const &
fields
myInitialShape : Shape from TopoDS;
myDeleted : MapOfShape from TopTools;
myMod : DataMapOfShapeListOfShape from TopTools;
myGen : DataMapOfShapeListOfShape from TopTools;
end Collect;

View File

@@ -0,0 +1,360 @@
// File: BRepBuilderAPI_Collect.cxx
// Created: Tue Apr 9 10:42:18 1996
// Author: Yves FRICAUD
// <yfr@stylox>
#include <BRepBuilderAPI_Collect.ixx>
#include <TopoDS.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_MapOfShape.hxx>
#ifdef DEB
#include <stdio.h>
Standard_Boolean Affich;
#endif
#ifdef DRAW
#include <DBRep.hxx>
#endif
//=======================================================================
//function : BuilBack
//purpose :
//=======================================================================
static void BuildBack (const TopTools_DataMapOfShapeListOfShape& M1,
TopTools_DataMapOfShapeShape& BM1)
{
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(M1);
for (; it.More(); it.Next()) {
const TopoDS_Shape& KS = it.Key();
TopTools_ListIteratorOfListOfShape itl(it.Value());
for ( ; itl.More(); itl.Next()) {
const TopoDS_Shape& VS = itl.Value();
BM1.Bind(VS,KS);
}
}
}
//=======================================================================
//function : Replace
//purpose :
//=======================================================================
static void Replace ( TopTools_ListOfShape& L,
const TopoDS_Shape Old,
const TopTools_ListOfShape& New)
{
//-----------------------------------
// Suppression de Old dans la liste.
//-----------------------------------
TopTools_ListIteratorOfListOfShape it(L);
while (it.More()) {
if (it.Value().IsSame(Old)) {
L.Remove(it);
break;
}
if (it.More()) it.Next();
}
//---------------------------
// Ajout de New a L.
//---------------------------
TopTools_ListOfShape copNew;
copNew = New;
L.Append(copNew);
}
//=======================================================================
//function : StoreImage
//purpose :
//=======================================================================
static void StoreImage ( TopTools_DataMapOfShapeListOfShape& MG,
const TopoDS_Shape& S,
const TopTools_DataMapOfShapeShape& MGBack,
const TopTools_ListOfShape& LI)
{
if (!LI.IsEmpty()) {
if (MGBack.IsBound(S)) {
Replace (MG.ChangeFind(MGBack(S)),S,LI);
}
else {
if (!MG.IsBound(S)) {
TopTools_ListOfShape empty;
MG.Bind(S,empty);
}
// Dans tous les cas on copie la liste pour eviter les pb de
// const& dans BRepBuilderAPI.
TopTools_ListIteratorOfListOfShape it;
for (it.Initialize(LI); it.More(); it.Next()) {
const TopoDS_Shape& SS = it.Value();
MG(S).Append(SS);
}
}
}
}
//=======================================================================
//function : UpdateGen
//purpose :
//=======================================================================
static void Update ( TopTools_DataMapOfShapeListOfShape& Mod,
TopTools_DataMapOfShapeListOfShape& Gen,
const TopTools_DataMapOfShapeShape& ModBack,
const TopTools_DataMapOfShapeShape& GenBack,
const TopoDS_Shape& SI,
BRepBuilderAPI_MakeShape& MKS,
const TopAbs_ShapeEnum ShapeType)
{
TopTools_MapOfShape DejaVu;
TopExp_Explorer exp;
for (exp.Init(SI,ShapeType); exp.More(); exp.Next()) {
const TopoDS_Shape& S = exp.Current();
if (!DejaVu.Add(S)) continue;
//---------------------------------------
// Recuperation de l image de S par MKS.
//---------------------------------------
const TopTools_ListOfShape& LIM = MKS.Modified(S);
if (!LIM.IsEmpty()) {
if (GenBack.IsBound(S)) {
// Modif de generation => generation du shape initial
StoreImage (Gen,S,GenBack,LIM);
}
else {
StoreImage (Mod,S,ModBack,LIM);
}
}
const TopTools_ListOfShape& LIG = MKS.Generated(S);
if (!LIG.IsEmpty()) {
if (ModBack.IsBound(S)) {
// Generation de modif => generation du shape initial
TopoDS_Shape IS = ModBack(S);
StoreImage (Gen,IS,GenBack,LIG);
}
else {
StoreImage (Gen,S,GenBack,LIG);
}
}
}
}
#ifdef DEB
//=======================================================================
//function : DEBControl
//purpose :
//=======================================================================
static void DEBControl (const TopTools_DataMapOfShapeListOfShape& MG)
{
char name[100];
Standard_Integer IK = 0;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(MG);
for (; it.More(); it.Next()) {
const TopoDS_Shape& OS = it.Key();
sprintf(name, "SK_%d",++IK);
#ifdef DRAW
DBRep::Set(name,OS);
#endif
TopTools_ListIteratorOfListOfShape itl(MG(OS));
Standard_Integer IV = 1;
for (; itl.More(); itl.Next()) {
const TopoDS_Shape& NS = itl.Value();
sprintf(name, "SV_%d_%d",IK,IV++);
#ifdef DRAW
DBRep::Set(name,NS);
#endif
}
}
}
#endif
//=======================================================================
//function : BRepBuilderAPI_Collect
//purpose :
//=======================================================================
BRepBuilderAPI_Collect::BRepBuilderAPI_Collect()
{}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_Collect::Add (const TopoDS_Shape& SI,
BRepBuilderAPI_MakeShape& MKS)
{
TopTools_DataMapOfShapeShape GenBack;
TopTools_DataMapOfShapeShape ModBack;
BuildBack (myGen, GenBack); // Vraiment pas optimum a Revoir
BuildBack (myMod, ModBack);
Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_FACE);
Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_EDGE);
Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_VERTEX);
#ifdef DEB
if (Affich) {
DEBControl (myGen);
DEBControl (myMod);
}
#endif
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_Collect::AddGenerated (const TopoDS_Shape& S,
const TopoDS_Shape& NS)
{
TopTools_DataMapOfShapeShape GenBack;
TopTools_DataMapOfShapeShape ModBack;
BuildBack (myGen, GenBack);
BuildBack (myMod, ModBack);
TopTools_ListOfShape LIG;
LIG.Append(NS);
if (ModBack.IsBound(S)) {
// Generation de modif => generation du shape initial
TopoDS_Shape IS = ModBack(S);
StoreImage (myGen,IS,GenBack,LIG);
}
else {
StoreImage (myGen,S,GenBack,LIG);
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_Collect::AddModif (const TopoDS_Shape& S,
const TopoDS_Shape& NS)
{
TopTools_DataMapOfShapeShape GenBack;
TopTools_DataMapOfShapeShape ModBack;
BuildBack (myGen, GenBack);
BuildBack (myMod, ModBack);
TopTools_ListOfShape LIG;
LIG.Append(NS);
if (GenBack.IsBound(S)) {
// Modif de generation => generation du shape initial
StoreImage (myGen,S,GenBack,LIG);
}
else {
StoreImage (myMod,S,ModBack,LIG);
}
}
//=======================================================================
//function : Filter
//purpose :
//=======================================================================
static void FilterByShape(TopTools_DataMapOfShapeListOfShape& MG,
const TopoDS_Shape& SF)
{
TopTools_MapOfShape MSF;
TopExp_Explorer exp;
Standard_Boolean YaEdge = Standard_False;
Standard_Boolean YaVertex = Standard_False;
for (exp.Init(SF,TopAbs_FACE) ; exp.More(); exp.Next()) MSF.Add(exp.Current());
//-------------------------------------------------------------
// Suppression de toutes les images qui ne sont pas dans MSF.
//-------------------------------------------------------------
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(MG);
for (; it.More(); it.Next()) {
const TopoDS_Shape& OS = it.Key();
TopTools_ListOfShape& LNS = MG.ChangeFind(OS);
TopTools_ListIteratorOfListOfShape itl(LNS);
while (itl.More()) {
const TopoDS_Shape& NS = itl.Value();
//-------------------------------------------------------------------
// Images contiennet des edges => ajout des edges resultat dans MSF.
//-------------------------------------------------------------------
if (!YaEdge && NS.ShapeType() == TopAbs_EDGE) {
for (exp.Init(SF,TopAbs_EDGE) ; exp.More(); exp.Next()) {
MSF.Add(exp.Current());
}
YaEdge = Standard_True;
}
//-------------------------------------------------------------------
// Images contiennet des vertex => ajout des vertex resultat dans MSF.
//-------------------------------------------------------------------
if (!YaVertex && NS.ShapeType() == TopAbs_VERTEX) {
for (exp.Init(SF,TopAbs_VERTEX) ; exp.More(); exp.Next()) {
MSF.Add(exp.Current());
}
YaVertex = Standard_True;
}
//---------------------------------------
// Si pas dans MSF suprresion de l image.
//---------------------------------------
if (!MSF.Contains(NS)) {
LNS.Remove(itl);
}
else if (itl.More()) itl.Next();
}
}
#ifdef DEB
if (Affich) {
DEBControl (MG);
}
#endif
}
//=======================================================================
//function : Modification
//purpose :
//=======================================================================
const TopTools_DataMapOfShapeListOfShape& BRepBuilderAPI_Collect::Modification() const
{
return myMod;
}
//=======================================================================
//function : Generation
//purpose :
//=======================================================================
const TopTools_DataMapOfShapeListOfShape& BRepBuilderAPI_Collect::Generated() const
{
return myGen;
}
//=======================================================================
//function : Filter
//purpose :
//=======================================================================
void BRepBuilderAPI_Collect::Filter(const TopoDS_Shape& SF)
{
FilterByShape (myGen,SF);
FilterByShape (myMod,SF);
}

View File

@@ -0,0 +1,56 @@
-- File: BRepBuilderAPI_Command.cdl
-- Created: Wed Jul 21 19:53:17 1993
-- Author: Remi LEQUETTE
-- <rle@nonox>
---Copyright: Matra Datavision 1993
deferred class Command from BRepBuilderAPI
---Purpose: Root class for all commands in BRepBuilderAPI.
--
-- Provides :
--
-- * Managements of the notDone flag.
--
-- * Catching of exceptions (not implemented).
--
-- * Logging (not implemented).
raises
NotDone from StdFail
is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~BRepBuilderAPI_Command(){Delete() ; }"
Initialize;
---Purpose: Set done to False.
IsDone(me) returns Boolean is virtual;
---Level: Public
Done(me : in out)
---Purpose: Set done to true.
---Level: Public
is static protected;
NotDone(me : in out)
---Purpose: Set done to false.
---Level: Public
is static protected;
Check(me)
---Purpose: Raises NotDone if done is false.
---Level: Public
raises NotDone from StdFail
is static;
fields
myDone : Boolean;
end Command;

View File

@@ -0,0 +1,68 @@
// File: BRepBuilderAPI_Command.cxx
// Created: Fri Jul 23 15:51:38 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_Command.ixx>
//=======================================================================
//function : BRepBuilderAPI_Command
//purpose :
//=======================================================================
BRepBuilderAPI_Command::BRepBuilderAPI_Command() :
myDone(Standard_False)
{
}
void BRepBuilderAPI_Command::Delete()
{}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_Command::IsDone()const
{
return myDone;
}
//=======================================================================
//function : Check
//purpose :
//=======================================================================
void BRepBuilderAPI_Command::Check()const
{
if (!myDone)
StdFail_NotDone::Raise("BRep_API: command not done");
}
//=======================================================================
//function : Done
//purpose :
//=======================================================================
void BRepBuilderAPI_Command::Done()
{
myDone = Standard_True;
}
//=======================================================================
//function : NotDone
//purpose :
//=======================================================================
void BRepBuilderAPI_Command::NotDone()
{
myDone = Standard_False;
}

View File

@@ -0,0 +1,50 @@
-- File: BRepBuilderAPI_Copy.cdl
-- Created: Mon Dec 12 12:10:47 1994
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1994
class Copy from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Duplication of a shape.
-- A Copy object provides a framework for:
-- - defining the construction of a duplicate shape,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses
Shape from TopoDS,
Face from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools
is
Create
---Purpose: Constructs an empty copy framework. Use the function
-- Perform to copy shapes.
returns Copy from BRepBuilderAPI;
Create(S: Shape from TopoDS; copyGeom: Boolean = Standard_True)
---Purpose: Constructs a copy framework and copies the shape S.
-- Use the function Shape to access the result.
-- If copyGeom is False, only topological objects will be copied, while
-- geometry will be shared with original shape.
-- Note: the constructed framework can be reused to copy
-- other shapes: just specify them with the function Perform.
returns Copy from BRepBuilderAPI;
Perform(me: in out; S: Shape from TopoDS; copyGeom: Boolean = Standard_True)
---Purpose: Copies the shape S.
-- Use the function Shape to access the result.
-- If copyGeom is False, only topological objects will be copied, while
-- geometry will be shared with original shape.
is static;
end Copy;

View File

@@ -0,0 +1,148 @@
// File: BRepBuilderAPI_Copy.cxx
// Created: Mon Dec 12 12:14:38 1994
// Author: Jacques GOUSSARD
// <jag@topsn2>
#include <BRepBuilderAPI_Copy.ixx>
#include <Geom_Surface.hxx>
#include <Geom_Curve.hxx>
#include <Geom2d_Curve.hxx>
#include <BRepTools_Modification.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification
{
public:
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom)
: myCopyGeom(copyGeom)
{
}
//! Returns true to indicate the need to copy face;
//! copies surface if requested
Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S,
TopLoc_Location& L, Standard_Real& Tol,
Standard_Boolean& RevWires, Standard_Boolean& RevFace)
{
S = BRep_Tool::Surface(F,L);
Tol = BRep_Tool::Tolerance(F);
RevWires = RevFace = Standard_False;
if ( ! S.IsNull() && myCopyGeom )
S = Handle(Geom_Surface)::DownCast(S->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies curves if requested
Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C,
TopLoc_Location& L, Standard_Real& Tol)
{
Standard_Real f,l;
C = BRep_Tool::Curve (E, L, f, l);
Tol = BRep_Tool::Tolerance(E);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom_Curve)::DownCast(C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P,
Standard_Real& Tol)
{
P = BRep_Tool::Pnt(V);
Tol = BRep_Tool::Tolerance(V);
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies pcurve if requested
Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F,
const TopoDS_Edge& NewE, const TopoDS_Face& NewF,
Handle(Geom2d_Curve)& C, Standard_Real& Tol)
{
Tol = BRep_Tool::Tolerance(E);
Standard_Real f, l;
C = BRep_Tool::CurveOnSurface (E, F, f, l);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom2d_Curve)::DownCast (C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E,
Standard_Real& P, Standard_Real& Tol)
{
if (V.IsNull()) return Standard_False; // infinite edge may have Null vertex
Tol = BRep_Tool::Tolerance(V);
P = BRep_Tool::Parameter (V, E);
return Standard_True;
}
//! Returns the continuity of E between F1 and F2
GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1,
const TopoDS_Face& F2, const TopoDS_Edge&,
const TopoDS_Face&, const TopoDS_Face&)
{
return BRep_Tool::Continuity (E, F1, F2);
}
public:
DEFINE_STANDARD_RTTI(BRepBuilderAPI_Copy_Modification)
private:
Standard_Boolean myCopyGeom;
};
DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
IMPLEMENT_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
IMPLEMENT_STANDARD_RTTIEXT(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
//=======================================================================
//function : BRepBuilderAPI_Copy
//purpose :
//=======================================================================
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
{
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True);
}
//=======================================================================
//function : BRepBuilderAPI_Copy
//purpose :
//=======================================================================
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom)
{
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom);
DoModif(S);
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void BRepBuilderAPI_Copy::Perform(const TopoDS_Shape& S, const Standard_Boolean copyGeom)
{
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom);
NotDone(); // on force la copie si on vient deja d`en faire une
DoModif(S);
}

View File

@@ -0,0 +1,71 @@
-- File: BRepBuilderAPI_FindPlane.cdl
-- Created: Thu Nov 2 11:36:39 1995
-- Author: Jing Cheng MEI
-- <mei@junon>
---Copyright: Matra Datavision 1995
class FindPlane from BRepBuilderAPI
---Purpose: Describes functions to find the plane in which the edges
-- of a given shape are located.
-- A FindPlane object provides a framework for:
-- - extracting the edges of a given shape,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses
Shape from TopoDS,
Plane from Geom
raises
NoSuchObject from Standard
is
Create
returns FindPlane from BRepBuilderAPI;
---Purpose: Initializes an empty algorithm. The function Init is then used to define the shape.
Create (S : Shape from TopoDS;
Tol : Real from Standard = -1)
returns FindPlane from BRepBuilderAPI;
---Purpose: Constructs the plane containing the edges of the shape S.
-- A plane is built only if all the edges are within a distance
-- of less than or equal to tolerance from a planar surface.
-- This tolerance value is equal to the larger of the following two values:
-- - Tol, where the default value is negative, or
-- - the largest of the tolerance values assigned to the individual edges of S.
-- Use the function Found to verify that a plane is built.
-- The resulting plane is then retrieved using the function Plane.
Init (me : in out;
S : Shape from TopoDS;
Tol : Real from Standard = -1);
---Purpose: Constructs the plane containing the edges of the shape S.
-- A plane is built only if all the edges are within a distance
-- of less than or equal to tolerance from a planar surface.
-- This tolerance value is equal to the larger of the following two values:
-- - Tol, where the default value is negative, or
-- - the largest of the tolerance values assigned to the individual edges of S.
-- Use the function Found to verify that a plane is built.
-- The resulting plane is then retrieved using the function Plane.
Found(me)
returns Boolean from Standard;
---Purpose: Returns true if a plane containing the edges of the
-- shape is found and built. Use the function Plane to consult the result.
Plane(me)
returns mutable Plane from Geom;
---Purpose: Returns the plane containing the edges of the shape.
-- Warning
-- Use the function Found to verify that the plane is built. If
-- a plane is not found, Plane returns a null handle.
fields
myPlane : Plane from Geom;
end FindPlane;

View File

@@ -0,0 +1,204 @@
// File: BRepBuilderAPI_FindPlane.cxx
// Created: Thu Nov 2 11:47:55 1995
// Author: Jing Cheng MEI
// <mei@junon>
#include <BRepBuilderAPI_FindPlane.ixx>
#include <Precision.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <gp_Pln.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TopoDS.hxx>
#include <TopLoc_Location.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <Geom_Line.hxx>
#include <Geom_Conic.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Parabola.hxx>
#include <Geom_Hyperbola.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
//=======================================================================
//function : BRepBuilderAPI_FindPlane
//purpose :
//=======================================================================
BRepBuilderAPI_FindPlane::BRepBuilderAPI_FindPlane()
{
}
//=======================================================================
//function : BRepBuilderAPI_FindPlane
//purpose :
//=======================================================================
BRepBuilderAPI_FindPlane::BRepBuilderAPI_FindPlane(const TopoDS_Shape& S,
const Standard_Real Tol)
{
Init(S,Tol);
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_FindPlane::Init(const TopoDS_Shape& S,
const Standard_Real Tol)
{
Standard_Real tolerance = Tol;
myPlane.Nullify();
// compute the tolerance
TopExp_Explorer ex;
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
Standard_Real t = BRep_Tool::Tolerance(TopoDS::Edge(ex.Current()));
if (t > tolerance) tolerance = t;
}
Standard_Real tol2 = tolerance*tolerance;
// try to find an analytical curve and calculate points
TopLoc_Location loc;
Standard_Real first, last;
Standard_Boolean found = Standard_False;
Handle(Geom_Plane) P;
TColgp_SequenceOfPnt points;
Standard_Integer nbPnts;
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
Handle(Geom_Curve) c3d =
BRep_Tool::Curve(TopoDS::Edge(ex.Current()), loc, first, last);
if (!c3d.IsNull()) {
Handle(Geom_Curve) c3dptr =
Handle(Geom_Curve)::DownCast(c3d->Transformed(loc.Transformation()));
Handle(Standard_Type) cType = c3dptr->DynamicType();
if (cType == STANDARD_TYPE(Geom_Line)) {
nbPnts = 3;
}
else if ((cType == STANDARD_TYPE(Geom_Circle)) ||
(cType == STANDARD_TYPE(Geom_Ellipse)) ||
(cType == STANDARD_TYPE(Geom_Parabola)) ||
(cType == STANDARD_TYPE(Geom_Hyperbola))) {
nbPnts = 4;
if (!found) {
found = Standard_True;
Handle(Geom_Conic) Co = Handle(Geom_Conic)::DownCast(c3dptr);
P = new Geom_Plane(gp_Ax3(Co->Position()));
}
}
else if (cType == STANDARD_TYPE(Geom_BezierCurve)) {
Handle(Geom_BezierCurve) Co =
Handle(Geom_BezierCurve)::DownCast(c3dptr);
nbPnts = Co->NbPoles();
}
else if (cType == STANDARD_TYPE(Geom_BSplineCurve)) {
Handle(Geom_BSplineCurve) Co =
Handle(Geom_BSplineCurve)::DownCast(c3dptr);
nbPnts = Co->NbPoles();
}
else {
nbPnts = 10;
}
gp_Pnt p0;
for (Standard_Integer i=1; i<=nbPnts; i++) {
if (i == 1) {
c3dptr->D0(first, p0);
}
else if (i == nbPnts) {
c3dptr->D0(last, p0);
}
else {
c3dptr->D0(first+(last-first)/(nbPnts-1)*(i-1), p0);
}
points.Append(p0);
}
}
}
if (!found) {
// try to find a plane with the points
if (points.Length() > 2) {
Standard_Real disMax = 0.0;
gp_Pnt p0 = points(1);
gp_Pnt p1;
for (Standard_Integer i=2; i<=points.Length(); i++) {
Standard_Real dist = p0.SquareDistance(points(i));
if (dist > disMax) {
disMax = dist;
p1 = points(i); // ca va plus vite de stocker le point, sinon il faut chercher une valeur dans une sequence
}
}
if (disMax > tol2) {
gp_Vec V1(p0, p1), V3;
Standard_Real proMax = 0.0;
gp_Pnt p2 = p0 ;
for (Standard_Integer j=2; j<=points.Length(); j++) {
V3 = V1^gp_Vec(p0, points(j));
Standard_Real pro = V3.SquareMagnitude();
if (pro > proMax) {
proMax = pro;
p2 = points(j);
}
}
if (p0.SquareDistance(p2) > tol2) {
gp_Dir D1(V1), D2(gp_Vec(p0, p2));
if (!D1.IsParallel(D2, Precision::Angular())) {
P = new Geom_Plane(gp_Ax3(p0, D1.Crossed(D2), D1));
found = Standard_True;
}
}
}
}
}
if (found) {
// test if all points are on the plane
const gp_Pln& pln = P->Pln();
for (Standard_Integer i=1; i<=points.Length(); i++) {
if (pln.SquareDistance(points(i)) > tol2) {
found = Standard_False;
break;
}
}
}
if (found) {
myPlane = P;
}
}
//=======================================================================
//function : Found
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_FindPlane::Found() const
{
return !myPlane.IsNull();
}
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
Handle(Geom_Plane) BRepBuilderAPI_FindPlane::Plane() const
{
return myPlane;
}

View File

@@ -0,0 +1,120 @@
-- File: BRepBuilderAPI_GTransform.cdl
-- Created: Mon Dec 30 17:10:14 1996
-- Author: Stagiaire Mary FABIEN
-- <fbi@zozox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1996
class GTransform from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Geometric transformation on a shape.
-- The transformation to be applied is defined as a gp_GTrsf
-- transformation. It may be:
-- - a transformation equivalent to a gp_Trsf transformation, the
-- most common case: you should , however, use a BRepAPI_Transform
-- object to perform this kind of transformation; or
-- - an affinity, or
-- - more generally, any type of point transformation which may
-- be defined by a three row, four column matrix of transformation.
-- In the last two cases, the underlying geometry of the
-- following shapes may change:
-- - a curve which supports an edge of the shape, or
-- - a surface which supports a face of the shape;
-- For example, a circle may be transformed into an ellipse when
-- applying an affinity transformation.
-- The transformation is applied to:
-- - all the curves which support edges of the shape, and
-- - all the surfaces which support faces of the shape.
-- A GTransform object provides a framework for:
-- - defining the geometric transformation to be applied,
-- - implementing the transformation algorithm, and
-- - consulting the result.
uses
Trsf from gp,
GTrsf from gp,
Shape from TopoDS,
Face from TopoDS,
Collect from BRepBuilderAPI,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools
-- Modified by Sergey KHROMOV - Thu Mar 27 17:45:42 2003 Begin
raises
NoSuchObject from Standard
-- Modified by Sergey KHROMOV - Thu Mar 27 17:45:42 2003 End
is
Create(T: GTrsf from gp)
returns GTransform from BRepBuilderAPI;
---Purpose: Constructs a framework for applying the geometric
-- transformation T to a shape. Use the function
-- Perform to define the shape to transform.
Create(S: Shape from TopoDS; T: GTrsf from gp;
Copy: Boolean from Standard = Standard_False)
returns GTransform from BRepBuilderAPI;
---Purpose: Constructs a framework for applying the geometric
-- transformation T to a shape, and applies it to the shape S.
-- - If the transformation T is direct and isometric (i.e. if
-- the determinant of the vectorial part of T is equal to
-- 1.), and if Copy equals false (default value), the
-- resulting shape is the same as the original but with
-- a new location assigned to it.
-- - In all other cases, the transformation is applied to
-- a duplicate of S.
-- Use the function Shape to access the result.
-- Note: the constructed framework can be reused to
-- apply the same geometric transformation to other
-- shapes: just specify them with the function Perform.
Perform(me: in out; S : Shape from TopoDS;
Copy: Boolean from Standard = Standard_False)
---Purpose: Applies the geometric transformation defined at the
-- time of construction of this framework to the shape S.
-- - If the transformation T is direct and isometric (i.e. if
-- the determinant of the vectorial part of T is equal to
-- 1.), and if Copy equals false (default value), the
-- resulting shape is the same as the original but with
-- a new location assigned to it.
-- - In all other cases, the transformation is applied to a duplicate of S.
-- Use the function Shape to access the result.
-- Note: this framework can be reused to apply the same
-- geometric transformation to other shapes: just specify
-- them by calling the function Perform again.
is static;
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;
-- Modified by Sergey KHROMOV - Thu Mar 27 17:43:59 2003 Begin
ModifiedShape(me; S: Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the modified shape corresponding to <S>.
---C++: return const&
raises NoSuchObject from Standard
-- if S is not the initial shape or a sub-shape
-- of the initial shape.
is redefined virtual;
-- Modified by Sergey KHROMOV - Thu Mar 27 17:44:02 2003 End
fields
myGTrsf : GTrsf from gp;
myUseModif : Boolean from Standard;
myHist : Collect from BRepBuilderAPI;
end Transform;

View File

@@ -0,0 +1,107 @@
// File: BRepBuilderAPI_GTransform.cxx
// Created: Mon Dec 30 17:12:14 1996
// Author: Stagiaire Mary FABIEN
// <fbi@zozox.paris1.matra-dtv.fr>
#include <BRepBuilderAPI_GTransform.ixx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepTools_GTrsfModification.hxx>
#include <BRepTools_NurbsConvertModification.hxx>
#include <BRepBuilderAPI_NurbsConvert.hxx>
#include <gp.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRep_Builder.hxx>
#include <TopoDS.hxx>
//=======================================================================
//function : BRepBuilderAPI_GTransform
//purpose :
//=======================================================================
BRepBuilderAPI_GTransform::BRepBuilderAPI_GTransform (const gp_GTrsf& T) :
myGTrsf(T)
{
myModification = new BRepTools_GTrsfModification(T);
}
//=======================================================================
//function : BRepBuilderAPI_GTransform
//purpose :
//=======================================================================
BRepBuilderAPI_GTransform::BRepBuilderAPI_GTransform (const TopoDS_Shape& S,
const gp_GTrsf& T,
const Standard_Boolean Copy) :
myGTrsf(T)
{
myModification = new BRepTools_GTrsfModification(T);
Perform(S,Copy);
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void BRepBuilderAPI_GTransform::Perform(const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
BRepBuilderAPI_NurbsConvert nc;
nc.Perform(S, Copy);
myHist.Add(S,nc);
TopoDS_Shape Slocal = nc.Shape();
Handle(BRepTools_GTrsfModification) theModif =
Handle(BRepTools_GTrsfModification)::DownCast(myModification);
theModif->GTrsf() = myGTrsf;
DoModif(Slocal,myModification);
// myHist.Filter (Shape());
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepBuilderAPI_GTransform::Modified
(const TopoDS_Shape& F)
{
myGenerated.Clear();
const TopTools_DataMapOfShapeListOfShape& M = myHist.Modification();
if (M.IsBound(F)) {
TopTools_ListOfShape Li;
TopTools_ListIteratorOfListOfShape itL(M(F));
for (;itL.More();itL.Next())
Li.Assign(BRepBuilderAPI_ModifyShape::Modified(itL.Value()));
}
return myGenerated;
}
//=======================================================================
//function : ModifiedShape
//purpose :
//=======================================================================
const TopoDS_Shape& BRepBuilderAPI_GTransform::ModifiedShape
(const TopoDS_Shape& S) const
{
const TopTools_DataMapOfShapeListOfShape &aMapModif = myHist.Modification();
TopoDS_Shape aShape = S;
if (aMapModif.IsBound(S)) {
const TopTools_ListOfShape &aListModShape = aMapModif(S);
Standard_Integer aNbShapes = aListModShape.Extent();
if (aNbShapes > 0)
aShape = aListModShape.First();
}
return BRepBuilderAPI_ModifyShape::ModifiedShape(aShape);
}

View File

@@ -0,0 +1,426 @@
-- File: BRepBuilderAPI_MakeEdge.cdl
-- Created: Tue Jul 6 18:57:30 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
class MakeEdge from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Provides methods to build edges.
--
-- The methods have the following syntax, where
-- TheCurve is one of Lin, Circ, ...
--
-- Create(C : TheCurve)
--
-- Makes an edge on the whole curve. Add vertices
-- on finite curves.
--
-- Create(C : TheCurve; p1,p2 : Real)
--
-- Make an edge on the curve between parameters p1
-- and p2. if p2 < p1 the edge will be REVERSED. If
-- p1 or p2 is infinite the curve will be open in
-- that direction. Vertices are created for finite
-- values of p1 and p2.
--
-- Create(C : TheCurve; P1, P2 : Pnt from gp)
--
-- Make an edge on the curve between the points P1
-- and P2. The points are projected on the curve
-- and the previous method is used. An error is
-- raised if the points are not on the curve.
--
-- Create(C : TheCurve; V1, V2 : Vertex from TopoDS)
--
-- Make an edge on the curve between the vertices
-- V1 and V2. Same as the previous but no vertices
-- are created. If a vertex is Null the curve will
-- be open in this direction.
uses
EdgeError from BRepBuilderAPI,
Edge from TopoDS,
Vertex from TopoDS,
Pnt from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Hypr from gp,
Parab from gp,
Curve from Geom2d,
Curve from Geom,
Surface from Geom,
MakeEdge from BRepLib
raises
NotDone from StdFail
is
Create returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Points
----------------------------------------
Create(V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(P1, P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Lin
----------------------------------------
Create(L : Lin from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Lin from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Lin from gp; P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Lin from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Circ
----------------------------------------
Create(L : Circ from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Circ from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Circ from gp; P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Circ from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Elips
----------------------------------------
Create(L : Elips from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Elips from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Elips from gp; P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Elips from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Hypr
----------------------------------------
Create(L : Hypr from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Hypr from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Hypr from gp; P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Hypr from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Parab
----------------------------------------
Create(L : Parab from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Parab from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Parab from gp; P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Parab from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Curve
----------------------------------------
Create(L : Curve from Geom)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom;
P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom;
V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom;
P1,P2 : Pnt from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom;
V1, V2 : Vertex from TopoDS;
p1, p2 :Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
----------------------------------------
-- Curve and surface
----------------------------------------
Create(L : Curve from Geom2d; S : Surface from Geom)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom2d; S : Surface from Geom; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom2d; S : Surface from Geom;
P1,P2 : Pnt from gp)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom2d; S : Surface from Geom;
V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom2d; S : Surface from Geom;
P1,P2 : Pnt from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
Create(L : Curve from Geom2d; S : Surface from Geom;
V1, V2 : Vertex from TopoDS;
p1, p2 :Real)
---Level: Public
returns MakeEdge from BRepBuilderAPI;
---Purpose: The general method to directly create an edge is to give
-- - a 3D curve C as the support (geometric domain) of the edge,
-- - two vertices V1 and V2 to limit the curve (definition of the restriction of
-- the edge), and
-- - two real values p1 and p2 which are the parameters for the vertices V1 and V2
-- on the curve.
-- The curve may be defined as a 2d curve in the parametric space of a surface: a
-- pcurve. The surface on which the edge is built is then kept at the level of the edge.
-- The default tolerance will be associated with this edge.
-- Rules applied to the arguments:
-- For the curve:
-- - The curve must not be a 'null handle'.
-- - If the curve is a trimmed curve the basis curve is used.
-- For the vertices:
-- - Vertices may be null shapes. When V1 or V2 is null the edge is open in the
-- corresponding direction and the parameter value p1 or p2 must be infinite
-- (remember that Precision::Infinite() defines an infinite value).
-- - The two vertices must be identical if they have the same 3D location.
-- Identical vertices are used in particular when the curve is closed.
-- For the parameters:
-- - The parameters must be in the parametric range of the curve (or the basis
-- curve if the curve is trimmed). If this condition is not satisfied the edge is not
-- built, and the Error function will return BRepAPI_ParameterOutOfRange.
-- - Parameter values must not be equal. If this condition is not satisfied (i.e.
-- if | p1 - p2 | ) the edge is not built, and the Error function will return
-- BRepAPI_LineThroughIdenticPoints.
-- Parameter values are expected to be given in increasing order:
-- C->FirstParameter()
-- - If the parameter values are given in decreasing order the vertices are switched,
-- i.e. the "first vertex" is on the point of parameter p2 and the "second vertex" is
-- on the point of parameter p1. In such a case, to keep the original intent of the
-- construction, the edge will be oriented "reversed".
-- - On a periodic curve the parameter values p1 and p2 are adjusted by adding or
-- subtracting the period to obtain p1 in the parametric range of the curve, and p2]
-- such that [ p1 , where Period is the period of the curve.
-- - A parameter value may be infinite. The edge is open in the corresponding
-- direction. However the corresponding vertex must be a null shape. If this condition
-- is not satisfied the edge is not built, and the Error function will return
-- BRepAPI_PointWithInfiniteParameter.
-- - The distance between the vertex and the point evaluated on the curve with the
-- parameter, must be lower than the precision of the vertex. If this condition is not
-- satisfied the edge is not built, and the Error function will return
-- BRepAPI_DifferentsPointAndParameter.
-- Other edge constructions
-- - The parameter values can be omitted, they will be computed by projecting the
-- vertices on the curve. Note that projection is the only way to evaluate the
-- parameter values of the vertices on the curve: vertices must be given on the curve,
-- i.e. the distance from a vertex to the curve must be less than or equal to the
-- precision of the vertex. If this condition is not satisfied the edge is not built,
-- and the Error function will return BRepAPI_PointProjectionFailed.
-- - 3D points can be given in place of vertices. Vertices will be created from the
-- points (with the default topological precision Precision::Confusion()).
-- Note:
-- - Giving vertices is useful when creating a connected edge.
-- - If the parameter values correspond to the extremities of a closed curve,
-- points must be identical, or at least coincident. If this condition is not
-- satisfied the edge is not built, and the Error function will return
-- BRepAPI_DifferentPointsOnClosedCurve.
-- - The vertices or points can be omitted if the parameter values are given. The
-- points will be computed from the parameters on the curve.
-- The vertices or points and the parameter values can be omitted. The first and last
-- parameters of the curve will then be used.
----------------------------------------
-- Auxiliary methods
----------------------------------------
Init(me : in out; C : Curve from Geom)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom;
P1, P2 : Pnt from gp)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom;
V1, V2 : Vertex from TopoDS)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom;
P1, P2 : Pnt from gp;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom;
V1, V2 : Vertex from TopoDS;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom;
P1, P2 : Pnt from gp)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom;
V1, V2 : Vertex from TopoDS)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom;
P1, P2 : Pnt from gp;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d; S : Surface from Geom;
V1, V2 : Vertex from TopoDS;
p1, p2 : Real)
---Level: Public
is static;
---Purpose: Defines or redefines the arguments for the construction of an edge.
-- This function is currently used after the empty constructor BRepAPI_MakeEdge().
----------------------------------------
-- Results
----------------------------------------
IsDone(me) returns Boolean
---Purpose: Returns true if the edge is built.
is redefined;
Error(me) returns EdgeError from BRepBuilderAPI
---Purpose: Returns the construction status
-- - BRepBuilderAPI_EdgeDone if the edge is built, or
-- - another value of the BRepBuilderAPI_EdgeError
-- enumeration indicating the reason of construction failure.
is static;
Edge(me) returns Edge from TopoDS
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Edge() const;"
--- Purpose:
-- Returns the constructed edge.
-- Exceptions StdFail_NotDone if the edge is not built.
raises
NotDone from StdFail
is static;
Vertex1(me) returns Vertex from TopoDS
---Purpose: Returns the first vertex of the edge. May be Null.
--
---C++: return const &
---Level: Public
is static;
Vertex2(me) returns Vertex from TopoDS
---C++: return const &
---Purpose: Returns the second vertex of the edge. May be Null.
--
-- Warning
-- The returned vertex in each function corresponds respectively to
-- - the lowest, or
-- - the highest parameter on the curve along which the edge is built.
-- It does not correspond to the first or second vertex
-- given at the time of the construction, if the edge is oriented reversed.
-- Exceptions
-- StdFail_NotDone if the edge is not built.
is static;
fields
myMakeEdge : MakeEdge from BRepLib;
end MakeEdge;

View File

@@ -0,0 +1,893 @@
// File: BRepBuilderAPI_MakeEdge.cxx
// Created: Fri Jul 23 15:51:46 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeEdge.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge()
{}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Lin& L)
: myMakeEdge(L)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Lin& L,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Lin& L,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(L,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Lin& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(L,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Circ& C)
: myMakeEdge(C)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Circ& C,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(C,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Circ& C ,
const gp_Pnt& P1,
const gp_Pnt& P2 )
: myMakeEdge(C,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Circ& C,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(C,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Elips& E)
:myMakeEdge(E)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Elips& E,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(E,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Elips& E,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(E,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Elips& E,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(E,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Hypr& H)
: myMakeEdge(H)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Hypr& H,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(H,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Hypr& H,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(H,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Hypr& H,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(H,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Parab& P)
: myMakeEdge(P)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Parab& P,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(P,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Parab& P,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(P,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const gp_Parab& P,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(P,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L)
: myMakeEdge(L)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(L,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(L,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L,
const gp_Pnt& P1,
const gp_Pnt& P2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,P1,P2,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,V1,V2,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S)
: myMakeEdge(L,S)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,S,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S,
const gp_Pnt& P1,
const gp_Pnt& P2)
: myMakeEdge(L,S,P1,P2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge(L,S,V1,V2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S,
const gp_Pnt& P1,
const gp_Pnt& P2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,S,P1,P2,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,
const Handle(Geom_Surface)& S,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge(L,S,V1,V2,p1,p2)
{
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& C)
{
myMakeEdge.Init(C);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& C,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge.Init(C,p1,p2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& C,
const gp_Pnt& P1,
const gp_Pnt& P2)
{
myMakeEdge.Init(C,P1,P2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& C,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
{
myMakeEdge.Init(C,V1,V2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& C,
const gp_Pnt& P1,
const gp_Pnt& P2,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge.Init(C,P1,P2,p1,p2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom_Curve)& CC,
const TopoDS_Vertex& VV1,
const TopoDS_Vertex& VV2,
const Standard_Real pp1,
const Standard_Real pp2)
{
myMakeEdge.Init(CC,VV1,VV2,pp1,pp2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& S)
{
myMakeEdge.Init(C,S);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& S,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge.Init(C,S,p1,p2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& S,
const gp_Pnt& P1,
const gp_Pnt& P2)
{
myMakeEdge.Init(C,S,P1,P2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& S,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
{
myMakeEdge.Init(C,S,V1,V2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& C,
const Handle(Geom_Surface)& S,
const gp_Pnt& P1,
const gp_Pnt& P2,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge.Init(C,S,P1,P2,p1,p2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge::Init(const Handle(Geom2d_Curve)& CC,
const Handle(Geom_Surface)& S,
const TopoDS_Vertex& VV1,
const TopoDS_Vertex& VV2,
const Standard_Real pp1,
const Standard_Real pp2)
{
myMakeEdge.Init(CC,S,VV1,VV2,pp1,pp2);
if ( myMakeEdge.IsDone()) {
Done();
myShape = myMakeEdge.Shape();
}
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeEdge::IsDone() const
{
return myMakeEdge.IsDone();
}
//=======================================================================
//function : Error
//purpose :
//=======================================================================
BRepBuilderAPI_EdgeError BRepBuilderAPI_MakeEdge::Error() const
{
switch ( myMakeEdge.Error()) {
case BRepLib_EdgeDone:
return BRepBuilderAPI_EdgeDone;
case BRepLib_PointProjectionFailed:
return BRepBuilderAPI_PointProjectionFailed;
case BRepLib_ParameterOutOfRange:
return BRepBuilderAPI_ParameterOutOfRange;
case BRepLib_DifferentPointsOnClosedCurve:
return BRepBuilderAPI_DifferentPointsOnClosedCurve;
case BRepLib_PointWithInfiniteParameter:
return BRepBuilderAPI_PointWithInfiniteParameter;
case BRepLib_DifferentsPointAndParameter:
return BRepBuilderAPI_DifferentsPointAndParameter;
case BRepLib_LineThroughIdenticPoints:
return BRepBuilderAPI_LineThroughIdenticPoints;
}
// portage WNT
return BRepBuilderAPI_EdgeDone;
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepBuilderAPI_MakeEdge::Edge()const
{
return myMakeEdge.Edge();
}
//=======================================================================
//function : Vertex1
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeEdge::Vertex1()const
{
return myMakeEdge.Vertex1();
}
//=======================================================================
//function : Vertex2
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeEdge::Vertex2()const
{
return myMakeEdge.Vertex2();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::operator TopoDS_Edge() const
{
return Edge();
}

View File

@@ -0,0 +1,284 @@
-- File: BRepBuilderAPI_MakeEdge2d.cdl
-- Created: Tue Jul 6 18:57:30 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
class MakeEdge2d from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Provides methods to build edges.
--
-- The methods have the following syntax, where
-- TheCurve is one of Lin2d, Circ2d, ...
--
-- Create(C : TheCurve)
--
-- Makes an edge on the whole curve. Add vertices
-- on finite curves.
--
-- Create(C : TheCurve; p1,p2 : Real)
--
-- Make an edge on the curve between parameters p1
-- and p2. if p2 < p1 the edge will be REVERSED. If
-- p1 or p2 is infinite the curve will be open in
-- that direction. Vertices are created for finite
-- values of p1 and p2.
--
-- Create(C : TheCurve; P1, P2 : Pnt2d from gp)
--
-- Make an edge on the curve between the points P1
-- and P2. The points are projected on the curve
-- and the previous method is used. An error is
-- raised if the points are not on the curve.
--
-- Create(C : TheCurve; V1, V2 : Vertex from TopoDS)
--
-- Make an edge on the curve between the vertices
-- V1 and V2. Same as the previous but no vertices
-- are created. If a vertex is Null the curve will
-- be open in this direction.
uses
EdgeError from BRepBuilderAPI,
Edge from TopoDS,
Vertex from TopoDS,
Pnt2d from gp,
Lin2d from gp,
Circ2d from gp,
Elips2d from gp,
Hypr2d from gp,
Parab2d from gp,
Curve from Geom2d,
MakeEdge2d from BRepLib
raises
NotDone from StdFail
is
----------------------------------------
-- Points
----------------------------------------
Create(V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(P1, P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Lin
----------------------------------------
Create(L : Lin2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Lin2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Lin2d from gp; P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Lin2d from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Circ
----------------------------------------
Create(L : Circ2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Circ2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Circ2d from gp; P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Circ2d from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Elips
----------------------------------------
Create(L : Elips2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Elips2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Elips2d from gp; P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Elips2d from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Hypr
----------------------------------------
Create(L : Hypr2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Hypr2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Hypr2d from gp; P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Hypr2d from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Parab
----------------------------------------
Create(L : Parab2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Parab2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Parab2d from gp; P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Parab2d from gp; V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Curve
----------------------------------------
Create(L : Curve from Geom2d)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Curve from Geom2d; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Curve from Geom2d;
P1,P2 : Pnt2d from gp)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Curve from Geom2d;
V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Curve from Geom2d;
P1,P2 : Pnt2d from gp; p1,p2 : Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
Create(L : Curve from Geom2d;
V1, V2 : Vertex from TopoDS;
p1, p2 :Real)
---Level: Public
returns MakeEdge2d from BRepBuilderAPI;
----------------------------------------
-- Auxiliary methods
----------------------------------------
Init(me : in out; C : Curve from Geom2d)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d;
P1, P2 : Pnt2d from gp)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d;
V1, V2 : Vertex from TopoDS)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d;
P1, P2 : Pnt2d from gp;
p1, p2 : Real)
---Level: Public
is static;
Init(me : in out; C : Curve from Geom2d;
V1, V2 : Vertex from TopoDS;
p1, p2 : Real)
---Level: Public
is static;
----------------------------------------
-- Results
----------------------------------------
IsDone(me) returns Boolean
---Level: Public
is redefined;
Error(me)
returns EdgeError from BRepBuilderAPI
---Purpose: Returns the error description when NotDone.
---Level: Public
is static;
Edge(me) returns Edge from TopoDS
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Edge() const;"
---Level: Public
raises
NotDone from StdFail
is static;
Vertex1(me) returns Vertex from TopoDS
---Purpose: Returns the first vertex of the edge. May be Null.
--
---C++: return const &
---Level: Public
is static;
Vertex2(me) returns Vertex from TopoDS
---Purpose: Returns the second vertex of the edge. May be Null.
--
---C++: return const &
---Level: Public
is static;
fields
myMakeEdge2d : MakeEdge2d from BRepLib;
end MakeEdge2d;

View File

@@ -0,0 +1,637 @@
// File: BRepBuilderAPI_MakeEdge2d.cxx
// Created: Fri Jul 23 15:51:46 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeEdge2d.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L)
: myMakeEdge2d(L)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(L,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(L,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(L,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& C)
: myMakeEdge2d(C)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& C,
const Standard_Real p1,
const Standard_Real p2)
:myMakeEdge2d(C,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& C,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(C,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& C,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(C,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& E)
: myMakeEdge2d(E)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& E,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(E,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& E,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(E,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& E,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(E,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& H)
: myMakeEdge2d(H)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& H,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(H,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& H,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(H,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& H,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(H,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& P)
: myMakeEdge2d(P)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& P,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(P,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& P,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(P,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& P,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(P,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L)
: myMakeEdge2d(L)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(L,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
: myMakeEdge2d(L,P1,P2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(L,V1,V2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(L,P1,P2,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const Standard_Real p1,
const Standard_Real p2)
: myMakeEdge2d(L,V1,V2,p1,p2)
{
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C)
{
myMakeEdge2d.Init(C);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge2d.Init(C,p1,p2);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2)
{
myMakeEdge2d.Init(C,P1,P2);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
{
myMakeEdge2d.Init(C,V1,V2);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C,
const gp_Pnt2d& P1,
const gp_Pnt2d& P2,
const Standard_Real p1,
const Standard_Real p2)
{
myMakeEdge2d.Init(C,P1,P2,p1,p2);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
const TopoDS_Vertex& VV1,
const TopoDS_Vertex& VV2,
const Standard_Real pp1,
const Standard_Real pp2)
{
myMakeEdge2d.Init(CC,VV1,VV2,pp1,pp2);
if ( myMakeEdge2d.IsDone()) {
Done();
myShape = myMakeEdge2d.Shape();
}
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeEdge2d::IsDone() const
{
return myMakeEdge2d.IsDone();
}
//=======================================================================
//function : Error
//purpose :
//=======================================================================
BRepBuilderAPI_EdgeError BRepBuilderAPI_MakeEdge2d::Error() const
{
switch ( myMakeEdge2d.Error()) {
case BRepLib_EdgeDone:
return BRepBuilderAPI_EdgeDone;
case BRepLib_PointProjectionFailed:
return BRepBuilderAPI_PointProjectionFailed;
case BRepLib_ParameterOutOfRange:
return BRepBuilderAPI_ParameterOutOfRange;
case BRepLib_DifferentPointsOnClosedCurve:
return BRepBuilderAPI_DifferentPointsOnClosedCurve;
case BRepLib_PointWithInfiniteParameter:
return BRepBuilderAPI_PointWithInfiniteParameter;
case BRepLib_DifferentsPointAndParameter:
return BRepBuilderAPI_DifferentsPointAndParameter;
case BRepLib_LineThroughIdenticPoints:
return BRepBuilderAPI_LineThroughIdenticPoints;
}
// portage WNT
return BRepBuilderAPI_EdgeDone;
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepBuilderAPI_MakeEdge2d::Edge()const
{
return myMakeEdge2d.Edge();
}
//=======================================================================
//function : Vertex1
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeEdge2d::Vertex1()const
{
return myMakeEdge2d.Vertex1();
}
//=======================================================================
//function : Vertex2
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeEdge2d::Vertex2()const
{
return myMakeEdge2d.Vertex2();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::operator TopoDS_Edge() const
{
return Edge();
}

View File

@@ -0,0 +1,315 @@
-- File: BRepBuilderAPI_MakeFace.cdl
-- Created: Mon Jul 12 11:35:23 1993
-- Author: Remi LEQUETTE
-- <rle@nonox>
-- xab: 29Nov96 correction de doc
---Copyright: Matra Datavision 1993
class MakeFace from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Provides methods to build faces.
--
-- A face may be built :
--
-- * From a surface.
--
-- - Elementary surface from gp.
--
-- - Surface from Geom.
--
-- * From a surface and U,V values.
--
-- * From a wire.
--
-- - Find the surface automatically if possible.
--
-- * From a surface and a wire.
--
-- - A flag Inside is given, when this flag is True
-- the wire is oriented to bound a finite area on
-- the surface.
--
-- * From a face and a wire.
--
-- - The new wire is a perforation.
uses
Pln from gp,
Cylinder from gp,
Cone from gp,
Sphere from gp,
Torus from gp,
Surface from Geom,
Face from TopoDS,
Wire from TopoDS,
FaceError from BRepBuilderAPI,
MakeFace from BRepLib
raises
NotDone from StdFail
is
Create
---Purpose: Not done.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(F : Face from TopoDS)
---Purpose: Load a face. Usefull to add wires.
---Level: Public
returns MakeFace from BRepBuilderAPI;
----------------------------------------------
-- From a surface
----------------------------------------------
Create(P : Pln from gp)
---Purpose: Make a face from a plane.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cylinder from gp)
---Purpose: Make a face from a cylinder.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cone from gp)
---Purpose: Make a face from a cone.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Sphere from gp)
---Purpose: Make a face from a sphere.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Torus from gp)
---Purpose: Make a face from a torus.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Surface from Geom)
---Purpose: Make a face from a Surface.
---Level: Public
returns MakeFace from BRepBuilderAPI;
----------------------------------------------
-- From a surface and U,V values
----------------------------------------------
Create(P : Pln from gp; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a plane.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cylinder from gp; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a cylinder.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cone from gp; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a cone.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Sphere from gp; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a sphere.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Torus from gp; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a torus.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Surface from Geom; UMin, UMax, VMin, VMax : Real)
---Purpose: Make a face from a Surface.
---Level: Public
returns MakeFace from BRepBuilderAPI;
----------------------------------------------
-- From a wire
----------------------------------------------
Create(W : Wire from TopoDS;
OnlyPlane : Boolean from Standard = Standard_False)
---Purpose: Find a surface from the wire and make a face.
-- if <OnlyPlane> is true, the computed surface will be
-- a plane. If it is not possible to find a plane, the
-- flag NotDone will be set.
---Level: Public
returns MakeFace from BRepBuilderAPI;
----------------------------------------------
-- From a surface and a wire
----------------------------------------------
Create(P : Pln from gp; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a plane and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cylinder from gp; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a cylinder and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Cone from gp; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a cone and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Sphere from gp; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a sphere and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(C : Torus from gp; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a torus and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
Create(S : Surface from Geom; W : Wire from TopoDS;
Inside : Boolean = Standard_True)
---Purpose: Make a face from a Surface and a wire.
---Level: Public
returns MakeFace from BRepBuilderAPI;
----------------------------------------------
-- From face and wire.
----------------------------------------------
Create(F : Face from TopoDS; W : Wire from TopoDS)
---Purpose: Adds the wire <W> in the face <F>
---Level: Public
returns MakeFace from BRepBuilderAPI;
---Purpose: A general method to create a face is to give
-- - a surface S as the support (the geometric domain) of the face,
-- - and a wire W to bound it.
-- The bounds of the face can also be defined by four parameter values
-- umin, umax, vmin, vmax which determine isoparametric limitations on
-- the parametric space of the surface. In this way, a patch is
-- defined. The parameter values are optional. If they are omitted, the
-- natural bounds of the surface are used. A wire is automatically
-- built using the defined bounds. Up to four edges and four vertices
-- are created with this wire (no edge is created when the
-- corresponding parameter value is infinite).
-- Wires can then be added using the function Add to define other
-- restrictions on the face. These restrictions represent holes. More
-- than one wire may be added by this way, provided that the wires do
-- not cross each other and that they define only one area on the
-- surface. (Be careful, however, as this is not checked).
-- Forbidden addition of wires
-- Note that in this schema, the third case is valid if edges of the
-- wire W are declared internal to the face. As a result, these edges
-- are no longer bounds of the face.
-- A default tolerance (Precision::Confusion()) is given to the face,
-- this tolerance may be increased during construction of the face
-- using various algorithms.
-- Rules applied to the arguments
-- For the surface:
-- - The surface must not be a 'null handle'.
-- - If the surface is a trimmed surface, the basis surface is used.
-- - For the wire: the wire is composed of connected edges, each
-- edge having a parametric curve description in the parametric
-- domain of the surface; in other words, as a pcurve.
-- For the parameters:
-- - The parameter values must be in the parametric range of the
-- surface (or the basis surface, if the surface is trimmed). If this
-- condition is not satisfied, the face is not built, and the Error
-- function will return BRepBuilderAPI_ParametersOutOfRange.
-- - The bounding parameters p1 and p2 are adjusted on a periodic
-- surface in a given parametric direction by adding or subtracting
-- the period to obtain p1 in the parametric range of the surface and
-- such p2, that p2 - p1 <= Period, where Period is the period of the
-- surface in this parametric direction.
-- - A parameter value may be infinite. There will be no edge and
-- no vertex in the corresponding direction.
Init(me : in out; F : Face from TopoDS)
---Purpose: Initializes (or reinitializes) the
-- construction of a face by creating a new object which is a copy of
-- the face F, in order to add wires to it, using the function Add.
-- Note: this complete copy of the geometry is only required if you
-- want to work on the geometries of the two faces independently.
is static;
Init(me : in out; S : Surface from Geom; Bound : Boolean = Standard_True)
---Purpose: Initializes (or reinitializes) the construction of a face on
-- the surface S. If Bound is true (the default value), a wire is
-- automatically created from the natural bounds of the
-- surface S and added to the face in order to bound it. If
-- Bound is false, no wire is added. This option is used
-- when real bounds are known. These will be added to
-- the face after this initialization, using the function Add.
is static;
Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax : Real)
---Purpose: Initializes (or reinitializes) the construction of a face on
-- the surface S, limited in the u parametric direction by
-- the two parameter values UMin and UMax and in the
-- v parametric direction by the two parameter values VMin and VMax.
-- Warning
-- Error returns:
-- - BRepBuilderAPI_ParametersOutOfRange
-- when the parameters given are outside the bounds of the
-- surface or the basis surface of a trimmed surface.
is static;
Add(me : in out; W : Wire from TopoDS)
---Purpose: Adds the wire W to the constructed face as a hole.
-- Warning
-- W must not cross the other bounds of the face, and all
-- the bounds must define only one area on the surface.
-- (Be careful, however, as this is not checked.)
-- Example
-- // a cylinder
-- gp_Cylinder C = ..;
-- // a wire
-- TopoDS_Wire W = ...;
-- BRepBuilderAPI_MakeFace MF(C);
-- MF.Add(W);
-- TopoDS_Face F = MF;
is static;
----------------------------------------------
-- Results
----------------------------------------------
IsDone(me) returns Boolean
---Purpose: Returns true if this algorithm has a valid face.
is redefined;
Error(me) returns FaceError from BRepBuilderAPI
---Purpose: Returns the construction status
-- BRepBuilderAPI_FaceDone if the face is built, or
-- - another value of the BRepBuilderAPI_FaceError
-- enumeration indicating why the construction failed, in
-- particular when the given parameters are outside the
-- bounds of the surface.
is static;
Face(me) returns Face from TopoDS
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Face() const;"
---Purpose: Returns the constructed face.
-- Exceptions
-- StdFail_NotDone if no face is built.
raises
NotDone from StdFail
is static;
fields
myMakeFace : MakeFace from BRepLib;
end MakeFace;

View File

@@ -0,0 +1,497 @@
// File: BRepBuilderAPI_MakeFace.cxx
// Created: Fri Jul 23 15:51:48 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeFace.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace()
{
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Face& F)
: myMakeFace(F)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P)
: myMakeFace(P)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C)
: myMakeFace(C)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C)
: myMakeFace(C)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S)
: myMakeFace(S)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T)
: myMakeFace(T)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S)
: myMakeFace(S)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(P,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(C,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(C,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(S,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(T,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax)
: myMakeFace(S,UMin,UMax,VMin,VMax)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Wire& W,
const Standard_Boolean OnlyPlane)
: myMakeFace(W,OnlyPlane)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(P,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(C,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(C,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(S,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(T,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S,
const TopoDS_Wire& W,
const Standard_Boolean Inside)
: myMakeFace(S,W,Inside)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Face& F,
const TopoDS_Wire& W)
: myMakeFace(F,W)
{
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeFace::Init(const TopoDS_Face& F)
{
myMakeFace.Init(F);
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeFace::Init(const Handle(Geom_Surface)& S,
const Standard_Boolean Bound)
{
myMakeFace.Init(S,Bound);
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeFace::Init(const Handle(Geom_Surface)& SS,
const Standard_Real Um,
const Standard_Real UM,
const Standard_Real Vm,
const Standard_Real VM)
{
myMakeFace.Init(SS,Um,UM,Vm,VM);
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeFace::Add(const TopoDS_Wire& W)
{
myMakeFace.Add(W);
if ( myMakeFace.IsDone()) {
Done();
myShape = myMakeFace.Shape();
}
}
//=======================================================================
//function : Face
//purpose :
//=======================================================================
const TopoDS_Face& BRepBuilderAPI_MakeFace::Face()const
{
return myMakeFace.Face();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::operator TopoDS_Face() const
{
return Face();
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeFace::IsDone() const
{
return myMakeFace.IsDone();
}
//=======================================================================
//function : Error
//purpose :
//=======================================================================
BRepBuilderAPI_FaceError BRepBuilderAPI_MakeFace::Error() const
{
switch ( myMakeFace.Error()) {
case BRepLib_FaceDone:
return BRepBuilderAPI_FaceDone;
case BRepLib_NoFace:
return BRepBuilderAPI_NoFace;
case BRepLib_NotPlanar:
return BRepBuilderAPI_NotPlanar;
case BRepLib_CurveProjectionFailed:
return BRepBuilderAPI_CurveProjectionFailed;
case BRepLib_ParametersOutOfRange:
return BRepBuilderAPI_ParametersOutOfRange;
}
// Portage WNT
return BRepBuilderAPI_FaceDone;
}

View File

@@ -0,0 +1,198 @@
-- File: BRepBuilderAPI_MakePolygon.cdl
-- Created: Thu Jul 29 11:39:48 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
class MakePolygon from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build polygonal wires. A
-- polygonal wire can be built from any number of points
-- or vertices, and consists of a sequence of connected
-- rectilinear edges.
-- When a point or vertex is added to the polygon if
-- it is identic to the previous point no edge is
-- built. The method added can be used to test it.
-- Construction of a Polygonal Wire
-- You can construct:
-- - a complete polygonal wire by defining all its points
-- or vertices (limited to four), or
-- - an empty polygonal wire and add its points or
-- vertices in sequence (unlimited number).
-- A MakePolygon object provides a framework for:
-- - initializing the construction of a polygonal wire,
-- - adding points or vertices to the polygonal wire under construction, and
-- - consulting the result.
uses
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Pnt from gp,
MakePolygon from BRepLib
raises
NotDone from StdFail
is
Create
returns MakePolygon from BRepBuilderAPI;
---Purpose: Initializes an empty polygonal wire, to which points or
-- vertices are added using the Add function.
-- As soon as the polygonal wire under construction
-- contains vertices, it can be consulted using the Wire function.
Create(P1, P2 : Pnt from gp)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
Create(P1, P2, P3 : Pnt from gp;
Close : Boolean = Standard_False)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
Create(P1, P2, P3, P4 : Pnt from gp;
Close : Boolean = Standard_False)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
---Purpose: Constructs a polygonal wire from 2, 3 or 4 points. Vertices are
-- automatically created on the given points. The polygonal wire is
-- closed if Close is true; otherwise it is open. Further vertices can
-- be added using the Add function. The polygonal wire under
-- construction can be consulted at any time by using the Wire function.
-- Example
-- //an open polygon from four points
-- TopoDS_Wire W = BRepBuilderAPI_MakePolygon(P1,P2,P3,P4);
-- Warning: The process is equivalent to:
-- - initializing an empty polygonal wire,
-- - and adding the given points in sequence.
-- Consequently, be careful when using this function: if the
-- sequence of points p1 - p2 - p1 is found among the arguments of the
-- constructor, you will create a polygonal wire with two
-- consecutive coincident edges.
Create(V1, V2 : Vertex from TopoDS)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
Create(V1, V2, V3 : Vertex from TopoDS;
Close : Boolean = Standard_False)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
Create(V1, V2, V3, V4 : Vertex from TopoDS;
Close : Boolean = Standard_False)
---Level: Public
returns MakePolygon from BRepBuilderAPI;
---Purpose: Constructs a polygonal wire from
-- 2, 3 or 4 vertices. The polygonal wire is closed if Close is true;
-- otherwise it is open (default value). Further vertices can be
-- added using the Add function. The polygonal wire under
-- construction can be consulted at any time by using the Wire function.
-- Example
-- //a closed triangle from three vertices
-- TopoDS_Wire W = BRepBuilderAPI_MakePolygon(V1,V2,V3,Standard_True);
-- Warning
-- The process is equivalent to:
-- - initializing an empty polygonal wire,
-- - then adding the given points in sequence.
-- So be careful, as when using this function, you could create a
-- polygonal wire with two consecutive coincident edges if
-- the sequence of vertices v1 - v2 - v1 is found among the
-- constructor's arguments.
Add(me : in out; P : Pnt from gp)
---Level: Public
is static;
Add(me : in out; V : Vertex from TopoDS)
---Level: Public
is static;
--- Purpose:
-- Adds the point P or the vertex V at the end of the
-- polygonal wire under construction. A vertex is
-- automatically created on the point P.
-- Warning
-- - When P or V is coincident to the previous vertex,
-- no edge is built. The method Added can be used to
-- test for this. Neither P nor V is checked to verify
-- that it is coincident with another vertex than the last
-- one, of the polygonal wire under construction. It is
-- also possible to add vertices on a closed polygon
-- (built for example by using a constructor which
-- declares the polygon closed, or after the use of the Close function).
-- Consequently, be careful using this function: you might create:
-- - a polygonal wire with two consecutive coincident edges, or
-- - a non manifold polygonal wire.
-- - P or V is not checked to verify if it is
-- coincident with another vertex but the last one, of
-- the polygonal wire under construction. It is also
-- possible to add vertices on a closed polygon (built
-- for example by using a constructor which declares
-- the polygon closed, or after the use of the Close function).
-- Consequently, be careful when using this function: you might create:
-- - a polygonal wire with two consecutive coincident edges, or
-- - a non-manifold polygonal wire.
Added(me) returns Boolean
---Purpose: Returns true if the last vertex added to the constructed
-- polygonal wire is not coincident with the previous one.
is static;
Close(me : in out)
---Purpose: Closes the polygonal wire under construction. Note - this
-- is equivalent to adding the first vertex to the polygonal
-- wire under construction.
is static;
FirstVertex(me) returns Vertex from TopoDS
---C++: return const &
---Level: Public
is static;
LastVertex(me) returns Vertex from TopoDS
---C++: return const &
---Level: Public
is static;
---Purpose: Returns the first or the last vertex of the polygonal wire under construction.
-- If the constructed polygonal wire is closed, the first and the last vertices are identical.
IsDone(me) returns Boolean
---Level: Public
is redefined;
---Purpose:
-- Returns true if this algorithm contains a valid polygonal
-- wire (i.e. if there is at least one edge).
-- IsDone returns false if fewer than two vertices have
-- been chained together by this construction algorithm.
Edge(me) returns Edge from TopoDS
---Purpose: Returns the edge built between the last two points or
-- vertices added to the constructed polygonal wire under construction.
-- Warning
-- If there is only one vertex in the polygonal wire, the result is a null edge.
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Edge() const;"
raises
NotDone from StdFail
is static;
Wire(me) returns Wire from TopoDS
---Purpose:
-- Returns the constructed polygonal wire, or the already
-- built part of the polygonal wire under construction.
-- Exceptions
-- StdFail_NotDone if the wire is not built, i.e. if fewer than
-- two vertices have been chained together by this construction algorithm.
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;"
raises
NotDone from StdFail
is static;
fields
myMakePolygon : MakePolygon from BRepLib;
end MakePolygon;

View File

@@ -0,0 +1,250 @@
// File: BRepBuilderAPI_MakePolygon.cxx
// Created: Thu Jul 29 17:17:23 1993
// Author: Remi LEQUETTE
// <rle@phylox>
#include <BRepBuilderAPI_MakePolygon.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon()
{
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2)
: myMakePolygon(P1,P2)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1,
const gp_Pnt& P2,
const gp_Pnt& P3,
const Standard_Boolean Cl)
: myMakePolygon(P1,P2,P3,Cl)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const gp_Pnt& P1,
const gp_Pnt& P2,
const gp_Pnt& P3,
const gp_Pnt& P4,
const Standard_Boolean Cl)
: myMakePolygon(P1,P2,P3,P4,Cl)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakePolygon(V1,V2)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const TopoDS_Vertex& V3,
const Standard_Boolean Cl)
: myMakePolygon(V1,V2,V3,Cl)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakePolygon
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const TopoDS_Vertex& V3,
const TopoDS_Vertex& V4,
const Standard_Boolean Cl)
: myMakePolygon(V1,V2,V3,V4,Cl)
{
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakePolygon::Add(const gp_Pnt& P)
{
myMakePolygon.Add(P);
if (myMakePolygon.IsDone()) {
Done();
if ( !LastVertex().IsNull())
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakePolygon::Add(const TopoDS_Vertex& V)
{
myMakePolygon.Add(V);
if (myMakePolygon.IsDone()) {
Done();
myShape = myMakePolygon.Shape();
}
}
//=======================================================================
//function : Added
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakePolygon::Added()const
{
return myMakePolygon.Added();
}
//=======================================================================
//function : Close
//purpose :
//=======================================================================
void BRepBuilderAPI_MakePolygon::Close()
{
myMakePolygon.Close();
myShape = myMakePolygon.Shape();
}
//=======================================================================
//function : FirstVertex
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::FirstVertex()const
{
return myMakePolygon.FirstVertex();
}
//=======================================================================
//function : LastVertex
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakePolygon::LastVertex()const
{
return myMakePolygon.LastVertex();
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakePolygon::IsDone() const
{
return myMakePolygon.IsDone();
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepBuilderAPI_MakePolygon::Edge()const
{
return myMakePolygon.Edge();
}
//=======================================================================
//function : Wire
//purpose :
//=======================================================================
const TopoDS_Wire& BRepBuilderAPI_MakePolygon::Wire()const
{
return myMakePolygon.Wire();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::operator TopoDS_Edge() const
{
return Edge();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakePolygon::operator TopoDS_Wire() const
{
return Wire();
}

View File

@@ -0,0 +1,86 @@
-- File: BRepBuilderAPI_MakeShape.cdl
-- Created: Wed Jul 21 18:15:13 1993
-- Author: Remi LEQUETTE
-- <rle@nonox>
---Copyright: Matra Datavision 1993
deferred class MakeShape from BRepBuilderAPI inherits Command from BRepBuilderAPI
---Purpose: This is the root class for all shape
-- constructions. It stores the result.
--
-- It provides deferred methods to trace the history
-- of sub-shapes.
uses
Shape from TopoDS,
Face from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools
raises
NotDone from StdFail
is
Delete(me:out) is redefined;
---C++: alias "Standard_EXPORT virtual ~BRepBuilderAPI_MakeShape(){Delete() ; }"
Initialize;
Build(me : in out)
---Purpose: This is called by Shape(). It does nothing but
-- may be redefined.
---Level: Public
is virtual;
Shape(me) returns Shape from TopoDS
---Purpose: Returns a shape built by the shape construction algorithm.
-- Raises exception StdFail_NotDone if the shape was not built.
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Shape() const;"
---Level: Public
raises
NotDone from StdFail
is static;
------------------------------------------------------------------
--- The following methods are not implemented at this level.
-- An empty list is returned.
--- They are optional and must be redefined.
------------------------------------------------------------------
Generated (me: in out; S : Shape from TopoDS)
---Purpose: Returns the list of shapes generated from the
-- shape <S>.
---C++: return const &
---Level: Public
returns ListOfShape from TopTools
is virtual;
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 virtual;
IsDeleted (me: in out; S : Shape from TopoDS)
returns Boolean
is virtual;
---Purpose: Returns true if the shape S has been deleted.
fields
myShape : Shape from TopoDS is protected;
myGenerated : ListOfShape from TopTools is protected;
end MakeShape;

View File

@@ -0,0 +1,103 @@
// File: BRepBuilderAPI_MakeShape.cxx
// Created: Fri Jul 23 15:51:51 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeShape.ixx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeShape
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShape::BRepBuilderAPI_MakeShape()
{
}
void BRepBuilderAPI_MakeShape::Delete()
{}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeShape::Build()
{
}
//=======================================================================
//function : Shape
//purpose :
//=======================================================================
const TopoDS_Shape& BRepBuilderAPI_MakeShape::Shape() const
{
if (!IsDone()) {
// the following is const cast away
((BRepBuilderAPI_MakeShape*) (void*) this)->Build();
Check();
}
return myShape;
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShape::operator TopoDS_Shape() const
{
return Shape();
}
//=======================================================================
//function : Generated
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepBuilderAPI_MakeShape::Generated (const TopoDS_Shape& S)
{
myGenerated.Clear();
return myGenerated;
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepBuilderAPI_MakeShape::Modified (const TopoDS_Shape& S)
{
myGenerated.Clear();
return myGenerated;
}
//=======================================================================
//function : IsDeleted
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeShape::IsDeleted (const TopoDS_Shape& S)
{
return Standard_False;
}

View File

@@ -0,0 +1,124 @@
-- File: BRepBuilderAPI_MakeShell.cdl
-- Created: Wed Feb 16 16:56:46 1994
-- Author: Remi LEQUETTE
-- <rle@zerox>
-- xab:19Nov96 correction de doc
---Copyright: Matra Datavision 1994
class MakeShell from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build a
-- shape corresponding to the skin of a surface.
-- Note that the term shell in the class name has the same definition
-- as that of a shell in STEP, in other words the skin of a shape,
-- and not a solid model defined by surface and thickness. If you want
-- to build the second sort of shell, you must use
-- BRepOffsetAPI_MakeOffsetShape. A shell is made of a series of
-- faces connected by their common edges.
-- If the underlying surface of a face is not C2 continuous and
-- the flag Segment is True, MakeShell breaks the surface down into
-- several faces which are all C2 continuous and which are
-- connected along the non-regular curves on the surface.
-- The resulting shell contains all these faces.
-- Construction of a Shell from a non-C2 continuous Surface
-- A MakeShell object provides a framework for:
-- - defining the construction of a shell,
-- - implementing the construction algorithm, and
-- - consulting the result.
-- Warning
-- The connected C2 faces in the shell resulting from a decomposition of
-- the surface are not sewn. For a sewn result, you need to use
-- BRepOffsetAPI_Sewing. For a shell with thickness, you need to use
-- BRepOffsetAPI_MakeOffsetShape.
uses
Surface from Geom,
Shell from TopoDS,
Face from TopoDS,
ShellError from BRepBuilderAPI,
MakeShell from BRepLib
raises
NotDone from StdFail
is
Create
---Purpose: Constructs an empty shell framework. The Init
-- function is used to define the construction arguments.
-- Warning
-- The function Error will return
-- BRepBuilderAPI_EmptyShell if it is called before the function Init.
returns MakeShell from BRepBuilderAPI;
----------------------------------------------
-- From a set of face
----------------------------------------------
----------------------------------------------
-- From a surface
----------------------------------------------
Create(S : Surface from Geom;
Segment : Boolean from Standard = Standard_False)
---Purpose: Constructs a shell from the surface S.
returns MakeShell from BRepBuilderAPI;
Create(S : Surface from Geom; UMin, UMax, VMin, VMax : Real;
Segment : Boolean from Standard = Standard_False)
---Purpose: Constructs a shell from the surface S,
-- limited in the u parametric direction by the two
-- parameter values UMin and UMax, and limited in the v
-- parametric direction by the two parameter values VMin and VMax.
returns MakeShell from BRepBuilderAPI;
Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax : Real;
Segment : Boolean from Standard = Standard_False)
---Purpose: Defines or redefines the arguments
-- for the construction of a shell. The construction is initialized
-- with the surface S, limited in the u parametric direction by the
-- two parameter values UMin and UMax, and in the v parametric
-- direction by the two parameter values VMin and VMax.
-- Warning
-- The function Error returns:
-- - BRepBuilderAPI_ShellParametersOutOfRange
-- when the given parameters are outside the bounds of the
-- surface or the basis surface if S is trimmed
is static;
----------------------------------------------
-- Results
----------------------------------------------
IsDone(me) returns Boolean
---Purpose: Returns true if the shell is built.
is redefined;
Error(me) returns ShellError from BRepBuilderAPI
---Purpose: Returns the construction status:
-- - BRepBuilderAPI_ShellDone if the shell is built, or
-- - another value of the BRepBuilderAPI_ShellError
-- enumeration indicating why the construction failed.
-- This is frequently BRepBuilderAPI_ShellParametersOutOfRange
-- indicating that the given parameters are outside the bounds of the surface.
is static;
Shell(me) returns Shell from TopoDS
---Purpose: Returns the new Shell.
--
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Shell() const;"
---Level: Public
raises
NotDone from StdFail
is static;
fields
myMakeShell : MakeShell from BRepLib;
end MakeShell;

View File

@@ -0,0 +1,137 @@
// File: BRepBuilderAPI_MakeShell.cxx
// Created: Fri Feb 18 15:13:16 1994
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeShell.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakeShell
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell()
{
}
//=======================================================================
//function : BRepBuilderAPI_MakeShell
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S,
const Standard_Boolean Segment)
: myMakeShell(S,Segment)
{
if ( myMakeShell.IsDone()) {
Done();
myShape = myMakeShell.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeShell
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax,
const Standard_Boolean Segment)
: myMakeShell(S,UMin,UMax,VMin,VMax,Segment)
{
if ( myMakeShell.IsDone()) {
Done();
myShape = myMakeShell.Shape();
}
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeShell::Init(const Handle(Geom_Surface)& S,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax,
const Standard_Boolean Segment)
{
myMakeShell.Init(S,UMin,UMax,VMin,VMax,Segment);
if ( myMakeShell.IsDone()) {
Done();
myShape = myMakeShell.Shape();
}
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeShell::IsDone() const
{
return myMakeShell.IsDone();
}
//=======================================================================
//function : Error
//purpose :
//=======================================================================
BRepBuilderAPI_ShellError BRepBuilderAPI_MakeShell::Error() const
{
switch ( myMakeShell.Error()) {
case BRepLib_ShellDone:
return BRepBuilderAPI_ShellDone;
case BRepLib_EmptyShell:
return BRepBuilderAPI_EmptyShell;
case BRepLib_DisconnectedShell:
return BRepBuilderAPI_DisconnectedShell;
case BRepLib_ShellParametersOutOfRange:
return BRepBuilderAPI_ShellParametersOutOfRange;
}
// portage WNT
return BRepBuilderAPI_ShellDone;
}
//=======================================================================
//function : TopoDS_Shell&
//purpose :
//=======================================================================
const TopoDS_Shell& BRepBuilderAPI_MakeShell::Shell() const
{
return myMakeShell.Shell();
}
//=======================================================================
//function : TopoDS_Shell
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShell::operator TopoDS_Shell() const
{
return Shell();
}

View File

@@ -0,0 +1,159 @@
-- File: BRepBuilderAPI_MakeSolid.cdl
-- Created: Wed Jul 21 16:06:45 1993
-- Author: Remi LEQUETTE
-- <rle@nonox>
---Copyright: Matra Datavision 1993
class MakeSolid from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build a solid from shells.
-- A solid is made of one shell, or a series of shells, which
-- do not intersect each other. One of these shells
-- constitutes the outside skin of the solid. It may be closed
-- (a finite solid) or open (an infinite solid). Other shells
-- form hollows (cavities) in these previous ones. Each
-- must bound a closed volume.
-- A MakeSolid object provides a framework for:
-- - defining and implementing the construction of a solid, and
-- - consulting the result.
uses
Solid from TopoDS,
CompSolid from TopoDS,
Shell from TopoDS,
Shape from TopoDS,
MakeSolid from BRepLib
raises
NotDone from StdFail
is
Create
---Purpose: Initializes the construction of a solid. An empty solid is
-- considered to cover the whole space. The Add function
-- is used to define shells to bound it.
returns MakeSolid from BRepBuilderAPI;
----------------------------------------------
-- From Compsolid
----------------------------------------------
Create(S : CompSolid from TopoDS)
---Purpose: Make a solid from a CompSolid.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
-- this algorithm removes all inner faces amd make solid from compsolid
----------------------------------------------
-- From shells
----------------------------------------------
Create(S : Shell from TopoDS)
---Purpose: Make a solid from a shell.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
Create(S1,S2 : Shell from TopoDS)
---Purpose: Make a solid from two shells.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
Create(S1,S2,S3 : Shell from TopoDS)
---Purpose: Make a solid from three shells.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
---Purpose: Constructs a solid
-- - covering the whole space, or
-- - from shell S, or
-- - from two shells S1 and S2, or
-- - from three shells S1, S2 and S3, or
-- Warning
-- No check is done to verify the conditions of coherence
-- of the resulting solid. In particular, S1, S2 (and S3) must
-- not intersect each other.
-- Besides, after all shells have been added using the Add
-- function, one of these shells should constitute the outside
-- skin of the solid; it may be closed (a finite solid) or open
-- (an infinite solid). Other shells form hollows (cavities) in
-- these previous ones. Each must bound a closed volume.
----------------------------------------------
-- From solid and shells
----------------------------------------------
Create(So : Solid from TopoDS)
---Purpose: Make a solid from a solid. Usefull for adding later.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
Create(So : Solid from TopoDS; S : Shell from TopoDS)
---Purpose: Add a shell to a solid.
---Level: Public
returns MakeSolid from BRepBuilderAPI;
---Purpose:
-- Constructs a solid:
-- - from the solid So, to which shells can be added, or
-- - by adding the shell S to the solid So.
-- Warning
-- No check is done to verify the conditions of coherence
-- of the resulting solid. In particular S must not intersect the solid S0.
-- Besides, after all shells have been added using the Add
-- function, one of these shells should constitute the outside
-- skin of the solid. It may be closed (a finite solid) or open
-- (an infinite solid). Other shells form hollows (cavities) in
-- the previous ones. Each must bound a closed volume.
----------------------------------------------
-- Auxiliary methods
----------------------------------------------
Add(me : in out; S : Shell from TopoDS)
---Purpose: Adds the shell to the current solid.
-- Warning
-- No check is done to verify the conditions of coherence
-- of the resulting solid. In particular, S must not intersect
-- other shells of the solid under construction.
-- Besides, after all shells have been added, one of
-- these shells should constitute the outside skin of the
-- solid. It may be closed (a finite solid) or open (an
-- infinite solid). Other shells form hollows (cavities) in
-- these previous ones. Each must bound a closed volume.
is static;
----------------------------------------------
-- Results
----------------------------------------------
IsDone(me) returns Boolean
---Purpose: Returns true if the solid is built.
-- For this class, a solid under construction is always valid.
-- If no shell has been added, it could be a whole-space
-- solid. However, no check was done to verify the
-- conditions of coherence of the resulting solid.
is redefined;
Solid(me) returns Solid from TopoDS
---Purpose: Returns the new Solid.
--
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Solid() const;"
---Level: Public
raises
NotDone from StdFail
is static;
IsDeleted (me: in out; S : Shape from TopoDS)
returns Boolean
is redefined;
fields
myMakeSolid : MakeSolid from BRepLib;
end MakeSolid;

View File

@@ -0,0 +1,178 @@
// File: BRepBuilderAPI_MakeSolid.cxx
// Created: Fri Jul 23 15:51:52 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeSolid.ixx>
#include <TopoDS.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid()
{
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S)
: myMakeSolid(S)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S)
: myMakeSolid(S)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1,
const TopoDS_Shell& S2)
: myMakeSolid(S1,S2)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1,
const TopoDS_Shell& S2,
const TopoDS_Shell& S3)
: myMakeSolid(S1,S2,S3)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So)
: myMakeSolid(So)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So,
const TopoDS_Shell& S)
: myMakeSolid(So,S)
{
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeSolid::Add(const TopoDS_Shell& S)
{
myMakeSolid.Add(S);
if ( myMakeSolid.IsDone()) {
Done();
myShape = myMakeSolid.Shape();
}
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeSolid::IsDone() const
{
return myMakeSolid.IsDone();
}
//=======================================================================
//function : Solid
//purpose :
//=======================================================================
const TopoDS_Solid& BRepBuilderAPI_MakeSolid::Solid()const
{
return myMakeSolid.Solid();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::operator TopoDS_Solid() const
{
return Solid();
}
//=======================================================================
//function : IsDeleted
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeSolid::IsDeleted (const TopoDS_Shape& S)
{
if(S.ShapeType() == TopAbs_FACE) {
BRepLib_ShapeModification aStatus = myMakeSolid.FaceStatus(TopoDS::Face(S));
if(aStatus == BRepLib_Deleted) return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,46 @@
-- File: BRepBuilderAPI_MakeVertex.cdl
-- Created: Tue Jul 6 17:57:32 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
class MakeVertex from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build BRepBuilder vertices directly
-- from 3D geometric points. A vertex built using a
-- MakeVertex object is only composed of a 3D point and
-- a default precision value (Precision::Confusion()).
-- Later on, 2D representations can be added, for example,
-- when inserting a vertex in an edge.
-- A MakeVertex object provides a framework for:
-- - defining and implementing the construction of a vertex, and
-- - consulting the result.
uses
Pnt from gp,
Vertex from TopoDS,
MakeVertex from BRepLib
is
Create (P : Pnt from gp)
---Purpose: Constructs a vertex from point P.
-- Example create a vertex from a 3D point.
-- gp_Pnt P(0,0,10);
-- TopoDS_Vertex V = BRepBuilderAPI_MakeVertex(P);
returns MakeVertex from BRepBuilderAPI;
Vertex(me) returns Vertex from TopoDS
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Vertex() const;"
---Purpose: Returns the constructed vertex.
is static;
fields
myMakeVertex : MakeVertex from BRepLib;
end MakeVertex;

View File

@@ -0,0 +1,48 @@
// File: BRepBuilderAPI_MakeVertex.cxx
// Created: Fri Jul 23 15:51:55 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeVertex.ixx>
#include <BRepBuilderAPI.hxx>
#include <BRep_Builder.hxx>
#include <TopoDS.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeVertex
//purpose :
//=======================================================================
BRepBuilderAPI_MakeVertex::BRepBuilderAPI_MakeVertex(const gp_Pnt& P)
: myMakeVertex(P)
{
if ( myMakeVertex.IsDone()) {
Done();
myShape = myMakeVertex.Shape();
}
}
//=======================================================================
//function : Vertex
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeVertex::Vertex()const
{
return myMakeVertex.Vertex();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeVertex::operator TopoDS_Vertex() const
{
return Vertex();
}

View File

@@ -0,0 +1,217 @@
-- File: BRepBuilderAPI_MakeWire.cdl
-- Created: Thu Jul 8 11:15:02 1993
-- Author: Remi LEQUETTE
-- <rle@phylox>
---Copyright: Matra Datavision 1993
class MakeWire from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Describes functions to build wires from edges. A wire can
-- be built from any number of edges.
-- To build a wire you first initialize the construction, then
-- add edges in sequence. An unlimited number of edges
-- can be added. The initialization of construction is done with:
-- - no edge (an empty wire), or
-- - edges of an existing wire, or
-- - up to four connectable edges.
-- In order to be added to a wire under construction, an
-- edge (unless it is the first one) must satisfy the following
-- condition: one of its vertices must be geometrically
-- coincident with one of the vertices of the wire (provided
-- that the highest tolerance factor is assigned to the two
-- vertices). It could also be the same vertex.
-- - The given edge is shared by the wire if it contains:
-- - two vertices, identical to two vertices of the wire
-- under construction (a general case of the wire closure), or
-- - one vertex, identical to a vertex of the wire under
-- construction; the other vertex not being
-- geometrically coincident with another vertex of the wire.
-- - In other cases, when one of the vertices of the edge
-- is simply geometrically coincident with a vertex of the
-- wire under construction (provided that the highest
-- tolerance factor is assigned to the two vertices), the
-- given edge is first copied and the coincident vertex is
-- replaced in this new edge, by the coincident vertex of the wire.
-- Note: it is possible to build non manifold wires using this construction tool.
-- A MakeWire object provides a framework for:
-- - initializing the construction of a wire,
-- - adding edges to the wire under construction, and
-- - consulting the result.
uses
Vertex from TopoDS,
Edge from TopoDS,
Wire from TopoDS,
ListOfShape from TopTools,
WireError from BRepBuilderAPI,
MakeWire from BRepLib
raises
NotDone from StdFail
is
Create
---Purpose: Constructs an empty wire framework, to which edges
-- are added using the Add function.
-- As soon as the wire contains one edge, it can return
-- with the use of the function Wire.
-- Warning
-- The function Error will return
-- BRepBuilderAPI_EmptyWire if it is called before at
-- least one edge is added to the wire under construction.
returns MakeWire from BRepBuilderAPI;
----------------------------------------------
-- From edges
----------------------------------------------
Create(E : Edge from TopoDS)
---Purpose: Make a Wire from an edge.
---Level: Public
returns MakeWire from BRepBuilderAPI;
Create(E1,E2 : Edge from TopoDS)
---Purpose: Make a Wire from two edges.
---Level: Public
returns MakeWire from BRepBuilderAPI;
Create(E1,E2,E3 : Edge from TopoDS)
---Purpose: Make a Wire from three edges.
---Level: Public
returns MakeWire from BRepBuilderAPI;
Create(E1,E2,E3,E4 : Edge from TopoDS)
---Purpose: Make a Wire from four edges.
---Level: Public
returns MakeWire from BRepBuilderAPI;
---Purpose: Constructs a wire
-- - from the TopoDS_Wire W composed of the edge E, or
-- - from edge E, or
-- - from two edges E1 and E2, or
-- - from three edges E1, E2 and E3, or
-- - from four edges E1, E2, E3 and E4.
-- Further edges can be added using the function Add.
-- Given edges are added in a sequence. Each of them
-- must be connectable to the wire under construction,
-- and so must satisfy the following condition (unless it is
-- the first edge of the wire): one of its vertices must be
-- geometrically coincident with one of the vertices of the
-- wire (provided that the highest tolerance factor is
-- assigned to the two vertices). It could also be the same vertex.
-- Warning
-- If an edge is not connectable to the wire under
-- construction it is not added. The function Error will
-- return BRepBuilderAPI_DisconnectedWire, the
-- function IsDone will return false and the function Wire
-- will raise an error, until a new connectable edge is added.
----------------------------------------------
-- From wire and edge
----------------------------------------------
Create(W : Wire from TopoDS)
---Purpose: Make a Wire from a Wire. Usefull for adding later.
---Level: Public
returns MakeWire from BRepBuilderAPI;
Create(W : Wire from TopoDS; E : Edge from TopoDS)
---Purpose: Add an edge to a wire.
---Level: Public
returns MakeWire from BRepBuilderAPI;
----------------------------------------------
-- Auxiliary methods
----------------------------------------------
Add(me : in out; E : Edge from TopoDS)
---Purpose: Adds the edge E to the wire under construction.
-- E must be connectable to the wire under construction, and, unless it
-- is the first edge of the wire, must satisfy the following
-- condition: one of its vertices must be geometrically coincident
-- with one of the vertices of the wire (provided that the highest
-- tolerance factor is assigned to the two vertices). It could also
-- be the same vertex.
-- Warning
-- If E is not connectable to the wire under construction it is not
-- added. The function Error will return
-- BRepBuilderAPI_DisconnectedWire, the function IsDone will return
-- false and the function Wire will raise an error, until a new
-- connectable edge is added.
is static;
Add(me : in out; W : Wire from TopoDS)
---Purpose: Add the edges of <W> to the current wire.
---Level: Public
is static;
Add(me : in out; L : ListOfShape from TopTools)
---Purpose: Adds the edges of <L> to the current wire. The
-- edges are not to be consecutive. But they are to
-- be all connected geometrically or topologically.
-- If some of them are not connected the Status give
-- DisconnectedWire but the "Maker" is Done() and you
-- can get the partial result. (ie connected to the
-- first edgeof the list <L>)
is static;
----------------------------------------------
-- Results
----------------------------------------------
IsDone(me) returns Boolean
---Purpose: Returns true if this algorithm contains a valid wire.
-- IsDone returns false if:
-- - there are no edges in the wire, or
-- - the last edge which you tried to add was not connectable.
is redefined;
Error(me) returns WireError from BRepBuilderAPI
---Purpose: Returns the construction status
-- - BRepBuilderAPI_WireDone if the wire is built, or
-- - another value of the BRepBuilderAPI_WireError
-- enumeration indicating why the construction failed.
is static;
Wire(me) returns Wire from TopoDS
---Purpose: Returns the constructed wire; or the part of the wire
-- under construction already built.
-- Exceptions StdFail_NotDone if a wire is not built.
---C++: return const &
---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;"
raises
NotDone from StdFail
is static;
Edge(me) returns Edge from TopoDS
---C++: return const &
---Purpose: Returns the last edge added to the wire under construction.
-- Warning
-- - This edge can be different from the original one (the
-- argument of the function Add, for instance,)
-- - A null edge is returned if there are no edges in the
-- wire under construction, or if the last edge which you
-- tried to add was not connectable..
raises
NotDone from StdFail
is static;
Vertex(me) returns Vertex from TopoDS
---C++: return const &
---Purpose: Returns the last vertex of the last edge added to the
-- wire under construction.
-- Warning
-- A null vertex is returned if there are no edges in the wire
-- under construction, or if the last edge which you tried to
-- add was not connectableR
raises
NotDone from StdFail
is static;
fields
myMakeWire : MakeWire from BRepLib;
end MakeWire;

View File

@@ -0,0 +1,240 @@
// File: BRepBuilderAPI_MakeWire.cxx
// Created: Fri Jul 23 15:51:57 1993
// Author: Remi LEQUETTE
// <rle@nonox>
#include <BRepBuilderAPI_MakeWire.ixx>
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire()
{
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E)
: myMakeWire(E)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
const TopoDS_Edge& E2)
: myMakeWire(E1,E2)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
const TopoDS_Edge& E2,
const TopoDS_Edge& E3)
: myMakeWire(E1,E2,E3)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1,
const TopoDS_Edge& E2,
const TopoDS_Edge& E3,
const TopoDS_Edge& E4)
: myMakeWire(E1,E2,E3,E4)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W)
: myMakeWire(W)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : BRepBuilderAPI_MakeWire
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::BRepBuilderAPI_MakeWire(const TopoDS_Wire& W,
const TopoDS_Edge& E)
: myMakeWire(W,E)
{
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeWire::Add(const TopoDS_Wire& W)
{
myMakeWire.Add(W);
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeWire::Add(const TopoDS_Edge& E)
{
myMakeWire.Add(E);
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeWire::Add(const TopTools_ListOfShape& L)
{
myMakeWire.Add(L);
if ( myMakeWire.IsDone()) {
Done();
myShape = myMakeWire.Wire();
}
}
//=======================================================================
//function : Wire
//purpose :
//=======================================================================
const TopoDS_Wire& BRepBuilderAPI_MakeWire::Wire()const
{
return myMakeWire.Wire();
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& BRepBuilderAPI_MakeWire::Edge()const
{
return myMakeWire.Edge();
}
//=======================================================================
//function : Vertex
//purpose :
//=======================================================================
const TopoDS_Vertex& BRepBuilderAPI_MakeWire::Vertex()const
{
return myMakeWire.Vertex();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
BRepBuilderAPI_MakeWire::operator TopoDS_Wire() const
{
return Wire();
}
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
Standard_Boolean BRepBuilderAPI_MakeWire::IsDone() const
{
return myMakeWire.IsDone();
}
//=======================================================================
//function : Error
//purpose :
//=======================================================================
BRepBuilderAPI_WireError BRepBuilderAPI_MakeWire::Error() const
{
switch ( myMakeWire.Error()) {
case BRepLib_WireDone:
return BRepBuilderAPI_WireDone;
case BRepLib_EmptyWire:
return BRepBuilderAPI_EmptyWire;
case BRepLib_DisconnectedWire:
return BRepBuilderAPI_DisconnectedWire;
case BRepLib_NonManifoldWire:
return BRepBuilderAPI_NonManifoldWire;
}
// portage WNT
return BRepBuilderAPI_WireDone;
}

View File

@@ -0,0 +1,127 @@
-- File: BRepBuilderAPI_ModifyShape.cdl
-- Created: Fri Dec 2 09:02:29 1994
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1994
deferred class ModifyShape from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
---Purpose: Implements the methods of MakeShape for the
-- constant topology modifications. The methods are
-- implemented when the modification uses a Modifier
-- from BRepTools. Some of them have to be redefined
-- if the modification is implemented with another
-- tool (see Transform from BRepBuilderAPI for example).
-- The BRepBuilderAPI package provides the following
-- frameworks to perform modifications of this sort:
-- - BRepBuilderAPI_Copy to produce the copy of a shape,
-- - BRepBuilderAPI_Transform and
-- BRepBuilderAPI_GTransform to apply a geometric
-- transformation to a shape,
-- - BRepBuilderAPI_NurbsConvert to convert the
-- whole geometry of a shape into NURBS geometry,
-- - BRepOffsetAPI_DraftAngle to build a tapered shape.
uses
Shape from TopoDS,
Face from TopoDS,
Edge from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools,
Modifier from BRepTools,
Modification from BRepTools
raises
NullObject from Standard,
NoSuchObject from Standard
is
Initialize;
---Purpose: Empty constructor.
Initialize(S:Shape from TopoDS);
---Purpose: Initializes the modifier with the Shape <S>, and
-- set the field <myInitialShape> to <S>.
Initialize(M: Modification from BRepTools);
---Purpose: Set the field <myModification> with <M>.
Initialize(S: Shape from TopoDS; M: Modification from BRepTools);
---Purpose: Initializes the modifier with the Shape <S>, and
-- set the field <myInitialShape> to <S>, and set the
-- field <myModification> with <M>, the performs the
-- modification.
DoModif(me: in out; S: Shape from TopoDS)
---Purpose: Performs the previously given modification on the
-- shape <S>.
raises NullObject from Standard
--- The exception is raised if no modification has been given.
is static protected;
DoModif(me: in out; M: Modification from BRepTools)
---Purpose: Performs the modification <M> on a previously
-- given shape.
raises NullObject from Standard
--- The exception is raised if no shape has been given.
is static protected;
DoModif(me: in out; S: Shape from TopoDS;
M: Modification from BRepTools)
---Purpose: Performs the modification <M> on the shape <S>.
is static protected;
--- Private implementation method
DoModif(me: in out)
is static private;
---Category: Querying isg-attention il faudrait passer en modified que
-- les faces dont les bornes sont modifiees et les faces
-- inclinees en generated (pas disponible aujourd 'hui dans BRepTools_modifier
-- a reprendre
--
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;
ModifiedShape(me; S: Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the modified shape corresponding to <S>.
-- S can correspond to the entire initial shape or to its subshape.
-- Exceptions
-- Standard_NoSuchObject if S is not the initial shape or
-- a subshape of the initial shape to which the
-- transformation has been applied. Raises NoSuchObject from Standard
-- if S is not the initial shape or a sub-shape
-- of the initial shape.
---C++: return const&
raises NoSuchObject from Standard
is virtual;
fields
myModifier : Modifier from BRepTools is protected;
myInitialShape : Shape from TopoDS is protected;
myModification : Modification from BRepTools is protected;
end ModifyShape;

View File

@@ -0,0 +1,141 @@
// File: BRepBuilderAPI_ModifyShape.cxx
// Created: Fri Dec 2 10:37:08 1994
// Author: Jacques GOUSSARD
// <jag@topsn2>
#include <BRepBuilderAPI_ModifyShape.ixx>
#include <Standard_NullObject.hxx>
//=======================================================================
//function : BRepBuilderAPI_ModifyShape
//purpose :
//=======================================================================
BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape () {}
//=======================================================================
//function : BRepBuilderAPI_ModifyShape
//purpose :
//=======================================================================
BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape (const TopoDS_Shape& S):
myModifier(S), myInitialShape(S)
{}
//=======================================================================
//function : BRepBuilderAPI_ModifyShape
//purpose :
//=======================================================================
BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape
(const Handle(BRepTools_Modification)& M)
{
myModification = M;
}
//=======================================================================
//function : BRepBuilderAPI_ModifyShape
//purpose :
//=======================================================================
BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape
(const TopoDS_Shape& S,
const Handle(BRepTools_Modification)& M): myModifier(S),myInitialShape(S)
{
myModification = M;
DoModif();
}
//=======================================================================
//function : DoModif
//purpose :
//=======================================================================
void BRepBuilderAPI_ModifyShape::DoModif ()
{
if (myInitialShape.IsNull() || myModification.IsNull()) {
Standard_NullObject::Raise();
}
myModifier.Perform(myModification);
if (myModifier.IsDone()) {
Done();
myShape = myModifier.ModifiedShape(myInitialShape);
}
else {
NotDone();
}
}
//=======================================================================
//function : DoModif
//purpose :
//=======================================================================
void BRepBuilderAPI_ModifyShape::DoModif (const TopoDS_Shape& S)
{
if (!S.IsEqual(myInitialShape) || !IsDone()) {
myInitialShape = S;
myModifier.Init(S);
DoModif();
}
}
//=======================================================================
//function : DoModif
//purpose :
//=======================================================================
void BRepBuilderAPI_ModifyShape::DoModif (const Handle(BRepTools_Modification)& M)
{
myModification = M;
DoModif();
}
//=======================================================================
//function : DoModif
//purpose :
//=======================================================================
void BRepBuilderAPI_ModifyShape::DoModif (const TopoDS_Shape& S,
const Handle(BRepTools_Modification)& M)
{
myInitialShape = S;
myModifier.Init(S);
myModification = M;
DoModif();
}
//=======================================================================
//function : ModifiedShape
//purpose :
//=======================================================================
const TopoDS_Shape& BRepBuilderAPI_ModifyShape::ModifiedShape
(const TopoDS_Shape& S) const
{
return myModifier.ModifiedShape(S);
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepBuilderAPI_ModifyShape::Modified
(const TopoDS_Shape& F)
{
myGenerated.Clear();
myGenerated.Append(myModifier.ModifiedShape(F));
return myGenerated;
}

View File

@@ -0,0 +1,56 @@
-- File: BRepBuilderAPI_NurbsConvert.cdl
-- Created: Fri Dec 9 09:02:17 1994
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1994
class NurbsConvert from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Conversion of the complete geometry of a shape into
-- NURBS geometry. For example, all curves supporting
-- edges of the basis shape are converted into BSpline
-- curves, and all surfaces supporting its faces are
-- converted into BSpline surfaces.
uses
Shape from TopoDS,
Face from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools
is
Create returns NurbsConvert from BRepBuilderAPI;
---Purpose: Constructs a framework for converting the geometry of a
-- shape into NURBS geometry. Use the function Perform
-- to define the shape to convert.
Create(S: Shape from TopoDS;
Copy: Boolean from Standard = Standard_False)
returns NurbsConvert from BRepBuilderAPI;
---Purpose: Builds a new shape by converting the geometry of the
-- shape S into NURBS geometry. Specifically, all curves
-- supporting edges of S are converted into BSpline
-- curves, and all surfaces supporting its faces are
-- converted into BSpline surfaces.
-- Use the function Shape to access the new shape.
-- Note: the constructed framework can be reused to
-- convert other shapes. You specify these with the
-- function Perform.
Perform(me: in out; S : Shape from TopoDS;
Copy: Boolean from Standard = Standard_False)
---Purpose: Builds a new shape by converting the geometry of the
-- shape S into NURBS geometry.
-- Specifically, all curves supporting edges of S are
-- converted into BSpline curves, and all surfaces
-- supporting its faces are converted into BSpline surfaces.
-- Use the function Shape to access the new shape.
-- Note: this framework can be reused to convert other
-- shapes: you specify them by calling the function Perform again.
is static;
end NurbsConvert;

View File

@@ -0,0 +1,57 @@
// File: BRepBuilderAPI_NurbsConvert.cxx
// Created: Fri Dec 9 09:14:55 1994
// Author: Jacques GOUSSARD
// <jag@topsn2>
#include <BRepBuilderAPI_NurbsConvert.ixx>
#include <BRepLib.hxx>
#include <TopAbs.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools_NurbsConvertModification.hxx>
//#include <gp.hxx>
//=======================================================================
//function : BRepBuilderAPI_NurbsConvert
//purpose :
//=======================================================================
BRepBuilderAPI_NurbsConvert::BRepBuilderAPI_NurbsConvert ()
{
myModification = new BRepTools_NurbsConvertModification();
}
//=======================================================================
//function : BRepBuilderAPI_NurbsConvert
//purpose :
//=======================================================================
BRepBuilderAPI_NurbsConvert::BRepBuilderAPI_NurbsConvert (const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
myModification = new BRepTools_NurbsConvertModification();
Perform(S,Copy);
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void BRepBuilderAPI_NurbsConvert::Perform(const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
Handle(BRepTools_NurbsConvertModification) theModif =
Handle(BRepTools_NurbsConvertModification)::DownCast(myModification);
DoModif(S,myModification);
}

View File

@@ -0,0 +1,530 @@
-- File: BRepBuilderAPI_Sewing.cdl
-- Created: Thu Mar 23 17:57:20 1995
-- Author: Jing Cheng MEI
-- <mei@junon>
---Copyright: Matra Datavision 1995
-- Modified Thu May 7 15:20:25 1998 by David Carbonel (dcl)
-- Little faces management.
-- Add of Cutting option.
-- Optimisation of cutting fonction
-- Modified Thu Jan 21 13:00:58 MET 1999 by Jing Cheng MEI
-- Nonmanifold processing
class Sewing from BRepBuilderAPI inherits TShared from MMgt
---Purpose: Provides methods to
--
-- - identify possible contigous boundaries (for control
-- afterwards)
--
-- - assemble contigous shapes into one shape.
-- Only manifold shapes will be found. Sewing will not
-- be done in case of multiple edges.
--
-- For sewing, use this function as following:
-- - create an empty object
-- - default tolerance 1.E-06
-- - with face analysis on
-- - with sewing operation on
-- - set the cutting option as you need (default True)
-- - define a tolerance
-- - add shapes to be sewed -> Add
-- - compute -> Perfom
-- - output the resulted shapes
-- - output free edges if necessary
-- - output multiple edges if necessary
-- - output the problems if any
-- For control, use this function as following:
-- - create an empty object
-- - default tolerance 1.E-06
-- - with face analysis on
-- - with sewing operation on
-- - set the cutting option as you need (default True)
-- - define a tolerance to capture contigous boundaries
-- - set if necessary face analysis off
-- - set sewing operation off
-- - add shapes to be controlled -> Add
-- - compute -> Perfom
-- - output couples of connected edges (contigous) and
-- their original boundary for control
-- - output the problems if any
uses
Shape from TopoDS,
Edge from TopoDS,
ListOfShape from TopTools,
MapOfShape from TopTools,
DataMapOfShapeShape from TopTools,
DataMapOfShapeListOfShape from TopTools,
IndexedMapOfShape from TopTools,
IndexedDataMapOfShapeShape from TopTools,
IndexedDataMapOfShapeListOfShape from TopTools,
SequenceOfShape from TopTools,
Array1OfShape from TopTools,
Face from TopoDS,
Array1OfInteger from TColStd,
Array1OfPnt from TColgp,
Array2OfPnt2d from TColgp,
Array1OfBoolean from TColStd,
Array1OfReal from TColStd,
IndexedMapOfInteger from TColStd,
Surface from Geom,
Location from TopLoc,
Curve from Geom2d,
Curve from Geom,
Surface from Geom,
Pnt from gp,
ReShape from BRepTools,
SequenceOfInteger from TColStd,
SequenceOfReal from TColStd,
SequenceOfPnt from TColgp
raises
OutOfRange from Standard,
NoSuchObject from Standard
is
Create(tolerance: Real = 1.0e-06; -- tolerance of connexity
option1 : Boolean = Standard_True; -- option for sewing
option2 : Boolean = Standard_True; -- option for analysis of degenerated shapes
option3 : Boolean = Standard_True; -- option for cutting of free edges.
option4 : Boolean = Standard_False) -- option for non manifold processing
returns Sewing from BRepBuilderAPI;
---Purpose: Creates an object with
-- tolerance of connexity
-- option for sewing (if false only control)
-- option for analysis of degenerated shapes
-- option for cutting of free edges.
-- option for non manifold processing
Init(me : mutable; tolerance: Real = 1.0e-06; -- tolerance of connexity
option1: Boolean = Standard_True; -- option for sewing
option2: Boolean = Standard_True; -- option for analysis of degenerated shapes
option3: Boolean = Standard_True; -- option for cutting free edge after first merging
-- This option can be set to False if no edge need to be cut.
option4: Boolean = Standard_False);-- option for non manifold processing
---Purpose: initialize the parameters if necessary
Load(me : mutable; shape : Shape from TopoDS);
---Purpose: Loades the context shape.
Add(me : mutable; shape : Shape from TopoDS);
---Purpose: Defines the shapes to be sewed or controlled
Perform(me : mutable); ---is virtual;
---Purpose: Computing
SewedShape(me) returns Shape from TopoDS;
---C++: return const &
---Purpose: Gives the sewed shape
-- a null shape if nothing constructed
-- may be a face, a shell, a solid or a compound
NbFreeEdges(me) returns Integer;
---Purpose: Gives the number of free edges (edge shared by one face)
FreeEdge(me; index: Integer) returns Edge from TopoDS
raises OutOfRange from Standard; -- raised if index < 1 or > NbFreeEdges
---C++: return const &
---Purpose: Gives each free edge
NbMultipleEdges(me) returns Integer;
---Purpose: Gives the number of multiple edges
-- (edge shared by more than two faces)
MultipleEdge(me; index: Integer) returns Edge from TopoDS
raises OutOfRange from Standard; -- raised if index < 1 or > NbMultipleEdges
---C++: return const &
---Purpose: Gives each multiple edge
NbContigousEdges(me) returns Integer;
---Purpose: Gives the number of contigous edges (edge shared by two faces)
ContigousEdge(me; index: Integer) returns Edge from TopoDS
raises OutOfRange from Standard; -- raised if index < 1 or > NbContigousEdges
---C++: return const &
---Purpose: Gives each contigous edge
ContigousEdgeCouple(me; index: Integer) returns ListOfShape from TopTools
raises OutOfRange from Standard; -- raised if index < 1 or > NbContigousEdges
---C++: return const &
---Purpose: Gives the sections (edge) belonging to a contigous edge
IsSectionBound(me; section: Edge from TopoDS) returns Boolean;
---Purpose: Indicates if a section is bound (before use SectionToBoundary)
SectionToBoundary(me; section: Edge from TopoDS) returns Edge from TopoDS
raises NoSuchObject from Standard; -- raised if section has not been bound
---C++: return const &
---Purpose: Gives the original edge (free boundary) which becomes the
-- the section. Remember that sections constitute common edges.
-- This imformation is important for control because with
-- original edge we can find the surface to which the section
-- is attached.
NbDegeneratedShapes(me) returns Integer;
---Purpose: Gives the number of degenerated shapes
DegeneratedShape(me; index: Integer) returns Shape from TopoDS
raises OutOfRange from Standard; -- raised if index < 1 or > NbDegeneratedShapes
---C++: return const &
---Purpose: Gives each degenerated shape
IsDegenerated(me; shape: Shape from TopoDS) returns Boolean;
---Purpose: Indicates if a input shape is degenerated
IsModified(me; shape: Shape from TopoDS) returns Boolean;
---Purpose: Indicates if a input shape has been modified
Modified(me ; shape: Shape from TopoDS) returns Shape from TopoDS
raises NoSuchObject from Standard; -- raised if shape has not been modified
---C++: return const &
---Purpose: Gives a modifieded shape
IsModifiedSubShape(me; shape: Shape from TopoDS) returns Boolean;
---Purpose: Indicates if a input subshape has been modified
ModifiedSubShape(me ; shape: Shape from TopoDS) returns Shape from TopoDS
raises NoSuchObject from Standard; -- raised if shape has not been modified
---Purpose: Gives a modifieded subshape
Dump(me);
---Purpose: print the informations
NbDeletedFaces(me) returns Integer;
---Purpose: Gives the number of deleted faces (faces smallest than tolerance)
DeletedFace(me; index: Integer) returns Face from TopoDS
raises OutOfRange from Standard; -- raised if index < 1 or > NbDeletedFaces
---C++: return const &
---Purpose: Gives each deleted face
WhichFace(me; theEdg: Edge from TopoDS; index: Integer = 1) returns Face from TopoDS;
---Purpose: Gives a modified shape
SameParameterMode(me) returns Boolean;
---C++: inline
---Purpose: Gets same parameter mode.
SetSameParameterMode(me: in mutable; SameParameterMode : Boolean);
---C++: inline
---Purpose: Sets same parameter mode.
Tolerance(me) returns Real;
---C++: inline
---Purpose: Gives set tolerance.
SetTolerance(me: mutable; theToler : Real);
---C++: inline
---Purpose: Sets tolerance
MinTolerance(me) returns Real;
---C++: inline
---Purpose: Gives set min tolerance.
SetMinTolerance(me: mutable; theMinToler : Real);
---C++: inline
---Purpose: Sets min tolerance
MaxTolerance(me) returns Real;
---C++: inline
---Purpose: Gives set max tolerance
SetMaxTolerance(me:mutable; theMaxToler : Real);
---C++: inline
---Purpose: Sets max tolerance.
FaceMode(me) returns Boolean;
---C++: inline
---Purpose: Returns mode for sewing faces By default - true.
SetFaceMode(me: mutable; theFaceMode : Boolean);
---C++: inline
---Purpose: Sets mode for sewing faces By default - true.
FloatingEdgesMode(me) returns Boolean;
---C++: inline
---Purpose: Returns mode for sewing floating edges By default - false.
SetFloatingEdgesMode(me: mutable; theFloatingEdgesMode : Boolean);
---C++: inline
---Purpose: Sets mode for sewing floating edges By default - false.
-- CuttingFloatingEdgesMode(me) returns Boolean;
---C++: inline
---Purpose: Returns mode for cutting floating edges By default - false.
-- SetCuttingFloatingEdgesMode(me: mutable; theCuttingFloatingEdgesMode : Boolean);
---C++: inline
---Purpose: Sets mode for cutting floating edges By default - false.
LocalTolerancesMode(me) returns Boolean;
---C++: inline
---Purpose: Returns mode for accounting of local tolerances
-- of edges and vertices during of merging.
SetLocalTolerancesMode(me: mutable; theLocalTolerancesMode : Boolean);
---C++: inline
---Purpose: Sets mode for accounting of local tolerances
-- of edges and vertices during of merging
-- in this case WorkTolerance = myTolerance + tolEdge1+ tolEdg2;
SetNonManifoldMode(me: mutable; theNonManifoldMode : Boolean);
---C++: inline
---Purpose: Sets mode for non-manifold sewing.
NonManifoldMode(me) returns Boolean;
---C++: inline
---Purpose: Gets mode for non-manifold sewing.
-------------------------
--- INTERNAL FUCTIONS ---
-------------------------
Cutting(me : mutable) is protected;
---Purpose: Performs cutting of sections
Merging(me : mutable; passage : Boolean) is protected;
IsMergedClosed(me;
Edge1 : Edge from TopoDS;
Edge2 : Edge from TopoDS;
fase : Face from TopoDS)
returns Boolean is protected;
FindCandidates(me : mutable;
seqSections : in out SequenceOfShape from TopTools;
mapReference : in out IndexedMapOfInteger from TColStd;
seqCandidates : in out SequenceOfInteger from TColStd;
seqOrientations : in out SequenceOfInteger from TColStd)
returns Boolean is protected;
AnalysisNearestEdges(me : mutable;
sequenceSec : SequenceOfShape from TopTools;
seqIndCandidate : in out SequenceOfInteger from TColStd;
seqOrientations : in out SequenceOfInteger from TColStd;
evalDist : Boolean = Standard_True) is protected;
---Purpose:
MergedNearestEdges(me : mutable;
edge : Shape from TopoDS;
SeqMergedEdge : in out SequenceOfShape from TopTools;
SeqMergedOri : in out SequenceOfInteger from TColStd)
returns Boolean is protected;
---Purpose: Merged nearest edges.
EdgeProcessing(me : mutable) is protected;
CreateOutputInformations(me : mutable) is protected;
---------------------------------
--- VIRTUAL INTERNAL FUCTIONS ---
---------------------------------
IsUClosedSurface(me; surf : Surface from Geom; theEdge : Shape from TopoDS;
theloc : Location from TopLoc)
returns Boolean is virtual protected;
---Purpose: Defines if surface is U closed.
IsVClosedSurface(me; surf : Surface from Geom; theEdge : Shape from TopoDS;
theloc : Location from TopLoc)
returns Boolean is virtual protected;
---Purpose:Defines if surface is V closed.
FaceAnalysis(me : mutable) is virtual protected;
---Purpose:
-- This method is called from Perform only
FindFreeBoundaries(me : mutable) is virtual protected;
---Purpose:
-- This method is called from Perform only
VerticesAssembling(me : mutable) is virtual protected;
---Purpose:
-- This method is called from Perform only
CreateSewedShape(me : mutable) is virtual protected;
---Purpose:
-- This method is called from Perform only
GetFreeWires(me : mutable;
MapFreeEdges : in out MapOfShape from TopTools;
seqWires : in out SequenceOfShape from TopTools) is virtual protected;
---Purpose: Get wire from free edges.
-- This method is called from EdgeProcessing only
EvaluateAngulars(me;
sequenceSec : in out SequenceOfShape from TopTools;
secForward : in out Array1OfBoolean from TColStd;
tabAng : in out Array1OfReal from TColStd;
indRef : in Integer) is virtual protected;
---Purpose:
-- This method is called from MergingOfSections only
EvaluateDistances(me;
sequenceSec : in out SequenceOfShape from TopTools;
secForward : in out Array1OfBoolean from TColStd;
tabAng : in out Array1OfReal from TColStd;
arrLen : in out Array1OfReal from TColStd;
tabMinDist : in out Array1OfReal from TColStd;
indRef : in Integer) is virtual protected;
---Purpose:
-- This method is called from MergingOfSections only
SameRange(me;
CurvePtr : Curve from Geom2d;
FirstOnCurve : Real from Standard;
LastOnCurve : Real from Standard;
RequestedFirst : Real from Standard;
RequestedLast : Real from Standard)
returns Curve from Geom2d is virtual protected;
---Purpose:
-- This method is called from SameParameterEdge only
SameParameter(me; edge : Edge from TopoDS) is virtual protected;
---Purpose:
-- This method is called from SameParameterEdge only
SameParameterEdge(me : mutable;
edge : Shape from TopoDS;
seqEdges : SequenceOfShape from TopTools;
seqForward : SequenceOfInteger from TColStd;
mapMerged : in out MapOfShape from TopTools;
locReShape : ReShape from BRepTools)
returns Edge from TopoDS is virtual protected;
---Purpose:
-- This method is called from Merging only
SameParameterEdge(me : mutable;
edge1 : Edge from TopoDS;
edge2 : Edge from TopoDS;
listFaces1 : ListOfShape from TopTools;
listFaces2 : ListOfShape from TopTools;
secForward : Boolean ;
whichSec : in out Integer;
firstCall : Boolean = Standard_True)
returns Edge from TopoDS is virtual protected;
---Purpose:
-- This method is called from Merging only
ProjectPointsOnCurve(me;
arrPnt : Array1OfPnt from TColgp;
Crv : Curve from Geom;
first : Real from Standard;
last : Real from Standard;
arrDist : in out Array1OfReal from TColStd;
arrPara : in out Array1OfReal from TColStd;
arrProj : in out Array1OfPnt from TColgp) is virtual protected;
---Purpose: Projects points on curve
-- This method is called from Cutting only
CreateCuttingNodes(me : mutable;
MapVert : IndexedMapOfShape from TopTools;
bound : Shape from TopoDS;
vfirst : Shape from TopoDS;
vlast : Shape from TopoDS;
arrDist : Array1OfReal from TColStd;
arrPara : Array1OfReal from TColStd;
arrPnt : Array1OfPnt from TColgp;
seqNode : in out SequenceOfShape from TopTools;
seqPara : in out SequenceOfReal from TColStd) is virtual protected;
---Purpose: Creates cutting vertices on projections
-- This method is called from Cutting only
CreateSections(me : mutable;
bound : Shape from TopoDS;
seqNode : SequenceOfShape from TopTools;
seqPara : SequenceOfReal from TColStd;
listEdge : in out ListOfShape from TopTools) is virtual protected;
---Purpose: Performs cutting of bound
-- This method is called from Cutting only
SameParameterShape(me : mutable) is virtual protected;
---Purpose: Makes all edges from shape same parameter
-- if SameParameterMode is equal to Standard_True
-- This method is called from Perform only
fields
-- Input data
myTolerance : Real is protected;
mySewing : Boolean is protected;
myAnalysis : Boolean is protected;
myCutting : Boolean is protected;
-- Indicates if the cutting will be done or not.
-- Default value is true.
myNonmanifold : Boolean is protected;
myFaceMode : Boolean; -- Mode for sewing faces by default true
myFloatingEdgesMode : Boolean; -- Mode for sewing floating edges by default - false
-- myCuttingFloatingEdgesMode : Boolean; -- Mode for cutting of floating edges by default - false
mySameParameterMode : Boolean;
myLocalToleranceMode : Boolean;
myOldShapes : IndexedDataMapOfShapeShape from TopTools is protected;
-- input shape -> input shape after analysis
mySewedShape : Shape from TopoDS is protected;
-- contains the sewed shape
myDegenerated : IndexedMapOfShape from TopTools is protected;
-- contains all degenerated shapes
myFreeEdges : IndexedMapOfShape from TopTools is protected;
-- contains all free edges
-- (edge shared by only one face)
myMultipleEdges : IndexedMapOfShape from TopTools is protected;
-- contains all multiple edges
-- (edge shared by more than two faces)
myContigousEdges : IndexedDataMapOfShapeListOfShape from TopTools is protected;
-- contains all contigous edges
-- (edge shared by two faces) and a list of sections
-- (two edges) which constitute each contigous edge
myContigSecBound : DataMapOfShapeShape is protected;
-- for each section belong to a contigous edge
-- indicates its the original free boundary
-- Work data
-- OldShape : input shapes
-- Shape : input shapes after analysis
-- Bound : free boundaries
-- Section : free boundaries after cutting
-- Edge : connected sections become edge
-- - Free edge : edge shared by one face
-- - Contigous edge : edge shared by two faces
-- - Multiple edge : edge shared by more than two faces
-- Vertex : vertices on free boundaries
-- Node : assembled vertices become node
myNbShapes : Integer is protected; -- number of input shapes after analysis
myNbVertices : Integer is protected; -- number of nodes after assembling
myNbEdges : Integer is protected; -- number of edges after merging
myBoundFaces : IndexedDataMapOfShapeListOfShape from TopTools is protected;
-- for EACH bound contains a list of faces (REFERENCE map)
myBoundSections : DataMapOfShapeListOfShape from TopTools is protected;
-- for bound contains a list of cutting sections if any
--mySectionEdge : DataMapOfShapeShape from TopTools is protected;
-- for section contains a merged edge for this section
mySectionBound : DataMapOfShapeShape from TopTools is protected;
-- for EACH section contains its bound
myVertexNode : IndexedDataMapOfShapeShape from TopTools is protected;
-- for EACH original vertex contains a node
myVertexNodeFree : IndexedDataMapOfShapeShape from TopTools is protected;
-- for EACH floating vertex contains a node
myNodeSections : DataMapOfShapeListOfShape from TopTools is protected;
-- for EACH node contains a list of sections
myCuttingNode : DataMapOfShapeListOfShape from TopTools is protected;
-- nodes cutting edges
myLittleFace : IndexedMapOfShape from TopTools is protected;
-- Faces to be suppress because they are too little
myMinTolerance : Real;
myMaxTolerance : Real;
myShape : Shape from TopoDS is protected;
myReShape : ReShape from BRepTools is protected;
myMergedEdges : MapOfShape from TopTools;
end Sewing;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,187 @@
// File: BRepBuilderAPI_Sewing.lxx
// Created: Mon Dec 18 13:16:57 2000
// Author: Galina KULIKOVA
// <gka@zamox.nnov.matra-dtv.fr>
//=======================================================================
//function : SetMaxTolerance
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetMaxTolerance(const Standard_Real theMaxToler)
{
myMaxTolerance = theMaxToler;
}
//=======================================================================
//function : MaxTolerance
//purpose :
//=======================================================================
inline Standard_Real BRepBuilderAPI_Sewing::MaxTolerance() const
{
return myMaxTolerance;
}
//=======================================================================
//function : Tolerance
//purpose :
//=======================================================================
inline Standard_Real BRepBuilderAPI_Sewing::Tolerance() const
{
return myTolerance;
}
//=======================================================================
//function : SetTolerance
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetTolerance(const Standard_Real theToler)
{
myTolerance = theToler;
}
//=======================================================================
//function : SetMinTolerance
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetMinTolerance(const Standard_Real theMinToler)
{
myMinTolerance = theMinToler;
}
//=======================================================================
//function : MinTolerance
//purpose :
//=======================================================================
inline Standard_Real BRepBuilderAPI_Sewing::MinTolerance() const
{
return myMinTolerance;
}
//=======================================================================
//function : SetFaceMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetFaceMode(const Standard_Boolean theFaceMode)
{
myFaceMode = theFaceMode;
}
//=======================================================================
//function : FaceMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::FaceMode() const
{
return myFaceMode;
}
//=======================================================================
//function : SetFloatingEdgesMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetFloatingEdgesMode(const Standard_Boolean theFloatingEdgesMode)
{
myFloatingEdgesMode = theFloatingEdgesMode;
}
//=======================================================================
//function : FloatingEdgesMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::FloatingEdgesMode() const
{
return myFloatingEdgesMode;
}
/*
//=======================================================================
//function : SetCuttingFloatingEdgesMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetCuttingFloatingEdgesMode(const Standard_Boolean theCuttingFloatingEdgesMode)
{
myCuttingFloatingEdgesMode = theCuttingFloatingEdgesMode;
}
//=======================================================================
//function : CuttingFloatingEdgesMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::CuttingFloatingEdgesMode() const
{
return myCuttingFloatingEdgesMode;
}
*/
//=======================================================================
//function : SameParameterMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::SameParameterMode() const
{
return mySameParameterMode;
}
//=======================================================================
//function : SetSameParameterMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetSameParameterMode(const Standard_Boolean SameParameterMode)
{
mySameParameterMode = SameParameterMode;
}
//=======================================================================
//function : SetLocalTolerancesMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetLocalTolerancesMode(const Standard_Boolean theLocalTolerancesMode)
{
myLocalToleranceMode = theLocalTolerancesMode;
}
//=======================================================================
//function : LocalTolerancesMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::LocalTolerancesMode() const
{
return myLocalToleranceMode;
}
//=======================================================================
//function : SetNonManifoldMode
//purpose :
//=======================================================================
inline void BRepBuilderAPI_Sewing::SetNonManifoldMode(const Standard_Boolean theNonManifoldMode)
{
myNonmanifold = theNonManifoldMode;
}
//=======================================================================
//function : NonManifoldMode
//purpose :
//=======================================================================
inline Standard_Boolean BRepBuilderAPI_Sewing::NonManifoldMode() const
{
return myNonmanifold;
}

View File

@@ -0,0 +1,97 @@
-- File: BRepBuilderAPI_Transform.cdl
-- Created: Fri Dec 9 09:02:17 1994
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1994
class Transform from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Geometric transformation on a shape.
-- The transformation to be applied is defined as a
-- gp_Trsf transformation, i.e. a transformation which does
-- not modify the underlying geometry of shapes.
-- The transformation is applied to:
-- - all curves which support edges of a shape, and
-- - all surfaces which support its faces.
-- A Transform object provides a framework for:
-- - defining the geometric transformation to be applied,
-- - implementing the transformation algorithm, and
-- - consulting the results.
uses
Trsf from gp,
Location from TopLoc,
Shape from TopoDS,
Face from TopoDS,
ShapeModification from BRepBuilderAPI,
ListOfShape from TopTools
raises
NoSuchObject from Standard
is
Create(T: Trsf from gp)
returns Transform from BRepBuilderAPI;
---Purpose: Constructs a framework for applying the geometric
-- transformation T to a shape. Use the function Perform
-- to define the shape to transform.
Create(S: Shape from TopoDS; T: Trsf from gp;
Copy: Boolean from Standard = Standard_False)
returns Transform from BRepBuilderAPI;
---Purpose: Creates a transformation from the gp_Trsf <T>, and
-- applies it to the shape <S>. If the transformation
-- is direct and isometric (determinant = 1) and
-- <Copy> = Standard_False, the resulting shape is
-- <S> on which a new location has been set.
-- Otherwise, the transformation is applied on a
-- duplication of <S>.
Perform(me: in out; S : Shape from TopoDS;
Copy: Boolean from Standard = Standard_False)
---Purpose: pplies the geometric transformation defined at the
-- time of construction of this framework to the shape S.
-- - If the transformation T is direct and isometric, in
-- other words, if the determinant of the vectorial part
-- of T is equal to 1., and if Copy equals false (the
-- default value), the resulting shape is the same as
-- the original but with a new location assigned to it.
-- - In all other cases, the transformation is applied to a duplicate of S.
-- Use the function Shape to access the result.
-- Note: this framework can be reused to apply the same
-- geometric transformation to other shapes. You only
-- need to specify them by calling the function Perform again.
is static;
ModifiedShape(me; S: Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the modified shape corresponding to <S>.
---C++: return const&
raises NoSuchObject from Standard
-- if S is not the initial shape or a sub-shape
-- of the initial shape.
is redefined virtual;
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;
fields
myTrsf : Trsf from gp;
myLocation : Location from TopLoc;
myUseModif : Boolean from Standard;
end Transform;

View File

@@ -0,0 +1,99 @@
// File: BRepBuilderAPI_Transform.cxx
// Created: Fri Dec 9 09:14:55 1994
// Author: Jacques GOUSSARD
// <jag@topsn2>
#include <BRepBuilderAPI_Transform.ixx>
#include <BRepTools_TrsfModification.hxx>
#include <gp.hxx>
//=======================================================================
//function : BRepBuilderAPI_Transform
//purpose :
//=======================================================================
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const gp_Trsf& T) :
myTrsf(T)
{
myModification = new BRepTools_TrsfModification(T);
}
//=======================================================================
//function : BRepBuilderAPI_Transform
//purpose :
//=======================================================================
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& S,
const gp_Trsf& T,
const Standard_Boolean Copy) :
myTrsf(T)
{
myModification = new BRepTools_TrsfModification(T);
Perform(S,Copy);
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
// myUseModif = Copy || myTrsf.IsNegative(); bug gp_Trsf.
myUseModif = Copy ||
myTrsf.ScaleFactor()*myTrsf.HVectorialPart().Determinant() < 0. ||
Abs(Abs(myTrsf.ScaleFactor()) - 1) > gp::Resolution();
if (myUseModif) {
Handle(BRepTools_TrsfModification) theModif =
Handle(BRepTools_TrsfModification)::DownCast(myModification);
theModif->Trsf() = myTrsf;
DoModif(S,myModification);
}
else {
myLocation = myTrsf;
myShape = S.Moved(myLocation);
Done();
}
}
//=======================================================================
//function : ModifiedShape
//purpose :
//=======================================================================
const TopoDS_Shape& BRepBuilderAPI_Transform::ModifiedShape
(const TopoDS_Shape& S) const
{
if (myUseModif) {
return myModifier.ModifiedShape(S);
}
static TopoDS_Shape SM;
SM = S.Moved (myLocation);
return SM;
}
//=======================================================================
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepBuilderAPI_Transform::Modified
(const TopoDS_Shape& F)
{
if (!myUseModif) {
myGenerated.Clear();
myGenerated.Append(F.Moved(myLocation));
return myGenerated;
}
return BRepBuilderAPI_ModifyShape::Modified(F);
}