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

0024002: Overall code and build procedure refactoring -- automatic

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

View File

@@ -1,320 +0,0 @@
-- Created on: 1993-07-06
-- Created by: Remi LEQUETTE
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package 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,
Message
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;
deferred class MakeShape;
--
-- 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;
imported transient class FastSewing;
--
-- Construction of composite topologies
--
class MakeWire;
class MakeShell;
class MakeSolid;
--
-- Shape modification (constant topology)
--
deferred class ModifyShape;
class Transform;
class NurbsConvert ;
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

@@ -14,27 +14,26 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI.ixx>
#include <BRepLib.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI.hxx>
#include <BRepLib.hxx>
#include <BRepTools.hxx>
#include <Geom_Plane.hxx>
#include <gp.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Face.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);

View File

@@ -0,0 +1,165 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_HeaderFile
#define _BRepBuilderAPI_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
class Geom_Plane;
class BRepBuilderAPI_Command;
class BRepBuilderAPI_MakeShape;
class BRepBuilderAPI_MakeVertex;
class BRepBuilderAPI_MakeEdge;
class BRepBuilderAPI_MakeEdge2d;
class BRepBuilderAPI_MakePolygon;
class BRepBuilderAPI_MakeFace;
class BRepBuilderAPI_FindPlane;
class BRepBuilderAPI_Sewing;
class BRepBuilderAPI_MakeWire;
class BRepBuilderAPI_MakeShell;
class BRepBuilderAPI_MakeSolid;
class BRepBuilderAPI_ModifyShape;
class BRepBuilderAPI_Transform;
class BRepBuilderAPI_NurbsConvert;
class BRepBuilderAPI_GTransform;
class BRepBuilderAPI_Copy;
class BRepBuilderAPI_Collect;
//! 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.
class BRepBuilderAPI
{
public:
DEFINE_STANDARD_ALLOC
//! Sets the current plane.
Standard_EXPORT static void Plane (const Handle(Geom_Plane)& P);
//! Returns the current plane.
Standard_EXPORT static const Handle(Geom_Plane)& Plane();
//! Sets the default precision. The current Precision
//! is returned.
Standard_EXPORT static void Precision (const Standard_Real P);
//! Returns the default precision.
Standard_EXPORT static Standard_Real Precision();
protected:
private:
friend class BRepBuilderAPI_Command;
friend class BRepBuilderAPI_MakeShape;
friend class BRepBuilderAPI_MakeVertex;
friend class BRepBuilderAPI_MakeEdge;
friend class BRepBuilderAPI_MakeEdge2d;
friend class BRepBuilderAPI_MakePolygon;
friend class BRepBuilderAPI_MakeFace;
friend class BRepBuilderAPI_FindPlane;
friend class BRepBuilderAPI_Sewing;
friend class BRepBuilderAPI_MakeWire;
friend class BRepBuilderAPI_MakeShell;
friend class BRepBuilderAPI_MakeSolid;
friend class BRepBuilderAPI_ModifyShape;
friend class BRepBuilderAPI_Transform;
friend class BRepBuilderAPI_NurbsConvert;
friend class BRepBuilderAPI_GTransform;
friend class BRepBuilderAPI_Copy;
friend class BRepBuilderAPI_Collect;
};
#endif // _BRepBuilderAPI_HeaderFile

View File

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

@@ -14,15 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_Collect.ixx>
#include <TopoDS.hxx>
#include <BRepBuilderAPI_Collect.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#ifdef OCCT_DEBUG

View File

@@ -0,0 +1,80 @@
// Created on: 1996-04-09
// Created by: Yves FRICAUD
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Collect_HeaderFile
#define _BRepBuilderAPI_Collect_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
class TopoDS_Shape;
class BRepBuilderAPI_MakeShape;
class BRepBuilderAPI_Collect
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBuilderAPI_Collect();
Standard_EXPORT void Add (const TopoDS_Shape& SI, BRepBuilderAPI_MakeShape& MKS);
Standard_EXPORT void AddGenerated (const TopoDS_Shape& S, const TopoDS_Shape& Gen);
Standard_EXPORT void AddModif (const TopoDS_Shape& S, const TopoDS_Shape& Mod);
Standard_EXPORT void Filter (const TopoDS_Shape& SF);
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Modification() const;
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Generated() const;
protected:
private:
TopoDS_Shape myInitialShape;
TopTools_MapOfShape myDeleted;
TopTools_DataMapOfShapeListOfShape myMod;
TopTools_DataMapOfShapeListOfShape myGen;
};
#endif // _BRepBuilderAPI_Collect_HeaderFile

View File

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

@@ -14,13 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_Command.ixx>
#include <BRepBuilderAPI_Command.hxx>
#include <StdFail_NotDone.hxx>
//=======================================================================
//function : BRepBuilderAPI_Command
//purpose :
//=======================================================================
BRepBuilderAPI_Command::BRepBuilderAPI_Command() :
myDone(Standard_False)
{

View File

@@ -0,0 +1,85 @@
// Created on: 1993-07-21
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Command_HeaderFile
#define _BRepBuilderAPI_Command_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
class StdFail_NotDone;
//! Root class for all commands in BRepBuilderAPI.
//!
//! Provides :
//!
//! * Managements of the notDone flag.
//!
//! * Catching of exceptions (not implemented).
//!
//! * Logging (not implemented).
class BRepBuilderAPI_Command
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT virtual void Delete();
Standard_EXPORT virtual ~BRepBuilderAPI_Command(){Delete() ; }
Standard_EXPORT virtual Standard_Boolean IsDone() const;
//! Raises NotDone if done is false.
Standard_EXPORT void Check() const;
protected:
//! Set done to False.
Standard_EXPORT BRepBuilderAPI_Command();
//! Set done to true.
Standard_EXPORT void Done();
//! Set done to false.
Standard_EXPORT void NotDone();
private:
Standard_Boolean myDone;
};
#endif // _BRepBuilderAPI_Command_HeaderFile

View File

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

@@ -14,15 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#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 <BRepBuilderAPI_Copy.hxx>
#include <BRepTools_Modification.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification

View File

@@ -0,0 +1,82 @@
// Created on: 1994-12-12
// Created by: Jacques GOUSSARD
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Copy_HeaderFile
#define _BRepBuilderAPI_Copy_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_Copy : public BRepBuilderAPI_ModifyShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty copy framework. Use the function
//! Perform to copy shapes.
Standard_EXPORT BRepBuilderAPI_Copy();
//! 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.
Standard_EXPORT BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom = Standard_True);
//! 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.
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean copyGeom = Standard_True);
protected:
private:
};
#endif // _BRepBuilderAPI_Copy_HeaderFile

View File

