1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0025354: Intersection operation

I. New features:
I.1 class BOPAlgo_Section
     The class clontains the algorithm to build a result of Secton between the arguments.
     The result of Section consists of vertices and edges.
     The result of Section contains:
     1. new vertices that are subjects of V/V, E/E, E/F, F/F interferences
     2. vertices that are subjects of V/E, V/F interferences
     3. new edges that are subjects of F/F interferences
     4. edges that are Common Blocks
     5.a vertex is included in result of Section only when it is not shared
     between the edges of the result of Section

The class BOPAlgo_Section inherits the functionality of root class BOPAlgo_Builder

1.2 class BOPTest_Objects
method:
BOPAlgo_Section& BOPTest_Objects::Section()
has been added to get access to BOPAlgo_Section object

II. Changes:
II.1. class BOPAlgo_BOP
method:
void BOPAlgo_BOP::BuildSection()
has been removed
methods:
void BOPAlgo_BOP::CheckData()
void BOPAlgo_BOP::Prepare()
void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
const TopTools_ListOfShape& BOPAlgo_BOP::Generated
  (const TopoDS_Shape& theS)
have been modified to eliminate references on Section operation

II.2. class BOPAlgo_PaveFiller
method:
void BOPAlgo_PaveFiller::UpdateFaceInfo
  (BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME)
modified to prevent the usage of negative index in Data Structure

II.3. class BOPTest_Objects
static function:
Standard_Integer bopsection(Draw_Interpretor& di, Standard_Integer n, const char** a)
has been modified to use BOPAlgo_Section object instead of BOPAlgo_BOP object

static function:
Standard_Integer bbop(Draw_Interpretor& di,
                      Standard_Integer n,
                      const char** a)
has been modified to use BOPAlgo_Section object instea of BOPAlgo_BOP object

II.4. class BRepAlgoAPI_BooleanOperation
field:
myBuilder
the type has been changed from BOPAlgo_BOP* to BOPAlgo_Builder*
method:
void BRepAlgoAPI_BooleanOperation::Build()
has been modified  to use BOPAlgo_Section object

II.5. class QANewModTopOpe_Tools
method:
Standard_Boolean QANewModTopOpe_Tools::HasSameDomain(
                                                   const BOPAlgo_PBOP& theBuilder,
                                                     const TopoDS_Shape& theFace)

void QANewModTopOpe_Tools::SameDomain(
                                      const BOPAlgo_PBOP&   theBuilder,
                                      const TopoDS_Shape&   theFace,
                                      TopTools_ListOfShape& theResultList)

the type of the parameter <theBuilder> has been modified
to use BOPAlgo_Builder* instead of BOPAlgo_BOP*

II.6. The method:
const TopTools_ListOfShape& BOPAlgo_BOP::Generated
  (const TopoDS_Shape& theS)
has been removed
This commit is contained in:
pkv 2014-10-23 15:11:39 +04:00 committed by bugmaster
parent 905428003c
commit 8591531065
16 changed files with 846 additions and 412 deletions

View File

@ -63,6 +63,7 @@ is
class PaveFiller; class PaveFiller;
class Builder; class Builder;
class BOP; class BOP;
class Section;
-- --
deferred class BuilderArea; deferred class BuilderArea;
class BuilderFace; class BuilderFace;
@ -81,6 +82,7 @@ is
-- --
pointer PPaveFiller to PaveFiller from BOPAlgo; pointer PPaveFiller to PaveFiller from BOPAlgo;
pointer PWireEdgeSet to WireEdgeSet from BOPAlgo; pointer PWireEdgeSet to WireEdgeSet from BOPAlgo;
pointer PSection to Section from BOPAlgo;
pointer PBOP to BOP from BOPAlgo; pointer PBOP to BOP from BOPAlgo;
pointer PBuilder to Builder from BOPAlgo; pointer PBuilder to Builder from BOPAlgo;
pointer PArgumentAnalyzer to ArgumentAnalyzer from BOPAlgo; pointer PArgumentAnalyzer to ArgumentAnalyzer from BOPAlgo;

View File

@ -12,7 +12,6 @@
-- Alternatively, this file may be used under the terms of Open CASCADE -- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement. -- commercial license or contractual agreement.
--BOPAlgo_BOP.cdl
class BOP from BOPAlgo class BOP from BOPAlgo
inherits Builder from BOPAlgo inherits Builder from BOPAlgo
@ -89,25 +88,12 @@ is
BuildSolid(me:out) BuildSolid(me:out)
is protected; is protected;
BuildSection(me:out)
is protected;
IsBoundSplits(me:out; IsBoundSplits(me:out;
theS:Shape from TopoDS; theS:Shape from TopoDS;
theMEF:out IndexedDataMapOfShapeListOfShape from BOPCol) theMEF:out IndexedDataMapOfShapeListOfShape from BOPCol)
returns Boolean from Standard returns Boolean from Standard
is protected; is protected;
Generated (me:out;
theS : Shape from TopoDS)
returns ListOfShape from TopTools
is redefined;
---C++: return const &
---Purpose: Returns the list of shapes generated from the
-- shape theS.
fields fields
myOperation : Operation from BOPAlgo is protected; myOperation : Operation from BOPAlgo is protected;
myDims : Integer from Standard[2] is protected; myDims : Integer from Standard[2] is protected;

View File

