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:
@@ -1,324 +0,0 @@
|
||||
-- Created on: 1993-12-15
|
||||
-- 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 BRepLib
|
||||
|
||||
---Purpose: The BRepLib package provides general utilities for
|
||||
-- BRep.
|
||||
--
|
||||
-- * FindSurface : Class to compute a surface through
|
||||
-- a set of edges.
|
||||
--
|
||||
-- * Compute missing 3d curve on an edge.
|
||||
|
||||
uses
|
||||
Standard,
|
||||
StdFail,
|
||||
gp,
|
||||
Geom,
|
||||
GeomAbs,
|
||||
Geom2d,
|
||||
TopoDS,
|
||||
TopLoc,
|
||||
TopTools,
|
||||
TopAbs
|
||||
|
||||
is
|
||||
|
||||
enumeration EdgeError is
|
||||
---Purpose: Errors that can occur at edge construction.
|
||||
EdgeDone, -- no error
|
||||
PointProjectionFailed,
|
||||
ParameterOutOfRange,
|
||||
DifferentPointsOnClosedCurve,
|
||||
PointWithInfiniteParameter,
|
||||
DifferentsPointAndParameter,
|
||||
LineThroughIdenticPoints
|
||||
end EdgeError;
|
||||
|
||||
|
||||
enumeration WireError is
|
||||
---Purpose: Errors that can occur at wire construction.
|
||||
WireDone, -- no error
|
||||
EmptyWire,
|
||||
DisconnectedWire,
|
||||
NonManifoldWire
|
||||
|
||||
end WireError;
|
||||
|
||||
|
||||
enumeration FaceError is
|
||||
---Purpose: Errors that can occur at face construction.
|
||||
FaceDone, -- no error
|
||||
NoFace, -- not initialised
|
||||
NotPlanar,
|
||||
CurveProjectionFailed,
|
||||
ParametersOutOfRange
|
||||
|
||||
end FaceError;
|
||||
|
||||
|
||||
enumeration ShellError is
|
||||
---Purpose: Errors that can occur at shell construction.
|
||||
|
||||
ShellDone, -- no error
|
||||
EmptyShell,
|
||||
DisconnectedShell,
|
||||
ShellParametersOutOfRange
|
||||
|
||||
end ShellError;
|
||||
|
||||
enumeration ShapeModification is
|
||||
---Purpose: Modification type after a topologic operation.
|
||||
|
||||
Preserved, -- no modification
|
||||
Deleted,
|
||||
Trimmed,
|
||||
Merged,
|
||||
BoundaryModified
|
||||
|
||||
end ShapeModification;
|
||||
|
||||
deferred class Command;
|
||||
|
||||
deferred class MakeShape;
|
||||
|
||||
--
|
||||
-- Construction of topology from geometry
|
||||
--
|
||||
|
||||
class MakeVertex;
|
||||
|
||||
class MakeEdge;
|
||||
|
||||
class MakeEdge2d;
|
||||
|
||||
class MakePolygon;
|
||||
|
||||
class MakeFace;
|
||||
|
||||
--
|
||||
-- Construction of composite topologies
|
||||
--
|
||||
|
||||
class MakeWire;
|
||||
|
||||
class MakeShell;
|
||||
|
||||
class MakeSolid;
|
||||
|
||||
|
||||
|
||||
|
||||
--- END of API commands.
|
||||
|
||||
|
||||
|
||||
|
||||
class FindSurface;
|
||||
|
||||
class FuseEdges;
|
||||
---Purpose:
|
||||
|
||||
class CheckCurveOnSurface;
|
||||
---Purpose:
|
||||
-- Computes the max distance between edge
|
||||
-- and its 2d representation on the face.
|
||||
|
||||
--
|
||||
-- Default precison methods.
|
||||
-- The default precision is initialized with Precision::Confusion()
|
||||
--
|
||||
|
||||
Precision(P : Real);
|
||||
---Purpose: Sets the default precision. The current Precision
|
||||
-- is returned.
|
||||
---Level: Public
|
||||
|
||||
Precision returns Real;
|
||||
---Purpose: Returns the default precision.
|
||||
---Level: Public
|
||||
|
||||
|
||||
--
|
||||
-- Default plane for 2d edges.
|
||||
--
|
||||
|
||||
Plane(P : Plane from Geom);
|
||||
---Purpose: Sets the current plane to P.
|
||||
---Level: Public
|
||||
|
||||
Plane returns Plane from Geom;
|
||||
---Purpose: Returns the current plane.
|
||||
--
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
|
||||
|
||||
|
||||
CheckSameRange(E : Edge from TopoDS ;
|
||||
Confusion : Real from Standard = 1.0e-12)
|
||||
returns Boolean;
|
||||
|
||||
---Purpose: checks if the Edge is same range IGNORING
|
||||
-- the same range flag of the edge
|
||||
-- Confusion argument is to compare real numbers
|
||||
-- idenpendently of any model space tolerance
|
||||
--
|
||||
|
||||
|
||||
SameRange(E : Edge from TopoDS ;
|
||||
Tolerance : Real from Standard = 1.0e-5) ;
|
||||
---Purpose: will make all the curve representation have
|
||||
-- the same range domain for the parameters.
|
||||
-- This will IGNORE the same range flag value
|
||||
-- to proceed.
|
||||
-- If there is a 3D curve there it will the
|
||||
-- range of that curve. If not the first curve representation
|
||||
-- encountered in the list will give its range to
|
||||
-- the all the other curves.
|
||||
|
||||
BuildCurve3d(E : Edge from TopoDS ;
|
||||
Tolerance : Real from Standard = 1.0e-5 ;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C1;
|
||||
MaxDegree : Integer = 14;
|
||||
MaxSegment : Integer = 0 --30
|
||||
) returns Boolean;
|
||||
---Purpose: Computes the 3d curve for the edge <E> if it does
|
||||
-- not exist. Returns True if the curve was computed
|
||||
-- or existed. Returns False if there is no planar
|
||||
-- pcurve or the computation failed.
|
||||
-- <MaxSegment> >= 30 in approximation
|
||||
|
||||
BuildCurves3d(S : Shape from TopoDS ;
|
||||
Tolerance : Real from Standard;
|
||||
Continuity : Shape from GeomAbs = GeomAbs_C1;
|
||||
MaxDegree : Integer = 14;
|
||||
MaxSegment : Integer = 0 --30
|
||||
) returns Boolean;
|
||||
|
||||
---Purpose: Computes the 3d curves for all the edges of <S>
|
||||
-- return False if one of the computation failed.
|
||||
-- <MaxSegment> >= 30 in approximation
|
||||
|
||||
BuildCurves3d(S : Shape from TopoDS)
|
||||
returns Boolean;
|
||||
|
||||
---Purpose: Computes the 3d curves for all the edges of <S>
|
||||
-- return False if one of the computation failed.
|
||||
|
||||
|
||||
--
|
||||
--
|
||||
UpdateEdgeTol( E : Edge from TopoDS ;
|
||||
MinToleranceRequest : Real from Standard ;
|
||||
MaxToleranceToCheck : Real from Standard)
|
||||
---Purpose: Checks if the edge has a Tolerance smaller than -- --
|
||||
-- -- -- MaxToleranceToCheck if so it will compute the
|
||||
-- radius of -- the cylindrical pipe surface that
|
||||
-- MinToleranceRequest is the minimum tolerance before it
|
||||
-- is usefull to start testing. Usually it should be arround
|
||||
-- 10e-5
|
||||
-- contains all -- the curve represenation of the edge
|
||||
-- returns True if the Edge tolerance had to be updated
|
||||
returns Boolean ;
|
||||
|
||||
|
||||
UpdateEdgeTolerance(S : Shape from TopoDS;
|
||||
MinToleranceRequest : Real from Standard ;
|
||||
MaxToleranceToCheck : Real from Standard)
|
||||
|
||||
---Purpose: -- Checks all the edges of the shape whose -- -- --
|
||||
-- Tolerance is smaller than MaxToleranceToCheck --
|
||||
-- Returns True if at least one edge was updated --
|
||||
-- MinToleranceRequest is the minimum tolerance before
|
||||
-- -- it -- is usefull to start testing. Usually it
|
||||
-- should be arround -- 10e-5--
|
||||
--
|
||||
-- Warning :The method is very slow as it checks all.
|
||||
-- Use only in interfaces or processing assimilate batch
|
||||
--
|
||||
|
||||
returns Boolean ;
|
||||
|
||||
SameParameter(E: Edge from TopoDS;
|
||||
Tolerance : Real from Standard = 1.0e-5);
|
||||
---Purpose: Computes new 2d curve(s) for the edge <E> to have
|
||||
-- the same parameter as the 3d curve.
|
||||
-- The algorithm is not done if the flag SameParameter
|
||||
-- was True on the Edge.
|
||||
|
||||
|
||||
|
||||
SameParameter(S: Shape from TopoDS ;
|
||||
Tolerance : Real from Standard = 1.0e-5;
|
||||
forced : Boolean from Standard = Standard_False);
|
||||
---Purpose: Computes new 2d curve(s) for all the edges of <S>
|
||||
-- to have the same parameter as the 3d curve.
|
||||
-- The algorithm is not done if the flag SameParameter
|
||||
-- was True on an Edge.
|
||||
|
||||
UpdateTolerances(S: Shape from TopoDS;
|
||||
verifyFaceTolerance : Boolean from Standard = Standard_False);
|
||||
---Purpose: Replaces tolerance of FACE EDGE VERTEX by the
|
||||
-- tolerance Max of their connected handling shapes.
|
||||
-- It is not necessary to use this call after
|
||||
-- SameParameter. (called in)
|
||||
|
||||
OrientClosedSolid(solid : in out Solid from TopoDS)
|
||||
---Purpose: Orients the solid forward and the shell with the
|
||||
-- orientation to have matter in the solid. Returns
|
||||
-- False if the solid is unOrientable (open or incoherent)
|
||||
returns Boolean;
|
||||
|
||||
|
||||
EncodeRegularity(S : Shape from TopoDS;
|
||||
TolAng : Real from Standard = 1.0e-10);
|
||||
---Purpose: Encodes the Regularity of edges on a Shape.
|
||||
-- Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
-- Warning: If the edges's regularity are coded before, nothing
|
||||
-- is done.
|
||||
|
||||
EncodeRegularity(S : in out Edge from TopoDS;
|
||||
F1, F2 : Face from TopoDS;
|
||||
TolAng : Real from Standard = 1.0e-10);
|
||||
---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E>
|
||||
-- Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
-- Warning: If the edge's regularity is coded before, nothing
|
||||
-- is done.
|
||||
|
||||
SortFaces (S : Shape from TopoDS;
|
||||
LF : in out ListOfShape from TopTools);
|
||||
---Purpose: Sorts in LF the Faces of S on the complexity of
|
||||
-- their surfaces
|
||||
-- (Plane,Cylinder,Cone,Sphere,Torus,other)
|
||||
|
||||
ReverseSortFaces (S : Shape from TopoDS;
|
||||
LF : in out ListOfShape from TopTools);
|
||||
---Purpose: Sorts in LF the Faces of S on the reverse
|
||||
-- complexity of their surfaces
|
||||
-- (other,Torus,Sphere,Cone,Cylinder,Plane)
|
||||
|
||||
EnsureNormalConsistency (S : Shape from TopoDS;
|
||||
theAngTol: Real from Standard = 0.001;
|
||||
ForceComputeNormals: Boolean from Standard = Standard_False)
|
||||
returns Boolean;
|
||||
---Purpose: Corrects the normals in Poly_Triangulation of faces,
|
||||
-- in such way that normals at nodes lying along smooth
|
||||
-- edges have the same value on both adjacent triangulations.
|
||||
-- Returns TRUE if any correction is done.
|
||||
|
||||
end BRepLib;
|
@@ -17,75 +17,76 @@
|
||||
//pmn 26/09/97 Add parameters of approximation in BuildCurve3d
|
||||
// Modified by skv - Thu Jun 3 12:39:19 2004 OCC5898
|
||||
|
||||
#include <BRepLib.ixx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_HCurve2d.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <Approx_CurvilinearParameter.hxx>
|
||||
#include <Approx_SameParameter.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepAdaptor_HCurve2d.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <GeomLProp_SLProps.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <BRep_ListOfCurveRepresentation.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <AdvApprox_ApproxAFunction.hxx>
|
||||
#include <Approx_SameParameter.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_MapOfTransient.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <Approx_CurvilinearParameter.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TShort_HArray1OfShortReal.hxx>
|
||||
#include <GeomLProp_SLProps.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
|
||||
// TODO - not thread-safe static variables
|
||||
static Standard_Real thePrecision = Precision::Confusion();
|
||||
|
219
src/BRepLib/BRepLib.hxx
Normal file
219
src/BRepLib/BRepLib.hxx
Normal file
@@ -0,0 +1,219 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_HeaderFile
|
||||
#define _BRepLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class Geom_Plane;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Solid;
|
||||
class TopoDS_Face;
|
||||
class BRepLib_Command;
|
||||
class BRepLib_MakeShape;
|
||||
class BRepLib_MakeVertex;
|
||||
class BRepLib_MakeEdge;
|
||||
class BRepLib_MakeEdge2d;
|
||||
class BRepLib_MakePolygon;
|
||||
class BRepLib_MakeFace;
|
||||
class BRepLib_MakeWire;
|
||||
class BRepLib_MakeShell;
|
||||
class BRepLib_MakeSolid;
|
||||
class BRepLib_FindSurface;
|
||||
class BRepLib_FuseEdges;
|
||||
class BRepLib_CheckCurveOnSurface;
|
||||
|
||||
|
||||
//! The BRepLib package provides general utilities for
|
||||
//! BRep.
|
||||
//!
|
||||
//! * FindSurface : Class to compute a surface through
|
||||
//! a set of edges.
|
||||
//!
|
||||
//! * Compute missing 3d curve on an edge.
|
||||
class BRepLib
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Computes the max distance between edge
|
||||
//! and its 2d representation on the face.
|
||||
//! 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();
|
||||
|
||||
//! Sets the current plane to P.
|
||||
Standard_EXPORT static void Plane (const Handle(Geom_Plane)& P);
|
||||
|
||||
//! Returns the current plane.
|
||||
Standard_EXPORT static const Handle(Geom_Plane)& Plane();
|
||||
|
||||
//! checks if the Edge is same range IGNORING
|
||||
//! the same range flag of the edge
|
||||
//! Confusion argument is to compare real numbers
|
||||
//! idenpendently of any model space tolerance
|
||||
Standard_EXPORT static Standard_Boolean CheckSameRange (const TopoDS_Edge& E, const Standard_Real Confusion = 1.0e-12);
|
||||
|
||||
//! will make all the curve representation have
|
||||
//! the same range domain for the parameters.
|
||||
//! This will IGNORE the same range flag value
|
||||
//! to proceed.
|
||||
//! If there is a 3D curve there it will the
|
||||
//! range of that curve. If not the first curve representation
|
||||
//! encountered in the list will give its range to
|
||||
//! the all the other curves.
|
||||
Standard_EXPORT static void SameRange (const TopoDS_Edge& E, const Standard_Real Tolerance = 1.0e-5);
|
||||
|
||||
//! Computes the 3d curve for the edge <E> if it does
|
||||
//! not exist. Returns True if the curve was computed
|
||||
//! or existed. Returns False if there is no planar
|
||||
//! pcurve or the computation failed.
|
||||
//! <MaxSegment> >= 30 in approximation
|
||||
Standard_EXPORT static Standard_Boolean BuildCurve3d (const TopoDS_Edge& E, const Standard_Real Tolerance = 1.0e-5, const GeomAbs_Shape Continuity = GeomAbs_C1, const Standard_Integer MaxDegree = 14, const Standard_Integer MaxSegment = 0);
|
||||
|
||||
//! Computes the 3d curves for all the edges of <S>
|
||||
//! return False if one of the computation failed.
|
||||
//! <MaxSegment> >= 30 in approximation
|
||||
Standard_EXPORT static Standard_Boolean BuildCurves3d (const TopoDS_Shape& S, const Standard_Real Tolerance, const GeomAbs_Shape Continuity = GeomAbs_C1, const Standard_Integer MaxDegree = 14, const Standard_Integer MaxSegment = 0);
|
||||
|
||||
//! Computes the 3d curves for all the edges of <S>
|
||||
//! return False if one of the computation failed.
|
||||
Standard_EXPORT static Standard_Boolean BuildCurves3d (const TopoDS_Shape& S);
|
||||
|
||||
//! Checks if the edge has a Tolerance smaller than -- --
|
||||
//! -- -- MaxToleranceToCheck if so it will compute the
|
||||
//! radius of -- the cylindrical pipe surface that
|
||||
//! MinToleranceRequest is the minimum tolerance before it
|
||||
//! is usefull to start testing. Usually it should be arround
|
||||
//! 10e-5
|
||||
//! contains all -- the curve represenation of the edge
|
||||
//! returns True if the Edge tolerance had to be updated
|
||||
Standard_EXPORT static Standard_Boolean UpdateEdgeTol (const TopoDS_Edge& E, const Standard_Real MinToleranceRequest, const Standard_Real MaxToleranceToCheck);
|
||||
|
||||
//! -- Checks all the edges of the shape whose -- -- --
|
||||
//! Tolerance is smaller than MaxToleranceToCheck --
|
||||
//! Returns True if at least one edge was updated --
|
||||
//! MinToleranceRequest is the minimum tolerance before
|
||||
//! -- it -- is usefull to start testing. Usually it
|
||||
//! should be arround -- 10e-5--
|
||||
//!
|
||||
//! Warning :The method is very slow as it checks all.
|
||||
//! Use only in interfaces or processing assimilate batch
|
||||
Standard_EXPORT static Standard_Boolean UpdateEdgeTolerance (const TopoDS_Shape& S, const Standard_Real MinToleranceRequest, const Standard_Real MaxToleranceToCheck);
|
||||
|
||||
//! Computes new 2d curve(s) for the edge <E> to have
|
||||
//! the same parameter as the 3d curve.
|
||||
//! The algorithm is not done if the flag SameParameter
|
||||
//! was True on the Edge.
|
||||
Standard_EXPORT static void SameParameter (const TopoDS_Edge& E, const Standard_Real Tolerance = 1.0e-5);
|
||||
|
||||
//! Computes new 2d curve(s) for all the edges of <S>
|
||||
//! to have the same parameter as the 3d curve.
|
||||
//! The algorithm is not done if the flag SameParameter
|
||||
//! was True on an Edge.
|
||||
Standard_EXPORT static void SameParameter (const TopoDS_Shape& S, const Standard_Real Tolerance = 1.0e-5, const Standard_Boolean forced = Standard_False);
|
||||
|
||||
//! Replaces tolerance of FACE EDGE VERTEX by the
|
||||
//! tolerance Max of their connected handling shapes.
|
||||
//! It is not necessary to use this call after
|
||||
//! SameParameter. (called in)
|
||||
Standard_EXPORT static void UpdateTolerances (const TopoDS_Shape& S, const Standard_Boolean verifyFaceTolerance = Standard_False);
|
||||
|
||||
//! Orients the solid forward and the shell with the
|
||||
//! orientation to have matter in the solid. Returns
|
||||
//! False if the solid is unOrientable (open or incoherent)
|
||||
Standard_EXPORT static Standard_Boolean OrientClosedSolid (TopoDS_Solid& solid);
|
||||
|
||||
//! Encodes the Regularity of edges on a Shape.
|
||||
//! Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
//! Warning: If the edges's regularity are coded before, nothing
|
||||
//! is done.
|
||||
Standard_EXPORT static void EncodeRegularity (const TopoDS_Shape& S, const Standard_Real TolAng = 1.0e-10);
|
||||
|
||||
//! Encodes the Regularity beetween <F1> and <F2> by <E>
|
||||
//! Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
//! Warning: If the edge's regularity is coded before, nothing
|
||||
//! is done.
|
||||
Standard_EXPORT static void EncodeRegularity (TopoDS_Edge& S, const TopoDS_Face& F1, const TopoDS_Face& F2, const Standard_Real TolAng = 1.0e-10);
|
||||
|
||||
//! Sorts in LF the Faces of S on the complexity of
|
||||
//! their surfaces
|
||||
//! (Plane,Cylinder,Cone,Sphere,Torus,other)
|
||||
Standard_EXPORT static void SortFaces (const TopoDS_Shape& S, TopTools_ListOfShape& LF);
|
||||
|
||||
//! Sorts in LF the Faces of S on the reverse
|
||||
//! complexity of their surfaces
|
||||
//! (other,Torus,Sphere,Cone,Cylinder,Plane)
|
||||
Standard_EXPORT static void ReverseSortFaces (const TopoDS_Shape& S, TopTools_ListOfShape& LF);
|
||||
|
||||
//! Corrects the normals in Poly_Triangulation of faces,
|
||||
//! in such way that normals at nodes lying along smooth
|
||||
//! edges have the same value on both adjacent triangulations.
|
||||
//! Returns TRUE if any correction is done.
|
||||
Standard_EXPORT static Standard_Boolean EnsureNormalConsistency (const TopoDS_Shape& S, const Standard_Real theAngTol = 0.001, const Standard_Boolean ForceComputeNormals = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class BRepLib_Command;
|
||||
friend class BRepLib_MakeShape;
|
||||
friend class BRepLib_MakeVertex;
|
||||
friend class BRepLib_MakeEdge;
|
||||
friend class BRepLib_MakeEdge2d;
|
||||
friend class BRepLib_MakePolygon;
|
||||
friend class BRepLib_MakeFace;
|
||||
friend class BRepLib_MakeWire;
|
||||
friend class BRepLib_MakeShell;
|
||||
friend class BRepLib_MakeSolid;
|
||||
friend class BRepLib_FindSurface;
|
||||
friend class BRepLib_FuseEdges;
|
||||
friend class BRepLib_CheckCurveOnSurface;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_HeaderFile
|
@@ -1,175 +0,0 @@
|
||||
-- Created by: Eugeny MALTCHIKOV
|
||||
-- Copyright (c) 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 CheckCurveOnSurface from BRepLib
|
||||
|
||||
---Purpose:
|
||||
-- Computes the max distance between edge and its
|
||||
-- 2d representation on the face.
|
||||
--
|
||||
-- The algorithm can be initialized in the following ways:
|
||||
-- 1. Input args are Edge and Face;
|
||||
-- 2. Input args are 3D curve, 2d curve, Surface and
|
||||
-- parametric range of the curve (first and last values).
|
||||
|
||||
uses
|
||||
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns CheckCurveOnSurface from BRepLib;
|
||||
---Purpose:
|
||||
-- Empty contructor
|
||||
|
||||
Create(
|
||||
theEdge : Edge from TopoDS;
|
||||
theFace : Face from TopoDS);
|
||||
---Purpose:
|
||||
-- Contructor
|
||||
|
||||
Create(
|
||||
theCurve : Curve from Geom;
|
||||
thePCurve : Curve from Geom2d;
|
||||
theSurface : Surface from Geom;
|
||||
theFirst : Real from Standard;
|
||||
theLast : Real from Standard);
|
||||
---Purpose:
|
||||
-- Contructor
|
||||
|
||||
Init(me:out;
|
||||
theEdge : Edge from TopoDS;
|
||||
theFace : Face from TopoDS);
|
||||
---Purpose:
|
||||
-- Sets the data for the algorithm
|
||||
|
||||
Init(me:out;
|
||||
theCurve : Curve from Geom;
|
||||
thePCurve : Curve from Geom2d;
|
||||
theSurface : Surface from Geom;
|
||||
theFirst : Real from Standard;
|
||||
theLast : Real from Standard);
|
||||
---Purpose:
|
||||
-- Sets the data for the algorithm
|
||||
|
||||
Curve(me)
|
||||
returns Curve from Geom;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
-- Returns my3DCurve
|
||||
|
||||
PCurve(me)
|
||||
returns Curve from Geom2d;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
-- Returns my2DCurve
|
||||
|
||||
PCurve2(me)
|
||||
returns Curve from Geom2d;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
-- Returns my2DCurve
|
||||
|
||||
Surface(me)
|
||||
returns Surface from Geom;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
---Purpose:
|
||||
-- Returns mySurface
|
||||
|
||||
Range(me:out;
|
||||
theFirst : out Real from Standard;
|
||||
theLast : out Real from Standard);
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns the range
|
||||
|
||||
-- computations
|
||||
--
|
||||
Perform(me:out;
|
||||
isTheMultyTheradDisabled : Boolean from Standard = Standard_False);
|
||||
---Purpose:
|
||||
-- Performs the calculation
|
||||
-- If isTheMultyTheadDisabled == TRUE then computation will be made
|
||||
-- without any parallelization.
|
||||
|
||||
CheckData(me:out)
|
||||
is protected;
|
||||
---Purpose:
|
||||
-- Checks the data
|
||||
|
||||
Compute(me:out;
|
||||
thePCurve : Curve from Geom2d;
|
||||
isTheMultyTheradDisabled : Boolean from Standard)
|
||||
is protected;
|
||||
---Purpose:
|
||||
-- Computes the max distance for the 3d curve <myCurve>
|
||||
-- and 2d curve <thePCurve>
|
||||
-- If isTheMultyTheadDisabled == TRUE then computation will be made
|
||||
-- without any parallelization.
|
||||
|
||||
-- results
|
||||
--
|
||||
IsDone(me)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns true if the max distance has been found
|
||||
|
||||
ErrorStatus(me)
|
||||
returns Integer from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns error status
|
||||
-- The possible values are:
|
||||
-- 0 - OK;
|
||||
-- 1 - null curve or surface or 2d curve;
|
||||
-- 2 - invalid parametric range;
|
||||
-- 3 - error in calculations.
|
||||
|
||||
MaxDistance(me)
|
||||
returns Real from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns max distance
|
||||
|
||||
MaxParameter(me)
|
||||
returns Real from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns parameter in which the distance is maximal
|
||||
|
||||
fields
|
||||
-- source data
|
||||
myCurve : Curve from Geom;
|
||||
myPCurve : Curve from Geom2d;
|
||||
-- 2nd p-curve (for closed surface)
|
||||
myPCurve2 : Curve from Geom2d;
|
||||
mySurface : Surface from Geom;
|
||||
myFirst : Real from Standard;
|
||||
myLast : Real from Standard;
|
||||
-- result
|
||||
myErrorStatus : Integer from Standard;
|
||||
myMaxDistance : Real from Standard;
|
||||
myMaxParameter : Real from Standard;
|
||||
|
||||
end CheckCurveOnSurface;
|
@@ -12,47 +12,39 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_CheckCurveOnSurface.ixx>
|
||||
|
||||
#include <Adaptor2d_HCurve2d.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <BRepLib_CheckCurveOnSurface.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
#include <Geom2dAdaptor_GHCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
|
||||
#include <GeomProjLib.hxx>
|
||||
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
#include <OSD_Parallel.hxx>
|
||||
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_MultipleVarFunctionWithHessian.hxx>
|
||||
#include <math_NewtonMinimum.hxx>
|
||||
#include <math_PSO.hxx>
|
||||
#include <math_PSOParticlesPool.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <OSD_Parallel.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
class BRepLib_CheckCurveOnSurface_TargetFunc;
|
||||
|
||||
|
158
src/BRepLib/BRepLib_CheckCurveOnSurface.hxx
Normal file
158
src/BRepLib/BRepLib_CheckCurveOnSurface.hxx
Normal file
@@ -0,0 +1,158 @@
|
||||
// Created by: Eugeny MALTCHIKOV
|
||||
// Copyright (c) 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 _BRepLib_CheckCurveOnSurface_HeaderFile
|
||||
#define _BRepLib_CheckCurveOnSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
class Geom_Surface;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
|
||||
//! Computes the max distance between edge and its
|
||||
//! 2d representation on the face.
|
||||
//!
|
||||
//! The algorithm can be initialized in the following ways:
|
||||
//! 1. Input args are Edge and Face;
|
||||
//! 2. Input args are 3D curve, 2d curve, Surface and
|
||||
//! parametric range of the curve (first and last values).
|
||||
class BRepLib_CheckCurveOnSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Empty contructor
|
||||
Standard_EXPORT BRepLib_CheckCurveOnSurface();
|
||||
|
||||
|
||||
//! Contructor
|
||||
Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
|
||||
|
||||
|
||||
//! Contructor
|
||||
Standard_EXPORT BRepLib_CheckCurveOnSurface(const Handle(Geom_Curve)& theCurve, const Handle(Geom2d_Curve)& thePCurve, const Handle(Geom_Surface)& theSurface, const Standard_Real theFirst, const Standard_Real theLast);
|
||||
|
||||
|
||||
//! Sets the data for the algorithm
|
||||
Standard_EXPORT void Init (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
|
||||
|
||||
|
||||
//! Sets the data for the algorithm
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& theCurve, const Handle(Geom2d_Curve)& thePCurve, const Handle(Geom_Surface)& theSurface, const Standard_Real theFirst, const Standard_Real theLast);
|
||||
|
||||
|
||||
//! Returns my3DCurve
|
||||
const Handle(Geom_Curve)& Curve() const;
|
||||
|
||||
|
||||
//! Returns my2DCurve
|
||||
const Handle(Geom2d_Curve)& PCurve() const;
|
||||
|
||||
|
||||
//! Returns my2DCurve
|
||||
const Handle(Geom2d_Curve)& PCurve2() const;
|
||||
|
||||
|
||||
//! Returns mySurface
|
||||
const Handle(Geom_Surface)& Surface() const;
|
||||
|
||||
|
||||
//! Returns the range
|
||||
void Range (Standard_Real& theFirst, Standard_Real& theLast);
|
||||
|
||||
|
||||
//! Performs the calculation
|
||||
//! If isTheMultyTheadDisabled == TRUE then computation will be made
|
||||
//! without any parallelization.
|
||||
Standard_EXPORT void Perform (const Standard_Boolean isTheMultyTheradDisabled = Standard_False);
|
||||
|
||||
|
||||
//! Returns true if the max distance has been found
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
|
||||
//! Returns error status
|
||||
//! The possible values are:
|
||||
//! 0 - OK;
|
||||
//! 1 - null curve or surface or 2d curve;
|
||||
//! 2 - invalid parametric range;
|
||||
//! 3 - error in calculations.
|
||||
Standard_Integer ErrorStatus() const;
|
||||
|
||||
|
||||
//! Returns max distance
|
||||
Standard_Real MaxDistance() const;
|
||||
|
||||
|
||||
//! Returns parameter in which the distance is maximal
|
||||
Standard_Real MaxParameter() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
//! Checks the data
|
||||
Standard_EXPORT void CheckData();
|
||||
|
||||
|
||||
//! Computes the max distance for the 3d curve <myCurve>
|
||||
//! and 2d curve <thePCurve>
|
||||
//! If isTheMultyTheadDisabled == TRUE then computation will be made
|
||||
//! without any parallelization.
|
||||
Standard_EXPORT void Compute (const Handle(Geom2d_Curve)& thePCurve, const Standard_Boolean isTheMultyTheradDisabled);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Curve) myCurve;
|
||||
Handle(Geom2d_Curve) myPCurve;
|
||||
Handle(Geom2d_Curve) myPCurve2;
|
||||
Handle(Geom_Surface) mySurface;
|
||||
Standard_Real myFirst;
|
||||
Standard_Real myLast;
|
||||
Standard_Integer myErrorStatus;
|
||||
Standard_Real myMaxDistance;
|
||||
Standard_Real myMaxParameter;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <BRepLib_CheckCurveOnSurface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_CheckCurveOnSurface_HeaderFile
|
@@ -1,64 +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 BRepLib
|
||||
|
||||
---Purpose: Root class for all commands in BRepLib.
|
||||
--
|
||||
-- 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 ~BRepLib_Command(){Delete() ; }"
|
||||
|
||||
Initialize;
|
||||
---Purpose: Set done to False.
|
||||
|
||||
IsDone(me) returns Boolean
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
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;
|
@@ -14,13 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_Command.ixx>
|
||||
|
||||
#include <BRepLib_Command.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_Command
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_Command::BRepLib_Command() :
|
||||
myDone(Standard_False)
|
||||
{
|
||||
|
85
src/BRepLib/BRepLib_Command.hxx
Normal file
85
src/BRepLib/BRepLib_Command.hxx
Normal 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 _BRepLib_Command_HeaderFile
|
||||
#define _BRepLib_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 BRepLib.
|
||||
//!
|
||||
//! Provides :
|
||||
//!
|
||||
//! * Managements of the notDone flag.
|
||||
//!
|
||||
//! * Catching of exceptions (not implemented).
|
||||
//!
|
||||
//! * Logging (not implemented).
|
||||
class BRepLib_Command
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Delete();
|
||||
Standard_EXPORT virtual ~BRepLib_Command(){Delete() ; }
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! Raises NotDone if done is false.
|
||||
Standard_EXPORT void Check() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Set done to False.
|
||||
Standard_EXPORT BRepLib_Command();
|
||||
|
||||
//! Set done to true.
|
||||
Standard_EXPORT void Done();
|
||||
|
||||
//! Set done to false.
|
||||
Standard_EXPORT void NotDone();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myDone;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_Command_HeaderFile
|
33
src/BRepLib/BRepLib_EdgeError.hxx
Normal file
33
src/BRepLib/BRepLib_EdgeError.hxx
Normal file
@@ -0,0 +1,33 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_EdgeError_HeaderFile
|
||||
#define _BRepLib_EdgeError_HeaderFile
|
||||
|
||||
//! Errors that can occur at edge construction.
|
||||
//! no error
|
||||
enum BRepLib_EdgeError
|
||||
{
|
||||
BRepLib_EdgeDone,
|
||||
BRepLib_PointProjectionFailed,
|
||||
BRepLib_ParameterOutOfRange,
|
||||
BRepLib_DifferentPointsOnClosedCurve,
|
||||
BRepLib_PointWithInfiniteParameter,
|
||||
BRepLib_DifferentsPointAndParameter,
|
||||
BRepLib_LineThroughIdenticPoints
|
||||
};
|
||||
|
||||
#endif // _BRepLib_EdgeError_HeaderFile
|
32
src/BRepLib/BRepLib_FaceError.hxx
Normal file
32
src/BRepLib/BRepLib_FaceError.hxx
Normal file
@@ -0,0 +1,32 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_FaceError_HeaderFile
|
||||
#define _BRepLib_FaceError_HeaderFile
|
||||
|
||||
//! Errors that can occur at face construction.
|
||||
//! no error
|
||||
//! not initialised
|
||||
enum BRepLib_FaceError
|
||||
{
|
||||
BRepLib_FaceDone,
|
||||
BRepLib_NoFace,
|
||||
BRepLib_NotPlanar,
|
||||
BRepLib_CurveProjectionFailed,
|
||||
BRepLib_ParametersOutOfRange
|
||||
};
|
||||
|
||||
#endif // _BRepLib_FaceError_HeaderFile
|
@@ -1,109 +0,0 @@
|
||||
-- Created on: 1994-07-22
|
||||
-- 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.
|
||||
|
||||
class FindSurface from BRepLib
|
||||
|
||||
---Purpose: Provides an algorithm to find a Surface through a
|
||||
-- set of edges.
|
||||
--
|
||||
-- The edges of the shape given as argument are
|
||||
-- explored if they are not coplanar at the required
|
||||
-- tolerance the method Found returns false.
|
||||
--
|
||||
-- If a null tolerance is given the max of the edges
|
||||
-- tolerances is used.
|
||||
--
|
||||
-- The method Tolerance returns the true distance of
|
||||
-- the edges to the Surface.
|
||||
--
|
||||
-- The method Surface returns the Surface if found.
|
||||
--
|
||||
-- The method Existed returns returns True if the
|
||||
-- Surface was already attached to some of the edges.
|
||||
--
|
||||
-- When Existed returns True the Surface may have a
|
||||
-- location given by the Location method.
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
Location from TopLoc,
|
||||
Surface from Geom
|
||||
|
||||
raises
|
||||
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns FindSurface from BRepLib;
|
||||
|
||||
Create (S : Shape from TopoDS;
|
||||
Tol : Real from Standard = -1;
|
||||
OnlyPlane : Boolean from Standard = Standard_False;
|
||||
OnlyClosed: Boolean from Standard = Standard_False)
|
||||
---Purpose: Computes the Surface from the edges of <S> with the
|
||||
-- given tolerance.
|
||||
-- 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.
|
||||
-- If <OnlyClosed> is true, then S sould be a wire
|
||||
-- and the existing surface, on which wire S is not
|
||||
-- closed in 2D, will be ignored.
|
||||
returns FindSurface from BRepLib;
|
||||
|
||||
Init (me : in out;
|
||||
S : Shape from TopoDS;
|
||||
Tol : Real from Standard = -1;
|
||||
OnlyPlane : Boolean from Standard = Standard_False;
|
||||
OnlyClosed: Boolean from Standard = Standard_False)
|
||||
---Purpose: Computes the Surface from the edges of <S> with the
|
||||
-- given tolerance.
|
||||
-- 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.
|
||||
-- If <OnlyClosed> is true, then S sould be a wire
|
||||
-- and the existing surface, on which wire S is not
|
||||
-- closed in 2D, will be ignored.
|
||||
is static;
|
||||
|
||||
Found(me) returns Boolean
|
||||
is static;
|
||||
|
||||
Surface(me) returns Surface from Geom
|
||||
is static;
|
||||
|
||||
Tolerance(me) returns Real
|
||||
is static;
|
||||
|
||||
ToleranceReached(me) returns Real
|
||||
is static;
|
||||
|
||||
Existed(me) returns Boolean
|
||||
is static;
|
||||
|
||||
Location(me) returns Location from TopLoc
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
mySurface : Surface from Geom;
|
||||
myTolerance : Real;
|
||||
myTolReached : Real;
|
||||
isExisted : Boolean;
|
||||
myLocation : Location from TopLoc;
|
||||
|
||||
end FindSurface;
|
@@ -14,46 +14,47 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_FindSurface.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepLib_FindSurface.hxx>
|
||||
#include <BRepLib_MakeFace.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
|
||||
#include <GeomLib.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <gp_Hypr.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Parab.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Controle
|
||||
|
122
src/BRepLib/BRepLib_FindSurface.hxx
Normal file
122
src/BRepLib/BRepLib_FindSurface.hxx
Normal file
@@ -0,0 +1,122 @@
|
||||
// Created on: 1994-07-22
|
||||
// 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 _BRepLib_FindSurface_HeaderFile
|
||||
#define _BRepLib_FindSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
class Geom_Surface;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class TopLoc_Location;
|
||||
|
||||
|
||||
//! Provides an algorithm to find a Surface through a
|
||||
//! set of edges.
|
||||
//!
|
||||
//! The edges of the shape given as argument are
|
||||
//! explored if they are not coplanar at the required
|
||||
//! tolerance the method Found returns false.
|
||||
//!
|
||||
//! If a null tolerance is given the max of the edges
|
||||
//! tolerances is used.
|
||||
//!
|
||||
//! The method Tolerance returns the true distance of
|
||||
//! the edges to the Surface.
|
||||
//!
|
||||
//! The method Surface returns the Surface if found.
|
||||
//!
|
||||
//! The method Existed returns returns True if the
|
||||
//! Surface was already attached to some of the edges.
|
||||
//!
|
||||
//! When Existed returns True the Surface may have a
|
||||
//! location given by the Location method.
|
||||
class BRepLib_FindSurface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepLib_FindSurface();
|
||||
|
||||
//! Computes the Surface from the edges of <S> with the
|
||||
//! given tolerance.
|
||||
//! 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.
|
||||
//! If <OnlyClosed> is true, then S sould be a wire
|
||||
//! and the existing surface, on which wire S is not
|
||||
//! closed in 2D, will be ignored.
|
||||
Standard_EXPORT BRepLib_FindSurface(const TopoDS_Shape& S, const Standard_Real Tol = -1, const Standard_Boolean OnlyPlane = Standard_False, const Standard_Boolean OnlyClosed = Standard_False);
|
||||
|
||||
//! Computes the Surface from the edges of <S> with the
|
||||
//! given tolerance.
|
||||
//! 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.
|
||||
//! If <OnlyClosed> is true, then S sould be a wire
|
||||
//! and the existing surface, on which wire S is not
|
||||
//! closed in 2D, will be ignored.
|
||||
Standard_EXPORT void Init (const TopoDS_Shape& S, const Standard_Real Tol = -1, const Standard_Boolean OnlyPlane = Standard_False, const Standard_Boolean OnlyClosed = Standard_False);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Found() const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Surface) Surface() const;
|
||||
|
||||
Standard_EXPORT Standard_Real Tolerance() const;
|
||||
|
||||
Standard_EXPORT Standard_Real ToleranceReached() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean Existed() const;
|
||||
|
||||
Standard_EXPORT TopLoc_Location Location() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Surface) mySurface;
|
||||
Standard_Real myTolerance;
|
||||
Standard_Real myTolReached;
|
||||
Standard_Boolean isExisted;
|
||||
TopLoc_Location myLocation;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_FindSurface_HeaderFile
|
@@ -1,148 +0,0 @@
|
||||
-- Created on: 2007-09-10
|
||||
-- Created by: Igor FEOKTISTOV
|
||||
-- Copyright (c) 2007-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 FuseEdges from BRepLib
|
||||
|
||||
---Purpose: This class can detect vertices in a face that can
|
||||
-- be considered useless and then perform the fuse of
|
||||
-- the edges and remove the useless vertices. By
|
||||
-- useles vertices, we mean :
|
||||
-- * vertices that have exactly two connex edges
|
||||
-- * the edges connex to the vertex must have
|
||||
-- exactly the same 2 connex faces .
|
||||
-- * The edges connex to the vertex must have the
|
||||
-- same geometric support.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
MapOfShape from TopTools,
|
||||
ListOfShape from TopTools,
|
||||
DataMapOfIntegerListOfShape from TopTools,
|
||||
DataMapOfIntegerShape from TopTools,
|
||||
DataMapOfShapeShape from TopTools,
|
||||
IndexedDataMapOfShapeListOfShape from TopTools,
|
||||
IndexedMapOfShape from TopTools
|
||||
|
||||
raises
|
||||
ConstructionError from Standard,
|
||||
NullObject from Standard
|
||||
|
||||
is
|
||||
Create (theShape : Shape from TopoDS;
|
||||
PerformNow : Boolean from Standard = Standard_False)
|
||||
returns FuseEdges from BRepLib
|
||||
raises NullObject from Standard;
|
||||
---Purpose: Initialise members and build construction of map
|
||||
-- of ancestors.
|
||||
|
||||
AvoidEdges (me : in out; theMapEdg : IndexedMapOfShape from TopTools);
|
||||
---Purpose: set edges to avoid being fused
|
||||
|
||||
-- Modified by IFV 19.04.07
|
||||
SetConcatBSpl(me : in out; theConcatBSpl : Boolean from Standard = Standard_True);
|
||||
---Purpose: set mode to enable concatenation G1 BSpline edges in one
|
||||
-- End Modified by IFV 19.04.07
|
||||
|
||||
Edges (me : in out ; theMapLstEdg : in out DataMapOfIntegerListOfShape from TopTools);
|
||||
---Purpose: returns all the list of edges to be fused
|
||||
-- each list of the map represent a set of connex edges
|
||||
-- that can be fused.
|
||||
|
||||
ResultEdges (me : in out ; theMapEdg : in out DataMapOfIntegerShape from TopTools);
|
||||
---Purpose: returns all the fused edges. each integer entry in
|
||||
-- the map corresponds to the integer in the
|
||||
-- DataMapOfIntegerListOfShape we get in method
|
||||
-- Edges. That is to say, to the list of edges in
|
||||
-- theMapLstEdg(i) corresponds the resulting edge theMapEdge(i)
|
||||
--
|
||||
|
||||
|
||||
Faces (me: in out; theMapFac : in out DataMapOfShapeShape from TopTools);
|
||||
---Purpose: returns the map of modified faces.
|
||||
|
||||
Shape (me : in out)
|
||||
returns Shape from TopoDS
|
||||
raises NullObject from Standard;
|
||||
---Purpose: returns myShape modified with the list of internal
|
||||
-- edges removed from it.
|
||||
---C++: return &
|
||||
|
||||
NbVertices (me : in out)
|
||||
returns Integer from Standard
|
||||
raises NullObject from Standard;
|
||||
---Purpose: returns the number of vertices candidate to be removed
|
||||
---C++: return const
|
||||
|
||||
Perform (me : in out);
|
||||
---Purpose: Using map of list of connex edges, fuse each list to
|
||||
-- one edge and then update myShape
|
||||
|
||||
|
||||
BuildAncestors (me; S: Shape from TopoDS; TS: ShapeEnum from TopAbs;
|
||||
TA: ShapeEnum from TopAbs; M: in out IndexedDataMapOfShapeListOfShape from TopTools)
|
||||
---Purpose: build a map of shapes and ancestors, like
|
||||
-- TopExp.MapShapesAndAncestors, but we remove duplicate
|
||||
-- shapes in list of shapes.
|
||||
is private;
|
||||
|
||||
BuildListEdges (me : in out)
|
||||
---Purpose: Build the all the lists of edges that are to be fused
|
||||
is private;
|
||||
|
||||
BuildListResultEdges (me : in out)
|
||||
---Purpose: Build result fused edges according to the list
|
||||
-- builtin BuildLisEdges
|
||||
is private;
|
||||
|
||||
BuildListConnexEdge (me : in out; theEdge : Shape from TopoDS; theMapUniq : in out MapOfShape from TopTools;
|
||||
theLstEdg : in out ListOfShape from TopTools)
|
||||
is private;
|
||||
|
||||
NextConnexEdge (me; theVertex : Vertex from TopoDS; theEdge : Shape from TopoDS;
|
||||
theEdgeConnex : in out Shape from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
|
||||
SameSupport (me; E1 : Edge from TopoDS; E2 :Edge from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
|
||||
UpdatePCurve (me; theOldEdge : Edge from TopoDS;
|
||||
theNewEdge : in out Edge from TopoDS;
|
||||
theLstEdg : ListOfShape from TopTools)
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
|
||||
|
||||
fields
|
||||
myShape : Shape from TopoDS;
|
||||
myShapeDone : Boolean from Standard;
|
||||
myEdgesDone : Boolean from Standard;
|
||||
myResultEdgesDone : Boolean from Standard;
|
||||
myMapVerLstEdg : IndexedDataMapOfShapeListOfShape from TopTools;
|
||||
myMapEdgLstFac : IndexedDataMapOfShapeListOfShape from TopTools;
|
||||
myMapLstEdg : DataMapOfIntegerListOfShape from TopTools;
|
||||
myMapEdg : DataMapOfIntegerShape from TopTools;
|
||||
myMapFaces : DataMapOfShapeShape from TopTools;
|
||||
myNbConnexEdge : Integer from Standard;
|
||||
myAvoidEdg : IndexedMapOfShape from TopTools;
|
||||
-- Modified by IFV 19.04.07
|
||||
myConcatBSpl : Boolean from Standard; -- to enable concatenation of G1 BSpline
|
||||
-- edges
|
||||
|
||||
end FuseEdges;
|
@@ -19,68 +19,61 @@
|
||||
// Modif : Thu Jan 21 11:40:20 1999. Add trace context #if DEB
|
||||
// add test to avoid loop while in NextConnexEdge (in case of a closed connex wire)
|
||||
|
||||
|
||||
#include <BRepLib_FuseEdges.ixx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
|
||||
#include <GeomLib.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_BoundedCurve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_FuseEdges.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepTools_Substitution.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Trsf2d.hxx>
|
||||
|
||||
#include <BRepTools_Substitution.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
#include <Geom2dConvert_CompCurveToBSplineCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <Geom2d_BoundedCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dConvert_CompCurveToBSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BoundedCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <Geom2d_BoundedCurve.hxx>
|
||||
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Trsf2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//#ifdef OCCT_DEBUG
|
||||
//Standard_IMPORT Standard_Boolean TopOpeBRepBuild_GettraceFE();
|
||||
//#endif
|
||||
|
||||
static void BCSmoothing(Handle(Geom_BSplineCurve)& theC,
|
||||
const Standard_Integer theCont,
|
||||
const Standard_Real theTol)
|
||||
|
149
src/BRepLib/BRepLib_FuseEdges.hxx
Normal file
149
src/BRepLib/BRepLib_FuseEdges.hxx
Normal file
@@ -0,0 +1,149 @@
|
||||
// Created on: 2007-09-10
|
||||
// Created by: Igor FEOKTISTOV
|
||||
// Copyright (c) 2007-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 _BRepLib_FuseEdges_HeaderFile
|
||||
#define _BRepLib_FuseEdges_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfIntegerShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class Standard_ConstructionError;
|
||||
class Standard_NullObject;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Vertex;
|
||||
class TopoDS_Edge;
|
||||
|
||||
|
||||
//! This class can detect vertices in a face that can
|
||||
//! be considered useless and then perform the fuse of
|
||||
//! the edges and remove the useless vertices. By
|
||||
//! useles vertices, we mean :
|
||||
//! * vertices that have exactly two connex edges
|
||||
//! * the edges connex to the vertex must have
|
||||
//! exactly the same 2 connex faces .
|
||||
//! * The edges connex to the vertex must have the
|
||||
//! same geometric support.
|
||||
class BRepLib_FuseEdges
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Initialise members and build construction of map
|
||||
//! of ancestors.
|
||||
Standard_EXPORT BRepLib_FuseEdges(const TopoDS_Shape& theShape, const Standard_Boolean PerformNow = Standard_False);
|
||||
|
||||
//! set edges to avoid being fused
|
||||
Standard_EXPORT void AvoidEdges (const TopTools_IndexedMapOfShape& theMapEdg);
|
||||
|
||||
//! set mode to enable concatenation G1 BSpline edges in one
|
||||
//! End Modified by IFV 19.04.07
|
||||
Standard_EXPORT void SetConcatBSpl (const Standard_Boolean theConcatBSpl = Standard_True);
|
||||
|
||||
//! returns all the list of edges to be fused
|
||||
//! each list of the map represent a set of connex edges
|
||||
//! that can be fused.
|
||||
Standard_EXPORT void Edges (TopTools_DataMapOfIntegerListOfShape& theMapLstEdg);
|
||||
|
||||
//! returns all the fused edges. each integer entry in
|
||||
//! the map corresponds to the integer in the
|
||||
//! DataMapOfIntegerListOfShape we get in method
|
||||
//! Edges. That is to say, to the list of edges in
|
||||
//! theMapLstEdg(i) corresponds the resulting edge theMapEdge(i)
|
||||
Standard_EXPORT void ResultEdges (TopTools_DataMapOfIntegerShape& theMapEdg);
|
||||
|
||||
//! returns the map of modified faces.
|
||||
Standard_EXPORT void Faces (TopTools_DataMapOfShapeShape& theMapFac);
|
||||
|
||||
//! returns myShape modified with the list of internal
|
||||
//! edges removed from it.
|
||||
Standard_EXPORT TopoDS_Shape& Shape();
|
||||
|
||||
//! returns the number of vertices candidate to be removed
|
||||
Standard_EXPORT const Standard_Integer NbVertices();
|
||||
|
||||
//! Using map of list of connex edges, fuse each list to
|
||||
//! one edge and then update myShape
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! build a map of shapes and ancestors, like
|
||||
//! TopExp.MapShapesAndAncestors, but we remove duplicate
|
||||
//! shapes in list of shapes.
|
||||
Standard_EXPORT void BuildAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M) const;
|
||||
|
||||
//! Build the all the lists of edges that are to be fused
|
||||
Standard_EXPORT void BuildListEdges();
|
||||
|
||||
//! Build result fused edges according to the list
|
||||
//! builtin BuildLisEdges
|
||||
Standard_EXPORT void BuildListResultEdges();
|
||||
|
||||
Standard_EXPORT void BuildListConnexEdge (const TopoDS_Shape& theEdge, TopTools_MapOfShape& theMapUniq, TopTools_ListOfShape& theLstEdg);
|
||||
|
||||
Standard_EXPORT Standard_Boolean NextConnexEdge (const TopoDS_Vertex& theVertex, const TopoDS_Shape& theEdge, TopoDS_Shape& theEdgeConnex) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean SameSupport (const TopoDS_Edge& E1, const TopoDS_Edge& E2) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean UpdatePCurve (const TopoDS_Edge& theOldEdge, TopoDS_Edge& theNewEdge, const TopTools_ListOfShape& theLstEdg) const;
|
||||
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Boolean myShapeDone;
|
||||
Standard_Boolean myEdgesDone;
|
||||
Standard_Boolean myResultEdgesDone;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myMapVerLstEdg;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myMapEdgLstFac;
|
||||
TopTools_DataMapOfIntegerListOfShape myMapLstEdg;
|
||||
TopTools_DataMapOfIntegerShape myMapEdg;
|
||||
TopTools_DataMapOfShapeShape myMapFaces;
|
||||
Standard_Integer myNbConnexEdge;
|
||||
TopTools_IndexedMapOfShape myAvoidEdg;
|
||||
Standard_Boolean myConcatBSpl;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_FuseEdges_HeaderFile
|
@@ -1,356 +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 BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---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 BRepLib,
|
||||
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
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Points
|
||||
----------------------------------------
|
||||
|
||||
Create(V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(P1, P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Lin
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Lin from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Lin from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Lin from gp; P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Lin from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Circ
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Circ from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Circ from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Circ from gp; P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Circ from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Elips
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Elips from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Elips from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Elips from gp; P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Elips from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Hypr
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Hypr from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Hypr from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Hypr from gp; P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Hypr from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Parab
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Parab from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Parab from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Parab from gp; P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Parab from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Curve
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Curve from Geom)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom;
|
||||
P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom;
|
||||
V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom;
|
||||
P1,P2 : Pnt from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom;
|
||||
V1, V2 : Vertex from TopoDS;
|
||||
p1, p2 :Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Curve and surface
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom;
|
||||
P1,P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom;
|
||||
V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom;
|
||||
P1,P2 : Pnt from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; S : Surface from Geom;
|
||||
V1, V2 : Vertex from TopoDS;
|
||||
p1, p2 :Real)
|
||||
---Level: Public
|
||||
returns MakeEdge from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- 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;
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Results
|
||||
----------------------------------------
|
||||
|
||||
Error(me) returns EdgeError from BRepLib
|
||||
---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
|
||||
|
||||
myError : EdgeError from BRepLib;
|
||||
myVertex1 : Vertex from TopoDS;
|
||||
myVertex2 : Vertex from TopoDS;
|
||||
|
||||
end MakeEdge;
|
@@ -17,33 +17,43 @@
|
||||
// Modified: Wed Oct 23 09:17:47 1996
|
||||
// check ponctuallity (PRO4896)
|
||||
|
||||
#include <BRepLib_MakeEdge.ixx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Ellipse.hxx>
|
||||
#include <Geom_Hyperbola.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Parabola.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <gp.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 <Precision.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Project
|
||||
//purpose : project a vertex on a curve
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean Project(const Handle(Geom_Curve)& C,
|
||||
const TopoDS_Vertex& V,
|
||||
Standard_Real& p)
|
||||
|
212
src/BRepLib/BRepLib_MakeEdge.hxx
Normal file
212
src/BRepLib/BRepLib_MakeEdge.hxx
Normal file
@@ -0,0 +1,212 @@
|
||||
// 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 _BRepLib_MakeEdge_HeaderFile
|
||||
#define _BRepLib_MakeEdge_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_EdgeError.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <Standard_Real.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 BRepLib_MakeEdge : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge();
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Lin& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Circ& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Elips& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Hypr& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const gp_Parab& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const gp_Pnt& P1, const gp_Pnt& P2, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge(const Handle(Geom2d_Curve)& L, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_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);
|
||||
|
||||
Standard_EXPORT BRepLib_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);
|
||||
|
||||
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 the error description when NotDone.
|
||||
Standard_EXPORT BRepLib_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_EdgeError myError;
|
||||
TopoDS_Vertex myVertex1;
|
||||
TopoDS_Vertex myVertex2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeEdge_HeaderFile
|
@@ -1,289 +0,0 @@
|
||||
-- Created on: 1995-01-04
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- 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 MakeEdge2d from BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---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 BRepLib,
|
||||
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
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
----------------------------------------
|
||||
-- Points
|
||||
----------------------------------------
|
||||
|
||||
Create(V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(P1, P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Lin
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Lin2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Lin2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Lin2d from gp; P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Lin2d from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Circ
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Circ2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Circ2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Circ2d from gp; P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Circ2d from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Elips
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Elips2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Elips2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Elips2d from gp; P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Elips2d from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Hypr
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Hypr2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Hypr2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Hypr2d from gp; P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Hypr2d from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Parab
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Parab2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Parab2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Parab2d from gp; P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Parab2d from gp; V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- Curve
|
||||
----------------------------------------
|
||||
|
||||
Create(L : Curve from Geom2d)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d;
|
||||
P1,P2 : Pnt2d from gp)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d;
|
||||
V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d;
|
||||
P1,P2 : Pnt2d from gp; p1,p2 : Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
Create(L : Curve from Geom2d;
|
||||
V1, V2 : Vertex from TopoDS;
|
||||
p1, p2 :Real)
|
||||
---Level: Public
|
||||
returns MakeEdge2d from BRepLib;
|
||||
|
||||
----------------------------------------
|
||||
-- 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
|
||||
----------------------------------------
|
||||
|
||||
Error(me)
|
||||
returns EdgeError from BRepLib
|
||||
---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
|
||||
|
||||
myError : EdgeError from BRepLib;
|
||||
myVertex1 : Vertex from TopoDS;
|
||||
myVertex2 : Vertex from TopoDS;
|
||||
|
||||
end MakeEdge2d;
|
@@ -14,32 +14,40 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeEdge2d.ixx>
|
||||
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Extrema_ExtPC2d.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeEdge2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtPC2d.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <gp.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 <Precision.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Point
|
||||
//purpose : make a 3d point on the current plane
|
||||
//=======================================================================
|
||||
|
||||
static gp_Pnt Point(const gp_Pnt2d& P)
|
||||
{
|
||||
return BRepLib::Plane()->Value(P.X(),P.Y());
|
||||
|
184
src/BRepLib/BRepLib_MakeEdge2d.hxx
Normal file
184
src/BRepLib/BRepLib_MakeEdge2d.hxx
Normal file
@@ -0,0 +1,184 @@
|
||||
// Created on: 1995-01-04
|
||||
// Created by: Bruno DUMORTIER
|
||||
// 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 _BRepLib_MakeEdge2d_HeaderFile
|
||||
#define _BRepLib_MakeEdge2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_EdgeError.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <Standard_Real.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 BRepLib_MakeEdge2d : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Lin2d& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Lin2d& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Lin2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Lin2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Circ2d& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Circ2d& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Circ2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Circ2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Elips2d& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Elips2d& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Elips2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Elips2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Hypr2d& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Hypr2d& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Hypr2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Hypr2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Parab2d& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Parab2d& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Parab2d& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const gp_Parab2d& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const Handle(Geom2d_Curve)& L);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const Handle(Geom2d_Curve)& L, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const Handle(Geom2d_Curve)& L, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakeEdge2d(const Handle(Geom2d_Curve)& L, const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Real p1, const Standard_Real p2);
|
||||
|
||||
Standard_EXPORT BRepLib_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);
|
||||
|
||||
//! Returns the error description when NotDone.
|
||||
Standard_EXPORT BRepLib_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_EdgeError myError;
|
||||
TopoDS_Vertex myVertex1;
|
||||
TopoDS_Vertex myVertex2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeEdge2d_HeaderFile
|
@@ -1,276 +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.
|
||||
|
||||
class MakeFace from BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---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,
|
||||
Curve from Geom,
|
||||
Surface from Geom,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
FaceError from BRepLib
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Not done.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(F : Face from TopoDS)
|
||||
---Purpose: Load a face. Usefull to add wires.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- From a surface
|
||||
----------------------------------------------
|
||||
|
||||
Create(P : Pln from gp)
|
||||
---Purpose: Make a face from a plane.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(C : Cylinder from gp)
|
||||
---Purpose: Make a face from a cylinder.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(C : Cone from gp)
|
||||
---Purpose: Make a face from a cone.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(S : Sphere from gp)
|
||||
---Purpose: Make a face from a sphere.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(C : Torus from gp)
|
||||
---Purpose: Make a face from a torus.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
Create(C : Cylinder from gp; UMin, UMax, VMin, VMax : Real)
|
||||
---Purpose: Make a face from a cylinder.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(C : Cone from gp; UMin, UMax, VMin, VMax : Real)
|
||||
---Purpose: Make a face from a cone.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(S : Sphere from gp; UMin, UMax, VMin, VMax : Real)
|
||||
---Purpose: Make a face from a sphere.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(C : Torus from gp; UMin, UMax, VMin, VMax : Real)
|
||||
---Purpose: Make a face from a torus.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
Create(S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
|
||||
---Purpose: Make a face from a Surface. Accepts min & max parameters
|
||||
-- to construct the face's bounds. Also accepts tolerance value (TolDegen)
|
||||
-- for resolution of degenerated edges.
|
||||
---Level: Public
|
||||
returns MakeFace from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
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 BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- Auxiliary methods
|
||||
----------------------------------------------
|
||||
|
||||
Init(me : in out; F : Face from TopoDS)
|
||||
---Purpose: Load the face.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Init(me : in out; S : Surface from Geom; Bound : Boolean; TolDegen : Real)
|
||||
---Purpose: Creates the face from the surface. If Bound is
|
||||
-- True a wire is made from the natural bounds.
|
||||
-- Accepts tolerance value (TolDegen) for resolution
|
||||
-- of degenerated edges.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
|
||||
---Purpose: Creates the face from the surface and the min-max
|
||||
-- values. Accepts tolerance value (TolDegen) for resolution
|
||||
-- of degenerated edges.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Add(me : in out; W : Wire from TopoDS)
|
||||
---Purpose: Adds the wire <W> in the current face.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
----------------------------------------------
|
||||
-- Auxiliary methods
|
||||
----------------------------------------------
|
||||
|
||||
CheckInside(me : in out)
|
||||
---Purpose: Reorient the current face if the boundary is not
|
||||
-- finite.
|
||||
---Level: Public
|
||||
is static private;
|
||||
|
||||
----------------------------------------------
|
||||
-- Results
|
||||
----------------------------------------------
|
||||
|
||||
Error(me) returns FaceError from BRepLib
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Face(me) returns Face from TopoDS
|
||||
---Purpose: Returns the new face.
|
||||
--
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Face() const;"
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
IsDegenerated (myclass;
|
||||
theCurve : Curve from Geom;
|
||||
theMaxTol : Real from Standard;
|
||||
theActTol : in out Real from Standard)
|
||||
returns Boolean;
|
||||
--- Purpose: Checks the specified curve is degenerated
|
||||
-- according to specified tolerance.
|
||||
-- Returns <theActTol> less than <theMaxTol>, which shows
|
||||
-- actual tolerance to decide the curve is degenerated.
|
||||
-- Warning: For internal use of BRepLib_MakeFace and BRepLib_MakeShell.
|
||||
|
||||
fields
|
||||
myError : FaceError from BRepLib;
|
||||
end MakeFace;
|
@@ -14,45 +14,48 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeFace.ixx>
|
||||
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
|
||||
#include <Geom2d_Line.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
|
||||
#include <BRepLib_FindSurface.hxx>
|
||||
#include <BRepLib_MakeFace.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeFace::BRepLib_MakeFace() :
|
||||
myError(BRepLib_NoFace)
|
||||
{
|
||||
|
202
src/BRepLib/BRepLib_MakeFace.hxx
Normal file
202
src/BRepLib/BRepLib_MakeFace.hxx
Normal file
@@ -0,0 +1,202 @@
|
||||
// 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 _BRepLib_MakeFace_HeaderFile
|
||||
#define _BRepLib_MakeFace_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_FaceError.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.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;
|
||||
class Geom_Curve;
|
||||
|
||||
|
||||
//! 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 BRepLib_MakeFace : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Not done.
|
||||
Standard_EXPORT BRepLib_MakeFace();
|
||||
|
||||
//! Load a face. Usefull to add wires.
|
||||
Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F);
|
||||
|
||||
//! Make a face from a plane.
|
||||
Standard_EXPORT BRepLib_MakeFace(const gp_Pln& P);
|
||||
|
||||
//! Make a face from a cylinder.
|
||||
Standard_EXPORT BRepLib_MakeFace(const gp_Cylinder& C);
|
||||
|
||||
//! Make a face from a cone.
|
||||
Standard_EXPORT BRepLib_MakeFace(const gp_Cone& C);
|
||||
|
||||
//! Make a face from a sphere.
|
||||
Standard_EXPORT BRepLib_MakeFace(const gp_Sphere& S);
|
||||
|
||||
//! Make a face from a torus.
|
||||
Standard_EXPORT BRepLib_MakeFace(const gp_Torus& C);
|
||||
|
||||
//! Make a face from a Surface. Accepts tolerance value (TolDegen)
|
||||
//! for resolution of degenerated edges.
|
||||
Standard_EXPORT BRepLib_MakeFace(const Handle(Geom_Surface)& S, const Standard_Real TolDegen);
|
||||
|
||||
//! Make a face from a plane.
|
||||
Standard_EXPORT BRepLib_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 BRepLib_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 BRepLib_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 BRepLib_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 BRepLib_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 min & max parameters
|
||||
//! to construct the face's bounds. Also accepts tolerance value (TolDegen)
|
||||
//! for resolution of degenerated edges.
|
||||
Standard_EXPORT BRepLib_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 BRepLib_MakeFace(const TopoDS_Wire& W, const Standard_Boolean OnlyPlane = Standard_False);
|
||||
|
||||
//! Make a face from a plane and a wire.
|
||||
Standard_EXPORT BRepLib_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 BRepLib_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 BRepLib_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 BRepLib_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 BRepLib_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 BRepLib_MakeFace(const Handle(Geom_Surface)& S, const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True);
|
||||
|
||||
//! Adds the wire <W> in the face <F>
|
||||
Standard_EXPORT BRepLib_MakeFace(const TopoDS_Face& F, const TopoDS_Wire& W);
|
||||
|
||||
//! Load the face.
|
||||
Standard_EXPORT void Init (const TopoDS_Face& F);
|
||||
|
||||
//! Creates the face from the surface. If Bound is
|
||||
//! True a wire is made from the natural bounds.
|
||||
//! Accepts tolerance value (TolDegen) for resolution
|
||||
//! of degenerated edges.
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Boolean Bound, const Standard_Real TolDegen);
|
||||
|
||||
//! Creates the face from the surface and the min-max
|
||||
//! values. Accepts tolerance value (TolDegen) 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> in the current face.
|
||||
Standard_EXPORT void Add (const TopoDS_Wire& W);
|
||||
|
||||
Standard_EXPORT BRepLib_FaceError Error() const;
|
||||
|
||||
//! Returns the new face.
|
||||
Standard_EXPORT const TopoDS_Face& Face() const;
|
||||
Standard_EXPORT operator TopoDS_Face() const;
|
||||
|
||||
//! Checks the specified curve is degenerated
|
||||
//! according to specified tolerance.
|
||||
//! Returns <theActTol> less than <theMaxTol>, which shows
|
||||
//! actual tolerance to decide the curve is degenerated.
|
||||
//! Warning: For internal use of BRepLib_MakeFace and BRepLib_MakeShell.
|
||||
Standard_EXPORT static Standard_Boolean IsDegenerated (const Handle(Geom_Curve)& theCurve, const Standard_Real theMaxTol, Standard_Real& theActTol);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Reorient the current face if the boundary is not
|
||||
//! finite.
|
||||
Standard_EXPORT void CheckInside();
|
||||
|
||||
|
||||
BRepLib_FaceError myError;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeFace_HeaderFile
|
@@ -1,132 +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 BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---Purpose: Class to build polygonal wires.
|
||||
--
|
||||
-- A polygonal wire may be build from
|
||||
--
|
||||
-- - 2,4,3 points.
|
||||
--
|
||||
-- - 2,3,4 vertices.
|
||||
--
|
||||
-- - any number of points.
|
||||
--
|
||||
-- - any number of vertices.
|
||||
--
|
||||
--
|
||||
-- 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.
|
||||
|
||||
uses
|
||||
Wire from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Pnt from gp
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Create
|
||||
returns MakePolygon from BRepLib;
|
||||
---Purpose: Creates an empty MakePolygon.
|
||||
---Level: Public
|
||||
|
||||
Create(P1, P2 : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
Create(P1, P2, P3 : Pnt from gp;
|
||||
Close : Boolean = Standard_False)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
Create(P1, P2, P3, P4 : Pnt from gp;
|
||||
Close : Boolean = Standard_False)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
Create(V1, V2 : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
Create(V1, V2, V3 : Vertex from TopoDS;
|
||||
Close : Boolean = Standard_False)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
Create(V1, V2, V3, V4 : Vertex from TopoDS;
|
||||
Close : Boolean = Standard_False)
|
||||
---Level: Public
|
||||
returns MakePolygon from BRepLib;
|
||||
|
||||
|
||||
Add(me : in out; P : Pnt from gp)
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Add(me : in out; V : Vertex from TopoDS)
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Added(me) returns Boolean
|
||||
---Purpose: Returns True if the last vertex or point was
|
||||
-- succesfully added.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Close(me : in out)
|
||||
---Level: Public
|
||||
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;
|
||||
|
||||
Edge(me) returns Edge from TopoDS
|
||||
---Purpose: Returns the last edge added to the polygon.
|
||||
--
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Edge() const;"
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
Wire(me) returns Wire from TopoDS
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;"
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
myFirstVertex : Vertex from TopoDS;
|
||||
myLastVertex : Vertex from TopoDS;
|
||||
myEdge : Edge from TopoDS;
|
||||
|
||||
end MakePolygon;
|
@@ -14,20 +14,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakePolygon.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepLib_MakePolygon.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakePolygon
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakePolygon::BRepLib_MakePolygon()
|
||||
{
|
||||
}
|
||||
|
119
src/BRepLib/BRepLib_MakePolygon.hxx
Normal file
119
src/BRepLib/BRepLib_MakePolygon.hxx
Normal file
@@ -0,0 +1,119 @@
|
||||
// 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 _BRepLib_MakePolygon_HeaderFile
|
||||
#define _BRepLib_MakePolygon_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class StdFail_NotDone;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Vertex;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Wire;
|
||||
|
||||
|
||||
//! Class to build polygonal wires.
|
||||
//!
|
||||
//! A polygonal wire may be build from
|
||||
//!
|
||||
//! - 2,4,3 points.
|
||||
//!
|
||||
//! - 2,3,4 vertices.
|
||||
//!
|
||||
//! - any number of points.
|
||||
//!
|
||||
//! - any number of vertices.
|
||||
//!
|
||||
//! 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.
|
||||
class BRepLib_MakePolygon : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty MakePolygon.
|
||||
Standard_EXPORT BRepLib_MakePolygon();
|
||||
|
||||
Standard_EXPORT BRepLib_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakePolygon(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const Standard_Boolean Close = Standard_False);
|
||||
|
||||
Standard_EXPORT BRepLib_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 BRepLib_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);
|
||||
|
||||
Standard_EXPORT BRepLib_MakePolygon(const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const TopoDS_Vertex& V3, const Standard_Boolean Close = Standard_False);
|
||||
|
||||
Standard_EXPORT BRepLib_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);
|
||||
|
||||
Standard_EXPORT void Add (const TopoDS_Vertex& V);
|
||||
|
||||
//! Returns True if the last vertex or point was
|
||||
//! succesfully added.
|
||||
Standard_EXPORT Standard_Boolean Added() const;
|
||||
|
||||
Standard_EXPORT void Close();
|
||||
|
||||
Standard_EXPORT const TopoDS_Vertex& FirstVertex() const;
|
||||
|
||||
Standard_EXPORT const TopoDS_Vertex& LastVertex() const;
|
||||
|
||||
//! Returns the last edge added to the polygon.
|
||||
Standard_EXPORT const TopoDS_Edge& Edge() const;
|
||||
Standard_EXPORT operator TopoDS_Edge() const;
|
||||
|
||||
Standard_EXPORT const TopoDS_Wire& Wire() const;
|
||||
Standard_EXPORT operator TopoDS_Wire() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TopoDS_Vertex myFirstVertex;
|
||||
TopoDS_Vertex myLastVertex;
|
||||
TopoDS_Edge myEdge;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakePolygon_HeaderFile
|
@@ -1,112 +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 BRepLib inherits Command from BRepLib
|
||||
|
||||
---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,
|
||||
ShapeModification from BRepLib,
|
||||
ListOfShape from TopTools
|
||||
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Initialize;
|
||||
|
||||
Build(me : in out);
|
||||
---Purpose: This is called by Shape(). It does nothing but
|
||||
-- may be redefined.
|
||||
---Level: Public
|
||||
|
||||
Shape(me) returns Shape from TopoDS
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Shape() const;"
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
--- the following methods do nothing and must be redefined
|
||||
--- for faces creations.
|
||||
|
||||
FaceStatus(me; F: Face from TopoDS)
|
||||
---Purpose: returns the status of the Face after
|
||||
-- the shape creation.
|
||||
---Level: Public
|
||||
returns ShapeModification from BRepLib
|
||||
is virtual;
|
||||
|
||||
|
||||
HasDescendants(me; F: Face from TopoDS)
|
||||
---Purpose: Returns True if the Face generates new topology.
|
||||
---Level: Public
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
DescendantFaces(me: in out; F: Face from TopoDS)
|
||||
---Purpose: returns the list of generated Faces.
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
returns ListOfShape from TopTools
|
||||
is virtual;
|
||||
|
||||
|
||||
NbSurfaces(me)
|
||||
---Purpose: returns the number of surfaces
|
||||
-- after the shape creation.
|
||||
---Level: Public
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NewFaces(me: in out; I: Integer from Standard)
|
||||
---Purpose: Return the faces created for surface I.
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
returns ListOfShape from TopTools
|
||||
is virtual;
|
||||
|
||||
|
||||
FacesFromEdges(me: in out; E: Edge from TopoDS)
|
||||
---Purpose: returns a list of the created faces
|
||||
-- from the edge <E>.
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
returns ListOfShape from TopTools
|
||||
is virtual;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myShape : Shape from TopoDS is protected;
|
||||
myGenFaces: ListOfShape from TopTools is protected;
|
||||
myNewFaces: ListOfShape from TopTools is protected;
|
||||
myEdgFaces: ListOfShape from TopTools is protected;
|
||||
|
||||
end MakeShape;
|
@@ -14,13 +14,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeShape.ixx>
|
||||
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeShape::BRepLib_MakeShape()
|
||||
{
|
||||
}
|
||||
|
105
src/BRepLib/BRepLib_MakeShape.hxx
Normal file
105
src/BRepLib/BRepLib_MakeShape.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// 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 _BRepLib_MakeShape_HeaderFile
|
||||
#define _BRepLib_MakeShape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <BRepLib_Command.hxx>
|
||||
#include <BRepLib_ShapeModification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class StdFail_NotDone;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Edge;
|
||||
|
||||
|
||||
//! 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 BRepLib_MakeShape : public BRepLib_Command
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! This is called by Shape(). It does nothing but
|
||||
//! may be redefined.
|
||||
Standard_EXPORT void Build();
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Shape() const;
|
||||
Standard_EXPORT operator TopoDS_Shape() const;
|
||||
|
||||
//! returns the status of the Face after
|
||||
//! the shape creation.
|
||||
Standard_EXPORT virtual BRepLib_ShapeModification FaceStatus (const TopoDS_Face& F) const;
|
||||
|
||||
//! Returns True if the Face generates new topology.
|
||||
Standard_EXPORT virtual Standard_Boolean HasDescendants (const TopoDS_Face& F) const;
|
||||
|
||||
//! returns the list of generated Faces.
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& DescendantFaces (const TopoDS_Face& F);
|
||||
|
||||
//! returns the number of surfaces
|
||||
//! after the shape creation.
|
||||
Standard_EXPORT virtual Standard_Integer NbSurfaces() const;
|
||||
|
||||
//! Return the faces created for surface I.
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& NewFaces (const Standard_Integer I);
|
||||
|
||||
//! returns a list of the created faces
|
||||
//! from the edge <E>.
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& FacesFromEdges (const TopoDS_Edge& E);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT BRepLib_MakeShape();
|
||||
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
TopTools_ListOfShape myGenFaces;
|
||||
TopTools_ListOfShape myNewFaces;
|
||||
TopTools_ListOfShape myEdgFaces;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeShape_HeaderFile
|
@@ -1,89 +0,0 @@
|
||||
-- Created on: 1995-01-04
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- 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 MakeShell from BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---Purpose: Provides methos to build shells.
|
||||
--
|
||||
-- Build a shell from a set of faces.
|
||||
-- Build untied shell from a non C2 surface
|
||||
-- splitting it into C2-continuous parts.
|
||||
|
||||
uses
|
||||
|
||||
Surface from Geom,
|
||||
Shell from TopoDS,
|
||||
Face from TopoDS,
|
||||
ShellError from BRepLib
|
||||
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
Create
|
||||
---Purpose: Not done.
|
||||
---Level: Public
|
||||
returns MakeShell from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- From a set of face
|
||||
----------------------------------------------
|
||||
|
||||
----------------------------------------------
|
||||
-- From a surface
|
||||
----------------------------------------------
|
||||
|
||||
Create(S : Surface from Geom;
|
||||
Segment : Boolean from Standard = Standard_False)
|
||||
---Level: Public
|
||||
returns MakeShell from BRepLib;
|
||||
|
||||
Create(S : Surface from Geom; UMin, UMax, VMin, VMax : Real;
|
||||
Segment : Boolean from Standard = Standard_False)
|
||||
---Level: Public
|
||||
returns MakeShell from BRepLib;
|
||||
|
||||
Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax : Real;
|
||||
Segment : Boolean from Standard = Standard_False)
|
||||
---Purpose: Creates the shell from the surface and the min-max
|
||||
-- values.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
-- Results
|
||||
----------------------------------------------
|
||||
|
||||
Error(me) returns ShellError from BRepLib
|
||||
---Level: Public
|
||||
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
|
||||
myError : ShellError from BRepLib;
|
||||
|
||||
end MakeShell;
|
@@ -14,37 +14,34 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeShell.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeFace.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <BRepLib_MakeShell.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <TColGeom2d_Array1OfCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColGeom2d_Array1OfCurve.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeShell::BRepLib_MakeShell() :
|
||||
myError(BRepLib_EmptyShell)
|
||||
{
|
||||
|
86
src/BRepLib/BRepLib_MakeShell.hxx
Normal file
86
src/BRepLib/BRepLib_MakeShell.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 1995-01-04
|
||||
// Created by: Bruno DUMORTIER
|
||||
// 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 _BRepLib_MakeShell_HeaderFile
|
||||
#define _BRepLib_MakeShell_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_ShellError.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Geom_Surface;
|
||||
class TopoDS_Shell;
|
||||
|
||||
|
||||
//! Provides methos to build shells.
|
||||
//!
|
||||
//! Build a shell from a set of faces.
|
||||
//! Build untied shell from a non C2 surface
|
||||
//! splitting it into C2-continuous parts.
|
||||
class BRepLib_MakeShell : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Not done.
|
||||
Standard_EXPORT BRepLib_MakeShell();
|
||||
|
||||
Standard_EXPORT BRepLib_MakeShell(const Handle(Geom_Surface)& S, const Standard_Boolean Segment = Standard_False);
|
||||
|
||||
Standard_EXPORT BRepLib_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);
|
||||
|
||||
//! Creates the shell from the surface and the min-max
|
||||
//! values.
|
||||
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);
|
||||
|
||||
Standard_EXPORT BRepLib_ShellError Error() const;
|
||||
|
||||
//! Returns the new Shell.
|
||||
Standard_EXPORT const TopoDS_Shell& Shell() const;
|
||||
Standard_EXPORT operator TopoDS_Shell() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRepLib_ShellError myError;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeShell_HeaderFile
|
@@ -1,120 +0,0 @@
|
||||
-- Created on: 1995-01-04
|
||||
-- Created by: Bruno DUMORTIER
|
||||
-- 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 MakeSolid from BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---Purpose: Makes a solid from compsolid or shells.
|
||||
|
||||
uses
|
||||
Solid from TopoDS,
|
||||
CompSolid from TopoDS,
|
||||
Shell from TopoDS,
|
||||
Face from TopoDS,
|
||||
ListOfShape from TopTools,
|
||||
ShapeModification from BRepLib
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Level: Public
|
||||
---Purpose: Solid covers whole space.
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- From CompSolid
|
||||
----------------------------------------------
|
||||
|
||||
Create(S : CompSolid from TopoDS)
|
||||
---Purpose: Make a solid from a CompSolid.
|
||||
---Level: Public
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
-- From shells
|
||||
----------------------------------------------
|
||||
|
||||
Create(S : Shell from TopoDS)
|
||||
---Purpose: Make a solid from a shell.
|
||||
---Level: Public
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
|
||||
Create(S1,S2 : Shell from TopoDS)
|
||||
---Purpose: Make a solid from two shells.
|
||||
---Level: Public
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
Create(S1,S2,S3 : Shell from TopoDS)
|
||||
---Purpose: Make a solid from three shells.
|
||||
---Level: Public
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
Create(So : Solid from TopoDS; S : Shell from TopoDS)
|
||||
---Purpose: Add a shell to a solid.
|
||||
---Level: Public
|
||||
returns MakeSolid from BRepLib;
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
-- Auxiliary methods
|
||||
----------------------------------------------
|
||||
|
||||
Add(me : in out; S : Shell from TopoDS)
|
||||
---Purpose: Add the shell to the current solid.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
----------------------------------------------
|
||||
-- Results
|
||||
----------------------------------------------
|
||||
|
||||
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;
|
||||
|
||||
FaceStatus(me; F: Face from TopoDS)
|
||||
---Purpose: returns the status of the Face after
|
||||
-- the shape creation.
|
||||
---Level: Public
|
||||
returns ShapeModification from BRepLib
|
||||
is redefined;
|
||||
|
||||
fields
|
||||
|
||||
myDeletedFaces: ListOfShape from TopTools is protected;
|
||||
|
||||
end MakeSolid;
|
@@ -14,20 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeSolid.ixx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepLib_MakeSolid.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_CompSolid.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeSolid::BRepLib_MakeSolid()
|
||||
{
|
||||
BRep_Builder B;
|
||||
|
98
src/BRepLib/BRepLib_MakeSolid.hxx
Normal file
98
src/BRepLib/BRepLib_MakeSolid.hxx
Normal file
@@ -0,0 +1,98 @@
|
||||
// Created on: 1995-01-04
|
||||
// Created by: Bruno DUMORTIER
|
||||
// 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 _BRepLib_MakeSolid_HeaderFile
|
||||
#define _BRepLib_MakeSolid_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <BRepLib_ShapeModification.hxx>
|
||||
class StdFail_NotDone;
|
||||
class TopoDS_CompSolid;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Solid;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
//! Makes a solid from compsolid or shells.
|
||||
class BRepLib_MakeSolid : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Solid covers whole space.
|
||||
Standard_EXPORT BRepLib_MakeSolid();
|
||||
|
||||
//! Make a solid from a CompSolid.
|
||||
Standard_EXPORT BRepLib_MakeSolid(const TopoDS_CompSolid& S);
|
||||
|
||||
//! Make a solid from a shell.
|
||||
Standard_EXPORT BRepLib_MakeSolid(const TopoDS_Shell& S);
|
||||
|
||||
//! Make a solid from two shells.
|
||||
Standard_EXPORT BRepLib_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2);
|
||||
|
||||
//! Make a solid from three shells.
|
||||
Standard_EXPORT BRepLib_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 BRepLib_MakeSolid(const TopoDS_Solid& So);
|
||||
|
||||
//! Add a shell to a solid.
|
||||
Standard_EXPORT BRepLib_MakeSolid(const TopoDS_Solid& So, const TopoDS_Shell& S);
|
||||
|
||||
//! Add the shell to the current solid.
|
||||
Standard_EXPORT void Add (const TopoDS_Shell& S);
|
||||
|
||||
//! Returns the new Solid.
|
||||
Standard_EXPORT const TopoDS_Solid& Solid() const;
|
||||
Standard_EXPORT operator TopoDS_Solid() const;
|
||||
|
||||
//! returns the status of the Face after
|
||||
//! the shape creation.
|
||||
Standard_EXPORT virtual BRepLib_ShapeModification FaceStatus (const TopoDS_Face& F) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
TopTools_ListOfShape myDeletedFaces;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeSolid_HeaderFile
|
@@ -1,36 +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 BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---Purpose: Provides methods to build vertices.
|
||||
|
||||
uses
|
||||
Pnt from gp,
|
||||
Vertex from TopoDS
|
||||
|
||||
is
|
||||
Create (P : Pnt from gp)
|
||||
---Level: Public
|
||||
returns MakeVertex from BRepLib;
|
||||
|
||||
Vertex(me) returns Vertex from TopoDS
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Vertex() const;"
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
end MakeVertex;
|
@@ -14,16 +14,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeVertex.ixx>
|
||||
#include <BRepLib.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeVertex::BRepLib_MakeVertex(const gp_Pnt& P)
|
||||
{
|
||||
BRep_Builder B;
|
||||
|
65
src/BRepLib/BRepLib_MakeVertex.hxx
Normal file
65
src/BRepLib/BRepLib_MakeVertex.hxx
Normal file
@@ -0,0 +1,65 @@
|
||||
// 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 _BRepLib_MakeVertex_HeaderFile
|
||||
#define _BRepLib_MakeVertex_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
class gp_Pnt;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
//! Provides methods to build vertices.
|
||||
class BRepLib_MakeVertex : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepLib_MakeVertex(const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT const TopoDS_Vertex& Vertex() const;
|
||||
Standard_EXPORT operator TopoDS_Vertex() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeVertex_HeaderFile
|
@@ -1,187 +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 BRepLib inherits MakeShape from BRepLib
|
||||
|
||||
---Purpose: Provides methods to build wires.
|
||||
--
|
||||
-- A wire may be built :
|
||||
--
|
||||
-- * From a single edge.
|
||||
--
|
||||
-- * From a wire and an edge.
|
||||
--
|
||||
-- - A new wire is created with the edges of the
|
||||
-- wire + the edge.
|
||||
--
|
||||
-- - If the edge is not connnected to the wire the
|
||||
-- flag NotDone is set and the method Wire will
|
||||
-- raise an error.
|
||||
--
|
||||
-- - The connection may be :
|
||||
--
|
||||
-- . Through an existing vertex. The edge is shared.
|
||||
--
|
||||
-- . Through a geometric coincidence of vertices.
|
||||
-- The edge is copied and the vertices from the
|
||||
-- edge are replaced by the vertices from the
|
||||
-- wire.
|
||||
--
|
||||
-- . The new edge and the connection vertices are
|
||||
-- kept by the algorithm.
|
||||
--
|
||||
--
|
||||
-- * From 2, 3, 4 edges.
|
||||
--
|
||||
-- - A wire is created from the first edge, the
|
||||
-- following edges are added.
|
||||
--
|
||||
-- * From many edges.
|
||||
--
|
||||
-- - The following syntax may be used :
|
||||
--
|
||||
-- BRepLib_MakeWire MW;
|
||||
--
|
||||
-- // for all the edges ...
|
||||
-- MW.Add(anEdge);
|
||||
--
|
||||
-- TopoDS_Wire W = MW;
|
||||
|
||||
|
||||
|
||||
uses
|
||||
WireError from BRepLib,
|
||||
Wire from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
MapOfShape from TopTools,
|
||||
ListOfShape from TopTools
|
||||
|
||||
raises
|
||||
NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: NotDone MakeWire.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- From edges
|
||||
----------------------------------------------
|
||||
|
||||
Create(E : Edge from TopoDS)
|
||||
---Purpose: Make a Wire from an edge.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
Create(E1,E2 : Edge from TopoDS)
|
||||
---Purpose: Make a Wire from two edges.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
Create(E1,E2,E3 : Edge from TopoDS)
|
||||
---Purpose: Make a Wire from three edges.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
Create(E1,E2,E3,E4 : Edge from TopoDS)
|
||||
---Purpose: Make a Wire from four edges.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- 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 BRepLib;
|
||||
|
||||
Create(W : Wire from TopoDS; E : Edge from TopoDS)
|
||||
---Purpose: Add an edge to a wire.
|
||||
---Level: Public
|
||||
returns MakeWire from BRepLib;
|
||||
|
||||
----------------------------------------------
|
||||
-- Auxiliary methods
|
||||
----------------------------------------------
|
||||
|
||||
Add(me : in out; E : Edge from TopoDS)
|
||||
---Purpose: Add the edge <E> to the current wire.
|
||||
---Level: Public
|
||||
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: Add 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.
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
----------------------------------------------
|
||||
-- Results
|
||||
----------------------------------------------
|
||||
|
||||
Error(me) returns WireError from BRepLib
|
||||
---Level: Public
|
||||
is static;
|
||||
|
||||
Wire(me) returns Wire from TopoDS
|
||||
---Purpose: Returns the new wire.
|
||||
--
|
||||
---C++: return const &
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;"
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
Edge(me) returns Edge from TopoDS
|
||||
---Purpose: Returns the last edge added to the wire.
|
||||
--
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
Vertex(me) returns Vertex from TopoDS
|
||||
---Purpose: Returns the last connecting vertex.
|
||||
--
|
||||
---C++: return const &
|
||||
---Level: Public
|
||||
raises
|
||||
NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
myError : WireError from BRepLib;
|
||||
myEdge : Edge from TopoDS;
|
||||
myVertex : Vertex from TopoDS;
|
||||
myVertices : MapOfShape from TopTools;
|
||||
FirstVertex : Vertex from TopoDS;
|
||||
VF, VL : Vertex from TopoDS;
|
||||
|
||||
end MakeWire;
|
@@ -14,27 +14,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeWire.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <BRepLib_MakeWire.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepLib_MakeWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepLib_MakeWire::BRepLib_MakeWire() :
|
||||
myError(BRepLib_EmptyWire)
|
||||
{
|
||||
|
159
src/BRepLib/BRepLib_MakeWire.hxx
Normal file
159
src/BRepLib/BRepLib_MakeWire.hxx
Normal file
@@ -0,0 +1,159 @@
|
||||
// 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 _BRepLib_MakeWire_HeaderFile
|
||||
#define _BRepLib_MakeWire_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepLib_WireError.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <BRepLib_MakeShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class StdFail_NotDone;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
//! Provides methods to build wires.
|
||||
//!
|
||||
//! A wire may be built :
|
||||
//!
|
||||
//! * From a single edge.
|
||||
//!
|
||||
//! * From a wire and an edge.
|
||||
//!
|
||||
//! - A new wire is created with the edges of the
|
||||
//! wire + the edge.
|
||||
//!
|
||||
//! - If the edge is not connnected to the wire the
|
||||
//! flag NotDone is set and the method Wire will
|
||||
//! raise an error.
|
||||
//!
|
||||
//! - The connection may be :
|
||||
//!
|
||||
//! . Through an existing vertex. The edge is shared.
|
||||
//!
|
||||
//! . Through a geometric coincidence of vertices.
|
||||
//! The edge is copied and the vertices from the
|
||||
//! edge are replaced by the vertices from the
|
||||
//! wire.
|
||||
//!
|
||||
//! . The new edge and the connection vertices are
|
||||
//! kept by the algorithm.
|
||||
//!
|
||||
//! * From 2, 3, 4 edges.
|
||||
//!
|
||||
//! - A wire is created from the first edge, the
|
||||
//! following edges are added.
|
||||
//!
|
||||
//! * From many edges.
|
||||
//!
|
||||
//! - The following syntax may be used :
|
||||
//!
|
||||
//! BRepLib_MakeWire MW;
|
||||
//!
|
||||
//! // for all the edges ...
|
||||
//! MW.Add(anEdge);
|
||||
//!
|
||||
//! TopoDS_Wire W = MW;
|
||||
class BRepLib_MakeWire : public BRepLib_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! NotDone MakeWire.
|
||||
Standard_EXPORT BRepLib_MakeWire();
|
||||
|
||||
//! Make a Wire from an edge.
|
||||
Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E);
|
||||
|
||||
//! Make a Wire from two edges.
|
||||
Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2);
|
||||
|
||||
//! Make a Wire from three edges.
|
||||
Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& E3);
|
||||
|
||||
//! Make a Wire from four edges.
|
||||
Standard_EXPORT BRepLib_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 BRepLib_MakeWire(const TopoDS_Wire& W);
|
||||
|
||||
//! Add an edge to a wire.
|
||||
Standard_EXPORT BRepLib_MakeWire(const TopoDS_Wire& W, const TopoDS_Edge& E);
|
||||
|
||||
//! Add the edge <E> to the current wire.
|
||||
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);
|
||||
|
||||
//! Add 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.
|
||||
Standard_EXPORT void Add (const TopTools_ListOfShape& L);
|
||||
|
||||
Standard_EXPORT BRepLib_WireError Error() const;
|
||||
|
||||
//! Returns the new wire.
|
||||
Standard_EXPORT const TopoDS_Wire& Wire() const;
|
||||
Standard_EXPORT operator TopoDS_Wire() const;
|
||||
|
||||
//! Returns the last edge added to the wire.
|
||||
Standard_EXPORT const TopoDS_Edge& Edge() const;
|
||||
|
||||
//! Returns the last connecting vertex.
|
||||
Standard_EXPORT const TopoDS_Vertex& Vertex() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRepLib_WireError myError;
|
||||
TopoDS_Edge myEdge;
|
||||
TopoDS_Vertex myVertex;
|
||||
TopTools_MapOfShape myVertices;
|
||||
TopoDS_Vertex FirstVertex;
|
||||
TopoDS_Vertex VF;
|
||||
TopoDS_Vertex VL;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepLib_MakeWire_HeaderFile
|
@@ -14,32 +14,33 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepLib_MakeWire.ixx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapOfOrientedShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeWire.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfOrientedShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose : Add the list of edges to the current wire
|
||||
//=======================================================================
|
||||
|
||||
void BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
|
||||
{
|
||||
myError = BRepLib_WireDone;
|
||||
|
30
src/BRepLib/BRepLib_ShapeModification.hxx
Normal file
30
src/BRepLib/BRepLib_ShapeModification.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_ShapeModification_HeaderFile
|
||||
#define _BRepLib_ShapeModification_HeaderFile
|
||||
|
||||
//! Modification type after a topologic operation.
|
||||
enum BRepLib_ShapeModification
|
||||
{
|
||||
BRepLib_Preserved,
|
||||
BRepLib_Deleted,
|
||||
BRepLib_Trimmed,
|
||||
BRepLib_Merged,
|
||||
BRepLib_BoundaryModified
|
||||
};
|
||||
|
||||
#endif // _BRepLib_ShapeModification_HeaderFile
|
29
src/BRepLib/BRepLib_ShellError.hxx
Normal file
29
src/BRepLib/BRepLib_ShellError.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_ShellError_HeaderFile
|
||||
#define _BRepLib_ShellError_HeaderFile
|
||||
|
||||
//! Errors that can occur at shell construction.
|
||||
enum BRepLib_ShellError
|
||||
{
|
||||
BRepLib_ShellDone,
|
||||
BRepLib_EmptyShell,
|
||||
BRepLib_DisconnectedShell,
|
||||
BRepLib_ShellParametersOutOfRange
|
||||
};
|
||||
|
||||
#endif // _BRepLib_ShellError_HeaderFile
|
30
src/BRepLib/BRepLib_WireError.hxx
Normal file
30
src/BRepLib/BRepLib_WireError.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created on: 1993-12-15
|
||||
// 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 _BRepLib_WireError_HeaderFile
|
||||
#define _BRepLib_WireError_HeaderFile
|
||||
|
||||
//! Errors that can occur at wire construction.
|
||||
//! no error
|
||||
enum BRepLib_WireError
|
||||
{
|
||||
BRepLib_WireDone,
|
||||
BRepLib_EmptyWire,
|
||||
BRepLib_DisconnectedWire,
|
||||
BRepLib_NonManifoldWire
|
||||
};
|
||||
|
||||
#endif // _BRepLib_WireError_HeaderFile
|
@@ -1 +1,35 @@
|
||||
BRepLib.cxx
|
||||
BRepLib.hxx
|
||||
BRepLib_CheckCurveOnSurface.cxx
|
||||
BRepLib_CheckCurveOnSurface.hxx
|
||||
BRepLib_CheckCurveOnSurface.lxx
|
||||
BRepLib_Command.cxx
|
||||
BRepLib_Command.hxx
|
||||
BRepLib_EdgeError.hxx
|
||||
BRepLib_FaceError.hxx
|
||||
BRepLib_FindSurface.cxx
|
||||
BRepLib_FindSurface.hxx
|
||||
BRepLib_FuseEdges.cxx
|
||||
BRepLib_FuseEdges.hxx
|
||||
BRepLib_MakeEdge.cxx
|
||||
BRepLib_MakeEdge.hxx
|
||||
BRepLib_MakeEdge2d.cxx
|
||||
BRepLib_MakeEdge2d.hxx
|
||||
BRepLib_MakeFace.cxx
|
||||
BRepLib_MakeFace.hxx
|
||||
BRepLib_MakePolygon.cxx
|
||||
BRepLib_MakePolygon.hxx
|
||||
BRepLib_MakeShape.cxx
|
||||
BRepLib_MakeShape.hxx
|
||||
BRepLib_MakeShell.cxx
|
||||
BRepLib_MakeShell.hxx
|
||||
BRepLib_MakeSolid.cxx
|
||||
BRepLib_MakeSolid.hxx
|
||||
BRepLib_MakeVertex.cxx
|
||||
BRepLib_MakeVertex.hxx
|
||||
BRepLib_MakeWire.cxx
|
||||
BRepLib_MakeWire.hxx
|
||||
BRepLib_MakeWire_1.cxx
|
||||
BRepLib_ShapeModification.hxx
|
||||
BRepLib_ShellError.hxx
|
||||
BRepLib_WireError.hxx
|
||||
|
Reference in New Issue
Block a user