@@ -0,0 +1,55 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_EdgeError_HeaderFile
#define _BRepBuilderAPI_EdgeError_HeaderFile
//! 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.
enum BRepBuilderAPI_EdgeError
{
BRepBuilderAPI_EdgeDone,
BRepBuilderAPI_PointProjectionFailed,
BRepBuilderAPI_ParameterOutOfRange,
BRepBuilderAPI_DifferentPointsOnClosedCurve,
BRepBuilderAPI_PointWithInfiniteParameter,
BRepBuilderAPI_DifferentsPointAndParameter,
BRepBuilderAPI_LineThroughIdenticPoints
};
#endif // _BRepBuilderAPI_EdgeError_HeaderFile

View File

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

View File

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

@@ -14,35 +14,34 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#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 <BRepBuilderAPI_FindPlane.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Conic.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Hyperbola.hxx>
#include <Geom_Line.hxx>
#include <Geom_Parabola.hxx>
#include <Geom_Plane.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepBuilderAPI_FindPlane
//purpose :
//=======================================================================
BRepBuilderAPI_FindPlane::BRepBuilderAPI_FindPlane()
{
}

View File

@@ -0,0 +1,101 @@
// Created on: 1995-11-02
// Created by: Jing Cheng MEI
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_FindPlane_HeaderFile
#define _BRepBuilderAPI_FindPlane_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Geom_Plane;
class Standard_NoSuchObject;
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_FindPlane
{
public:
DEFINE_STANDARD_ALLOC
//! Initializes an empty algorithm. The function Init is then used to define the shape.
Standard_EXPORT BRepBuilderAPI_FindPlane();
//! 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.
Standard_EXPORT BRepBuilderAPI_FindPlane(const TopoDS_Shape& S, const Standard_Real Tol = -1);
//! 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.
Standard_EXPORT void Init (const TopoDS_Shape& S, const Standard_Real Tol = -1);
//! Returns true if a plane containing the edges of the
//! shape is found and built. Use the function Plane to consult the result.
Standard_EXPORT Standard_Boolean Found() const;
//! 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.
Standard_EXPORT Handle(Geom_Plane) Plane() const;
protected:
private:
Handle(Geom_Plane) myPlane;
};
#endif // _BRepBuilderAPI_FindPlane_HeaderFile

View File

@@ -1,126 +0,0 @@
-- Created on: 1996-12-30
-- Created by: Stagiaire Mary FABIEN
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class 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;
ModifiedShape(me; S: Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the modified shape corresponding to <S>.
raises NoSuchObject from Standard
-- if S is not the initial shape or a sub-shape
-- of the initial shape.
is redefined virtual;
fields
myGTrsf : GTrsf from gp;
myHist : Collect from BRepBuilderAPI;
end Transform;

View File

@@ -14,22 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_GTransform.ixx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_GTransform.hxx>
#include <BRepBuilderAPI_NurbsConvert.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 <gp_GTrsf.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
//=======================================================================
//function : BRepBuilderAPI_GTransform
//purpose :
//=======================================================================
BRepBuilderAPI_GTransform::BRepBuilderAPI_GTransform (const gp_GTrsf& T) :
myGTrsf(T)
{

View File

@@ -0,0 +1,129 @@
// Created on: 1996-12-30
// Created by: Stagiaire Mary FABIEN
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_GTransform_HeaderFile
#define _BRepBuilderAPI_GTransform_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_GTrsf.hxx>
#include <BRepBuilderAPI_Collect.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
class Standard_NoSuchObject;
class gp_GTrsf;
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_GTransform : public BRepBuilderAPI_ModifyShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for applying the geometric
//! transformation T to a shape. Use the function
//! Perform to define the shape to transform.
Standard_EXPORT BRepBuilderAPI_GTransform(const gp_GTrsf& T);
//! 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.
Standard_EXPORT BRepBuilderAPI_GTransform(const TopoDS_Shape& S, const gp_GTrsf& T, const Standard_Boolean Copy = Standard_False);
//! 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.
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the modified shape corresponding to <S>.
Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const Standard_OVERRIDE;
protected:
private:
gp_GTrsf myGTrsf;
BRepBuilderAPI_Collect myHist;
};
#endif // _BRepBuilderAPI_GTransform_HeaderFile

View File

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

@@ -14,13 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeEdge.ixx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Pnt.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeEdge
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge::BRepBuilderAPI_MakeEdge()
{}

View File

@@ -0,0 +1,295 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeEdge_HeaderFile
#define _BRepBuilderAPI_MakeEdge_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_EdgeError.hxx>
class StdFail_NotDone;
class TopoDS_Vertex;
class gp_Pnt;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Hypr;
class gp_Parab;
class Geom_Curve;
class Geom2d_Curve;
class Geom_Surface;
class TopoDS_Edge;
//! 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.
class BRepBuilderAPI_MakeEdge : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBuilderAPI_MakeEdge();
Standard_EXPORT BRepBuilderAPI_MakeEdge(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Lin& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Lin& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Lin& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Lin& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Circ& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Circ& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Circ& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Circ& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Elips& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Elips& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Elips& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Elips& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Hypr& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Hypr& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Hypr& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Hypr& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Parab& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Parab& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Parab& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const gp_Parab& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT 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);
//! 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
Standard_EXPORT 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);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT void 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);
//! Defines or redefines the arguments for the construction of an edge.
//! This function is currently used after the empty constructor BRepAPI_MakeEdge().
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
//! Returns true if the edge is built.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! 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.
Standard_EXPORT BRepBuilderAPI_EdgeError Error() const;
//! Returns the constructed edge.
//! Exceptions StdFail_NotDone if the edge is not built.
Standard_EXPORT const TopoDS_Edge& Edge() const;
Standard_EXPORT operator TopoDS_Edge() const;
//! Returns the first vertex of the edge. May be Null.
Standard_EXPORT const TopoDS_Vertex& Vertex1() const;
//! 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.
Standard_EXPORT const TopoDS_Vertex& Vertex2() const;
protected:
private:
BRepLib_MakeEdge myMakeEdge;
};
#endif // _BRepBuilderAPI_MakeEdge_HeaderFile

View File

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

@@ -14,14 +14,23 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeEdge2d.ixx>
#include <BRepBuilderAPI_MakeEdge2d.hxx>
#include <Geom2d_Curve.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Hypr2d.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Pnt2d.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeEdge2d
//purpose :
//=======================================================================
BRepBuilderAPI_MakeEdge2d::BRepBuilderAPI_MakeEdge2d(const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2)
: myMakeEdge2d(V1,V2)

View File