@ -140,15 +140,26 @@ void BOPAlgo_BOP::CheckData()
// //
myErrorStatus=0; myErrorStatus=0;
// //
if (!(myOperation==BOPAlgo_COMMON ||
myOperation==BOPAlgo_FUSE ||
myOperation==BOPAlgo_CUT||
myOperation==BOPAlgo_CUT21)) {
// non-licit operation
myErrorStatus=14;
return;
}
//
aNbArgs=myArguments.Extent(); aNbArgs=myArguments.Extent();
if (!aNbArgs) { if (!aNbArgs) {
myErrorStatus=100; // invalid number of Arguments // invalid number of Arguments
myErrorStatus=100;
return; return;
} }
// //
aNbTools=myTools.Extent(); aNbTools=myTools.Extent();
if (!aNbTools) { if (!aNbTools) {
myErrorStatus=100; // invalid number of Tools // invalid number of Tools
myErrorStatus=100;
return; return;
} }
// //
@ -162,6 +173,9 @@ void BOPAlgo_BOP::CheckData()
return; return;
} }
// //
// myDims
myDims[0]=-1;
myDims[1]=-1;
for (i=0; i<2; ++i) { for (i=0; i<2; ++i) {
const BOPCol_ListOfShape& aLS=(!i)? myArguments : myTools; const BOPCol_ListOfShape& aLS=(!i)? myArguments : myTools;
aItLS.Initialize(aLS); aItLS.Initialize(aLS);
@ -174,7 +188,8 @@ void BOPAlgo_BOP::CheckData()
// //
iDim=BOPTools_AlgoTools::Dimension(aS); iDim=BOPTools_AlgoTools::Dimension(aS);
if (iDim<0) { if (iDim<0) {
myErrorStatus=13; // non-homogenious argument // non-homogenious argument
myErrorStatus=13;
return; return;
} }
// //
@ -184,27 +199,26 @@ void BOPAlgo_BOP::CheckData()
} }
// //
if (iDim!=myDims[i]) { if (iDim!=myDims[i]) {
myErrorStatus=13; // non-homogenious argument // non-homogenious argument
myErrorStatus=13;
return; return;
} }
} }
} }
// //
if (myOperation==BOPAlgo_UNKNOWN) { if (myDims[0]<myDims[1]) {
myErrorStatus=14; // non-licit operation
return;
}
else if (myDims[0]<myDims[1]) {
if (myOperation==BOPAlgo_FUSE || if (myOperation==BOPAlgo_FUSE ||
myOperation==BOPAlgo_CUT21) { myOperation==BOPAlgo_CUT21) {
myErrorStatus=14; // non-licit operation for the arguments // non-licit operation for the arguments
myErrorStatus=14;
return; return;
} }
} }
else if (myDims[0]>myDims[1]) { else if (myDims[0]>myDims[1]) {
if (myOperation==BOPAlgo_FUSE || if (myOperation==BOPAlgo_FUSE ||
myOperation==BOPAlgo_CUT) { myOperation==BOPAlgo_CUT) {
myErrorStatus=14; // non-licit operation for the arguments // non-licit operation for the arguments
myErrorStatus=14;
return; return;
} }
} }
@ -258,8 +272,6 @@ void BOPAlgo_BOP::Prepare()
} }
break; break;
// //
case BOPAlgo_COMMON:
case BOPAlgo_SECTION:
default: default:
break; break;
} }
@ -388,31 +400,23 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_EDGE); BuildResult(TopAbs_EDGE);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//-------------------------------- SECTION
if (myOperation==BOPAlgo_SECTION) {
BuildSection();
PrepareHistory();
PostTreat();
return;
}
//--------------------------------
// //
// 3.3 Wires // 3.3 Wires
FillImagesContainers(TopAbs_WIRE); FillImagesContainers(TopAbs_WIRE);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_WIRE); BuildResult(TopAbs_WIRE);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
// 3.4 Faces // 3.4 Faces
FillImagesFaces(); FillImagesFaces();
if (myErrorStatus) { if (myErrorStatus) {
@ -423,43 +427,46 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
// 3.5 Shells // 3.5 Shells
FillImagesContainers(TopAbs_SHELL); FillImagesContainers(TopAbs_SHELL);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_SHELL); BuildResult(TopAbs_SHELL);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
// 3.6 Solids // 3.6 Solids
FillImagesSolids(); FillImagesSolids();
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_SOLID); BuildResult(TopAbs_SOLID);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
// 3.7 CompSolids // 3.7 CompSolids
FillImagesContainers(TopAbs_COMPSOLID); FillImagesContainers(TopAbs_COMPSOLID);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_COMPSOLID); BuildResult(TopAbs_COMPSOLID);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
// 3.8 Compounds // 3.8 Compounds
FillImagesCompounds(); FillImagesCompounds();
if (myErrorStatus) { if (myErrorStatus) {
return; return;
} }
//
BuildResult(TopAbs_COMPOUND); BuildResult(TopAbs_COMPOUND);
if (myErrorStatus) { if (myErrorStatus) {
return; return;
@ -964,7 +971,7 @@ void BOPAlgo_BOP::BuildSolid()
myShape=aRC; myShape=aRC;
} }
//======================================================================= //=======================================================================
//function : IsBoundImages //function : IsBoundSplits
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPAlgo_BOP::IsBoundSplits Standard_Boolean BOPAlgo_BOP::IsBoundSplits

View File

