mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +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,78 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- Copyright (c) 2000-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 BOPTools
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
gp,
|
||||
Bnd,
|
||||
TopAbs,
|
||||
Geom,
|
||||
Geom2d,
|
||||
GeomAPI,
|
||||
BRepClass3d,
|
||||
TopoDS,
|
||||
BRepAdaptor,
|
||||
TopTools,
|
||||
IntTools,
|
||||
ProjLib,
|
||||
--
|
||||
BOPCol
|
||||
is
|
||||
|
||||
--
|
||||
-- classes
|
||||
--
|
||||
class ShapeSet;
|
||||
class EdgeSet;
|
||||
class AlgoTools;
|
||||
class Set;
|
||||
class SetMapHasher;
|
||||
class AlgoTools2D;
|
||||
class AlgoTools3D;
|
||||
--
|
||||
imported MapOfSet;
|
||||
imported DataMapOfShapeSet;
|
||||
--
|
||||
-- primitives
|
||||
--
|
||||
imported ListOfShapeSet from BOPTools;
|
||||
imported ListOfEdgeSet from BOPTools;
|
||||
imported ConnexityBlock from BOPTools;
|
||||
imported ListOfConnexityBlock from BOPTools;
|
||||
imported CoupleOfShape from BOPTools;
|
||||
imported ListOfCoupleOfShape from BOPTools;
|
||||
--
|
||||
-- static methods
|
||||
--
|
||||
MapShapes(S : Shape from TopoDS;
|
||||
M : in out MapOfShape from BOPCol);
|
||||
|
||||
MapShapes(S : Shape from TopoDS;
|
||||
M : in out IndexedMapOfShape from BOPCol);
|
||||
|
||||
MapShapes(S : Shape from TopoDS;
|
||||
T : ShapeEnum from TopAbs;
|
||||
M : in out IndexedMapOfShape from BOPCol);
|
||||
|
||||
|
||||
MapShapesAndAncestors
|
||||
(S : Shape from TopoDS;
|
||||
TS : ShapeEnum from TopAbs;
|
||||
TA : ShapeEnum from TopAbs;
|
||||
M : in out IndexedDataMapOfShapeListOfShape from BOPCol);
|
||||
|
||||
end BOPTools;
|
@@ -12,9 +12,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools.ixx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <BOPTools.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MapShapes
|
||||
|
82
src/BOPTools/BOPTools.hxx
Normal file
82
src/BOPTools/BOPTools.hxx
Normal file
@@ -0,0 +1,82 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2000-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 _BOPTools_HeaderFile
|
||||
#define _BOPTools_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
class BOPTools_ShapeSet;
|
||||
class BOPTools_EdgeSet;
|
||||
class BOPTools_AlgoTools;
|
||||
class BOPTools_Set;
|
||||
class BOPTools_SetMapHasher;
|
||||
class BOPTools_AlgoTools2D;
|
||||
class BOPTools_AlgoTools3D;
|
||||
|
||||
|
||||
|
||||
class BOPTools
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, BOPCol_MapOfShape& M);
|
||||
|
||||
Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, BOPCol_IndexedMapOfShape& M);
|
||||
|
||||
Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, BOPCol_IndexedMapOfShape& M);
|
||||
|
||||
Standard_EXPORT static void MapShapesAndAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, BOPCol_IndexedDataMapOfShapeListOfShape& M);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class BOPTools_ShapeSet;
|
||||
friend class BOPTools_EdgeSet;
|
||||
friend class BOPTools_AlgoTools;
|
||||
friend class BOPTools_Set;
|
||||
friend class BOPTools_SetMapHasher;
|
||||
friend class BOPTools_AlgoTools2D;
|
||||
friend class BOPTools_AlgoTools3D;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_HeaderFile
|
@@ -1,472 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- Copyright (c) 2010-2014 OPEN CASCADE SAS
|
||||
-- Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
-- Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
-- EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
--
|
||||
-- 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 AlgoTools from BOPTools
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
Dir from gp,
|
||||
Plane from Geom,
|
||||
State from TopAbs,
|
||||
ShapeEnum from TopAbs,
|
||||
Curve from IntTools,
|
||||
Shape from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Shell from TopoDS,
|
||||
Solid from TopoDS,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom,
|
||||
--
|
||||
BaseAllocator from BOPCol,
|
||||
ListOfShape from BOPCol,
|
||||
IndexedMapOfShape from BOPCol,
|
||||
IndexedDataMapOfShapeListOfShape from BOPCol,
|
||||
Context from IntTools,
|
||||
ListOfCoupleOfShape from BOPTools,
|
||||
Range from IntTools
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
ComputeVV(myclass;
|
||||
aV1:Vertex from TopoDS;
|
||||
aP2:Pnt from gp;
|
||||
aTolP2:Real from Standard)
|
||||
returns Integer from Standard;
|
||||
|
||||
ComputeVV(myclass;
|
||||
aV1:Vertex from TopoDS;
|
||||
aV2:Vertex from TopoDS)
|
||||
returns Integer from Standard;
|
||||
|
||||
MakeVertex (myclass;
|
||||
aLV: out ListOfShape from BOPCol;
|
||||
aV : out Vertex from TopoDS);
|
||||
|
||||
MakeEdge(myclass;
|
||||
theCurve:Curve from IntTools;
|
||||
theV1: Vertex from TopoDS;
|
||||
theT1: Real from Standard;
|
||||
theV2: Vertex from TopoDS;
|
||||
theT2: Real from Standard;
|
||||
theTolR3D: Real from Standard;
|
||||
theE :out Edge from TopoDS);
|
||||
|
||||
MakePCurve(myclass;
|
||||
theE : Edge from TopoDS;
|
||||
theF1: Face from TopoDS;
|
||||
theF2: Face from TopoDS;
|
||||
theCurve:Curve from IntTools;
|
||||
thePC1:Boolean from Standard;
|
||||
thePC2:Boolean from Standard);
|
||||
|
||||
MakeContainer(myclass;
|
||||
theType:ShapeEnum from TopAbs;
|
||||
theShape:out Shape from TopoDS);
|
||||
|
||||
|
||||
IsHole(myclass;
|
||||
aW: Shape from TopoDS;
|
||||
aF: Shape from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsSplitToReverse(myclass;
|
||||
theSplit : Shape from TopoDS;
|
||||
theShape : Shape from TopoDS;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Returns True if the shape theSplit has opposite
|
||||
-- direction than theShape
|
||||
-- theContext - cashed geometrical tools
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsSplitToReverse(myclass;
|
||||
theSplit : Face from TopoDS;
|
||||
theShape : Face from TopoDS;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Returns True if normal direction of the face
|
||||
-- theShape is not the same as for the face
|
||||
-- theSplit
|
||||
-- theContext - cashed geometrical tools
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsSplitToReverse (myclass;
|
||||
aE1: Edge from TopoDS;
|
||||
aE2: Edge from TopoDS;
|
||||
aContext:out Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
AreFacesSameDomain(myclass;
|
||||
theF1: Face from TopoDS;
|
||||
theF2: Face from TopoDS;
|
||||
theContext:out Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
|
||||
CheckSameGeom (myclass;
|
||||
theF1: Face from TopoDS;
|
||||
theF2: Face from TopoDS;
|
||||
theContext:out Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Sense (myclass;
|
||||
theF1: Face from TopoDS;
|
||||
theF2: Face from TopoDS)
|
||||
returns Integer from Standard;
|
||||
|
||||
GetEdgeOff (myclass;
|
||||
theEdge :Edge from TopoDS;
|
||||
theFace :Face from TopoDS;
|
||||
theEdgeOff :out Edge from TopoDS)
|
||||
---Purpose: Returns True if the face theFace contains
|
||||
-- the edge theEdge but with opposite orientation.
|
||||
-- If the method returns True theEdgeOff is the
|
||||
-- edge founded
|
||||
returns Boolean from Standard;
|
||||
|
||||
GetFaceOff(myclass;
|
||||
theEdge :Edge from TopoDS;
|
||||
theFace :Face from TopoDS;
|
||||
theLCEF :out ListOfCoupleOfShape from BOPTools;
|
||||
theFaceOff :out Face from TopoDS;
|
||||
theContext :out Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
|
||||
---Purpose: For the face theFace and its edge theEdge
|
||||
-- finds the face suitable to produce shell.
|
||||
-- theLCEF - set of faces to search. All faces
|
||||
-- from theLCEF must share edge theEdge
|
||||
|
||||
IsInternalFace(myclass;
|
||||
theFace :Face from TopoDS;
|
||||
theEdge :Edge from TopoDS;
|
||||
theFace1 :Face from TopoDS;
|
||||
theFace2 :Face from TopoDS;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Returns True if the face theFace is inside of the
|
||||
-- couple of faces theFace1, theFace2.
|
||||
-- The faces theFace, theFace1, theFace2 must
|
||||
-- share the edge theEdge
|
||||
returns Integer from Standard;
|
||||
|
||||
IsInternalFace(myclass;
|
||||
theFace :Face from TopoDS;
|
||||
theEdge :Edge from TopoDS;
|
||||
theLF :out ListOfShape from BOPCol;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Returns True if the face theFace is inside of the
|
||||
-- appropriate couple of faces (from the set theLF) .
|
||||
-- The faces of the set theLF and theFace must
|
||||
-- share the edge theEdge
|
||||
returns Integer from Standard;
|
||||
|
||||
IsInternalFace(myclass;
|
||||
theFace :Face from TopoDS;
|
||||
theSolid :Solid from TopoDS;
|
||||
theMEF :out IndexedDataMapOfShapeListOfShape from BOPCol;
|
||||
theTol :Real from Standard;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Returns True if the face theFace is inside the
|
||||
-- solid theSolid.
|
||||
-- theMEF - Map Edge/Faces for theSolid
|
||||
-- theTol - value of precision of computation
|
||||
-- theContext- cahed geometrical tools
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
GetEdgeOnFace (myclass;
|
||||
theEdge :Edge from TopoDS;
|
||||
theFace :Face from TopoDS;
|
||||
theEdgeOnF :out Edge from TopoDS)
|
||||
---Purpose: For the face theFace gets the edge theEdgeOnF
|
||||
-- that is the same as theEdge
|
||||
-- Returns True if such edge exists
|
||||
-- Returns False if there is no such edge
|
||||
returns Boolean from Standard;
|
||||
|
||||
ComputeState(myclass;
|
||||
thePoint :Pnt from gp;
|
||||
theSolid :Solid from TopoDS;
|
||||
theTol :Real from Standard;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Computes the 3-D state of the point thePoint
|
||||
-- toward solid theSolid.
|
||||
-- theTol - value of precision of computation
|
||||
-- theContext- cahed geometrical tools
|
||||
-- Returns 3-D state.
|
||||
returns State from TopAbs;
|
||||
|
||||
ComputeState(myclass;
|
||||
theVertex:Vertex from TopoDS;
|
||||
theSolid :Solid from TopoDS;
|
||||
theTol :Real from Standard;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Computes the 3-D state of the vertex theVertex
|
||||
-- toward solid theSolid.
|
||||
-- theTol - value of precision of computation
|
||||
-- theContext- cahed geometrical tools
|
||||
-- Returns 3-D state.
|
||||
returns State from TopAbs;
|
||||
|
||||
ComputeState(myclass;
|
||||
theEdge :Edge from TopoDS;
|
||||
theSolid :Solid from TopoDS;
|
||||
theTol :Real from Standard;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Computes the 3-D state of the edge theEdge
|
||||
-- toward solid theSolid.
|
||||
-- theTol - value of precision of computation
|
||||
-- theContext- cahed geometrical tools
|
||||
-- Returns 3-D state.
|
||||
returns State from TopAbs;
|
||||
|
||||
ComputeState(myclass;
|
||||
theFace :Face from TopoDS;
|
||||
theSolid :Solid from TopoDS;
|
||||
theTol :Real from Standard;
|
||||
theBounds:out IndexedMapOfShape from BOPCol;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Computes the 3-D state of the face theFace
|
||||
-- toward solid theSolid.
|
||||
-- theTol - value of precision of computation
|
||||
-- theBounds - set of edges of theFace to avoid
|
||||
-- theContext- cahed geometrical tools
|
||||
-- Returns 3-D state.
|
||||
returns State from TopAbs;
|
||||
|
||||
ComputeStateByOnePoint(myclass;
|
||||
theShape :Shape from TopoDS;
|
||||
theSolid :Solid from TopoDS;
|
||||
theTol :Real from Standard;
|
||||
theContext:out Context from IntTools)
|
||||
---Purpose: Computes the 3-D state of the shape theShape
|
||||
-- toward solid theSolid.
|
||||
-- theTol - value of precision of computation
|
||||
-- theContext- cahed geometrical tools
|
||||
-- Returns 3-D state.
|
||||
returns State from TopAbs;
|
||||
|
||||
MakeConnexityBlock(myclass;
|
||||
theLS :out ListOfShape from BOPCol;
|
||||
theMapAvoid:out IndexedMapOfShape from BOPCol;
|
||||
theLSCB :out ListOfShape from BOPCol;
|
||||
theAllocator:BaseAllocator from BOPCol);
|
||||
---Purpose: For the list of faces theLS build block
|
||||
-- theLSCB in terms of connexity by edges
|
||||
-- theMapAvoid - set of edges to avoid for
|
||||
-- the treatment
|
||||
|
||||
MakeConnexityBlocks(myclass;
|
||||
theS :Shape from TopoDS;
|
||||
theType1 :ShapeEnum from TopAbs;
|
||||
theType2 :ShapeEnum from TopAbs;
|
||||
theLCB :out ListOfShape from BOPCol);
|
||||
---Purpose: For the compound theS build the blocks
|
||||
-- theLCB (as list of compounds)
|
||||
-- in terms of connexity by the shapes of theType
|
||||
|
||||
OrientFacesOnShell (myclass;
|
||||
theS :out Shape from TopoDS);
|
||||
|
||||
CorrectTolerances (myclass;
|
||||
theS: Shape from TopoDS;
|
||||
theTolMax: Real from Standard =0.0001;
|
||||
theRunParallel: Boolean from Standard=Standard_False);
|
||||
|
||||
---Purpose:
|
||||
-- Provides valid values of tolerances for the shape <theS>
|
||||
-- <theTolMax> is max value of the tolerance that can be
|
||||
-- accepted for correction. If real value of the tolerance
|
||||
-- will be greater than <aTolMax>, the correction does not
|
||||
-- perform.
|
||||
|
||||
CorrectCurveOnSurface (myclass;
|
||||
theS: Shape from TopoDS;
|
||||
theTolMax: Real from Standard =0.0001;
|
||||
theRunParallel: Boolean from Standard=Standard_False);
|
||||
---Purpose:
|
||||
-- Provides valid values of tolerances for the shape <theS>
|
||||
-- in terms of BRepCheck_InvalidCurveOnSurface.
|
||||
|
||||
CorrectPointOnCurve (myclass;
|
||||
theS: Shape from TopoDS;
|
||||
theTolMax: Real from Standard =0.0001;
|
||||
theRunParallel: Boolean from Standard=Standard_False);
|
||||
---Purpose:
|
||||
-- Provides valid values of tolerances for the shape <theS>
|
||||
-- in terms of BRepCheck_InvalidPointOnCurve.
|
||||
|
||||
MakeNewVertex (myclass;
|
||||
aP1 : Pnt from gp;
|
||||
aTol: Real from Standard;
|
||||
aNewVertex:out Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
|
||||
|
||||
MakeNewVertex (myclass;
|
||||
aV1,aV2: Vertex from TopoDS;
|
||||
aNewVertex:out Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Make a vertex using couple of vertices <aV1, aV2>
|
||||
|
||||
MakeNewVertex (myclass;
|
||||
aE1: Edge from TopoDS;
|
||||
aP1: Real from Standard;
|
||||
aE2: Edge from TopoDS;
|
||||
aP2: Real from Standard;
|
||||
aNewVertex:out Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Make a vertex in place of intersection between two edges
|
||||
-- <aE1, aE2> with parameters <aP1, aP2>
|
||||
|
||||
MakeNewVertex (myclass;
|
||||
aE1: Edge from TopoDS;
|
||||
aP1: Real from Standard;
|
||||
aF2: Face from TopoDS;
|
||||
aNewVertex:out Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Make a vertex in place of intersection between the edge <aE1>
|
||||
-- with parameter <aP1> and the face <aF2>
|
||||
|
||||
PointOnEdge (myclass;
|
||||
aEdge: Edge from TopoDS;
|
||||
aPrm: Real from Standard;
|
||||
aP:out Pnt from gp);
|
||||
---Purpose:
|
||||
-- Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
|
||||
|
||||
MakeSplitEdge (myclass;
|
||||
aE1: Edge from TopoDS;
|
||||
aV1: Vertex from TopoDS;
|
||||
aP1: Real from Standard;
|
||||
aV2: Vertex from TopoDS;
|
||||
aP2: Real from Standard;
|
||||
aNewEdge:out Edge from TopoDS);
|
||||
---Purpose:
|
||||
-- Make the edge from base edge <aE1> and two vertices <aV1,aV2>
|
||||
-- at parameters <aP1,aP2>
|
||||
|
||||
MakeSectEdge (myclass;
|
||||
aIC: Curve from IntTools;
|
||||
aV1: Vertex from TopoDS;
|
||||
aP1: Real from Standard;
|
||||
aV2: Vertex from TopoDS;
|
||||
aP2: Real from Standard;
|
||||
aNewEdge:out Edge from TopoDS);
|
||||
---Purpose:
|
||||
-- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
|
||||
-- at parameters <aP1,aP2>
|
||||
|
||||
UpdateVertex (myclass;
|
||||
aIC: Curve from IntTools;
|
||||
aT : Real from Standard;
|
||||
aV : Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Update the tolerance value for vertex <aV>
|
||||
-- taking into account the fact that <aV> lays on
|
||||
-- the curve <aIC>
|
||||
|
||||
UpdateVertex (myclass;
|
||||
aE : Edge from TopoDS;
|
||||
aT : Real from Standard;
|
||||
aV : Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Update the tolerance value for vertex <aV>
|
||||
-- taking into account the fact that <aV> lays on
|
||||
-- the edge <aE>
|
||||
|
||||
UpdateVertex (myclass;
|
||||
aVF : Vertex from TopoDS;
|
||||
aVN : Vertex from TopoDS);
|
||||
---Purpose:
|
||||
-- Update the tolerance value for vertex <aVN>
|
||||
-- taking into account the fact that <aVN> should
|
||||
-- cover tolerance zone of <aVF>
|
||||
|
||||
CorrectRange (myclass;
|
||||
aE1: Edge from TopoDS;
|
||||
aE2: Edge from TopoDS;
|
||||
aSR: Range from IntTools;
|
||||
aNewSR:out Range from IntTools);
|
||||
---Purpose:
|
||||
-- Correct shrunk range <aSR> taking into account 3D-curve
|
||||
-- resolution and corresp. tolerances' values of <aE1>, <aE2>
|
||||
|
||||
CorrectRange (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aSR: Range from IntTools;
|
||||
aNewSR:out Range from IntTools);
|
||||
---Purpose:
|
||||
-- Correct shrunk range <aSR> taking into account 3D-curve
|
||||
-- resolution and corresp. tolerances' values of <aE>, <aF>
|
||||
|
||||
IsBlockInOnFace(myclass;
|
||||
aShR : Range from IntTools;
|
||||
aF : Face from TopoDS;
|
||||
aE : Edge from TopoDS;
|
||||
aContext:out Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
|
||||
-- the <PB> is IN or ON in 2D of <aF>
|
||||
|
||||
IsMicroEdge(myclass;
|
||||
theEdge : Edge from TopoDS;
|
||||
theContext : Context from IntTools)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Checks if it is possible to compute shrunk range for the edge <aE>.
|
||||
--
|
||||
|
||||
CorrectShapeTolerances (myclass;
|
||||
theS: Shape from TopoDS;
|
||||
theRunParallel: Boolean from Standard=Standard_False);
|
||||
---Purpose:
|
||||
-- Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
|
||||
|
||||
Dimension(myclass;
|
||||
theS:Shape from TopoDS)
|
||||
returns Integer from Standard;
|
||||
---Purpose:
|
||||
-- Retutns dimension of the shape <theS>.
|
||||
|
||||
IsOpenShell(myclass;
|
||||
theShell:Shell from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the shell <theShell> is open
|
||||
|
||||
IsInvertedSolid(myclass;
|
||||
theSolid:Solid from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the solid <theSolid> is inverted
|
||||
|
||||
ComputeTolerance(myclass;
|
||||
theFace : Face from TopoDS;
|
||||
theEdge : Edge from TopoDS;
|
||||
theMaxDist : out Real from Standard;
|
||||
theMaxPar : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Computes the necessary value of the tolerance for the edge
|
||||
|
||||
end AlgoTools;
|
@@ -15,59 +15,66 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_AlgoTools.ixx>
|
||||
//
|
||||
#include <Precision.hxx>
|
||||
//
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
//
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <Geom2dInt_Geom2dCurveTool.hxx>
|
||||
//
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
//
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_CompSolid.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
//
|
||||
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BOPTools_AlgoTools3D.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
#include <BOPTools_ListOfCoupleOfShape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepAdaptor_Curve2d.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dInt_Geom2dCurveTool.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Curve.hxx>
|
||||
#include <IntTools_Range.hxx>
|
||||
#include <IntTools_ShrunkRange.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
//
|
||||
#include <IntTools_Tools.hxx>
|
||||
//
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
#include <BOPTools_ListOfCoupleOfShape.hxx>
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BOPTools_AlgoTools3D.hxx>
|
||||
//
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
//
|
||||
#include <IntTools_ShrunkRange.hxx>
|
||||
#include <Precision.hxx>
|
||||
//
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_CompSolid.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
static
|
||||
Standard_Real AngleWithRef(const gp_Dir& theD1,
|
||||
const gp_Dir& theD2,
|
||||
|
302
src/BOPTools/BOPTools_AlgoTools.hxx
Normal file
302
src/BOPTools/BOPTools_AlgoTools.hxx
Normal file
@@ -0,0 +1,302 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2010-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// 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 _BOPTools_AlgoTools_HeaderFile
|
||||
#define _BOPTools_AlgoTools_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <BOPTools_ListOfCoupleOfShape.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_BaseAllocator.hxx>
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class IntTools_Curve;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Shape;
|
||||
class IntTools_Context;
|
||||
class TopoDS_Solid;
|
||||
class IntTools_Range;
|
||||
class TopoDS_Shell;
|
||||
|
||||
|
||||
|
||||
class BOPTools_AlgoTools
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static Standard_Integer ComputeVV (const TopoDS_Vertex& aV1, const gp_Pnt& aP2, const Standard_Real aTolP2);
|
||||
|
||||
Standard_EXPORT static Standard_Integer ComputeVV (const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2);
|
||||
|
||||
Standard_EXPORT static void MakeVertex (BOPCol_ListOfShape& aLV, TopoDS_Vertex& aV);
|
||||
|
||||
Standard_EXPORT static void MakeEdge (const IntTools_Curve& theCurve, const TopoDS_Vertex& theV1, const Standard_Real theT1, const TopoDS_Vertex& theV2, const Standard_Real theT2, const Standard_Real theTolR3D, TopoDS_Edge& theE);
|
||||
|
||||
Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE, const TopoDS_Face& theF1, const TopoDS_Face& theF2, const IntTools_Curve& theCurve, const Standard_Boolean thePC1, const Standard_Boolean thePC2);
|
||||
|
||||
Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsHole (const TopoDS_Shape& aW, const TopoDS_Shape& aF);
|
||||
|
||||
//! Returns True if the shape theSplit has opposite
|
||||
//! direction than theShape
|
||||
//! theContext - cashed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Shape& theSplit, const TopoDS_Shape& theShape, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if normal direction of the face
|
||||
//! theShape is not the same as for the face
|
||||
//! theSplit
|
||||
//! theContext - cashed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theSplit, const TopoDS_Face& theShape, Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Edge& aE1, const TopoDS_Edge& aE2, Handle(IntTools_Context)& aContext);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean AreFacesSameDomain (const TopoDS_Face& theF1, const TopoDS_Face& theF2, Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean CheckSameGeom (const TopoDS_Face& theF1, const TopoDS_Face& theF2, Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2);
|
||||
|
||||
//! Returns True if the face theFace contains
|
||||
//! the edge theEdge but with opposite orientation.
|
||||
//! If the method returns True theEdgeOff is the
|
||||
//! edge founded
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOff (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, TopoDS_Edge& theEdgeOff);
|
||||
|
||||
//! For the face theFace and its edge theEdge
|
||||
//! finds the face suitable to produce shell.
|
||||
//! theLCEF - set of faces to search. All faces
|
||||
//! from theLCEF must share edge theEdge
|
||||
Standard_EXPORT static Standard_Boolean GetFaceOff (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, BOPTools_ListOfCoupleOfShape& theLCEF, TopoDS_Face& theFaceOff, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! couple of faces theFace1, theFace2.
|
||||
//! The faces theFace, theFace1, theFace2 must
|
||||
//! share the edge theEdge
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, const TopoDS_Face& theFace1, const TopoDS_Face& theFace2, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! appropriate couple of faces (from the set theLF) .
|
||||
//! The faces of the set theLF and theFace must
|
||||
//! share the edge theEdge
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, BOPCol_ListOfShape& theLF, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside the
|
||||
//! solid theSolid.
|
||||
//! theMEF - Map Edge/Faces for theSolid
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! For the face theFace gets the edge theEdgeOnF
|
||||
//! that is the same as theEdge
|
||||
//! Returns True if such edge exists
|
||||
//! Returns False if there is no such edge
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOnFace (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, TopoDS_Edge& theEdgeOnF);
|
||||
|
||||
//! Computes the 3-D state of the point thePoint
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const gp_Pnt& thePoint, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the vertex theVertex
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Vertex& theVertex, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the edge theEdge
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Edge& theEdge, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the face theFace
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theBounds - set of edges of theFace to avoid
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, const Standard_Real theTol, BOPCol_IndexedMapOfShape& theBounds, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the shape theShape
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint (const TopoDS_Shape& theShape, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! For the list of faces theLS build block
|
||||
//! theLSCB in terms of connexity by edges
|
||||
//! theMapAvoid - set of edges to avoid for
|
||||
//! the treatment
|
||||
Standard_EXPORT static void MakeConnexityBlock (BOPCol_ListOfShape& theLS, BOPCol_IndexedMapOfShape& theMapAvoid, BOPCol_ListOfShape& theLSCB, const BOPCol_BaseAllocator& theAllocator);
|
||||
|
||||
//! For the compound theS build the blocks
|
||||
//! theLCB (as list of compounds)
|
||||
//! in terms of connexity by the shapes of theType
|
||||
Standard_EXPORT static void MakeConnexityBlocks (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType1, const TopAbs_ShapeEnum theType2, BOPCol_ListOfShape& theLCB);
|
||||
|
||||
Standard_EXPORT static void OrientFacesOnShell (TopoDS_Shape& theS);
|
||||
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! <theTolMax> is max value of the tolerance that can be
|
||||
//! accepted for correction. If real value of the tolerance
|
||||
//! will be greater than <aTolMax>, the correction does not
|
||||
//! perform.
|
||||
Standard_EXPORT static void CorrectTolerances (const TopoDS_Shape& theS, const Standard_Real theTolMax = 0.0001, const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! in terms of BRepCheck_InvalidCurveOnSurface.
|
||||
Standard_EXPORT static void CorrectCurveOnSurface (const TopoDS_Shape& theS, const Standard_Real theTolMax = 0.0001, const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! in terms of BRepCheck_InvalidPointOnCurve.
|
||||
Standard_EXPORT static void CorrectPointOnCurve (const TopoDS_Shape& theS, const Standard_Real theTolMax = 0.0001, const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
|
||||
//! Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
|
||||
Standard_EXPORT static void MakeNewVertex (const gp_Pnt& aP1, const Standard_Real aTol, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
//! Make a vertex using couple of vertices <aV1, aV2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
//! Make a vertex in place of intersection between two edges
|
||||
//! <aE1, aE2> with parameters <aP1, aP2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Edge& aE1, const Standard_Real aP1, const TopoDS_Edge& aE2, const Standard_Real aP2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
//! Make a vertex in place of intersection between the edge <aE1>
|
||||
//! with parameter <aP1> and the face <aF2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Edge& aE1, const Standard_Real aP1, const TopoDS_Face& aF2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
//! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
|
||||
Standard_EXPORT static void PointOnEdge (const TopoDS_Edge& aEdge, const Standard_Real aPrm, gp_Pnt& aP);
|
||||
|
||||
|
||||
//! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSplitEdge (const TopoDS_Edge& aE1, const TopoDS_Vertex& aV1, const Standard_Real aP1, const TopoDS_Vertex& aV2, const Standard_Real aP2, TopoDS_Edge& aNewEdge);
|
||||
|
||||
|
||||
//! Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSectEdge (const IntTools_Curve& aIC, const TopoDS_Vertex& aV1, const Standard_Real aP1, const TopoDS_Vertex& aV2, const Standard_Real aP2, TopoDS_Edge& aNewEdge);
|
||||
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the curve <aIC>
|
||||
Standard_EXPORT static void UpdateVertex (const IntTools_Curve& aIC, const Standard_Real aT, const TopoDS_Vertex& aV);
|
||||
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the edge <aE>
|
||||
Standard_EXPORT static void UpdateVertex (const TopoDS_Edge& aE, const Standard_Real aT, const TopoDS_Vertex& aV);
|
||||
|
||||
|
||||
//! Update the tolerance value for vertex <aVN>
|
||||
//! taking into account the fact that <aVN> should
|
||||
//! cover tolerance zone of <aVF>
|
||||
Standard_EXPORT static void UpdateVertex (const TopoDS_Vertex& aVF, const TopoDS_Vertex& aVN);
|
||||
|
||||
|
||||
//! Correct shrunk range <aSR> taking into account 3D-curve
|
||||
//! resolution and corresp. tolerances' values of <aE1>, <aE2>
|
||||
Standard_EXPORT static void CorrectRange (const TopoDS_Edge& aE1, const TopoDS_Edge& aE2, const IntTools_Range& aSR, IntTools_Range& aNewSR);
|
||||
|
||||
|
||||
//! Correct shrunk range <aSR> taking into account 3D-curve
|
||||
//! resolution and corresp. tolerances' values of <aE>, <aF>
|
||||
Standard_EXPORT static void CorrectRange (const TopoDS_Edge& aE, const TopoDS_Face& aF, const IntTools_Range& aSR, IntTools_Range& aNewSR);
|
||||
|
||||
|
||||
//! Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
|
||||
//! the <PB> is IN or ON in 2D of <aF>
|
||||
Standard_EXPORT static Standard_Boolean IsBlockInOnFace (const IntTools_Range& aShR, const TopoDS_Face& aF, const TopoDS_Edge& aE, Handle(IntTools_Context)& aContext);
|
||||
|
||||
|
||||
//! Checks if it is possible to compute shrunk range for the edge <aE>.
|
||||
Standard_EXPORT static Standard_Boolean IsMicroEdge (const TopoDS_Edge& theEdge, const Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
//! Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
|
||||
Standard_EXPORT static void CorrectShapeTolerances (const TopoDS_Shape& theS, const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
|
||||
//! Retutns dimension of the shape <theS>.
|
||||
Standard_EXPORT static Standard_Integer Dimension (const TopoDS_Shape& theS);
|
||||
|
||||
//! Returns true if the shell <theShell> is open
|
||||
Standard_EXPORT static Standard_Boolean IsOpenShell (const TopoDS_Shell& theShell);
|
||||
|
||||
//! Returns true if the solid <theSolid> is inverted
|
||||
Standard_EXPORT static Standard_Boolean IsInvertedSolid (const TopoDS_Solid& theSolid);
|
||||
|
||||
|
||||
//! Computes the necessary value of the tolerance for the edge
|
||||
Standard_EXPORT static Standard_Boolean ComputeTolerance (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, Standard_Real& theMaxDist, Standard_Real& theMaxPar);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_AlgoTools_HeaderFile
|
@@ -1,218 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 AlgoTools2D from BOPTools
|
||||
|
||||
---Purpose:
|
||||
--- The class contains handy static functions
|
||||
--- dealing with the topology
|
||||
--- This is the copy of the BOPTools_AlgoTools2D.cdl
|
||||
uses
|
||||
Vec from gp,
|
||||
Dir from gp,
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Surface from BRepAdaptor,
|
||||
Curve from Geom2d,
|
||||
Curve from Geom,
|
||||
ProjectedCurve from ProjLib,
|
||||
Context from IntTools,
|
||||
ListOfShape from BOPCol
|
||||
|
||||
is
|
||||
|
||||
BuildPCurveForEdgeOnFace (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS);
|
||||
---Purpose:
|
||||
--- Compute P-Curve for the edge <aE> on the face <aF>
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
EdgeTangent (myclass;
|
||||
anE : Edge from TopoDS;
|
||||
aT : Real from Standard;
|
||||
Tau : out Vec from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Compute tangent for the edge <aE> [in 3D] at parameter <aT>
|
||||
---
|
||||
|
||||
PointOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aT: Real from Standard;
|
||||
U : out Real from Standard;
|
||||
V : out Real from Standard);
|
||||
---Purpose:
|
||||
--- Compute surface parameters <U,V> of the face <aF>
|
||||
--- for the point from the edge <aE> at parameter <aT>.
|
||||
--- If <aE> has't pcurve on surface, algorithm tries to get it by
|
||||
--- projection and can
|
||||
--- raise exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
CurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aC : out Curve from Geom2d;
|
||||
aToler: out Real from Standard);
|
||||
---Purpose:
|
||||
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
--- If the P-Curve does not exist, build it using Make2D().
|
||||
--- [aToler] - reached tolerance
|
||||
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
|
||||
CurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aC : out Curve from Geom2d;
|
||||
aFirst: out Real from Standard;
|
||||
aLast : out Real from Standard;
|
||||
aToler: out Real from Standard);
|
||||
|
||||
---Purpose:
|
||||
--- Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
--- If the P-Curve does not exist, build it using Make2D().
|
||||
--- [aFirst, aLast] - range of the P-Curve
|
||||
--- [aToler] - reached tolerance
|
||||
--- Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
|
||||
HasCurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aC : out Curve from Geom2d;
|
||||
aFirst: out Real from Standard;
|
||||
aLast : out Real from Standard;
|
||||
aToler: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
--- on surface <aF> .
|
||||
--- [aFirst, aLast] - range of the P-Curve
|
||||
--- [aToler] - reached tolerance
|
||||
--- If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
---
|
||||
HasCurveOnSurface (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
--- on surface <aF> .
|
||||
--- If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
---
|
||||
|
||||
AdjustPCurveOnFace (myclass;
|
||||
aF : Face from TopoDS;
|
||||
C3D : Curve from Geom;
|
||||
aC2D : Curve from Geom2d;
|
||||
aC2DA : out Curve from Geom2d);
|
||||
---Purpose:
|
||||
--- Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
---
|
||||
AdjustPCurveOnFace (myclass;
|
||||
aF : Face from TopoDS;
|
||||
aT1 : Real from Standard;
|
||||
aT2 : Real from Standard;
|
||||
aC2D : Curve from Geom2d;
|
||||
aC2DA : out Curve from Geom2d);
|
||||
---Purpose:
|
||||
--- Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
--- [aT1, aT2] - range to adjust
|
||||
---
|
||||
AdjustPCurveOnFace (myclass;
|
||||
aF : Surface from BRepAdaptor;
|
||||
aT1 : Real from Standard;
|
||||
aT2 : Real from Standard;
|
||||
aC2D : Curve from Geom2d;
|
||||
aC2DA : out Curve from Geom2d);
|
||||
---Purpose:
|
||||
--- Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
--- [aT1, aT2] - range to adjust
|
||||
---
|
||||
IntermediatePoint (myclass;
|
||||
aFirst: Real from Standard;
|
||||
aLast : Real from Standard)
|
||||
returns Real from Standard;
|
||||
---Purpose:
|
||||
--- Compute intermediate value in between [aFirst, aLast] .
|
||||
---
|
||||
IntermediatePoint (myclass;
|
||||
anE : Edge from TopoDS)
|
||||
returns Real from Standard;
|
||||
---Purpose:
|
||||
--- Compute intermediate value of parameter for the edge <anE>.
|
||||
---
|
||||
BuildPCurveForEdgeOnPlane(myclass;
|
||||
theE : Edge from TopoDS;
|
||||
theF : Face from TopoDS);
|
||||
|
||||
BuildPCurveForEdgesOnPlane(myclass;
|
||||
theLE : ListOfShape from BOPCol;
|
||||
theF : Face from TopoDS);
|
||||
|
||||
Make2D (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aC : out Curve from Geom2d;
|
||||
aFirst: out Real from Standard;
|
||||
aLast : out Real from Standard;
|
||||
aToler: out Real from Standard);
|
||||
---Purpose:
|
||||
--- Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
--- [aFirst, aLast] - range of the P-Curve
|
||||
--- [aToler] - reached tolerance
|
||||
--- Raises exception Standard_ConstructionError if algorithm fails
|
||||
|
||||
MakePCurveOnFace (myclass;
|
||||
aF: Face from TopoDS;
|
||||
C3D : Curve from Geom;
|
||||
aC : out Curve from Geom2d;
|
||||
aToler: out Real from Standard) ;
|
||||
---Purpose:
|
||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
--- [aToler] - reached tolerance
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
MakePCurveOnFace (myclass;
|
||||
aF: Face from TopoDS;
|
||||
C3D : Curve from Geom;
|
||||
aT1 : Real from Standard;
|
||||
aT2 : Real from Standard;
|
||||
aC : out Curve from Geom2d;
|
||||
aToler: out Real from Standard) ;
|
||||
---Purpose:
|
||||
--- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
--- [aT1, aT2] - range to build
|
||||
--- [aToler] - reached tolerance
|
||||
--- Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
|
||||
MakePCurveOfType (myclass;
|
||||
PC : ProjectedCurve from ProjLib;
|
||||
aC : out Curve from Geom2d);
|
||||
---Purpose:
|
||||
--- Make empty P-Curve <aC> of relevant to <PC> type
|
||||
---
|
||||
AttachExistingPCurve (myclass;
|
||||
aEold : Edge from TopoDS;
|
||||
aEnew : Edge from TopoDS;
|
||||
aF : Face from TopoDS;
|
||||
aCtx : Context from IntTools)
|
||||
returns Integer from Standard;
|
||||
---Purpose:
|
||||
--- Attach P-Curve from the edge <aEold> on surface <aF>
|
||||
--- to the edge <aEnew>
|
||||
--- Returns 0 in case of success
|
||||
|
||||
end AlgoTools2D;
|
@@ -12,70 +12,58 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_AlgoTools2D.ixx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepClass_FaceClassifier.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Geom2d_BSplineCurve.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.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 <GeomInt.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
#include <Geom2d_Curve.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 <Geom2d_BSplineCurve.hxx>
|
||||
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
|
||||
#include <GeomProjLib.hxx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepClass_FaceClassifier.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
|
||||
#include <BOPTools.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <GeomInt.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
static
|
||||
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& );
|
||||
|
172
src/BOPTools/BOPTools_AlgoTools2D.hxx
Normal file
172
src/BOPTools/BOPTools_AlgoTools2D.hxx
Normal file
@@ -0,0 +1,172 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_AlgoTools2D_HeaderFile
|
||||
#define _BOPTools_AlgoTools2D_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
class gp_Vec;
|
||||
class Geom2d_Curve;
|
||||
class Geom_Curve;
|
||||
class BRepAdaptor_Surface;
|
||||
class ProjLib_ProjectedCurve;
|
||||
class IntTools_Context;
|
||||
|
||||
|
||||
|
||||
//! The class contains handy static functions
|
||||
//! dealing with the topology
|
||||
//! This is the copy of the BOPTools_AlgoTools2D.cdl
|
||||
class BOPTools_AlgoTools2D
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Compute P-Curve for the edge <aE> on the face <aF>
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
||||
|
||||
|
||||
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
|
||||
Standard_EXPORT static Standard_Boolean EdgeTangent (const TopoDS_Edge& anE, const Standard_Real aT, gp_Vec& Tau);
|
||||
|
||||
|
||||
//! Compute surface parameters <U,V> of the face <aF>
|
||||
//! for the point from the edge <aE> at parameter <aT>.
|
||||
//! If <aE> has't pcurve on surface, algorithm tries to get it by
|
||||
//! projection and can
|
||||
//! raise exception Standard_ConstructionError if projection algorithm fails
|
||||
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, Standard_Real& U, Standard_Real& V);
|
||||
|
||||
|
||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
//! If the P-Curve does not exist, build it using Make2D().
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
//! If the P-Curve does not exist, build it using Make2D().
|
||||
//! [aFirst, aLast] - range of the P-Curve
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails
|
||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
//! on surface <aF> .
|
||||
//! [aFirst, aLast] - range of the P-Curve
|
||||
//! [aToler] - reached tolerance
|
||||
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
//! on surface <aF> .
|
||||
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
||||
|
||||
|
||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
||||
|
||||
|
||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
//! [aT1, aT2] - range to adjust
|
||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
||||
|
||||
|
||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
//! [aT1, aT2] - range to adjust
|
||||
Standard_EXPORT static void AdjustPCurveOnFace (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
||||
|
||||
|
||||
//! Compute intermediate value in between [aFirst, aLast] .
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast);
|
||||
|
||||
|
||||
//! Compute intermediate value of parameter for the edge <anE>.
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint (const TopoDS_Edge& anE);
|
||||
|
||||
Standard_EXPORT static void BuildPCurveForEdgeOnPlane (const TopoDS_Edge& theE, const TopoDS_Face& theF);
|
||||
|
||||
Standard_EXPORT static void BuildPCurveForEdgesOnPlane (const BOPCol_ListOfShape& theLE, const TopoDS_Face& theF);
|
||||
|
||||
|
||||
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .
|
||||
//! [aFirst, aLast] - range of the P-Curve
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if algorithm fails
|
||||
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .
|
||||
//! [aT1, aT2] - range to build
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails
|
||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF, const Handle(Geom_Curve)& C3D, const Standard_Real aT1, const Standard_Real aT2, Handle(Geom2d_Curve)& aC, Standard_Real& aToler);
|
||||
|
||||
|
||||
//! Make empty P-Curve <aC> of relevant to <PC> type
|
||||
Standard_EXPORT static void MakePCurveOfType (const ProjLib_ProjectedCurve& PC, Handle(Geom2d_Curve)& aC);
|
||||
|
||||
|
||||
//! Attach P-Curve from the edge <aEold> on surface <aF>
|
||||
//! to the edge <aEnew>
|
||||
//! Returns 0 in case of success
|
||||
Standard_EXPORT static Standard_Integer AttachExistingPCurve (const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_AlgoTools2D_HeaderFile
|
@@ -1,193 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 AlgoTools3D from BOPTools
|
||||
---Purpose:
|
||||
-- The class contains handy static functions
|
||||
-- dealing with the topology
|
||||
-- This is the copy of BOPTools_AlgoTools3D.cdl file
|
||||
|
||||
uses
|
||||
Pln from gp,
|
||||
Dir from gp,
|
||||
Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
|
||||
Surface from Geom,
|
||||
|
||||
Shape from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Solid from TopoDS,
|
||||
|
||||
ShapeEnum from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
State from TopAbs,
|
||||
|
||||
ListOfShape from BOPCol,
|
||||
|
||||
Context from IntTools,
|
||||
|
||||
IndexedDataMapOfShapeListOfShape from BOPCol
|
||||
|
||||
is
|
||||
|
||||
DoSplitSEAMOnFace (myclass;
|
||||
aSp: Edge from TopoDS;
|
||||
aF : Face from TopoDS);
|
||||
---Purpose:
|
||||
-- Make the edge <aSp> seam edge for the face <aF>
|
||||
--
|
||||
|
||||
GetNormalToFaceOnEdge (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aT: Real from Standard;
|
||||
aD:out Dir from gp);
|
||||
---Purpose:
|
||||
--- Computes normal to the face <aF> for the point on the edge <aE>
|
||||
--- at parameter <aT>
|
||||
---
|
||||
GetNormalToFaceOnEdge (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aD:out Dir from gp);
|
||||
---Purpose:
|
||||
--- Computes normal to the face <aF> for the point on the edge <aE>
|
||||
--- at arbitrary intermediate parameter
|
||||
---
|
||||
|
||||
SenseFlag (myclass;
|
||||
aNF1 : Dir from gp;
|
||||
aNF2 : Dir from gp)
|
||||
returns Integer from Standard;
|
||||
---Purpose:
|
||||
--- Returns 1 if scalar product aNF1* aNF2>0.
|
||||
--- Returns 0 if directions aNF1 aNF2 coinside
|
||||
--- Returns -1 if scalar product aNF1* aNF2<0.
|
||||
---
|
||||
GetNormalToSurface (myclass;
|
||||
aS: Surface from Geom;
|
||||
U : Real from Standard;
|
||||
V : Real from Standard;
|
||||
aD:out Dir from gp)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Compute normal <aD> to surface <aS> in point (U,V)
|
||||
--- Returns TRUE if directions aD1U, aD1V coinside
|
||||
---
|
||||
|
||||
GetApproxNormalToFaceOnEdge (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aT: Real from Standard;
|
||||
aPx:out Pnt from gp;
|
||||
aD:out Dir from gp;
|
||||
theContext:out Context from IntTools);
|
||||
---Purpose:
|
||||
--- Computes normal to the face <aF> for the 3D-point that
|
||||
--- belonds to the edge <aE> at parameter <aT>.
|
||||
-- Output:
|
||||
--- aPx - the 3D-point where the normal computed
|
||||
--- aD - the normal;
|
||||
---
|
||||
-- Warning:
|
||||
--- The normal is computed not exactly in the point on the
|
||||
--- edge, but in point that is near to the edge towards to
|
||||
--- the face material (so, we'll have approx. normal)
|
||||
---
|
||||
|
||||
GetApproxNormalToFaceOnEdge(myclass;
|
||||
theE : Edge from TopoDS;
|
||||
theF : Face from TopoDS;
|
||||
aT : Real from Standard;
|
||||
aP : out Pnt from gp;
|
||||
aDNF : out Dir from gp;
|
||||
aDt2D: Real from Standard);
|
||||
|
||||
PointNearEdge (myclass;
|
||||
aE : Edge from TopoDS;
|
||||
aF : Face from TopoDS;
|
||||
aT : Real from Standard;
|
||||
aDt2D: Real from Standard;
|
||||
aP2D :out Pnt2d from gp;
|
||||
aPx :out Pnt from gp);
|
||||
---Purpose:
|
||||
--- Compute the point <aPx>, (<aP2D>) that is near to
|
||||
--- the edge <aE> at parameter <aT> towards to the
|
||||
--- material of the face <aF>. The value of shifting in
|
||||
--- 2D is <aDt2D>
|
||||
---
|
||||
PointNearEdge (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aT: Real from Standard;
|
||||
aP2D:out Pnt2d from gp;
|
||||
aPx:out Pnt from gp;
|
||||
theContext:out Context from IntTools);
|
||||
---Purpose:
|
||||
--- Computes the point <aPx>, (<aP2D>) that is near to
|
||||
--- the edge <aE> at parameter <aT> towards to the
|
||||
--- material of the face <aF>. The value of shifting in
|
||||
-- 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
|
||||
---
|
||||
PointNearEdge (myclass;
|
||||
aE: Edge from TopoDS;
|
||||
aF: Face from TopoDS;
|
||||
aP2D:out Pnt2d from gp;
|
||||
aPx:out Pnt from gp;
|
||||
theContext:out Context from IntTools);
|
||||
---Purpose:
|
||||
--- Compute the point <aPx>, (<aP2D>) that is near to
|
||||
--- the edge <aE> at arbitrary parameter towards to the
|
||||
--- material of the face <aF>. The value of shifting in
|
||||
-- 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
|
||||
---
|
||||
|
||||
MinStepIn2d(myclass)
|
||||
returns Real from Standard;
|
||||
---Purpose:
|
||||
--- Returns simple step value that is used in 2D-computations
|
||||
--- = 1.e-5
|
||||
---
|
||||
IsEmptyShape(myclass;
|
||||
aS: Shape from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Returns TRUE if the shape <aS> does not contain
|
||||
--- geometry information (e.g. empty compound)
|
||||
---
|
||||
|
||||
OrientEdgeOnFace (myclass;
|
||||
aE : Edge from TopoDS;
|
||||
aF : Face from TopoDS;
|
||||
aER : out Edge from TopoDS);
|
||||
---Purpose:
|
||||
--- Get the edge <aER> from the face <aF> that is the same as
|
||||
--- the edge <aE>
|
||||
---
|
||||
|
||||
PointInFace(myclass;
|
||||
theF:Face from TopoDS;
|
||||
theP:out Pnt from gp;
|
||||
theP2D:out Pnt2d from gp;
|
||||
theContext:out Context from IntTools)
|
||||
returns Integer from Standard;
|
||||
---Purpose: Computes a point <theP> inside the face <theF>. <br>
|
||||
-- <theP2D> - 2D representation of <theP> <br>
|
||||
-- on the surface of <theF> <br>
|
||||
-- Returns 0 in case of success. <br>
|
||||
|
||||
end AlgoTools3D;
|
@@ -12,68 +12,57 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_AlgoTools3D.ixx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dHatch_Hatcher.hxx>
|
||||
#include <HatchGen_Domain.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BOPTools_AlgoTools3D.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dHatch_Hatcher.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <HatchGen_Domain.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
static void Add(const TopoDS_Shape& aS,
|
||||
BOPCol_IndexedMapOfShape& myShapes,
|
||||
|
151
src/BOPTools/BOPTools_AlgoTools3D.hxx
Normal file
151
src/BOPTools/BOPTools_AlgoTools3D.hxx
Normal file
@@ -0,0 +1,151 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_AlgoTools3D_HeaderFile
|
||||
#define _BOPTools_AlgoTools3D_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 TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
class gp_Dir;
|
||||
class Geom_Surface;
|
||||
class gp_Pnt;
|
||||
class IntTools_Context;
|
||||
class gp_Pnt2d;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
//! The class contains handy static functions
|
||||
//! dealing with the topology
|
||||
//! This is the copy of BOPTools_AlgoTools3D.cdl file
|
||||
class BOPTools_AlgoTools3D
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Make the edge <aSp> seam edge for the face <aF>
|
||||
Standard_EXPORT static void DoSplitSEAMOnFace (const TopoDS_Edge& aSp, const TopoDS_Face& aF);
|
||||
|
||||
|
||||
//! Computes normal to the face <aF> for the point on the edge <aE>
|
||||
//! at parameter <aT>
|
||||
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Dir& aD);
|
||||
|
||||
|
||||
//! Computes normal to the face <aF> for the point on the edge <aE>
|
||||
//! at arbitrary intermediate parameter
|
||||
Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, gp_Dir& aD);
|
||||
|
||||
|
||||
//! Returns 1 if scalar product aNF1* aNF2>0.
|
||||
//! Returns 0 if directions aNF1 aNF2 coinside
|
||||
//! Returns -1 if scalar product aNF1* aNF2<0.
|
||||
Standard_EXPORT static Standard_Integer SenseFlag (const gp_Dir& aNF1, const gp_Dir& aNF2);
|
||||
|
||||
|
||||
//! Compute normal <aD> to surface <aS> in point (U,V)
|
||||
//! Returns TRUE if directions aD1U, aD1V coinside
|
||||
Standard_EXPORT static Standard_Boolean GetNormalToSurface (const Handle(Geom_Surface)& aS, const Standard_Real U, const Standard_Real V, gp_Dir& aD);
|
||||
|
||||
|
||||
//! Computes normal to the face <aF> for the 3D-point that
|
||||
//! belonds to the edge <aE> at parameter <aT>.
|
||||
//! Output:
|
||||
//! aPx - the 3D-point where the normal computed
|
||||
//! aD - the normal;
|
||||
//!
|
||||
//! Warning:
|
||||
//! The normal is computed not exactly in the point on the
|
||||
//! edge, but in point that is near to the edge towards to
|
||||
//! the face material (so, we'll have approx. normal)
|
||||
Standard_EXPORT static void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Pnt& aPx, gp_Dir& aD, Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& theE, const TopoDS_Face& theF, const Standard_Real aT, gp_Pnt& aP, gp_Dir& aDNF, const Standard_Real aDt2D);
|
||||
|
||||
|
||||
//! Compute the point <aPx>, (<aP2D>) that is near to
|
||||
//! the edge <aE> at parameter <aT> towards to the
|
||||
//! material of the face <aF>. The value of shifting in
|
||||
//! 2D is <aDt2D>
|
||||
Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, const Standard_Real aDt2D, gp_Pnt2d& aP2D, gp_Pnt& aPx);
|
||||
|
||||
|
||||
//! Computes the point <aPx>, (<aP2D>) that is near to
|
||||
//! the edge <aE> at parameter <aT> towards to the
|
||||
//! material of the face <aF>. The value of shifting in
|
||||
//! 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
|
||||
Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Pnt2d& aP2D, gp_Pnt& aPx, Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
//! Compute the point <aPx>, (<aP2D>) that is near to
|
||||
//! the edge <aE> at arbitrary parameter towards to the
|
||||
//! material of the face <aF>. The value of shifting in
|
||||
//! 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
|
||||
Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, gp_Pnt2d& aP2D, gp_Pnt& aPx, Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
//! Returns simple step value that is used in 2D-computations
|
||||
//! = 1.e-5
|
||||
Standard_EXPORT static Standard_Real MinStepIn2d();
|
||||
|
||||
|
||||
//! Returns TRUE if the shape <aS> does not contain
|
||||
//! geometry information (e.g. empty compound)
|
||||
Standard_EXPORT static Standard_Boolean IsEmptyShape (const TopoDS_Shape& aS);
|
||||
|
||||
|
||||
//! Get the edge <aER> from the face <aF> that is the same as
|
||||
//! the edge <aE>
|
||||
Standard_EXPORT static void OrientEdgeOnFace (const TopoDS_Edge& aE, const TopoDS_Face& aF, TopoDS_Edge& aER);
|
||||
|
||||
//! Computes a point <theP> inside the face <theF>. <br>
|
||||
//! <theP2D> - 2D representation of <theP> <br>
|
||||
//! on the surface of <theF> <br>
|
||||
//! Returns 0 in case of success. <br>
|
||||
Standard_EXPORT static Standard_Integer PointInFace (const TopoDS_Face& theF, gp_Pnt& theP, gp_Pnt2d& theP2D, Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_AlgoTools3D_HeaderFile
|
@@ -12,77 +12,84 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_AlgoTools.ixx>
|
||||
//
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
//
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
//
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
//
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
//
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dInt_GInter.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
//
|
||||
#include <GeomProjLib.hxx>
|
||||
//
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
//
|
||||
#include <IntRes2d_Domain.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
//
|
||||
#include <TopLoc_Location.hxx>
|
||||
//
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
//
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BOPCol_NCVector.hxx>
|
||||
#include <BOPCol_Parallel.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
//
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
//
|
||||
#include <BRepLib_CheckCurveOnSurface.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
//
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <Geom2dInt_GInter.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 <GeomProjLib.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <IntRes2d_Domain.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Curve.hxx>
|
||||
#include <IntTools_Range.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
//
|
||||
#include <IntTools_Tools.hxx>
|
||||
//
|
||||
#include <BOPCol_NCVector.hxx>
|
||||
#include <BOPCol_Parallel.hxx>
|
||||
#include <BRepLib_CheckCurveOnSurface.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
static
|
||||
void CheckEdge (const TopoDS_Edge& E,
|
||||
const Standard_Real aMaxTol);
|
||||
|
@@ -12,25 +12,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_AlgoTools.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <IntTools_Curve.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Curve.hxx>
|
||||
#include <IntTools_Range.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
static
|
||||
void TreatCompound(const TopoDS_Shape& theC1,
|
||||
|
@@ -1,76 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 EdgeSet from BOPTools
|
||||
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Edge from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
BaseAllocator from BOPCol,
|
||||
MapOfShape from BOPCol,
|
||||
ListOfShape from BOPCol
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
Create
|
||||
returns EdgeSet from BOPTools;
|
||||
---C++: alias "virtual ~BOPTools_EdgeSet();"
|
||||
---C++: inline
|
||||
|
||||
Create (theAllocator: BaseAllocator from BOPCol)
|
||||
returns EdgeSet from BOPTools;
|
||||
---C++: inline
|
||||
|
||||
SetShape(me:out;
|
||||
theS:Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
Shape(me)
|
||||
returns Shape from TopoDS;
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
|
||||
AddEdge(me:out;
|
||||
theEdge:Edge from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
AddEdges(me:out;
|
||||
theLS:ListOfShape from BOPCol);
|
||||
|
||||
AddEdges(me:out;
|
||||
theFace:Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
Clear(me:out);
|
||||
---C++: inline
|
||||
|
||||
Get(me;
|
||||
theLS:out ListOfShape from BOPCol);
|
||||
---C++: inline
|
||||
|
||||
Contains(me;
|
||||
theSet:EdgeSet from BOPTools)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
fields
|
||||
myShape : Shape from TopoDS is protected;
|
||||
myMap : MapOfShape from BOPCol is protected;
|
||||
myEdges : ListOfShape from BOPCol is protected;
|
||||
|
||||
end EdgeSet;
|
@@ -12,4 +12,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_EdgeSet.ixx>
|
||||
|
||||
#include <BOPTools_EdgeSet.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
87
src/BOPTools/BOPTools_EdgeSet.hxx
Normal file
87
src/BOPTools/BOPTools_EdgeSet.hxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_EdgeSet_HeaderFile
|
||||
#define _BOPTools_EdgeSet_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <BOPCol_BaseAllocator.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Edge;
|
||||
|
||||
|
||||
|
||||
class BOPTools_EdgeSet
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
BOPTools_EdgeSet();
|
||||
virtual ~BOPTools_EdgeSet();
|
||||
|
||||
BOPTools_EdgeSet(const BOPCol_BaseAllocator& theAllocator);
|
||||
|
||||
void SetShape (const TopoDS_Shape& theS);
|
||||
|
||||
const TopoDS_Shape& Shape() const;
|
||||
|
||||
void AddEdge (const TopoDS_Edge& theEdge);
|
||||
|
||||
Standard_EXPORT void AddEdges (const BOPCol_ListOfShape& theLS);
|
||||
|
||||
void AddEdges (const TopoDS_Shape& theFace);
|
||||
|
||||
void Clear();
|
||||
|
||||
void Get (BOPCol_ListOfShape& theLS) const;
|
||||
|
||||
Standard_Boolean Contains (const BOPTools_EdgeSet& theSet) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
BOPCol_MapOfShape myMap;
|
||||
BOPCol_ListOfShape myEdges;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <BOPTools_EdgeSet.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_EdgeSet_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 Set from BOPTools
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
ShapeEnum from TopAbs,
|
||||
Shape from TopoDS,
|
||||
ListOfShape from BOPCol,
|
||||
BaseAllocator from BOPCol
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
Create
|
||||
returns Set from BOPTools;
|
||||
---C++: alias "Standard_EXPORT virtual ~BOPTools_Set();"
|
||||
|
||||
Create (theAllocator: BaseAllocator from BOPCol)
|
||||
returns Set from BOPTools;
|
||||
|
||||
Assign(me:out;
|
||||
Other : Set from BOPTools)
|
||||
returns Set from BOPTools;
|
||||
---C++: alias operator =
|
||||
---C++: return &
|
||||
|
||||
Clear(me:out)
|
||||
is protected;
|
||||
|
||||
Shape(me)
|
||||
returns Shape from TopoDS;
|
||||
---C++: return const &
|
||||
|
||||
Add(me:out;
|
||||
theS:Shape from TopoDS;
|
||||
theType: ShapeEnum from TopAbs);
|
||||
|
||||
NbShapes(me)
|
||||
returns Integer from Standard;
|
||||
|
||||
IsEqual(me;
|
||||
aOther:Set from BOPTools)
|
||||
returns Boolean from Standard;
|
||||
|
||||
HashCode(me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard;
|
||||
|
||||
fields
|
||||
myAllocator : BaseAllocator from BOPCol is protected;
|
||||
myShapes : ListOfShape from BOPCol is protected;
|
||||
myShape : Shape from TopoDS is protected;
|
||||
myNbShapes : Integer from Standard is protected;
|
||||
mySum : Integer from Standard is protected;
|
||||
myUpper : Integer from Standard is protected;
|
||||
|
||||
end Set;
|
@@ -12,12 +12,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_Set.ixx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPTools_Set.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
static
|
||||
Standard_Integer NormalizedIds(const Standard_Integer aId,
|
||||
|
91
src/BOPTools/BOPTools_Set.hxx
Normal file
91
src/BOPTools/BOPTools_Set.hxx
Normal file
@@ -0,0 +1,91 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_Set_HeaderFile
|
||||
#define _BOPTools_Set_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BOPCol_BaseAllocator.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
class BOPTools_Set
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BOPTools_Set();
|
||||
Standard_EXPORT virtual ~BOPTools_Set();
|
||||
|
||||
Standard_EXPORT BOPTools_Set(const BOPCol_BaseAllocator& theAllocator);
|
||||
|
||||
Standard_EXPORT BOPTools_Set& Assign (const BOPTools_Set& Other);
|
||||
BOPTools_Set& operator = (const BOPTools_Set& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Shape() const;
|
||||
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType);
|
||||
|
||||
Standard_EXPORT Standard_Integer NbShapes() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsEqual (const BOPTools_Set& aOther) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer HashCode (const Standard_Integer Upper) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
|
||||
BOPCol_BaseAllocator myAllocator;
|
||||
BOPCol_ListOfShape myShapes;
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Integer myNbShapes;
|
||||
Standard_Integer mySum;
|
||||
Standard_Integer myUpper;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_Set_HeaderFile
|
@@ -1,39 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 SetMapHasher from BOPTools
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Set from BOPTools
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
HashCode(myclass;
|
||||
aSet : Set from BOPTools;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard;
|
||||
---C++: inline
|
||||
|
||||
IsEqual(myclass;
|
||||
aSet1 : Set from BOPTools;
|
||||
aSet2 : Set from BOPTools)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
--fields
|
||||
|
||||
end SetMapHasher;
|
@@ -12,4 +12,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_SetMapHasher.ixx>
|
||||
|
||||
#include <BOPTools_Set.hxx>
|
||||
#include <BOPTools_SetMapHasher.hxx>
|
||||
|
63
src/BOPTools/BOPTools_SetMapHasher.hxx
Normal file
63
src/BOPTools/BOPTools_SetMapHasher.hxx
Normal file
@@ -0,0 +1,63 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_SetMapHasher_HeaderFile
|
||||
#define _BOPTools_SetMapHasher_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class BOPTools_Set;
|
||||
|
||||
|
||||
|
||||
class BOPTools_SetMapHasher
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
static Standard_Integer HashCode (const BOPTools_Set& aSet, const Standard_Integer Upper);
|
||||
|
||||
static Standard_Boolean IsEqual (const BOPTools_Set& aSet1, const BOPTools_Set& aSet2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <BOPTools_SetMapHasher.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_SetMapHasher_HeaderFile
|
@@ -1,93 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- 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 ShapeSet from BOPTools
|
||||
|
||||
---Purpose: Implementation of some formal
|
||||
-- opereations with a set of shapes
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Edge from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
BaseAllocator from BOPCol,
|
||||
MapOfOrientedShape from BOPCol,
|
||||
ListOfShape from BOPCol
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
Create
|
||||
returns ShapeSet from BOPTools;
|
||||
---C++: alias "virtual ~BOPTools_ShapeSet();"
|
||||
---C++: inline
|
||||
|
||||
Create (theAllocator: BaseAllocator from BOPCol)
|
||||
returns ShapeSet from BOPTools;
|
||||
---C++: inline
|
||||
|
||||
SetShape(me:out;
|
||||
theS:Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
Shape(me)
|
||||
returns Shape from TopoDS;
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
|
||||
Add(me:out;
|
||||
theLS:ListOfShape from BOPCol);
|
||||
|
||||
Add(me:out;
|
||||
theShape:Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
Add(me:out;
|
||||
theShape:Shape from TopoDS;
|
||||
theType: ShapeEnum from TopAbs);
|
||||
|
||||
AddEdge(me:out;
|
||||
theEdge:Edge from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
AddEdges(me:out;
|
||||
theLS:ListOfShape from BOPCol);
|
||||
|
||||
AddEdges(me:out;
|
||||
theFace:Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
Subtract(me:out;
|
||||
theSet:ShapeSet from BOPTools);
|
||||
---C++: alias operator -=
|
||||
---C++: inline
|
||||
|
||||
Clear(me:out);
|
||||
---C++: inline
|
||||
|
||||
Get(me;
|
||||
theLS:out ListOfShape from BOPCol);
|
||||
---C++: inline
|
||||
|
||||
Contains(me;
|
||||
theSet:ShapeSet from BOPTools)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
|
||||
fields
|
||||
myShape: Shape from TopoDS is protected;
|
||||
myMap : MapOfOrientedShape from BOPCol is protected;
|
||||
|
||||
end ShapeSet;
|
@@ -12,4 +12,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPTools_ShapeSet.ixx>
|
||||
|
||||
#include <BOPTools_ShapeSet.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
100
src/BOPTools/BOPTools_ShapeSet.hxx
Normal file
100
src/BOPTools/BOPTools_ShapeSet.hxx
Normal file
@@ -0,0 +1,100 @@
|
||||
// Created by: Peter KURNEV
|
||||
// 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 _BOPTools_ShapeSet_HeaderFile
|
||||
#define _BOPTools_ShapeSet_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <BOPCol_MapOfOrientedShape.hxx>
|
||||
#include <BOPCol_BaseAllocator.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Edge;
|
||||
|
||||
|
||||
//! Implementation of some formal
|
||||
//! opereations with a set of shapes
|
||||
class BOPTools_ShapeSet
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
BOPTools_ShapeSet();
|
||||
virtual ~BOPTools_ShapeSet();
|
||||
|
||||
BOPTools_ShapeSet(const BOPCol_BaseAllocator& theAllocator);
|
||||
|
||||
void SetShape (const TopoDS_Shape& theS);
|
||||
|
||||
const TopoDS_Shape& Shape() const;
|
||||
|
||||
Standard_EXPORT void Add (const BOPCol_ListOfShape& theLS);
|
||||
|
||||
void Add (const TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType);
|
||||
|
||||
void AddEdge (const TopoDS_Edge& theEdge);
|
||||
|
||||
Standard_EXPORT void AddEdges (const BOPCol_ListOfShape& theLS);
|
||||
|
||||
void AddEdges (const TopoDS_Shape& theFace);
|
||||
|
||||
void Subtract (const BOPTools_ShapeSet& theSet);
|
||||
void operator -= (const BOPTools_ShapeSet& theSet)
|
||||
{
|
||||
Subtract(theSet);
|
||||
}
|
||||
|
||||
void Clear();
|
||||
|
||||
void Get (BOPCol_ListOfShape& theLS) const;
|
||||
|
||||
Standard_Boolean Contains (const BOPTools_ShapeSet& theSet) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
BOPCol_MapOfOrientedShape myMap;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <BOPTools_ShapeSet.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_ShapeSet_HeaderFile
|
@@ -1,14 +1,30 @@
|
||||
BOPTools.cxx
|
||||
BOPTools.hxx
|
||||
BOPTools_AlgoTools.cxx
|
||||
BOPTools_AlgoTools.hxx
|
||||
BOPTools_AlgoTools2D.cxx
|
||||
BOPTools_AlgoTools2D.hxx
|
||||
BOPTools_AlgoTools2D_1.cxx
|
||||
BOPTools_AlgoTools3D.cxx
|
||||
BOPTools_AlgoTools3D.hxx
|
||||
BOPTools_AlgoTools_1.cxx
|
||||
BOPTools_AlgoTools_2.cxx
|
||||
BOPTools_AlgoTools2D.cxx
|
||||
BOPTools_AlgoTools3D.cxx
|
||||
BOPTools_ConnexityBlock.hxx
|
||||
BOPTools_ListOfConnexityBlock.hxx
|
||||
BOPTools_ListOfShapeSet.hxx
|
||||
BOPTools_CoupleOfShape.hxx
|
||||
BOPTools_DataMapOfShapeSet.hxx
|
||||
BOPTools_EdgeSet.cxx
|
||||
BOPTools_EdgeSet.hxx
|
||||
BOPTools_EdgeSet.lxx
|
||||
BOPTools_ListOfConnexityBlock.hxx
|
||||
BOPTools_ListOfCoupleOfShape.hxx
|
||||
BOPTools_ListOfEdgeSet.hxx
|
||||
BOPTools_ListOfShapeSet.hxx
|
||||
BOPTools_MapOfSet.hxx
|
||||
BOPTools_DataMapOfShapeSet.hxx
|
||||
|
||||
BOPTools_AlgoTools2D_1.cxx
|
||||
BOPTools_Set.cxx
|
||||
BOPTools_Set.hxx
|
||||
BOPTools_SetMapHasher.cxx
|
||||
BOPTools_SetMapHasher.hxx
|
||||
BOPTools_SetMapHasher.lxx
|
||||
BOPTools_ShapeSet.cxx
|
||||
BOPTools_ShapeSet.hxx
|
||||
BOPTools_ShapeSet.lxx
|
||||
|
Reference in New Issue
Block a user