@@ -0,0 +1,185 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeEdge2d_HeaderFile
#define _BRepBuilderAPI_MakeEdge2d_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeEdge2d.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_EdgeError.hxx>
class StdFail_NotDone;
class TopoDS_Vertex;
class gp_Pnt2d;
class gp_Lin2d;
class gp_Circ2d;
class gp_Elips2d;
class gp_Hypr2d;
class gp_Parab2d;
class Geom2d_Curve;
class TopoDS_Edge;
//! 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.
class BRepBuilderAPI_MakeEdge2d : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Lin2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Circ2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Elips2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Hypr2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const gp_Parab2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT BRepBuilderAPI_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT void Init (const Handle(Geom2d_Curve)& C, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! Returns the error description when NotDone.
Standard_EXPORT BRepBuilderAPI_EdgeError Error() const;
Standard_EXPORT const TopoDS_Edge& Edge() const;
Standard_EXPORT operator TopoDS_Edge() const;
//! Returns the first vertex of the edge. May be Null.
Standard_EXPORT const TopoDS_Vertex& Vertex1() const;
//! Returns the second vertex of the edge. May be Null.
Standard_EXPORT const TopoDS_Vertex& Vertex2() const;
protected:
private:
BRepLib_MakeEdge2d myMakeEdge2d;
};
#endif // _BRepBuilderAPI_MakeEdge2d_HeaderFile

View File

@@ -1,331 +0,0 @@
-- Created on: 1993-07-12
-- Created by: Remi LEQUETTE
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- xab: 29Nov96 correction de doc
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; TolDegen : Real)
---Purpose: Make a face from a Surface. Accepts tolerance value (TolDegen)
-- for resolution of degenerated edges.
---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, TolDegen : Real)
---Purpose: Make a face from a Surface. Accepts tolerance value (TolDegen)
-- for resolution of degenerated edges.
---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; TolDegen : Real)
---Purpose: Initializes (or reinitializes) the construction of a face on
-- the surface S. If Bound is true, 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.
-- TolDegen parameter is used for resolution of degenerated edges
-- if calculation of natural bounds is turned on.
is static;
Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : 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.
-- TolDegen parameter is used for resolution of degenerated edges.
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

@@ -14,14 +14,22 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeFace.ixx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Geom_Surface.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pln.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeFace
//purpose :
//=======================================================================
BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace()
{
}

View File

@@ -0,0 +1,271 @@
// Created on: 1993-07-12
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeFace_HeaderFile
#define _BRepBuilderAPI_MakeFace_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_FaceError.hxx>
class StdFail_NotDone;
class TopoDS_Face;
class gp_Pln;
class gp_Cylinder;
class gp_Cone;
class gp_Sphere;
class gp_Torus;
class Geom_Surface;
class TopoDS_Wire;
//! 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.
class BRepBuilderAPI_MakeFace : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Not done.
Standard_EXPORT BRepBuilderAPI_MakeFace();
//! Load a face. Usefull to add wires.
Standard_EXPORT BRepBuilderAPI_MakeFace(const TopoDS_Face& F);
//! Make a face from a plane.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Pln& P);
//! Make a face from a cylinder.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cylinder& C);
//! Make a face from a cone.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cone& C);
//! Make a face from a sphere.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Sphere& S);
//! Make a face from a torus.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Torus& C);
//! Make a face from a Surface. Accepts tolerance value (TolDegen)
//! for resolution of degenerated edges.
Standard_EXPORT BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real TolDegen);
//! Make a face from a plane.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Pln& P, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
//! Make a face from a cylinder.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cylinder& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
//! Make a face from a cone.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cone& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
//! Make a face from a sphere.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Sphere& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
//! Make a face from a torus.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Torus& C, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
//! Make a face from a Surface. Accepts tolerance value (TolDegen)
//! for resolution of degenerated edges.
Standard_EXPORT BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeFace(const TopoDS_Wire& W, const Standard_Boolean OnlyPlane = Standard_False);
//! Make a face from a plane and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Pln& P, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Make a face from a cylinder and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cylinder& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Make a face from a cone and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Cone& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Make a face from a sphere and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Sphere& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Make a face from a torus and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const gp_Torus& C, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Make a face from a Surface and a wire.
Standard_EXPORT BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
//! Adds the wire <W> in the face <F>
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeFace(const TopoDS_Face& F, const TopoDS_Wire& W);
//! 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.
Standard_EXPORT void Init (const TopoDS_Face& F);
//! Initializes (or reinitializes) the construction of a face on
//! the surface S. If Bound is true, 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.
//! TolDegen parameter is used for resolution of degenerated edges
//! if calculation of natural bounds is turned on.
Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Boolean Bound, const Standard_Real TolDegen);
//! 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.
//! TolDegen parameter is used for resolution of degenerated edges.
Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real TolDegen);
//! 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;
Standard_EXPORT void Add (const TopoDS_Wire& W);
//! Returns true if this algorithm has a valid face.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! 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.
Standard_EXPORT BRepBuilderAPI_FaceError Error() const;
//! Returns the constructed face.
//! Exceptions
//! StdFail_NotDone if no face is built.
Standard_EXPORT const TopoDS_Face& Face() const;
Standard_EXPORT operator TopoDS_Face() const;
protected:
private:
BRepLib_MakeFace myMakeFace;
};
#endif // _BRepBuilderAPI_MakeFace_HeaderFile

View File

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

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

View File

@@ -0,0 +1,198 @@
// Created on: 1993-07-29
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakePolygon_HeaderFile
#define _BRepBuilderAPI_MakePolygon_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Boolean.hxx>
class StdFail_NotDone;
class gp_Pnt;
class TopoDS_Vertex;
class TopoDS_Edge;
class TopoDS_Wire;
//! 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.
class BRepBuilderAPI_MakePolygon : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepBuilderAPI_MakePolygon();
Standard_EXPORT BRepBuilderAPI_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2);
Standard_EXPORT BRepBuilderAPI_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const Standard_Boolean Close = Standard_False);
//! 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.
Standard_EXPORT BRepBuilderAPI_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4, const Standard_Boolean Close = Standard_False);
Standard_EXPORT BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
Standard_EXPORT BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const TopoDS_Vertex& V3, const Standard_Boolean Close = Standard_False);
//! 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.
Standard_EXPORT BRepBuilderAPI_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const TopoDS_Vertex& V3, const TopoDS_Vertex& V4, const Standard_Boolean Close = Standard_False);
Standard_EXPORT void Add (const gp_Pnt& P);
//! 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.
Standard_EXPORT void Add (const TopoDS_Vertex& V);
//! Returns true if the last vertex added to the constructed
//! polygonal wire is not coincident with the previous one.
Standard_EXPORT Standard_Boolean Added() const;
//! Closes the polygonal wire under construction. Note - this
//! is equivalent to adding the first vertex to the polygonal
//! wire under construction.
Standard_EXPORT void Close();
Standard_EXPORT const TopoDS_Vertex& FirstVertex() const;
//! 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.
Standard_EXPORT const TopoDS_Vertex& LastVertex() const;
//! 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.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! 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.
Standard_EXPORT const TopoDS_Edge& Edge() const;
Standard_EXPORT operator TopoDS_Edge() const;
//! 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.
Standard_EXPORT const TopoDS_Wire& Wire() const;
Standard_EXPORT operator TopoDS_Wire() const;
protected:
private:
BRepLib_MakePolygon myMakePolygon;
};
#endif // _BRepBuilderAPI_MakePolygon_HeaderFile