@ -1,159 +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.
#include <BOPAlgo_BOP.ixx>
#include <BOPDS_DS.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BOPDS_CommonBlock.hxx>
#include <BOPDS_FaceInfo.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
#include <BOPDS_MapOfPaveBlock.hxx>
#include <BOPDS_VectorOfListOfPaveBlock.hxx>
#include <BOPDS_VectorOfFaceInfo.hxx>
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BRep_Builder.hxx>
#include <TopExp_Explorer.hxx>
//=======================================================================
//function : BuildSection
//purpose :
//=======================================================================
void BOPAlgo_BOP::BuildSection()
{
Standard_Integer i, j, k, nE, nF1, nF2, aNbPB, aNbFF;
Standard_Boolean bFlag;
TopoDS_Shape aRC;
BRep_Builder aBB;
BOPCol_MapOfShape aME;
BOPCol_IndexedMapOfShape aME1, aME2;
//
myErrorStatus=0;
//
BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
aNbFF=aFFs.Extent();
//
for (i=0; i<aNbFF; ++i) {
BOPDS_InterfFF& aFF=aFFs(i);
aFF.Indices(nF1, nF2);
const BOPDS_FaceInfo& aFI1=myDS->FaceInfo(nF1);
const BOPDS_FaceInfo& aFI2=myDS->FaceInfo(nF2);
//
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
const BOPDS_IndexedMapOfPaveBlock& aMPBSc1=aFI1.PaveBlocksSc();
//
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
//
//1. Section edges
aNbPB = aMPBSc1.Extent();
for (j=1; j<=aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBSc1(j);
nE=aPB->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
if (aME.Add(aE)) {
aBB.Add(aRC, aE);
}
}
//2. Common edges
BOPDS_IndexedMapOfPaveBlock aMPB[4] = {aMPBOn2, aMPBIn1, aMPBIn2, aMPBOn1};
for (k = 0; k < 3; ++k) {
aNbPB = aMPB[k].Extent();
for (j=1; j<=aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPB[k](j);
bFlag = (k==0) ? aMPB[3].Contains(aPB) :
(aMPB[k-1].Contains(aPB) || aMPB[k+1].Contains(aPB));
if (bFlag) {
nE=aPB->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
if (aME.Add(aE)) {
aBB.Add(aRC, aE);
}
}
}
}
//3. Shared edges
aME1.Clear();
aME2.Clear();
//
const TopoDS_Face& aF1=(*(TopoDS_Face *)(&myDS->Shape(nF1)));
const TopoDS_Face& aF2=(*(TopoDS_Face *)(&myDS->Shape(nF2)));
//
BOPTools::MapShapes(aF1, TopAbs_EDGE, aME1);
BOPTools::MapShapes(aF2, TopAbs_EDGE, aME2);
//
aNbPB = aME1.Extent();
for (j=1; j<=aNbPB; ++j) {
const TopoDS_Shape& aE = aME1(j);
if (aME2.Contains(aE)) {
if (aME.Add(aE)) {
aBB.Add(aRC, aE);
}
}
}
}
//
myShape=aRC;
}
//=======================================================================
//function : Generated
//purpose :
//=======================================================================
const TopTools_ListOfShape& BOPAlgo_BOP::Generated
(const TopoDS_Shape& theS)
{
myHistShapes.Clear();
if (theS.IsNull() || (myOperation != BOPAlgo_SECTION)) {
return myHistShapes;
}
//
TopAbs_ShapeEnum aType = theS.ShapeType();
if (aType != TopAbs_FACE) {
return myHistShapes;
}
//
Standard_Integer nS = myDS->Index(theS);
if (nS < 0) {
return myHistShapes;
}
//
if (!myDS->HasFaceInfo(nS)) {
return myHistShapes;
}
//
//collect section edges of the face theS
Standard_Integer i, aNb, nSp;
//
const BOPDS_FaceInfo& aFI = myDS->FaceInfo(nS);
const BOPDS_IndexedMapOfPaveBlock& aMPBSc = aFI.PaveBlocksSc();
aNb = aMPBSc.Extent();
for (i = 1; i <= aNb; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
nSp = aPB->Edge();
const TopoDS_Shape& aSp = myDS->Shape(nSp);
myHistShapes.Append(aSp);
}
//
return myHistShapes;
}

View File

@ -698,7 +698,6 @@ Standard_Integer BOPAlgo_PaveFiller::PostTreatFF
aPF.Perform(); aPF.Perform();
iErr=aPF.ErrorStatus(); iErr=aPF.ErrorStatus();
if (iErr) { if (iErr) {
//iRet=1; //PKVft
return iRet; return iRet;
} }
aPDS=aPF.PDS(); aPDS=aPF.PDS();
@ -940,6 +939,9 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
for (j=0; j<aNbP; ++j) { for (j=0; j<aNbP; ++j) {
const BOPDS_Point& aNP=aVNP(j); const BOPDS_Point& aNP=aVNP(j);
nV1=aNP.Index(); nV1=aNP.Index();
if (nV1<0) {
continue;
}
aFI1.ChangeVerticesSc().Add(nV1); aFI1.ChangeVerticesSc().Add(nV1);
aFI2.ChangeVerticesSc().Add(nV1); aFI2.ChangeVerticesSc().Add(nV1);
} }

View File

@ -0,0 +1,75 @@
-- 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 Section from BOPAlgo
inherits Builder from BOPAlgo
---Purpose:
-- The algorithm to build a Secton between the arguments.
-- The Section consists of vertices and edges.
-- The Section contains:
-- 1. new vertices that are subjects of V/V, E/E, E/F, F/F interferences
-- 2. vertices that are subjects of V/E, V/F interferences
-- 3. new edges that are subjects of F/F interferences
-- 4. edges that are Common Blocks
-- The vertex is included in Section only when it is not shared
-- between the edges above
uses
ShapeEnum from TopAbs,
Shape from TopoDS,
ListOfShape from TopTools,
BaseAllocator from BOPCol,
PaveFiller from BOPAlgo
--raises
is
Create
returns Section from BOPAlgo;
---C++: alias "Standard_EXPORT virtual ~BOPAlgo_Section();"
---Purpose: Empty constructor
Create (theAllocator: BaseAllocator from BOPCol)
returns Section from BOPAlgo;
---Purpose: Empty constructor
--
-- protected methods
--
CheckData(me:out)
is redefined protected;
---Purpose:
PerformInternal1(me:out;
thePF:PaveFiller from BOPAlgo)
is redefined protected;
---Purpose: Performs calculations using prepared Filler
-- object <thePF>
BuildSection(me:out)
is virtual;
--
-- History
--
Generated (me:out;
theS : Shape from TopoDS)
returns ListOfShape from TopTools
is redefined;
---C++: return const &
---Purpose: Returns the list of shapes generated from the
-- shape theS.
end Section;

