mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0030150: Modeling Algorithms - Removal of BRepAlgo_BooleanOperations and BRepAlgo_DSAccess classes
Replacing usage of BRepAlgo_DSAccess with usage of modern Boolean operations algorithms in BRepFill_Draft. Removing BRepAlgo_BooleanOperations and BRepAlgo_DSAccess classes. The following classes have been removed as unused: * BRepAlgo_DataMapOfShapeBoolean * BRepAlgo_DataMapOfShapeInterference * BRepAlgo_EdgeConnector * BRepAlgo_SequenceOfSequenceOfInteger
This commit is contained in:
@@ -38,9 +38,6 @@ class BRepAlgo_Tool;
|
||||
class BRepAlgo_Image;
|
||||
class BRepAlgo_AsDes;
|
||||
class BRepAlgo_FaceRestrictor;
|
||||
class BRepAlgo_BooleanOperations;
|
||||
class BRepAlgo_DSAccess;
|
||||
class BRepAlgo_EdgeConnector;
|
||||
class BRepAlgo_NormalProjection;
|
||||
|
||||
|
||||
@@ -114,9 +111,6 @@ friend class BRepAlgo_Tool;
|
||||
friend class BRepAlgo_Image;
|
||||
friend class BRepAlgo_AsDes;
|
||||
friend class BRepAlgo_FaceRestrictor;
|
||||
friend class BRepAlgo_BooleanOperations;
|
||||
friend class BRepAlgo_DSAccess;
|
||||
friend class BRepAlgo_EdgeConnector;
|
||||
friend class BRepAlgo_NormalProjection;
|
||||
|
||||
};
|
||||
|
@@ -1,395 +0,0 @@
|
||||
// Created on: 1997-11-20
|
||||
// Created by: Prestataire Mary FABIEN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAlgo_BooleanOperations.hxx>
|
||||
#include <BRepAlgo_DSAccess.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepTools_Substitution.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopOpeBRep_DSFiller.hxx>
|
||||
#include <TopOpeBRepBuild_HBuilder.hxx>
|
||||
#include <TopOpeBRepDS_BuildTool.hxx>
|
||||
#include <TopOpeBRepDS_HDataStructure.hxx>
|
||||
#include <TopOpeBRepTool_GeomTool.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Create
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepAlgo_BooleanOperations::BRepAlgo_BooleanOperations() :
|
||||
myApproxNbPntMax (30) ,
|
||||
myApproxTol3D (1.e-7) ,
|
||||
myApproxTol2D (1.e-7)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shapes2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::Shapes2d (const TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2)
|
||||
{
|
||||
// S1 doit etre une face ou un ensemble de faces
|
||||
// S2 doit etre une edge.
|
||||
|
||||
if (S2.ShapeType() != TopAbs_EDGE) return;
|
||||
|
||||
BRep_Builder Builder ;
|
||||
TopoDS_Wire Wire ;
|
||||
Builder.MakeWire (Wire);
|
||||
Builder.Add (Wire, S2);
|
||||
|
||||
TopExp_Explorer Exp (S1, TopAbs_FACE) ;
|
||||
if (!Exp.More()) return ;
|
||||
const TopoDS_Face& FirstFace = TopoDS::Face (Exp.Current()) ;
|
||||
|
||||
TopLoc_Location Loc;
|
||||
const Handle(Geom_Surface)& Surf = BRep_Tool::Surface (FirstFace, Loc) ;
|
||||
|
||||
TopoDS_Face Face ;
|
||||
Builder.MakeFace (Face, Surf, Loc, BRep_Tool::Tolerance (FirstFace)) ;
|
||||
Builder.Add (Face, Wire) ;
|
||||
Face.Orientation (FirstFace.Orientation()) ;
|
||||
|
||||
myS1 = S1 ;
|
||||
myS2 = Face ;
|
||||
|
||||
myDSA.Init() ;
|
||||
myDSA.Load (myS1, myS2) ;
|
||||
Handle (TopOpeBRepDS_HDataStructure)& HDS = myDSA.ChangeDS() ;
|
||||
myDSA.myDSFiller.Insert2d (myS1, myS2, HDS) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shapes
|
||||
//purpose : Defines the arguments.
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::Shapes (const TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2)
|
||||
{
|
||||
myS1 = S1;
|
||||
myS2 = S2;
|
||||
myDSA.Init();
|
||||
myDSA.Load(myS1, myS2);
|
||||
Handle(TopOpeBRepDS_HDataStructure)& HDS = myDSA.ChangeDS();
|
||||
myDSA.myDSFiller.Insert(myS1,myS2,HDS);
|
||||
// const Standard_Boolean CheckShapes = Standard_True;
|
||||
// Standard_Boolean esp = HDS->EdgesSameParameter();
|
||||
// Standard_Boolean localcheck = CheckShapes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetApproxParameters
|
||||
//purpose : Sets the parameters for the approximations.
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::SetApproxParameters (const Standard_Integer NbPntMax,
|
||||
const Standard_Real Tol3D,
|
||||
const Standard_Real Tol2D)
|
||||
{
|
||||
myApproxNbPntMax = NbPntMax ;
|
||||
myApproxTol3D = Tol3D ;
|
||||
myApproxTol2D = Tol2D ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Define
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::Define (const TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2,
|
||||
Handle(TopOpeBRepDS_HDataStructure)& HDS)
|
||||
{
|
||||
ChangeDataStructure() = HDS;
|
||||
myS1 = S1;
|
||||
myS2 = S2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose : Performs the global boolean operation.
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::Perform ()
|
||||
{
|
||||
TopOpeBRepDS_BuildTool& BTofBuilder = myDSA.myHB->ChangeBuildTool();
|
||||
TopOpeBRepTool_GeomTool& GTofBTofBuilder = BTofBuilder.ChangeGeomTool();
|
||||
GTofBTofBuilder.SetNbPntMax(myApproxNbPntMax);
|
||||
GTofBTofBuilder.SetTolerances (myApproxTol3D, myApproxTol2D) ;
|
||||
Handle(TopOpeBRepBuild_HBuilder)& HB = myDSA.myHB;
|
||||
Handle(TopOpeBRepDS_HDataStructure)& HDS = myDSA.ChangeDS();
|
||||
HB->Perform(HDS,myS1,myS2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose : Performs the global boolean operation in regards of the
|
||||
// given states.
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::Perform (const TopAbs_State State1,
|
||||
const TopAbs_State State2)
|
||||
{
|
||||
Perform() ;
|
||||
|
||||
myShape.Nullify() ;
|
||||
myResult.Nullify() ;
|
||||
myMapShape.Clear() ;
|
||||
|
||||
Handle(TopOpeBRepBuild_HBuilder)& HBuilder = ChangeBuilder() ;
|
||||
HBuilder->MergeShapes (myS1, State1, myS2, State2) ;
|
||||
|
||||
const TopTools_ListOfShape& ListResults = HBuilder->Merged (myS1, State1) ;
|
||||
Standard_Integer NbResults = ListResults.Extent() ;
|
||||
if (NbResults > 0) {
|
||||
if (NbResults == 1) {
|
||||
myShape = ListResults.First() ;
|
||||
} else {
|
||||
BRep_Builder Builder ;
|
||||
Builder.MakeCompound (TopoDS::Compound (myShape)) ;
|
||||
TopTools_ListIteratorOfListOfShape Iter ;
|
||||
for (Iter.Initialize (ListResults) ; Iter.More() ; Iter.Next())
|
||||
Builder.Add (myShape, Iter.Value()) ;
|
||||
}
|
||||
TopExp_Explorer Explorer ;
|
||||
for (Explorer.Init (myShape, TopAbs_FACE) ; Explorer.More() ; Explorer.Next()) {
|
||||
myMapShape.Add (Explorer.Current()) ;
|
||||
}
|
||||
for (Explorer.Init (myShape, TopAbs_EDGE) ; Explorer.More() ; Explorer.Next()) {
|
||||
myMapShape.Add (Explorer.Current()) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Common
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::Common()
|
||||
{
|
||||
Perform (TopAbs_IN, TopAbs_IN) ;
|
||||
return myShape ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : fus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::Fus()
|
||||
{
|
||||
Perform (TopAbs_OUT, TopAbs_OUT) ;
|
||||
return myShape ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : cut
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::Cut()
|
||||
{
|
||||
Perform (TopAbs_OUT, TopAbs_IN) ;
|
||||
return myShape ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Section
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::Section()
|
||||
{
|
||||
// Standard_Boolean bcw = BuilderCanWork();
|
||||
// if ( ! bcw || myshapeisnull) return;
|
||||
|
||||
Perform () ;
|
||||
|
||||
myShape.Nullify() ;
|
||||
myResult.Nullify() ;
|
||||
myMapShape.Clear() ;
|
||||
|
||||
Handle(TopOpeBRepBuild_HBuilder)& HBuilder = myDSA.myHB ;
|
||||
|
||||
const TopTools_ListOfShape& ListResults = HBuilder->Section() ;
|
||||
Standard_Integer NbResults = ListResults.Extent() ;
|
||||
if (NbResults > 0) {
|
||||
if (NbResults == 1) {
|
||||
myShape = ListResults.First() ;
|
||||
} else {
|
||||
BRep_Builder Builder ;
|
||||
Builder.MakeCompound (TopoDS::Compound (myShape)) ;
|
||||
TopTools_ListIteratorOfListOfShape Iter ;
|
||||
for (Iter.Initialize (ListResults) ; Iter.More() ; Iter.Next())
|
||||
Builder.Add (myShape, Iter.Value()) ;
|
||||
}
|
||||
TopExp_Explorer Explorer ;
|
||||
for (Explorer.Init (myShape, TopAbs_EDGE) ; Explorer.More() ; Explorer.Next()) {
|
||||
myMapShape.Add (Explorer.Current()) ;
|
||||
}
|
||||
}
|
||||
|
||||
return myShape ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::Shape()
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Shape& BRepAlgo_BooleanOperations::ShapeFrom (const TopoDS_Shape& Shape)
|
||||
{
|
||||
myResult.Nullify() ;
|
||||
|
||||
if (!myShape.IsNull()) {
|
||||
|
||||
TopoDS_Shape ShapeToDel ;
|
||||
if (Shape.IsSame (myS1)) {
|
||||
ShapeToDel = myS2 ;
|
||||
} else {
|
||||
ShapeToDel = myS1 ;
|
||||
}
|
||||
|
||||
BRepTools_Substitution Substitute ;
|
||||
|
||||
TopTools_ListOfShape NullFaces ;
|
||||
NullFaces.Clear() ;
|
||||
|
||||
TopExp_Explorer ExpFac ;
|
||||
for (ExpFac.Init (ShapeToDel, TopAbs_FACE) ; ExpFac.More() ; ExpFac.Next()) {
|
||||
const TopoDS_Face& Face = TopoDS::Face (ExpFac.Current()) ;
|
||||
const TopTools_ListOfShape& ListResults = Modified (Face) ;
|
||||
if (ListResults.Extent() == 0) {
|
||||
if (myMapShape.Contains (Face)) Substitute.Substitute (Face, NullFaces) ;
|
||||
} else {
|
||||
TopTools_ListIteratorOfListOfShape ItrFace ;
|
||||
for (ItrFace.Initialize (ListResults) ; ItrFace.More() ; ItrFace.Next()) {
|
||||
Substitute.Substitute (TopoDS::Face (ItrFace.Value()), NullFaces) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Substitute.Build (myShape) ;
|
||||
if (Substitute.IsCopied (myShape)) {
|
||||
const TopTools_ListOfShape& ListResults = Substitute.Copy (myShape) ;
|
||||
Standard_Integer NbResults = ListResults.Extent() ;
|
||||
if (NbResults == 1) {
|
||||
myResult = ListResults.First() ;
|
||||
} else if (NbResults > 1) {
|
||||
BRep_Builder Builder ;
|
||||
Builder.MakeCompound (TopoDS::Compound (myResult)) ;
|
||||
TopTools_ListIteratorOfListOfShape ItrResult ;
|
||||
for (ItrResult.Initialize (ListResults) ; ItrResult.More() ; ItrResult.Next()) {
|
||||
Builder.Add (myResult, ItrResult.Value()) ;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
myResult = myShape ;
|
||||
}
|
||||
|
||||
}
|
||||
return myResult ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Modified
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& BRepAlgo_BooleanOperations::Modified (const TopoDS_Shape& Shape)
|
||||
{
|
||||
return myDSA.Modified(Shape);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDeleted
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepAlgo_BooleanOperations::IsDeleted (const TopoDS_Shape& Shape)
|
||||
{
|
||||
Standard_Boolean Deleted = Standard_True ;
|
||||
|
||||
Handle(TopOpeBRepBuild_HBuilder)& HBuilder = myDSA.myHB ;
|
||||
|
||||
if ( myMapShape.Contains (Shape)
|
||||
|| HBuilder->IsMerged (Shape, TopAbs_OUT)
|
||||
|| HBuilder->IsMerged (Shape, TopAbs_IN)
|
||||
|| HBuilder->IsMerged (Shape, TopAbs_ON)
|
||||
|| HBuilder->IsSplit (Shape, TopAbs_OUT)
|
||||
|| HBuilder->IsSplit (Shape, TopAbs_IN)
|
||||
|| HBuilder->IsSplit (Shape, TopAbs_ON))
|
||||
Deleted = Standard_False ;
|
||||
|
||||
return Deleted ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DataStructure
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(TopOpeBRepDS_HDataStructure)& BRepAlgo_BooleanOperations::DataStructure() const
|
||||
{
|
||||
return myDSA.DS();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DataStructure
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TopOpeBRepDS_HDataStructure)& BRepAlgo_BooleanOperations::ChangeDataStructure()
|
||||
{
|
||||
return myDSA.ChangeDS();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Builder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(TopOpeBRepBuild_HBuilder)& BRepAlgo_BooleanOperations::Builder() const
|
||||
{
|
||||
return myDSA.Builder();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Builder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TopOpeBRepBuild_HBuilder)& BRepAlgo_BooleanOperations::ChangeBuilder()
|
||||
{
|
||||
return myDSA.ChangeBuilder();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DataStructureAccess
|
||||
//purpose : returns the member myDSA.
|
||||
//=======================================================================
|
||||
BRepAlgo_DSAccess& BRepAlgo_BooleanOperations::DataStructureAccess()
|
||||
{
|
||||
return myDSA;
|
||||
}
|
||||
|
@@ -1,140 +0,0 @@
|
||||
// Created on: 1993-10-14
|
||||
// Created by: Prestataire Mary FABIEN
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepAlgo_BooleanOperations_HeaderFile
|
||||
#define _BRepAlgo_BooleanOperations_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepAlgo_DSAccess.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TopOpeBRepDS_HDataStructure;
|
||||
class TopOpeBRepBuild_HBuilder;
|
||||
class BRepAlgo_DSAccess;
|
||||
|
||||
|
||||
|
||||
class BRepAlgo_BooleanOperations
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepAlgo_BooleanOperations();
|
||||
|
||||
//! S1 is a Shell with ALL faces supported by the SAME S2 is
|
||||
//! an Edge INCLUDED in that surface with pcurve.
|
||||
//! this avoids a time-consuming 3D operation, compared to Shapes.
|
||||
Standard_EXPORT void Shapes2d (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! Defines the arguments.
|
||||
Standard_EXPORT void Shapes (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! Sets different parameters for the curve approximations :
|
||||
//! NbPntMax : Maximum number of points to be approximated at
|
||||
//! the same time in one curve.
|
||||
//! Tol3D, Tol2D : Tolerances to be reached by the approximation.
|
||||
//! RelativeTol : The given tolerances are relative.
|
||||
Standard_EXPORT void SetApproxParameters (const Standard_Integer NbPntMax, const Standard_Real Tol3D, const Standard_Real Tol2D);
|
||||
|
||||
Standard_EXPORT void Define (const TopoDS_Shape& S1, const TopoDS_Shape& S2, Handle(TopOpeBRepDS_HDataStructure)& HDS);
|
||||
|
||||
//! returns the common part of the shapes.
|
||||
Standard_EXPORT const TopoDS_Shape& Common();
|
||||
|
||||
//! returns the fuse part of the shapes.
|
||||
Standard_EXPORT const TopoDS_Shape& Fus();
|
||||
|
||||
//! returns the cut part of the shapes.
|
||||
Standard_EXPORT const TopoDS_Shape& Cut();
|
||||
|
||||
//! returns the intersection of the shapes.
|
||||
Standard_EXPORT const TopoDS_Shape& Section();
|
||||
|
||||
//! returns the result of the boolean operation.
|
||||
Standard_EXPORT const TopoDS_Shape& Shape();
|
||||
|
||||
//! Returns the shape(s) resulting of the boolean operation
|
||||
//! issued from the shape <S>.
|
||||
Standard_EXPORT const TopoDS_Shape& ShapeFrom (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns the list of the descendant shapes of the shape <S>.
|
||||
Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns the fact that the shape <S> has been deleted or not
|
||||
//! by the boolean operation.
|
||||
Standard_EXPORT Standard_Boolean IsDeleted (const TopoDS_Shape& S);
|
||||
|
||||
Standard_EXPORT const Handle(TopOpeBRepDS_HDataStructure)& DataStructure() const;
|
||||
|
||||
Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure)& ChangeDataStructure();
|
||||
|
||||
Standard_EXPORT const Handle(TopOpeBRepBuild_HBuilder)& Builder() const;
|
||||
|
||||
Standard_EXPORT Handle(TopOpeBRepBuild_HBuilder)& ChangeBuilder();
|
||||
|
||||
//! returns the member myDSA. It is useful to then access
|
||||
//! the method GetSectionEdgeSet (wich is a member of DSAccess)
|
||||
Standard_EXPORT BRepAlgo_DSAccess& DataStructureAccess();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Performs the global boolean operation.
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
//! Performs the global boolean operation and build the
|
||||
//! result in regards of the given states.
|
||||
Standard_EXPORT void Perform (const TopAbs_State State1, const TopAbs_State State2);
|
||||
|
||||
|
||||
BRepAlgo_DSAccess myDSA;
|
||||
TopoDS_Shape myS1;
|
||||
TopoDS_Shape myS2;
|
||||
TopoDS_Shape myShape;
|
||||
TopTools_MapOfShape myMapShape;
|
||||
TopoDS_Shape myResult;
|
||||
Standard_Integer myApproxNbPntMax;
|
||||
Standard_Real myApproxTol3D;
|
||||
Standard_Real myApproxTol2D;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepAlgo_BooleanOperations_HeaderFile
|
File diff suppressed because it is too large
Load Diff
@@ -1,237 +0,0 @@
|
||||
// Created on: 1997-08-13
|
||||
// Created by: Prestataire Mary FABIEN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepAlgo_DSAccess_HeaderFile
|
||||
#define _BRepAlgo_DSAccess_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopOpeBRep_DSFiller.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TColStd_PackedMapOfInteger.hxx>
|
||||
#include <BRepAlgo_CheckStatus.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopOpeBRepDS_Kind.hxx>
|
||||
class TopOpeBRepDS_HDataStructure;
|
||||
class TopOpeBRepBuild_HBuilder;
|
||||
class BRepAlgo_EdgeConnector;
|
||||
class BRepAlgo_BooleanOperations;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
|
||||
class BRepAlgo_DSAccess
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepAlgo_DSAccess();
|
||||
|
||||
//! Clears the internal data structure, including the
|
||||
Standard_EXPORT void Init();
|
||||
|
||||
//! Loads the shape in DS.
|
||||
Standard_EXPORT void Load (const TopoDS_Shape& S);
|
||||
|
||||
//! Loads two shapes in the DS without intersecting them.
|
||||
Standard_EXPORT void Load (TopoDS_Shape& S1, TopoDS_Shape& S2);
|
||||
|
||||
//! Intersects two shapes at input and loads the DS with
|
||||
//! their intersection. Clears the TopOpeBRepBuild_HBuilder if
|
||||
//! necessary
|
||||
Standard_EXPORT void Intersect();
|
||||
|
||||
//! Intersects the faces contained in two given shapes
|
||||
//! and loads them in the DS. Clears the TopOpeBRepBuild_HBuilder
|
||||
//! if necessary
|
||||
Standard_EXPORT void Intersect (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! This method does the same thing as the previous,
|
||||
//! but faster. There is no intersection face/face 3D.
|
||||
//! The faces have the same support(surface). No test of
|
||||
//! tangency (that is why it is faster). Intersects in 2d
|
||||
//! the faces tangent F1 anf F2.
|
||||
Standard_EXPORT void SameDomain (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! returns compounds of Edge connected with section, which
|
||||
//! contains sections between faces contained in S1 and S2.
|
||||
//! returns an empty list of Shape if S1 or S2 do not contain
|
||||
//! face.
|
||||
//! calls GetSectionEdgeSet() if it has not already been done
|
||||
Standard_EXPORT const TopTools_ListOfShape& GetSectionEdgeSet (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! returns all compounds of edges connected with section
|
||||
//! contained in the DS
|
||||
Standard_EXPORT const TopTools_ListOfShape& GetSectionEdgeSet();
|
||||
|
||||
//! NYI
|
||||
Standard_EXPORT Standard_Boolean IsWire (const TopoDS_Shape& Compound);
|
||||
|
||||
//! NYI
|
||||
Standard_EXPORT const TopoDS_Shape& Wire (const TopoDS_Shape& Compound);
|
||||
|
||||
//! NYI
|
||||
//! returns the vertex of section, which contains the section
|
||||
//! between face S1 and edge S2 (returns an empty Shape
|
||||
//! if S1 is not a face or if S2 is not an edge)
|
||||
Standard_EXPORT const TopTools_ListOfShape& SectionVertex (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||
|
||||
//! Invalidates a complete line of section. All
|
||||
//! Edges connected by Vertex or a Wire. Can be
|
||||
//! a group of connected Edges, which do not form a
|
||||
//! standard Wire.
|
||||
Standard_EXPORT void SuppressEdgeSet (const TopoDS_Shape& Compound);
|
||||
|
||||
//! Modifies a line of section. <New> -- should be a
|
||||
//! Group of Edges connected by Vertex. -- Can be a
|
||||
//! Wire. Can be a group of connected Edges that do not
|
||||
//! form a standard Wire. <New> should be sub-groupn of <Old>
|
||||
Standard_EXPORT void ChangeEdgeSet (const TopoDS_Shape& Old, const TopoDS_Shape& New);
|
||||
|
||||
//! NYI
|
||||
//! Make invalid a Vertex of section. The Vertex shoud be
|
||||
//! reconstructed from a point.
|
||||
Standard_EXPORT void SuppressSectionVertex (const TopoDS_Vertex& V);
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Merge (const TopAbs_State state1, const TopAbs_State state2);
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Merge (const TopAbs_State state1);
|
||||
|
||||
//! NYI Propagation of a state starting from the shape
|
||||
//! FromShape = edge or vertex of section, face or
|
||||
//! Coumpound de section. LoadShape is either S1,
|
||||
//! or S2 (see the method Load). Propagation from
|
||||
//! FromShape, on the states <what> of LoadShape.
|
||||
//! Return a Wire in 2d, a Shell in 3d.
|
||||
//! Specifications are incomplete, to be redefined for the typologies
|
||||
//! correpsonding to <FromShape> and the result :
|
||||
//! exemple : FromShape resultat
|
||||
//! vertex wire (or edge)
|
||||
//! edge of section face (or shell)
|
||||
//! compound of section shell
|
||||
//! ... ...
|
||||
Standard_EXPORT const TopoDS_Shape& Propagate (const TopAbs_State what, const TopoDS_Shape& FromShape, const TopoDS_Shape& LoadShape);
|
||||
|
||||
//! SectionShape est soit un Vertex de section(NYI), soit
|
||||
//! une Edge de section. Propagation des shapes
|
||||
//! de section en partant de SectionShape.
|
||||
//! return un Compound de section.
|
||||
Standard_EXPORT const TopoDS_Shape& PropagateFromSection (const TopoDS_Shape& SectionShape);
|
||||
|
||||
//! Returns the list of the descendant shapes of the shape <S>.
|
||||
Standard_EXPORT const TopTools_ListOfShape& Modified (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns the fact that the shape <S> has been deleted or not
|
||||
//! by the boolean operation.
|
||||
Standard_EXPORT Standard_Boolean IsDeleted (const TopoDS_Shape& S);
|
||||
|
||||
//! NYI
|
||||
//! coherence of the internal Data Structure.
|
||||
Standard_EXPORT BRepAlgo_CheckStatus Check();
|
||||
|
||||
Standard_EXPORT const Handle(TopOpeBRepDS_HDataStructure)& DS() const;
|
||||
|
||||
Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure)& ChangeDS();
|
||||
|
||||
Standard_EXPORT const Handle(TopOpeBRepBuild_HBuilder)& Builder() const;
|
||||
|
||||
Standard_EXPORT Handle(TopOpeBRepBuild_HBuilder)& ChangeBuilder();
|
||||
|
||||
|
||||
friend class BRepAlgo_BooleanOperations;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Suppress (const TopoDS_Shape& Compound, const TopoDS_Shape& KeepComp);
|
||||
|
||||
Standard_EXPORT void RemoveEdgeInterferences (const Standard_Integer iF1, const Standard_Integer iF2, const Standard_Integer iCurve);
|
||||
|
||||
Standard_EXPORT void RemoveEdgeInterferences (const Standard_Integer iE1, const Standard_Integer iE2, const TopoDS_Shape& SectEdge);
|
||||
|
||||
Standard_EXPORT void RemoveFaceInterferences (const Standard_Integer iF1, const Standard_Integer iF2, const Standard_Integer iE1, const Standard_Integer iE2);
|
||||
|
||||
Standard_EXPORT void RemoveFaceInterferences (const Standard_Integer iF1, const Standard_Integer iF2, const Standard_Integer iCurve);
|
||||
|
||||
Standard_EXPORT void RemoveEdgeInterferencesFromFace (const Standard_Integer iF1, const Standard_Integer iF2, const Standard_Integer ipv1, const TopOpeBRepDS_Kind kind1, const Standard_Integer ipv2, const TopOpeBRepDS_Kind kind2);
|
||||
|
||||
Standard_EXPORT void RemoveEdgeFromFace (const Standard_Integer iF, const Standard_Integer iV);
|
||||
|
||||
Standard_EXPORT void PntVtxOnCurve (const Standard_Integer iCurve, Standard_Integer& ipv1, TopOpeBRepDS_Kind& ik1, Standard_Integer& ipv2, TopOpeBRepDS_Kind& ik2);
|
||||
|
||||
Standard_EXPORT void PntVtxOnSectEdge (const TopoDS_Shape& SectEdge, Standard_Integer& ipv1, TopOpeBRepDS_Kind& ik1, Standard_Integer& ipv2, TopOpeBRepDS_Kind& ik2);
|
||||
|
||||
Standard_EXPORT void RemoveEdgeSameDomain (const Standard_Integer iE1, const Standard_Integer iE2);
|
||||
|
||||
Standard_EXPORT void RemoveFaceSameDomain (const TopoDS_Shape& C);
|
||||
|
||||
Standard_EXPORT TColStd_ListOfInteger& FindGoodFace (const Standard_Integer iE, Standard_Integer& iF1, Standard_Boolean& b);
|
||||
|
||||
Standard_EXPORT void RemoveFaceSameDomain (const Standard_Integer iF1, const Standard_Integer iF2);
|
||||
|
||||
Standard_EXPORT Standard_Boolean GoodInterf (const TopoDS_Shape& SectEdge, const TopOpeBRepDS_Kind kind, const Standard_Integer iPointVertex);
|
||||
|
||||
|
||||
Handle(TopOpeBRepDS_HDataStructure) myHDS;
|
||||
TopOpeBRep_DSFiller myDSFiller;
|
||||
Handle(TopOpeBRepBuild_HBuilder) myHB;
|
||||
Handle(BRepAlgo_EdgeConnector) myEC;
|
||||
TopoDS_Shape myS1;
|
||||
TopoDS_Shape myS2;
|
||||
TopAbs_State myState1;
|
||||
TopAbs_State myState2;
|
||||
TopTools_ListOfShape myListOfCompoundOfEdgeConnected;
|
||||
TopTools_ListOfShape myCurrentList;
|
||||
Standard_Boolean myRecomputeBuilderIsDone;
|
||||
Standard_Boolean myGetSectionIsDone;
|
||||
TopoDS_Shape myResultShape;
|
||||
TopoDS_Wire myWire;
|
||||
TopTools_ListOfShape myListOfVertex;
|
||||
TopTools_ListOfShape myModified;
|
||||
TopoDS_Shape myEmptyShape;
|
||||
TopTools_ListOfShape myEmptyListOfShape;
|
||||
TColStd_ListOfInteger myEmptyListOfInteger;
|
||||
TopTools_DataMapOfShapeShape myCompoundWireMap;
|
||||
TColStd_PackedMapOfInteger mySetOfKeepPoint;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepAlgo_DSAccess_HeaderFile
|
@@ -1,20 +0,0 @@
|
||||
// Copyright (c) 2015 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 BRepAlgo_DataMapIteratorOfDataMapOfShapeBoolean_HeaderFile
|
||||
#define BRepAlgo_DataMapIteratorOfDataMapOfShapeBoolean_HeaderFile
|
||||
|
||||
#include <BRepAlgo_DataMapOfShapeBoolean.hxx>
|
||||
|
||||
#endif
|
@@ -1,20 +0,0 @@
|
||||
// Copyright (c) 2015 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 BRepAlgo_DataMapIteratorOfDataMapOfShapeInterference_HeaderFile
|
||||
#define BRepAlgo_DataMapIteratorOfDataMapOfShapeInterference_HeaderFile
|
||||
|
||||
#include <BRepAlgo_DataMapOfShapeInterference.hxx>
|
||||
|
||||
#endif
|
@@ -1,29 +0,0 @@
|
||||
// Created on: 1997-01-17
|
||||
// Created by: Didier PIFFAULT
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BRepAlgo_DataMapOfShapeBoolean_HeaderFile
|
||||
#define BRepAlgo_DataMapOfShapeBoolean_HeaderFile
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
typedef NCollection_DataMap<TopoDS_Shape,Standard_Boolean,TopTools_ShapeMapHasher> BRepAlgo_DataMapOfShapeBoolean;
|
||||
typedef NCollection_DataMap<TopoDS_Shape,Standard_Boolean,TopTools_ShapeMapHasher>::Iterator BRepAlgo_DataMapIteratorOfDataMapOfShapeBoolean;
|
||||
|
||||
|
||||
#endif
|
@@ -1,29 +0,0 @@
|
||||
// Created on: 1997-01-17
|
||||
// Created by: Didier PIFFAULT
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BRepAlgo_DataMapOfShapeInterference_HeaderFile
|
||||
#define BRepAlgo_DataMapOfShapeInterference_HeaderFile
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopOpeBRepDS_Interference.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
typedef NCollection_DataMap<TopoDS_Shape,Handle(TopOpeBRepDS_Interference),TopTools_ShapeMapHasher> BRepAlgo_DataMapOfShapeInterference;
|
||||
typedef NCollection_DataMap<TopoDS_Shape,Handle(TopOpeBRepDS_Interference),TopTools_ShapeMapHasher>::Iterator BRepAlgo_DataMapIteratorOfDataMapOfShapeInterference;
|
||||
|
||||
|
||||
#endif
|
@@ -1,184 +0,0 @@
|
||||
// Created on: 1997-08-22
|
||||
// Created by: Prestataire Mary FABIEN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepAlgo_DataMapOfShapeBoolean.hxx>
|
||||
#include <BRepAlgo_EdgeConnector.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopOpeBRepBuild_BlockBuilder.hxx>
|
||||
#include <TopOpeBRepBuild_BlockIterator.hxx>
|
||||
#include <TopOpeBRepBuild_ShapeSet.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BRepAlgo_EdgeConnector,Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : Create
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepAlgo_EdgeConnector::BRepAlgo_EdgeConnector()
|
||||
:myIsDone(Standard_False)
|
||||
{
|
||||
myListeOfEdge.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepAlgo_EdgeConnector::Add(const TopoDS_Edge& e)
|
||||
{
|
||||
if(e.IsNull()) return;
|
||||
myListeOfEdge.Append(e);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepAlgo_EdgeConnector::Add(TopTools_ListOfShape& LOEdge)
|
||||
{
|
||||
if(LOEdge.IsEmpty()) return;
|
||||
myListeOfEdge.Append(LOEdge);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddStart
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepAlgo_EdgeConnector::AddStart(const TopoDS_Shape& e)
|
||||
{
|
||||
if(e.IsNull()) return;
|
||||
myListeOfStartEdge.Append(e);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddStart
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepAlgo_EdgeConnector::AddStart(TopTools_ListOfShape& LOEdge)
|
||||
{
|
||||
if(LOEdge.IsEmpty()) return;
|
||||
myListeOfStartEdge.Append(LOEdge);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearStartElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepAlgo_EdgeConnector::ClearStartElement()
|
||||
{
|
||||
myListeOfStartEdge.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopTools_ListOfShape& BRepAlgo_EdgeConnector::MakeBlock()
|
||||
{
|
||||
Standard_Boolean b;
|
||||
if(myListeOfStartEdge.IsEmpty()) return myListeOfStartEdge;
|
||||
TopOpeBRepBuild_ShapeSet SS(TopAbs_VERTEX);
|
||||
myResultMap.Clear();
|
||||
myResultList.Clear();
|
||||
TopTools_ListIteratorOfListOfShape it(myListeOfEdge);
|
||||
for(;it.More();it.Next()) {
|
||||
const TopoDS_Shape& edge = it.Value();
|
||||
SS.AddElement(edge);
|
||||
}
|
||||
it.Initialize(myListeOfStartEdge);
|
||||
for(;it.More();it.Next()) {
|
||||
const TopoDS_Shape& edge = it.Value();
|
||||
SS.AddStartElement(edge);
|
||||
}
|
||||
myBlockB.MakeBlock(SS);
|
||||
BRep_Builder WireB;
|
||||
for(myBlockB.InitBlock();myBlockB.MoreBlock();myBlockB.NextBlock()) {
|
||||
//#ifndef OCCT_DEBUG
|
||||
TopOpeBRepBuild_BlockIterator BI = myBlockB.BlockIterator();
|
||||
//#else
|
||||
// TopOpeBRepBuild_BlockIterator& BI = myBlockB.BlockIterator();
|
||||
//#endif
|
||||
TopoDS_Wire W;
|
||||
WireB.MakeWire(W);
|
||||
for(BI.Initialize();BI.More();BI.Next()) {
|
||||
const TopoDS_Shape& CurrentE = myBlockB.Element(BI);
|
||||
WireB.Add(W, CurrentE);
|
||||
}
|
||||
b = myBlockB.CurrentBlockIsRegular();
|
||||
myResultMap.Bind(W, b);
|
||||
myResultList.Append(W);
|
||||
}
|
||||
Done();
|
||||
return myResultList;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepAlgo_EdgeConnector::IsWire(const TopoDS_Shape& S)
|
||||
{
|
||||
if(!myResultMap.IsBound(S)) {
|
||||
return Standard_False;
|
||||
}
|
||||
Standard_Boolean b = Standard_False;
|
||||
myBlockB.InitBlock();
|
||||
TopTools_ListIteratorOfListOfShape LI(myResultList);
|
||||
for(;myBlockB.MoreBlock();myBlockB.NextBlock(),LI.Next()) {
|
||||
if(S == LI.Value()) {
|
||||
b = myBlockB.CurrentBlockIsRegular();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
Standard_Boolean BRepAlgo_EdgeConnector::IsDone() const
|
||||
{
|
||||
return myIsDone;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Done
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
void BRepAlgo_EdgeConnector::Done()
|
||||
{
|
||||
myIsDone = Standard_True;
|
||||
}
|
||||
|
@@ -1,101 +0,0 @@
|
||||
// Created on: 1997-08-22
|
||||
// Created by: Prestataire Mary FABIEN
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepAlgo_EdgeConnector_HeaderFile
|
||||
#define _BRepAlgo_EdgeConnector_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <BRepAlgo_DataMapOfShapeBoolean.hxx>
|
||||
#include <TopOpeBRepBuild_BlockBuilder.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class BRepAlgo_EdgeConnector;
|
||||
DEFINE_STANDARD_HANDLE(BRepAlgo_EdgeConnector, Standard_Transient)
|
||||
|
||||
//! Used by DSAccess to reconstruct an EdgeSet of connected edges. The result produced by
|
||||
//! MakeBlock is a list of non-standard TopoDS_wire,
|
||||
//! which can present connexions of edge of order > 2
|
||||
//! in certain vertex. The method IsWire
|
||||
//! indicates standard/non-standard character of all wire produced.
|
||||
class BRepAlgo_EdgeConnector : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT BRepAlgo_EdgeConnector();
|
||||
|
||||
Standard_EXPORT void Add (const TopoDS_Edge& e);
|
||||
|
||||
Standard_EXPORT void Add (TopTools_ListOfShape& LOEdge);
|
||||
|
||||
Standard_EXPORT void AddStart (const TopoDS_Shape& e);
|
||||
|
||||
Standard_EXPORT void AddStart (TopTools_ListOfShape& LOEdge);
|
||||
|
||||
Standard_EXPORT void ClearStartElement();
|
||||
|
||||
//! returns a list of wire non standard
|
||||
Standard_EXPORT TopTools_ListOfShape& MakeBlock();
|
||||
|
||||
Standard_EXPORT void Done();
|
||||
|
||||
//! NYI
|
||||
//! returns true if proceeded to MakeBlock()
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! NYI
|
||||
//! returns true if W is a Wire standard.
|
||||
//! W must belong to the list returned by MakeBlock.
|
||||
Standard_EXPORT Standard_Boolean IsWire (const TopoDS_Shape& W);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(BRepAlgo_EdgeConnector,Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TopTools_ListOfShape myListeOfEdge;
|
||||
TopTools_ListOfShape myListeOfStartEdge;
|
||||
BRepAlgo_DataMapOfShapeBoolean myResultMap;
|
||||
TopTools_ListOfShape myResultList;
|
||||
TopOpeBRepBuild_BlockBuilder myBlockB;
|
||||
Standard_Boolean myIsDone;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepAlgo_EdgeConnector_HeaderFile
|
@@ -23,7 +23,6 @@
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAlgo_NormalProjection.hxx>
|
||||
#include <BRepAlgo_SequenceOfSequenceOfInteger.hxx>
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
|
@@ -1,26 +0,0 @@
|
||||
// Created on: 1997-01-17
|
||||
// Created by: Didier PIFFAULT
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BRepAlgo_SequenceOfSequenceOfInteger_HeaderFile
|
||||
#define BRepAlgo_SequenceOfSequenceOfInteger_HeaderFile
|
||||
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
typedef NCollection_Sequence<TColStd_SequenceOfInteger> BRepAlgo_SequenceOfSequenceOfInteger;
|
||||
|
||||
|
||||
#endif
|
@@ -5,21 +5,11 @@ BRepAlgo_AsDes.cxx
|
||||
BRepAlgo_AsDes.hxx
|
||||
BRepAlgo_BooleanOperation.cxx
|
||||
BRepAlgo_BooleanOperation.hxx
|
||||
BRepAlgo_BooleanOperations.cxx
|
||||
BRepAlgo_BooleanOperations.hxx
|
||||
BRepAlgo_CheckStatus.hxx
|
||||
BRepAlgo_Common.cxx
|
||||
BRepAlgo_Common.hxx
|
||||
BRepAlgo_Cut.cxx
|
||||
BRepAlgo_Cut.hxx
|
||||
BRepAlgo_DataMapIteratorOfDataMapOfShapeBoolean.hxx
|
||||
BRepAlgo_DataMapIteratorOfDataMapOfShapeInterference.hxx
|
||||
BRepAlgo_DataMapOfShapeBoolean.hxx
|
||||
BRepAlgo_DataMapOfShapeInterference.hxx
|
||||
BRepAlgo_DSAccess.cxx
|
||||
BRepAlgo_DSAccess.hxx
|
||||
BRepAlgo_EdgeConnector.cxx
|
||||
BRepAlgo_EdgeConnector.hxx
|
||||
BRepAlgo_FaceRestrictor.cxx
|
||||
BRepAlgo_FaceRestrictor.hxx
|
||||
BRepAlgo_Fuse.cxx
|
||||
@@ -32,6 +22,5 @@ BRepAlgo_NormalProjection.cxx
|
||||
BRepAlgo_NormalProjection.hxx
|
||||
BRepAlgo_Section.cxx
|
||||
BRepAlgo_Section.hxx
|
||||
BRepAlgo_SequenceOfSequenceOfInteger.hxx
|
||||
BRepAlgo_Tool.cxx
|
||||
BRepAlgo_Tool.hxx
|
||||
|
Reference in New Issue
Block a user