View File

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

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

View File

@@ -0,0 +1,94 @@
// Created on: 1993-07-21
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeShape_HeaderFile
#define _BRepBuilderAPI_MakeShape_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepBuilderAPI_Command.hxx>
#include <Standard_Boolean.hxx>
class StdFail_NotDone;
class TopoDS_Shape;
//! This is the root class for all shape
//! constructions. It stores the result.
//!
//! It provides deferred methods to trace the history
//! of sub-shapes.
class BRepBuilderAPI_MakeShape : public BRepBuilderAPI_Command
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT virtual void Delete() Standard_OVERRIDE;
Standard_EXPORT virtual ~BRepBuilderAPI_MakeShape(){Delete() ; }
//! This is called by Shape(). It does nothing but
//! may be redefined.
Standard_EXPORT virtual void Build();
//! Returns a shape built by the shape construction algorithm.
//! Raises exception StdFail_NotDone if the shape was not built.
Standard_EXPORT virtual const TopoDS_Shape& Shape() const;
Standard_EXPORT operator TopoDS_Shape() const;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S);
//! Returns true if the shape S has been deleted.
Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S);
protected:
Standard_EXPORT BRepBuilderAPI_MakeShape();
TopoDS_Shape myShape;
TopTools_ListOfShape myGenerated;
private:
};
#endif // _BRepBuilderAPI_MakeShape_HeaderFile

View File

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

@@ -14,14 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeShell.ixx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <Geom_Surface.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS_Shell.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeShell
//purpose :
//=======================================================================
BRepBuilderAPI_MakeShell::BRepBuilderAPI_MakeShell()
{
}

View File

@@ -0,0 +1,131 @@
// Created on: 1994-02-16
// Created by: Remi LEQUETTE
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeShell_HeaderFile
#define _BRepBuilderAPI_MakeShell_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeShell.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <BRepBuilderAPI_ShellError.hxx>
class StdFail_NotDone;
class Geom_Surface;
class TopoDS_Shell;
//! 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.
class BRepBuilderAPI_MakeShell : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeShell();
//! Constructs a shell from the surface S.
Standard_EXPORT BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S, const Standard_Boolean Segment = Standard_False);
//! 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.
Standard_EXPORT 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 = Standard_False);
//! 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
Standard_EXPORT void 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 = Standard_False);
//! Returns true if the shell is built.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! 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.
Standard_EXPORT BRepBuilderAPI_ShellError Error() const;
//! Returns the new Shell.
Standard_EXPORT const TopoDS_Shell& Shell() const;
Standard_EXPORT operator TopoDS_Shell() const;
protected:
private:
BRepLib_MakeShell myMakeShell;
};
#endif // _BRepBuilderAPI_MakeShell_HeaderFile

View File

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

@@ -14,15 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeSolid.ixx>
#include <TopoDS.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <StdFail_NotDone.hxx>
#include <TopoDS.hxx>
#include <TopoDS_CompSolid.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeSolid
//purpose :
//=======================================================================
BRepBuilderAPI_MakeSolid::BRepBuilderAPI_MakeSolid()
{
}

View File

@@ -0,0 +1,149 @@
// Created on: 1993-07-21
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeSolid_HeaderFile
#define _BRepBuilderAPI_MakeSolid_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeSolid.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Standard_Boolean.hxx>
class StdFail_NotDone;
class TopoDS_CompSolid;
class TopoDS_Shell;
class TopoDS_Solid;
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_MakeSolid : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeSolid();
//! Make a solid from a CompSolid.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S);
//! Make a solid from a shell.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S);
//! Make a solid from two shells.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2);
//! Make a solid from three shells.
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2, const TopoDS_Shell& S3);
//! Make a solid from a solid. Usefull for adding later.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So);
//! Add a shell to a solid.
//!
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So, const TopoDS_Shell& S);
//! 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.
Standard_EXPORT void Add (const TopoDS_Shell& S);
//! 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.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! Returns the new Solid.
Standard_EXPORT const TopoDS_Solid& Solid() const;
Standard_EXPORT operator TopoDS_Solid() const;
Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
BRepLib_MakeSolid myMakeSolid;
};
#endif // _BRepBuilderAPI_MakeSolid_HeaderFile

View File

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

@@ -14,16 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeVertex.ixx>
#include <BRepBuilderAPI.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : BRepBuilderAPI_MakeVertex
//purpose :
//=======================================================================
BRepBuilderAPI_MakeVertex::BRepBuilderAPI_MakeVertex(const gp_Pnt& P)
: myMakeVertex(P)
{

View File

@@ -0,0 +1,80 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeVertex_HeaderFile
#define _BRepBuilderAPI_MakeVertex_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
class gp_Pnt;
class TopoDS_Vertex;
//! 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.
class BRepBuilderAPI_MakeVertex : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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);
Standard_EXPORT BRepBuilderAPI_MakeVertex(const gp_Pnt& P);
//! Returns the constructed vertex.
Standard_EXPORT const TopoDS_Vertex& Vertex() const;
Standard_EXPORT operator TopoDS_Vertex() const;
protected:
private:
BRepLib_MakeVertex myMakeVertex;
};
#endif // _BRepBuilderAPI_MakeVertex_HeaderFile

View File

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

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

View File