View File

@ -0,0 +1,421 @@
// 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.
#include <BOPAlgo_Section.ixx>
#include <NCollection_IncAllocator.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Edge.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BOPDS_CommonBlock.hxx>
#include <BOPDS_FaceInfo.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
#include <BOPDS_MapOfPaveBlock.hxx>
#include <BOPDS_VectorOfListOfPaveBlock.hxx>
#include <BOPDS_VectorOfFaceInfo.hxx>
//
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <BOPTools_AlgoTools.hxx>
//
#include <BOPAlgo_BuilderSolid.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BOPAlgo_Section::BOPAlgo_Section()
:
BOPAlgo_Builder()
{
Clear();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BOPAlgo_Section::BOPAlgo_Section
(const Handle(NCollection_BaseAllocator)& theAllocator)
:
BOPAlgo_Builder(theAllocator)
{
Clear();
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
BOPAlgo_Section::~BOPAlgo_Section()
{
}
//=======================================================================
//function : CheckData
//purpose :
//=======================================================================
void BOPAlgo_Section::CheckData()
{
Standard_Integer aNbArgs;
//
myErrorStatus=0;
//
aNbArgs=myArguments.Extent();
if (!aNbArgs) {
myErrorStatus=100; // invalid number of Arguments
return;
}
//
if (!myPaveFiller) {
myErrorStatus=101;
return;
}
//
myErrorStatus=myPaveFiller->ErrorStatus();
if (myErrorStatus) {
return;
}
}
//=======================================================================
//function : PerformInternal1
//purpose :
//=======================================================================
void BOPAlgo_Section::PerformInternal1
(const BOPAlgo_PaveFiller& theFiller)
{
myErrorStatus=0;
myWarningStatus=0;
//
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
myContext=myPaveFiller->Context();
//
// 1. CheckData
CheckData();
if (myErrorStatus && !myWarningStatus) {
return;
}
//
// 2. Prepare
Prepare();
if (myErrorStatus) {
return;
}
//
if(myWarningStatus == 2) {
return;
}
// 3. Fill Images
// 3.1 Vertices
FillImagesVertices();
if (myErrorStatus) {
return;
}
//
BuildResult(TopAbs_VERTEX);
if (myErrorStatus) {
return;
}
// 3.2 Edges
FillImagesEdges();
if (myErrorStatus) {
return;
}
//
BuildResult(TopAbs_EDGE);
if (myErrorStatus) {
return;
}
// 4. Section
BuildSection();
//
if (myErrorStatus) {
return;
}
// 5.History
PrepareHistory();
//
if (myErrorStatus) {
return;
}
// 6. Post-treatment
PostTreat();
}
//=======================================================================
//function : BuildSection
//purpose :
//=======================================================================
void BOPAlgo_Section::BuildSection()
{
Standard_Integer i, aNbMS, aNbLE;
Standard_Integer j, nE, nV, aNb, aNbF, aNbPBSc;
TopoDS_Shape aRC, aRC1;
BRep_Builder aBB;
TopExp_Explorer aExp;
BOPCol_ListOfShape aLSA, aLS;
BOPCol_ListIteratorOfListOfShape aIt, aItIm, aItLS;
BOPCol_IndexedDataMapOfShapeInteger aMSI(100, myAllocator);
BOPCol_IndexedMapOfShape aMS(100, myAllocator);
BOPCol_MapOfShape aMFence(100, myAllocator);
BOPCol_MapIteratorOfMapOfInteger aItMI;
BOPDS_ListIteratorOfListOfPaveBlock aItPB;
//
myErrorStatus=0;
//
BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC1);
//
// 1. aRC1
aNb=myDS->NbSourceShapes();
for (i=0; i<aNb; ++i) {
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
if (aSI.ShapeType()!=TopAbs_FACE) {
continue;
}
//
const BOPDS_FaceInfo& aFI=myDS->FaceInfo(i);
//
// 1.1 Vertices that are section vertices
const BOPCol_MapOfInteger& aMVSc=aFI.VerticesSc();
aItMI.Initialize(aMVSc);
for(; aItMI.More(); aItMI.Next()) {
nV=aItMI.Key();
const TopoDS_Shape& aV=myDS->Shape(nV);
aBB.Add(aRC1, aV);
}
//
// 1.2 Vertices that are in a face
const BOPCol_MapOfInteger& aMI=aFI.VerticesIn();
aItMI.Initialize(aMI);
for(; aItMI.More(); aItMI.Next()) {
nV=aItMI.Key();
if (nV<0) {
continue;
}
if (myDS->IsNewShape(nV) || myDS->HasInterf(nV)) {
const TopoDS_Shape& aV=myDS->Shape(nV);
aBB.Add(aRC1, aV);
}
}
//
// 1.3 Section edges
const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
//
aNbPBSc=aMPBSc.Extent();
for (j=1; j<=aNbPBSc; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j);
nE=aPB->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
aBB.Add(aRC1, aE);
}
}
//
// 2. Common blocks between an edge and a face
const BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->PaveBlocksPool();
//
aNb=aPBP.Size();
for (i=0; i<aNb; ++i) {
const BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
Handle(BOPDS_CommonBlock) aCB=myDS->CommonBlock(aPB);
if (!aCB.IsNull()) {
const BOPCol_ListOfInteger& aLF=aCB->Faces();
aNbF=aLF.Extent();
if (aNbF) {
const Handle(BOPDS_PaveBlock)& aPBR=aCB->PaveBlock1();
nE=aPBR->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
aBB.Add(aRC1, aE);
}
}
}
}
//
aIt.Initialize(myArguments);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSA=aIt.Value();
if (aMFence.Add(aSA)) {
aLSA.Append(aSA);
}
}
//
aMFence.Clear();
//
// 3. Treatment boundaries of arguments
//
// 3.1 Set to treat => aLS
aIt.Initialize(aLSA);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSA=aIt.Value();
//
aLS.Clear();
aMS.Clear();
aMFence.Clear();
//
aExp.Init (aSA, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aE=aExp.Current();
if (aMFence.Add(aE)) {
aLS.Append(aE);
}
}
aExp.Init (aSA, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aE=aExp.Current();
if (aMFence.Add(aE)) {
aLS.Append(aE);
}
}
//
// 3.2 aMSI
aItLS.Initialize(aLS);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aS=aItLS.Value();
//
if (myImages.IsBound(aS)){
const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSIm=aItIm.Value();
BOPTools::MapShapes(aSIm, TopAbs_VERTEX, aMS);
BOPTools::MapShapes(aSIm, TopAbs_EDGE , aMS);
}
}// if (myImages.IsBound(aF)){
else {
BOPTools::MapShapes(aS, TopAbs_VERTEX, aMS);
BOPTools::MapShapes(aS, TopAbs_EDGE , aMS);
}
}//for (; aItLS.More(); aItLS.Next()) {
//
aNbMS=aMS.Extent();
for (i=1; i<=aNbMS; ++i) {
const TopoDS_Shape& aS=aMS(i);
if (aMSI.Contains(aS)) {
Standard_Integer& iCnt=aMSI.ChangeFromKey(aS);
++iCnt;
}
else {
aMSI.Add(aS, 1);
}
}
} //for (; aIt.More(); aIt.Next()) {
//
aMS.Clear();
aMFence.Clear();
//
// 4. Build the result
BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator);
//
BOPTools::MapShapesAndAncestors(aRC1,
TopAbs_VERTEX,
TopAbs_EDGE,
aMVE);
//
aNbMS=aMSI.Extent();
for (i=1; i<=aNbMS; ++i) {
const TopoDS_Shape& aV=aMSI.FindKey(i);
const Standard_Integer& iCnt=aMSI.FindFromIndex(i);
if (iCnt>1) {
BOPTools::MapShapesAndAncestors(aV,
TopAbs_VERTEX,
TopAbs_EDGE,
aMVE);
}
}
//
BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);
//
aNbMS=aMVE.Extent();
for (i=1; i<=aNbMS; ++i) {
const TopoDS_Shape& aV=aMVE.FindKey(i);
const BOPCol_ListOfShape& aLE=aMVE.FindFromIndex(i);
aNbLE=aLE.Extent();
if (!aNbLE) {
// alone vertices
if (aMFence.Add(aV)) {
aBB.Add(aRC, aV);
}
}
else {
// edges
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (aMFence.Add(aE)) {
aBB.Add(aRC, aE);
}
}
}
}
//
myShape=aRC;
}
//=======================================================================
//function : Generated
//purpose :
//=======================================================================
const TopTools_ListOfShape& BOPAlgo_Section::Generated
(const TopoDS_Shape& theS)
{
myHistShapes.Clear();
if (theS.IsNull()) {
return myHistShapes;
}
//
TopAbs_ShapeEnum aType = theS.ShapeType();
if (aType != TopAbs_FACE) {
return myHistShapes;
}
//
Standard_Integer nS = myDS->Index(theS);
if (nS < 0) {
return myHistShapes;
}
//
if (!myDS->HasFaceInfo(nS)) {
return myHistShapes;
}
//
//collect section edges of the face theS
Standard_Integer i, aNb, nSp;
//
const BOPDS_FaceInfo& aFI = myDS->FaceInfo(nS);
const BOPDS_IndexedMapOfPaveBlock& aMPBSc = aFI.PaveBlocksSc();
aNb = aMPBSc.Extent();
for (i = 1; i <= aNb; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
nSp = aPB->Edge();
const TopoDS_Shape& aSp = myDS->Shape(nSp);
myHistShapes.Append(aSp);
}
//
return myHistShapes;
}