@@ -0,0 +1,207 @@
// Created on: 1993-07-08
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeWire_HeaderFile
#define _BRepBuilderAPI_MakeWire_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_WireError.hxx>
class StdFail_NotDone;
class TopoDS_Edge;
class TopoDS_Wire;
class TopoDS_Vertex;
//! 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.
class BRepBuilderAPI_MakeWire : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeWire();
//! Make a Wire from an edge.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Edge& E);
//! Make a Wire from two edges.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2);
//! Make a Wire from three edges.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& E3);
//! Make a Wire from four edges.
//! 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.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& E3, const TopoDS_Edge& E4);
//! Make a Wire from a Wire. Usefull for adding later.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Wire& W);
//! Add an edge to a wire.
Standard_EXPORT BRepBuilderAPI_MakeWire(const TopoDS_Wire& W, const TopoDS_Edge& E);
//! 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.
Standard_EXPORT void Add (const TopoDS_Edge& E);
//! Add the edges of <W> to the current wire.
Standard_EXPORT void Add (const TopoDS_Wire& W);
//! 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>)
Standard_EXPORT void Add (const TopTools_ListOfShape& L);
//! 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.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//! Returns the construction status
//! - BRepBuilderAPI_WireDone if the wire is built, or
//! - another value of the BRepBuilderAPI_WireError
//! enumeration indicating why the construction failed.
Standard_EXPORT BRepBuilderAPI_WireError Error() const;
//! Returns the constructed wire; or the part of the wire
//! under construction already built.
//! Exceptions StdFail_NotDone if a wire is not built.
Standard_EXPORT const TopoDS_Wire& Wire() const;
Standard_EXPORT operator TopoDS_Wire() const;
//! 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..
Standard_EXPORT const TopoDS_Edge& Edge() const;
//! 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
Standard_EXPORT const TopoDS_Vertex& Vertex() const;
protected:
private:
BRepLib_MakeWire myMakeWire;
};
#endif // _BRepBuilderAPI_MakeWire_HeaderFile

View File

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

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

View File

@@ -0,0 +1,125 @@
// Created on: 1994-12-02
// Created by: Jacques GOUSSARD
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_ModifyShape_HeaderFile
#define _BRepBuilderAPI_ModifyShape_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepTools_Modifier.hxx>
#include <TopoDS_Shape.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <TopTools_ListOfShape.hxx>
class BRepTools_Modification;
class Standard_NullObject;
class Standard_NoSuchObject;
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_ModifyShape : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
//! Returns the 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.
Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const;
protected:
//! Empty constructor.
Standard_EXPORT BRepBuilderAPI_ModifyShape();
//! Initializes the modifier with the Shape <S>, and
//! set the field <myInitialShape> to <S>.
Standard_EXPORT BRepBuilderAPI_ModifyShape(const TopoDS_Shape& S);
//! Set the field <myModification> with <M>.
Standard_EXPORT BRepBuilderAPI_ModifyShape(const Handle(BRepTools_Modification)& M);
//! 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.
Standard_EXPORT BRepBuilderAPI_ModifyShape(const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
//! Performs the previously given modification on the
//! shape <S>.
Standard_EXPORT void DoModif (const TopoDS_Shape& S);
//! Performs the modification <M> on a previously
//! given shape.
Standard_EXPORT void DoModif (const Handle(BRepTools_Modification)& M);
//! Performs the modification <M> on the shape <S>.
Standard_EXPORT void DoModif (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
BRepTools_Modifier myModifier;
TopoDS_Shape myInitialShape;
Handle(BRepTools_Modification) myModification;
private:
Standard_EXPORT void DoModif();
};
#endif // _BRepBuilderAPI_ModifyShape_HeaderFile

View File

@@ -1,66 +0,0 @@
-- Created on: 1994-12-09
-- Created by: Jacques GOUSSARD
-- Copyright (c) 1994-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class NurbsConvert from BRepBuilderAPI inherits ModifyShape from BRepBuilderAPI
---Purpose: Conversion of the complete geometry of a shape
-- (all 3D analytical representation of surfaces and curves)
-- into NURBS geometry (execpt for Planes). 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

@@ -14,23 +14,23 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_NurbsConvert.ixx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_NurbsConvert.hxx>
#include <BRepLib.hxx>
#include <BRepTools_NurbsConvertModification.hxx>
#include <TopAbs.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.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 ()
{

View File

@@ -0,0 +1,91 @@
// Created on: 1994-12-09
// Created by: Jacques GOUSSARD
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_NurbsConvert_HeaderFile
#define _BRepBuilderAPI_NurbsConvert_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Shape;
//! Conversion of the complete geometry of a shape
//! (all 3D analytical representation of surfaces and curves)
//! into NURBS geometry (execpt for Planes). 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.
class BRepBuilderAPI_NurbsConvert : public BRepBuilderAPI_ModifyShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for converting the geometry of a
//! shape into NURBS geometry. Use the function Perform
//! to define the shape to convert.
Standard_EXPORT BRepBuilderAPI_NurbsConvert();
//! 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.
Standard_EXPORT BRepBuilderAPI_NurbsConvert(const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
//! 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.
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
protected:
private:
};
#endif // _BRepBuilderAPI_NurbsConvert_HeaderFile

View File

@@ -0,0 +1,29 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_PipeError_HeaderFile
#define _BRepBuilderAPI_PipeError_HeaderFile
//! Errors that can occur at (shell)pipe construction.
enum BRepBuilderAPI_PipeError
{
BRepBuilderAPI_PipeDone,
BRepBuilderAPI_PipeNotDone,
BRepBuilderAPI_PlaneNotIntersectGuide,
BRepBuilderAPI_ImpossibleContact
};
#endif // _BRepBuilderAPI_PipeError_HeaderFile

View File

@@ -1,559 +0,0 @@
-- Created on: 1995-03-23
-- Created by: Jing Cheng MEI
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- Modified 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 (of continuity: C0, C1, ...))
--
-- - 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,
ProgressIndicator from Message
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;
thePI : ProgressIndicator from Message = 0);
---Purpose: Computing
-- thePI - progress indicator of algorithm
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
SetContext(me : mutable; theContext : ReShape from BRepTools);
---Purpose: set context
GetContext(me) returns ReShape from BRepTools;
---C++: return const &
---Purpose: return context
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;
thePI : ProgressIndicator from Message = 0) is protected;
---Purpose: Performs cutting of sections
-- thePI - progress indicator of processing
Merging(me : mutable; passage : Boolean;
thePI : ProgressIndicator from Message = 0) 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;
thePI : ProgressIndicator from Message = 0) 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;
thePI : ProgressIndicator from Message = 0) is virtual protected;
---Purpose:
-- This method is called from Perform only
-- thePI - progress indicator of processing
FindFreeBoundaries(me : mutable) is virtual protected;
---Purpose:
-- This method is called from Perform only
VerticesAssembling(me : mutable;
thePI : ProgressIndicator from Message = 0) is virtual protected;
---Purpose:
-- This method is called from Perform only
-- thePI - progress indicator of processing
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;
isConsiderEnds : in Boolean from Standard) is 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;

View File