View File

@ -12,7 +12,6 @@ BOPAlgo_Builder_1.cxx
BOPAlgo_Builder_2.cxx BOPAlgo_Builder_2.cxx
BOPAlgo_Builder_3.cxx BOPAlgo_Builder_3.cxx
BOPAlgo_Builder_4.cxx BOPAlgo_Builder_4.cxx
BOPAlgo_BOP_1.cxx
BOPAlgo_WireSplitter_1.cxx BOPAlgo_WireSplitter_1.cxx
BOPAlgo_ListOfCheckResult.hxx BOPAlgo_ListOfCheckResult.hxx

View File

@ -45,6 +45,7 @@
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Cut.hxx> #include <BRepAlgoAPI_Cut.hxx>
#include <BRepAlgoAPI_Section.hxx> #include <BRepAlgoAPI_Section.hxx>
#include <BOPAlgo_Section.hxx>
// //
static BOPAlgo_PaveFiller* pPF=NULL; static BOPAlgo_PaveFiller* pPF=NULL;
@ -193,14 +194,6 @@ Standard_Integer boptuc(Draw_Interpretor& di, Standard_Integer n, const char** a
return bopsmt(di, n, a, BOPAlgo_CUT21); return bopsmt(di, n, a, BOPAlgo_CUT21);
} }
//======================================================================= //=======================================================================
//function : bopsection
//purpose :
//=======================================================================
Standard_Integer bopsection(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
return bopsmt(di, n, a, BOPAlgo_SECTION);
}
//=======================================================================
//function : bopsmt //function : bopsmt
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -261,6 +254,62 @@ Standard_Integer bopsmt(Draw_Interpretor& di,
return 0; return 0;
} }
//======================================================================= //=======================================================================
//function : bopsection
//purpose :
//=======================================================================
Standard_Integer bopsection(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n<2) {
di << " use bopsmt r\n";
return 0;
}
//
if (!pPF) {
di << " prepare PaveFiller first\n";
return 0;
}
//
if (pPF->ErrorStatus()) {
di << " PaveFiller has not been done\n";
return 0;
}
//
char buf[64];
Standard_Integer aNb, iErr;
BOPAlgo_Section aBOP;
//
const BOPCol_ListOfShape& aLC=pPF->Arguments();
aNb=aLC.Extent();
if (aNb!=2) {
Sprintf (buf, " wrong number of arguments %s\n", aNb);
di << buf;
return 0;
}
//
const TopoDS_Shape& aS1=aLC.First();
const TopoDS_Shape& aS2=aLC.Last();
//
aBOP.AddArgument(aS1);
aBOP.AddArgument(aS2);
//
aBOP.PerformWithFiller(*pPF);
iErr=aBOP.ErrorStatus();
if (iErr) {
Sprintf(buf, " ErrorStatus : %d\n", iErr);
di << buf;
return 0;
}
//
const TopoDS_Shape& aR=aBOP.Shape();
if (aR.IsNull()) {
di << " null shape\n";
return 0;
}
//
DBRep::Set(a[1], aR);
return 0;
}
//=======================================================================
//function : bcommon //function : bcommon
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -327,7 +376,10 @@ Standard_Integer bsection(Draw_Interpretor& di,
const char* key2 = (n > 5) ? a[5] : NULL; const char* key2 = (n > 5) ? a[5] : NULL;
const char* pcurveconf = NULL; const char* pcurveconf = NULL;
if (key1 && (!strcasecmp(key1,"-n2d") || !strcasecmp(key1,"-n2d1") || !strcasecmp(key1,"-n2d2"))) { if (key1 &&
(!strcasecmp(key1,"-n2d") ||
!strcasecmp(key1,"-n2d1") ||
!strcasecmp(key1,"-n2d2"))) {
pcurveconf = key1; pcurveconf = key1;
} }
else { else {

View File

@ -18,11 +18,13 @@ class Objects from BOPTest
uses uses
ListOfShape from BOPCol, ListOfShape from BOPCol,
PDS from BOPDS,
PaveFiller from BOPAlgo, PaveFiller from BOPAlgo,
Builder from BOPAlgo, Builder from BOPAlgo,
PBuilder from BOPAlgo, PBuilder from BOPAlgo,
BOP from BOPAlgo, BOP from BOPAlgo,
PDS from BOPDS Section from BOPAlgo
--raises --raises
is is
@ -45,6 +47,10 @@ is
returns BOP from BOPAlgo; returns BOP from BOPAlgo;
---C++: return & ---C++: return &
Section(myclass)
returns Section from BOPAlgo;
---C++: return &
Shapes(myclass) Shapes(myclass)
returns ListOfShape from BOPCol; returns ListOfShape from BOPCol;
---C++: return & ---C++: return &

View File

@ -178,6 +178,15 @@ BOPAlgo_BOP& BOPTest_Objects::BOP()
return sBOP; return sBOP;
} }
//======================================================================= //=======================================================================
//function : Section
//purpose :
//=======================================================================
BOPAlgo_Section& BOPTest_Objects::Section()
{
static BOPAlgo_Section sSection(Allocator1());
return sSection;
}
//=======================================================================
//function : Shapes //function : Shapes
//purpose : //purpose :
//======================================================================= //=======================================================================

View File

@ -30,6 +30,7 @@
#include <BOPAlgo_PaveFiller.hxx> #include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Operation.hxx> #include <BOPAlgo_Operation.hxx>
#include <BOPAlgo_BOP.hxx> #include <BOPAlgo_BOP.hxx>
#include <BOPAlgo_Section.hxx>
// //
#include <BOPTest_DrawableShape.hxx> #include <BOPTest_DrawableShape.hxx>
#include <BOPTest_Objects.hxx> #include <BOPTest_Objects.hxx>
@ -241,7 +242,6 @@ Standard_Integer bbuild(Draw_Interpretor& di,
DBRep::Set(a[1], aR); DBRep::Set(a[1], aR);
return 0; return 0;
} }
//======================================================================= //=======================================================================
//function : bbop //function : bbop
//purpose : //purpose :
@ -288,30 +288,43 @@ Standard_Integer bbop(Draw_Interpretor& di,
// //
BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller(); BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller();
// //
BOPAlgo_BOP& aBOP=BOPTest_Objects::BOP(); BOPAlgo_Builder *pBuilder=NULL;
aBOP.Clear();
if (aOp!=BOPAlgo_SECTION) {
pBuilder=&BOPTest_Objects::BOP();
}
else {
pBuilder=&BOPTest_Objects::Section();
}
//
pBuilder->Clear();
// //
BOPCol_ListOfShape& aLSObj=BOPTest_Objects::Shapes(); BOPCol_ListOfShape& aLSObj=BOPTest_Objects::Shapes();
aIt.Initialize(aLSObj); aIt.Initialize(aLSObj);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value(); const TopoDS_Shape& aS=aIt.Value();
aBOP.AddArgument(aS); pBuilder->AddArgument(aS);
} }
// //
if (aOp!=BOPAlgo_SECTION) {
BOPAlgo_BOP *pBOP=(BOPAlgo_BOP *)pBuilder;
//
BOPCol_ListOfShape& aLSTools=BOPTest_Objects::Tools(); BOPCol_ListOfShape& aLSTools=BOPTest_Objects::Tools();
aIt.Initialize(aLSTools); aIt.Initialize(aLSTools);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value(); const TopoDS_Shape& aS=aIt.Value();
aBOP.AddTool(aS); pBOP->AddTool(aS);
} }
// //
aBOP.SetOperation(aOp); pBOP->SetOperation(aOp);
aBOP.SetRunParallel(bRunParallel); }
//
pBuilder->SetRunParallel(bRunParallel);
// //
aChrono.Start(); aChrono.Start();
// //
aBOP.PerformWithFiller(aPF); pBuilder->PerformWithFiller(aPF);
iErr=aBOP.ErrorStatus(); iErr=pBuilder->ErrorStatus();
if (iErr) { if (iErr) {
Sprintf(buf, " error: %d\n", iErr); Sprintf(buf, " error: %d\n", iErr);
di << buf; di << buf;
@ -328,7 +341,7 @@ Standard_Integer bbop(Draw_Interpretor& di,
di << buf; di << buf;
} }
// //
const TopoDS_Shape& aR=aBOP.Shape(); const TopoDS_Shape& aR=pBuilder->Shape();
if (aR.IsNull()) { if (aR.IsNull()) {
di << " null shape\n"; di << " null shape\n";
return 0; return 0;

View File

@ -36,8 +36,8 @@ uses
Shape from TopoDS, Shape from TopoDS,
ListOfShape from TopTools, ListOfShape from TopTools,
Operation from BOPAlgo, Operation from BOPAlgo,
BOP from BOPAlgo, Builder from BOPAlgo,
PBOP from BOPAlgo, PBuilder from BOPAlgo,
PaveFiller from BOPAlgo, PaveFiller from BOPAlgo,
PPaveFiller from BOPAlgo, PPaveFiller from BOPAlgo,
DataMapOfIntegerListOfShape from TopTools, DataMapOfIntegerListOfShape from TopTools,
@ -90,7 +90,8 @@ is
returns Operation from BOPAlgo; returns Operation from BOPAlgo;
---Purpose: Returns the type of Boolean Operation that has been performed. ---Purpose: Returns the type of Boolean Operation that has been performed.
FuseEdges(me) returns Boolean from Standard; FuseEdges(me)
returns Boolean from Standard;
---Purpose: Returns the flag of edge refining ---Purpose: Returns the flag of edge refining
RefineEdges(me:out); RefineEdges(me:out);
@ -100,7 +101,6 @@ is
returns Boolean from Standard returns Boolean from Standard
is protected; is protected;
---Category: Querying ---Category: Querying
BuilderCanWork(me) BuilderCanWork(me)
returns Boolean from Standard; returns Boolean from Standard;
@ -132,7 +132,8 @@ is
---Purpose: Returns true if the shape S has been deleted. The ---Purpose: Returns true if the shape S has been deleted. The
-- result shape of the operation does not contain the shape S. -- result shape of the operation does not contain the shape S.
Generated (me: in out; S : Shape from TopoDS) Generated (me: in out;
S : Shape from TopoDS)
returns ListOfShape from TopTools returns ListOfShape from TopTools
is redefined virtual; is redefined virtual;
---Purpose: Returns the list of shapes generated from the shape <S>. ---Purpose: Returns the list of shapes generated from the shape <S>.
@ -160,17 +161,15 @@ is
Destroy (me: in out); Destroy (me: in out);
---C++: alias "Standard_EXPORT virtual ~BRepAlgoAPI_BooleanOperation(){Destroy();}" ---C++: alias "Standard_EXPORT virtual ~BRepAlgoAPI_BooleanOperation(){Destroy();}"
--modified by NIZNHY-PKV Wed Mar 20 10:29:30 2002 f
SectionEdges (me: in out) SectionEdges (me: in out)
returns ListOfShape from TopTools; returns ListOfShape from TopTools;
--- Purpose: Returns a list of section edges. --- Purpose: Returns a list of section edges.
-- The edges represent the result of intersection between arguments of -- The edges represent the result of intersection between arguments of
-- Boolean Operation. They are computed during operation execution. -- Boolean Operation. They are computed during operation execution.
---C++: return const & ---C++: return const &
--modified by NIZNHY-PKV Wed Mar 20 10:29:35 2002 t
RefinedList (me: in out; theL : ListOfShape from TopTools) RefinedList (me: in out;
theL : ListOfShape from TopTools)
returns ListOfShape from TopTools returns ListOfShape from TopTools
is private; is private;
---Purpose: Returns the list of shapes generated from the shape <S>. ---Purpose: Returns the list of shapes generated from the shape <S>.
@ -184,8 +183,7 @@ fields
myOperation : Operation from BOPAlgo is protected; myOperation : Operation from BOPAlgo is protected;
myErrorStatus : Integer from Standard is protected; myErrorStatus : Integer from Standard is protected;
myDSFiller : PPaveFiller from BOPAlgo is protected; myDSFiller : PPaveFiller from BOPAlgo is protected;
myBuilder : PBOP from BOPAlgo is protected; myBuilder : PBuilder from BOPAlgo is protected;
myEntryType : Integer from Standard; myEntryType : Integer from Standard;
-- for edge refiner -- for edge refiner

View File

@ -24,15 +24,19 @@
#include <TopTools_MapOfShape.hxx> #include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPAlgo_PaveFiller.hxx> #include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_BOP.hxx> #include <BOPAlgo_BOP.hxx>
#include <BOPDS_DS.hxx> #include <BOPAlgo_Section.hxx>
//======================================================================= //=======================================================================
//function : BRepAlgoAPI_BooleanOperation //function : BRepAlgoAPI_BooleanOperation
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation(const TopoDS_Shape& aS1, BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation
(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2, const TopoDS_Shape& aS2,
const BOPAlgo_Operation anOp) const BOPAlgo_Operation anOp)
: :
@ -268,11 +272,21 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
} }
// //
myShape.Nullify(); myShape.Nullify();
//
myBuilder=new BOPAlgo_BOP; if (myOperation==BOPAlgo_SECTION) {
myBuilder=new BOPAlgo_Section;
myBuilder->AddArgument(aS1); myBuilder->AddArgument(aS1);
myBuilder->AddTool(aS2); myBuilder->AddArgument(aS2);
myBuilder->SetOperation(myOperation); }
else {
BOPAlgo_BOP *pBOP;
//
pBOP=new BOPAlgo_BOP;
myBuilder=pBOP;
pBOP->AddArgument(aS1);
pBOP->AddTool(aS2);
pBOP->SetOperation(myOperation);
}
// //
myBuilder->PerformWithFiller(*myDSFiller); myBuilder->PerformWithFiller(*myDSFiller);
iErr = myBuilder->ErrorStatus(); iErr = myBuilder->ErrorStatus();
@ -285,7 +299,12 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
BRepAlgoAPI_Check aCheckRes(myShape); BRepAlgoAPI_Check aCheckRes(myShape);
isDumpRes = !aCheckRes.IsValid(); isDumpRes = !aCheckRes.IsValid();
if (isDumpArgs || isDumpRes) { if (isDumpArgs || isDumpRes) {
BRepAlgoAPI::DumpOper(aPath, aS1, aS2, myShape, myOperation, isDumpArgs); BRepAlgoAPI::DumpOper(aPath,
aS1,
aS2,
myShape,
myOperation,
isDumpArgs);
} }
} }
// //