@@ -41,7 +41,6 @@
#define TEST 1
#include <BRepBuilderAPI_Sewing.ixx>
#include <Bnd_Box.hxx>
#include <Bnd_Box2d.hxx>
@@ -49,9 +48,18 @@
#include <BndLib_Add2dCurve.hxx>
#include <BndLib_Add3dCurve.hxx>
#include <BRep_Builder.hxx>
#include <BRep_ListOfPointRepresentation.hxx>
#include <BRep_PointOnCurve.hxx>
#include <BRep_Tool.hxx>
#include <BRep_TVertex.hxx>
#include <BRepBuilderAPI_BndBoxTreeSelector.hxx>
#include <BRepBuilderAPI_CellFilter.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepBuilderAPI_VertexInspector.hxx>
#include <BRepLib.hxx>
#include <BRepTools.hxx>
#include <BRepTools_Quilt.hxx>
#include <BRepTools_ReShape.hxx>
#include <BSplCLib.hxx>
#include <Extrema_ExtPC.hxx>
#include <GCPnts_AbscissaPoint.hxx>
@@ -68,25 +76,34 @@
#include <Geom_BSplineCurve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_OffsetSurface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomLib.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
//#include <LocalAnalysis_SurfaceContinuity.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressSentry.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Type.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TopAbs.hxx>
@@ -94,12 +111,14 @@
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Shell.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
@@ -110,26 +129,12 @@
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Compound.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <BRepTools.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_OffsetSurface.hxx>
#include <BRep_PointOnCurve.hxx>
#include <BRep_ListOfPointRepresentation.hxx>
#include <BRep_TVertex.hxx>
#include <Message_ProgressSentry.hxx>
#include <BRepBuilderAPI_VertexInspector.hxx>
#include <BRepBuilderAPI_CellFilter.hxx>
#include <BRepBuilderAPI_BndBoxTreeSelector.hxx>
#include <NCollection_UBTreeFiller.hxx>
//#include <LocalAnalysis_SurfaceContinuity.hxx>
//=======================================================================
//function : SameRange
//purpose :
//=======================================================================
Handle(Geom2d_Curve) BRepBuilderAPI_Sewing::SameRange(const Handle(Geom2d_Curve)& CurvePtr,
const Standard_Real FirstOnCurve,
const Standard_Real LastOnCurve,

View File

@@ -0,0 +1,382 @@
// Created on: 1995-03-23
// Created by: Jing Cheng MEI
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Sewing_HeaderFile
#define _BRepBuilderAPI_Sewing_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <Standard_Integer.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <MMgt_TShared.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_Array1OfBoolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_SequenceOfReal.hxx>
class BRepTools_ReShape;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class TopoDS_Shape;
class Message_ProgressIndicator;
class TopoDS_Edge;
class TopoDS_Face;
class Geom_Surface;
class TopLoc_Location;
class Geom2d_Curve;
class Geom_Curve;
class BRepBuilderAPI_Sewing;
DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Sewing, MMgt_TShared)
//! Provides methods to
//!
//! - identify possible contigous boundaries (for control
//! afterwards (of continuity: C0, C1, ...))
//!
//! - 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
class BRepBuilderAPI_Sewing : public MMgt_TShared
{
public:
//! 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
Standard_EXPORT BRepBuilderAPI_Sewing(const Standard_Real tolerance = 1.0e-06, const Standard_Boolean option1 = Standard_True, const Standard_Boolean option2 = Standard_True, const Standard_Boolean option3 = Standard_True, const Standard_Boolean option4 = Standard_False);
//! initialize the parameters if necessary
Standard_EXPORT void Init (const Standard_Real tolerance = 1.0e-06, const Standard_Boolean option1 = Standard_True, const Standard_Boolean option2 = Standard_True, const Standard_Boolean option3 = Standard_True, const Standard_Boolean option4 = Standard_False);
//! Loades the context shape.
Standard_EXPORT void Load (const TopoDS_Shape& shape);
//! Defines the shapes to be sewed or controlled
Standard_EXPORT void Add (const TopoDS_Shape& shape);
//! Computing
//! thePI - progress indicator of algorithm
Standard_EXPORT void Perform (const Handle(Message_ProgressIndicator)& thePI = 0);
//! Gives the sewed shape
//! a null shape if nothing constructed
//! may be a face, a shell, a solid or a compound
Standard_EXPORT const TopoDS_Shape& SewedShape() const;
//! set context
Standard_EXPORT void SetContext (const Handle(BRepTools_ReShape)& theContext);
//! return context
Standard_EXPORT const Handle(BRepTools_ReShape)& GetContext() const;
//! Gives the number of free edges (edge shared by one face)
Standard_EXPORT Standard_Integer NbFreeEdges() const;
//! Gives each free edge
Standard_EXPORT const TopoDS_Edge& FreeEdge (const Standard_Integer index) const;
//! Gives the number of multiple edges
//! (edge shared by more than two faces)
Standard_EXPORT Standard_Integer NbMultipleEdges() const;
//! Gives each multiple edge
Standard_EXPORT const TopoDS_Edge& MultipleEdge (const Standard_Integer index) const;
//! Gives the number of contigous edges (edge shared by two faces)
Standard_EXPORT Standard_Integer NbContigousEdges() const;
//! Gives each contigous edge
Standard_EXPORT const TopoDS_Edge& ContigousEdge (const Standard_Integer index) const;
//! Gives the sections (edge) belonging to a contigous edge
Standard_EXPORT const TopTools_ListOfShape& ContigousEdgeCouple (const Standard_Integer index) const;
//! Indicates if a section is bound (before use SectionToBoundary)
Standard_EXPORT Standard_Boolean IsSectionBound (const TopoDS_Edge& section) const;
//! 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.
Standard_EXPORT const TopoDS_Edge& SectionToBoundary (const TopoDS_Edge& section) const;
//! Gives the number of degenerated shapes
Standard_EXPORT Standard_Integer NbDegeneratedShapes() const;
//! Gives each degenerated shape
Standard_EXPORT const TopoDS_Shape& DegeneratedShape (const Standard_Integer index) const;
//! Indicates if a input shape is degenerated
Standard_EXPORT Standard_Boolean IsDegenerated (const TopoDS_Shape& shape) const;
//! Indicates if a input shape has been modified
Standard_EXPORT Standard_Boolean IsModified (const TopoDS_Shape& shape) const;
//! Gives a modifieded shape
Standard_EXPORT const TopoDS_Shape& Modified (const TopoDS_Shape& shape) const;
//! Indicates if a input subshape has been modified
Standard_EXPORT Standard_Boolean IsModifiedSubShape (const TopoDS_Shape& shape) const;
//! Gives a modifieded subshape
Standard_EXPORT TopoDS_Shape ModifiedSubShape (const TopoDS_Shape& shape) const;
//! print the informations
Standard_EXPORT void Dump() const;
//! Gives the number of deleted faces (faces smallest than tolerance)
Standard_EXPORT Standard_Integer NbDeletedFaces() const;
//! Gives each deleted face
Standard_EXPORT const TopoDS_Face& DeletedFace (const Standard_Integer index) const;
//! Gives a modified shape
Standard_EXPORT TopoDS_Face WhichFace (const TopoDS_Edge& theEdg, const Standard_Integer index = 1) const;
//! Gets same parameter mode.
Standard_Boolean SameParameterMode() const;
//! Sets same parameter mode.
void SetSameParameterMode (const Standard_Boolean SameParameterMode);
//! Gives set tolerance.
Standard_Real Tolerance() const;
//! Sets tolerance
void SetTolerance (const Standard_Real theToler);
//! Gives set min tolerance.
Standard_Real MinTolerance() const;
//! Sets min tolerance
void SetMinTolerance (const Standard_Real theMinToler);
//! Gives set max tolerance
Standard_Real MaxTolerance() const;
//! Sets max tolerance.
void SetMaxTolerance (const Standard_Real theMaxToler);
//! Returns mode for sewing faces By default - true.
Standard_Boolean FaceMode() const;
//! Sets mode for sewing faces By default - true.
void SetFaceMode (const Standard_Boolean theFaceMode);
//! Returns mode for sewing floating edges By default - false.
Standard_Boolean FloatingEdgesMode() const;
//! Sets mode for sewing floating edges By default - false.
//! Returns mode for cutting floating edges By default - false.
//! Sets mode for cutting floating edges By default - false.
void SetFloatingEdgesMode (const Standard_Boolean theFloatingEdgesMode);
//! Returns mode for accounting of local tolerances
//! of edges and vertices during of merging.
Standard_Boolean LocalTolerancesMode() const;
//! Sets mode for accounting of local tolerances
//! of edges and vertices during of merging
//! in this case WorkTolerance = myTolerance + tolEdge1+ tolEdg2;
void SetLocalTolerancesMode (const Standard_Boolean theLocalTolerancesMode);
//! Sets mode for non-manifold sewing.
void SetNonManifoldMode (const Standard_Boolean theNonManifoldMode);
//! Gets mode for non-manifold sewing.
//!
//! INTERNAL FUCTIONS ---
Standard_Boolean NonManifoldMode() const;
DEFINE_STANDARD_RTTI(BRepBuilderAPI_Sewing,MMgt_TShared)
protected:
//! Performs cutting of sections
//! thePI - progress indicator of processing
Standard_EXPORT void Cutting (const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT void Merging (const Standard_Boolean passage, const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT Standard_Boolean IsMergedClosed (const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const TopoDS_Face& fase) const;
Standard_EXPORT Standard_Boolean FindCandidates (TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfInteger& seqOrientations);
Standard_EXPORT void AnalysisNearestEdges (const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, TColStd_SequenceOfInteger& seqOrientations, const Standard_Boolean evalDist = Standard_True);
//! Merged nearest edges.
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfInteger& SeqMergedOri);
Standard_EXPORT void EdgeProcessing (const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT void CreateOutputInformations();
//! Defines if surface is U closed.
Standard_EXPORT virtual Standard_Boolean IsUClosedSurface (const Handle(Geom_Surface)& surf, const TopoDS_Shape& theEdge, const TopLoc_Location& theloc) const;
//! Defines if surface is V closed.
Standard_EXPORT virtual Standard_Boolean IsVClosedSurface (const Handle(Geom_Surface)& surf, const TopoDS_Shape& theEdge, const TopLoc_Location& theloc) const;
//! This method is called from Perform only
//! thePI - progress indicator of processing
Standard_EXPORT virtual void FaceAnalysis (const Handle(Message_ProgressIndicator)& thePI = 0);
//! This method is called from Perform only
Standard_EXPORT virtual void FindFreeBoundaries();
//! This method is called from Perform only
//! thePI - progress indicator of processing
Standard_EXPORT virtual void VerticesAssembling (const Handle(Message_ProgressIndicator)& thePI = 0);
//! This method is called from Perform only
Standard_EXPORT virtual void CreateSewedShape();
//! Get wire from free edges.
//! This method is called from EdgeProcessing only
Standard_EXPORT virtual void GetFreeWires (TopTools_MapOfShape& MapFreeEdges, TopTools_SequenceOfShape& seqWires);
//! This method is called from MergingOfSections only
Standard_EXPORT virtual void EvaluateAngulars (TopTools_SequenceOfShape& sequenceSec, TColStd_Array1OfBoolean& secForward, TColStd_Array1OfReal& tabAng, const Standard_Integer indRef) const;
//! This method is called from MergingOfSections only
Standard_EXPORT virtual void EvaluateDistances (TopTools_SequenceOfShape& sequenceSec, TColStd_Array1OfBoolean& secForward, TColStd_Array1OfReal& tabAng, TColStd_Array1OfReal& arrLen, TColStd_Array1OfReal& tabMinDist, const Standard_Integer indRef) const;
//! This method is called from SameParameterEdge only
Standard_EXPORT virtual Handle(Geom2d_Curve) SameRange (const Handle(Geom2d_Curve)& CurvePtr, const Standard_Real FirstOnCurve, const Standard_Real LastOnCurve, const Standard_Real RequestedFirst, const Standard_Real RequestedLast) const;
//! This method is called from SameParameterEdge only
Standard_EXPORT virtual void SameParameter (const TopoDS_Edge& edge) const;
//! This method is called from Merging only
Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, const TColStd_SequenceOfInteger& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape);
//! This method is called from Merging only
Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Edge& edge1, const TopoDS_Edge& edge2, const TopTools_ListOfShape& listFaces1, const TopTools_ListOfShape& listFaces2, const Standard_Boolean secForward, Standard_Integer& whichSec, const Standard_Boolean firstCall = Standard_True);
//! Projects points on curve
//! This method is called from Cutting only
Standard_EXPORT void ProjectPointsOnCurve (const TColgp_Array1OfPnt& arrPnt, const Handle(Geom_Curve)& Crv, const Standard_Real first, const Standard_Real last, TColStd_Array1OfReal& arrDist, TColStd_Array1OfReal& arrPara, TColgp_Array1OfPnt& arrProj, const Standard_Boolean isConsiderEnds) const;
//! Creates cutting vertices on projections
//! This method is called from Cutting only
Standard_EXPORT virtual void CreateCuttingNodes (const TopTools_IndexedMapOfShape& MapVert, const TopoDS_Shape& bound, const TopoDS_Shape& vfirst, const TopoDS_Shape& vlast, const TColStd_Array1OfReal& arrDist, const TColStd_Array1OfReal& arrPara, const TColgp_Array1OfPnt& arrPnt, TopTools_SequenceOfShape& seqNode, TColStd_SequenceOfReal& seqPara);
//! Performs cutting of bound
//! This method is called from Cutting only
Standard_EXPORT virtual void CreateSections (const TopoDS_Shape& bound, const TopTools_SequenceOfShape& seqNode, const TColStd_SequenceOfReal& seqPara, TopTools_ListOfShape& listEdge);
//! Makes all edges from shape same parameter
//! if SameParameterMode is equal to Standard_True
//! This method is called from Perform only
Standard_EXPORT virtual void SameParameterShape();
Standard_Real myTolerance;
Standard_Boolean mySewing;
Standard_Boolean myAnalysis;
Standard_Boolean myCutting;
Standard_Boolean myNonmanifold;
TopTools_IndexedDataMapOfShapeShape myOldShapes;
TopoDS_Shape mySewedShape;
TopTools_IndexedMapOfShape myDegenerated;
TopTools_IndexedMapOfShape myFreeEdges;
TopTools_IndexedMapOfShape myMultipleEdges;
TopTools_IndexedDataMapOfShapeListOfShape myContigousEdges;
TopTools_DataMapOfShapeShape myContigSecBound;
Standard_Integer myNbShapes;
Standard_Integer myNbVertices;
Standard_Integer myNbEdges;
TopTools_IndexedDataMapOfShapeListOfShape myBoundFaces;
TopTools_DataMapOfShapeListOfShape myBoundSections;
TopTools_DataMapOfShapeShape mySectionBound;
TopTools_IndexedDataMapOfShapeShape myVertexNode;
TopTools_IndexedDataMapOfShapeShape myVertexNodeFree;
TopTools_DataMapOfShapeListOfShape myNodeSections;
TopTools_DataMapOfShapeListOfShape myCuttingNode;
TopTools_IndexedMapOfShape myLittleFace;
TopoDS_Shape myShape;
Handle(BRepTools_ReShape) myReShape;
private:
Standard_Boolean myFaceMode;
Standard_Boolean myFloatingEdgesMode;
Standard_Boolean mySameParameterMode;
Standard_Boolean myLocalToleranceMode;
Standard_Real myMinTolerance;
Standard_Real myMaxTolerance;
TopTools_MapOfShape myMergedEdges;
};
#include <BRepBuilderAPI_Sewing.lxx>
#endif // _BRepBuilderAPI_Sewing_HeaderFile