View File

@ -21,6 +21,7 @@ uses
Shape from TopoDS, Shape from TopoDS,
State from TopAbs, State from TopAbs,
PPaveFiller from BOPAlgo, PPaveFiller from BOPAlgo,
PBuilder from BOPAlgo,
PBOP from BOPAlgo, PBOP from BOPAlgo,
ListOfShape from TopTools, ListOfShape from TopTools,
IndexedDataMapOfShapeListOfShape from TopTools IndexedDataMapOfShapeListOfShape from TopTools
@ -34,14 +35,15 @@ is
theIndex : Integer from Standard) theIndex : Integer from Standard)
returns Shape from TopoDS; returns Shape from TopoDS;
HasSameDomain(myclass; theBuilder: PBOP from BOPAlgo; HasSameDomain(myclass; theBuilder: PBuilder from BOPAlgo;
theFace : Shape from TopoDS) theFace : Shape from TopoDS)
returns Boolean from Standard; returns Boolean from Standard;
SameDomain(myclass; theBuilder: PBOP from BOPAlgo; SameDomain(myclass; theBuilder: PBuilder from BOPAlgo;
theFace : Shape from TopoDS; theFace : Shape from TopoDS;
theResultList: out ListOfShape from TopTools); theResultList: out ListOfShape from TopTools);
IsSplit(myclass; theDSFiller: PPaveFiller from BOPAlgo; IsSplit(myclass; theDSFiller: PPaveFiller from BOPAlgo;
theEdge : Shape from TopoDS; theEdge : Shape from TopoDS;
theState : State from TopAbs) theState : State from TopAbs)