View File

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

View File

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

View File

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

@@ -14,17 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_Transform.ixx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepTools_TrsfModification.hxx>
#include <gp.hxx>
#include <gp_Trsf.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepBuilderAPI_Transform
//purpose :
//=======================================================================
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const gp_Trsf& T) :
myTrsf(T)
{

View File

@@ -0,0 +1,113 @@
// Created on: 1994-12-09
// Created by: Jacques GOUSSARD
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Transform_HeaderFile
#define _BRepBuilderAPI_Transform_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Trsf.hxx>
#include <TopLoc_Location.hxx>
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <TopTools_ListOfShape.hxx>
class Standard_NoSuchObject;
class gp_Trsf;
class TopoDS_Shape;
//! 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.
class BRepBuilderAPI_Transform : public BRepBuilderAPI_ModifyShape
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a framework for applying the geometric
//! transformation T to a shape. Use the function Perform
//! to define the shape to transform.
Standard_EXPORT BRepBuilderAPI_Transform(const gp_Trsf& T);
//! 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>.
Standard_EXPORT BRepBuilderAPI_Transform(const TopoDS_Shape& S, const gp_Trsf& T, const Standard_Boolean Copy = Standard_False);
//! 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.
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
//! Returns the modified shape corresponding to <S>.
Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
protected:
private:
gp_Trsf myTrsf;
TopLoc_Location myLocation;
Standard_Boolean myUseModif;
};
#endif // _BRepBuilderAPI_Transform_HeaderFile

View File

@@ -0,0 +1,28 @@
// Created on: 1993-07-06
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_TransitionMode_HeaderFile
#define _BRepBuilderAPI_TransitionMode_HeaderFile
//! Option to manage discontinuities in Sweep
enum BRepBuilderAPI_TransitionMode
{
BRepBuilderAPI_Transformed,
BRepBuilderAPI_RightCorner,
BRepBuilderAPI_RoundCorner
};
#endif // _BRepBuilderAPI_TransitionMode_HeaderFile

View File

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

View File

@@ -1,5 +1,51 @@
BRepBuilderAPI_VertexInspector.hxx
BRepBuilderAPI_CellFilter.hxx
BRepBuilderAPI.cxx
BRepBuilderAPI.hxx
BRepBuilderAPI_BndBoxTreeSelector.hxx
BRepBuilderAPI_FastSewing.hxx
BRepBuilderAPI_CellFilter.hxx
BRepBuilderAPI_Collect.cxx
BRepBuilderAPI_Collect.hxx
BRepBuilderAPI_Command.cxx
BRepBuilderAPI_Command.hxx
BRepBuilderAPI_Copy.cxx
BRepBuilderAPI_Copy.hxx
BRepBuilderAPI_EdgeError.hxx
BRepBuilderAPI_FaceError.hxx
BRepBuilderAPI_FastSewing.cxx
BRepBuilderAPI_FastSewing.hxx
BRepBuilderAPI_FindPlane.cxx
BRepBuilderAPI_FindPlane.hxx
BRepBuilderAPI_GTransform.cxx
BRepBuilderAPI_GTransform.hxx
BRepBuilderAPI_MakeEdge.cxx
BRepBuilderAPI_MakeEdge.hxx
BRepBuilderAPI_MakeEdge2d.cxx
BRepBuilderAPI_MakeEdge2d.hxx
BRepBuilderAPI_MakeFace.cxx
BRepBuilderAPI_MakeFace.hxx
BRepBuilderAPI_MakePolygon.cxx
BRepBuilderAPI_MakePolygon.hxx
BRepBuilderAPI_MakeShape.cxx
BRepBuilderAPI_MakeShape.hxx
BRepBuilderAPI_MakeShell.cxx
BRepBuilderAPI_MakeShell.hxx
BRepBuilderAPI_MakeSolid.cxx
BRepBuilderAPI_MakeSolid.hxx
BRepBuilderAPI_MakeVertex.cxx
BRepBuilderAPI_MakeVertex.hxx
BRepBuilderAPI_MakeWire.cxx
BRepBuilderAPI_MakeWire.hxx
BRepBuilderAPI_ModifyShape.cxx
BRepBuilderAPI_ModifyShape.hxx
BRepBuilderAPI_NurbsConvert.cxx
BRepBuilderAPI_NurbsConvert.hxx
BRepBuilderAPI_PipeError.hxx
BRepBuilderAPI_Sewing.cxx
BRepBuilderAPI_Sewing.hxx
BRepBuilderAPI_Sewing.lxx
BRepBuilderAPI_ShapeModification.hxx
BRepBuilderAPI_ShellError.hxx
BRepBuilderAPI_Transform.cxx
BRepBuilderAPI_Transform.hxx
BRepBuilderAPI_TransitionMode.hxx
BRepBuilderAPI_VertexInspector.hxx
BRepBuilderAPI_WireError.hxx