View File

@ -175,7 +175,8 @@ TopoDS_Shape QANewModTopOpe_Tools::NewVertex(const BOPAlgo_PPaveFiller& theDSFil
// function: HasDomain // function: HasDomain
// purpose: // purpose:
// ======================================================================================== // ========================================================================================
Standard_Boolean QANewModTopOpe_Tools::HasSameDomain(const BOPAlgo_PBOP& theBuilder, Standard_Boolean QANewModTopOpe_Tools::HasSameDomain
(const BOPAlgo_PBuilder& theBuilder,
const TopoDS_Shape& theFace) const TopoDS_Shape& theFace)
{ {
Standard_Integer bRet; Standard_Integer bRet;
@ -212,7 +213,8 @@ Standard_Boolean QANewModTopOpe_Tools::HasSameDomain(const BOPAlgo_PBOP& theBuil
// function: SameDomain // function: SameDomain
// purpose: // purpose:
// ======================================================================================== // ========================================================================================
void QANewModTopOpe_Tools::SameDomain(const BOPAlgo_PBOP& theBuilder, void QANewModTopOpe_Tools::SameDomain
(const BOPAlgo_PBuilder& theBuilder,
const TopoDS_Shape& theFace, const TopoDS_Shape& theFace,
TopTools_ListOfShape& theResultList) TopTools_ListOfShape& theResultList)
{ {