1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0025614: Provide API access to the new fuctionalities of Boolean Components

I. New features:
1.1. class BOPAlgo_PaveFiller
method:
void BOPAlgo_PaveFiller::SetArguments(const TopTools_ListOfShape& theLS)
has been added to provide the setting argumemts  through
TopTools_ListOfShape

1.2. class BOPAlgo_Builder
method:
void BOPAlgo_Builder::SetArguments(const TopTools_ListOfShape& theLS)
has been added to provide the setting argumemts  through
TopTools_ListOfShape

1.3. class BOPAlgo_BOP
method:
void BOPAlgo_BOP::SetTools(const TopTools_ListOfShape& theLS)
has been added to provide the setting tools through
TopTools_ListOfShape

1.4. class BRepAlgoAPI_BuilderAlgo
construcror:
BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo
  (const BOPAlgo_PaveFiller& aPF)
has been added to provide the construction
of the object using BOPAlgo_PaveFiller object

method:
void BRepAlgoAPI_BuilderAlgo::SetArguments
 (const TopTools_ListOfShape& theLS)
has been added to provide the setting argumemts

method:
const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Arguments()const
has been added to provide access to the argumemts

1.5. class BRepAlgoAPI_BooleanOperation
method:
void BRepAlgoAPI_BooleanOperation::SetTools
  (const TopTools_ListOfShape& theLS)
has been added to provide the setting tools

method:
const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Tools()const
has been added to provide access to the tools

1.6. class BRepAlgoAPI_Common
construcror:
BRepAlgoAPI_Common::BRepAlgoAPI_Common
(const BOPAlgo_PaveFiller& aPF)
has been added to provide the construction
of the object using BOPAlgo_PaveFiller object

1.7. class BRepAlgoAPI_Cut
construcror:
BRepAlgoAPI_Cut::BRepAlgoAPI_Cut
(const BOPAlgo_PaveFiller& aPF)
has been added to provide the construction
of the object using BOPAlgo_PaveFiller object

1.8. class BRepAlgoAPI_Fuse
construcror:
BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse
(const BOPAlgo_PaveFiller& aPF)
has been added to provide the construction
of the object using BOPAlgo_PaveFiller object

1.9. class BRepAlgoAPI_Section
construcror:
BRepAlgoAPI_Section::BRepAlgoAPI_Section
(const BOPAlgo_PaveFiller& aPF)
has been added to provide the construction
of the object using BOPAlgo_PaveFiller object

1.10. class BOPTest
method:
void BOPTest::APICommands(Draw_Interpretor& theCommands)
has been added to provide tcl commands to launch the algorithms
implemented in BRepAlgoAPI package using DRAWEXE application.

Commands:
 >bapibuild r
   performs General Fuse algorithm.
     r -the result of the operation

 >bapibop r type
   performs Boolean Operation agorithm
      r -the result of the operation
      type -type of the operation:
        0-common
        1-fuse
        2-cut
        3-cut21
        4-section

method:
void BOPTest::OptionCommands(Draw_Interpretor& theCommands)
has been added to provide tcl commands to set/get the options that is
necessary for the algorithms implemented in BRepAlgoAPI package.

Commands:
 >boptions
   dump the state of current options

  >brunparallel [0/1]
   1 -sets the parallel mode of the computations
   0 -sets the sequential mode of the computations

  >bfuzzyvalue value
    sets the fuzzy value

-------------------------------------------------------------------------------------------------------------
II. Changes:
II.1. class BRepAlgoAPI_BuilderAlgo
methods:
const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Generated
  (const TopoDS_Shape& aS)
const TopTools_ListOfShape& BRepAlgoAPI_BuilderAlgo::Modified
  (const TopoDS_Shape& aS)
Standard_Boolean BRepAlgoAPI_BuilderAlgo::IsDeleted
  (const TopoDS_Shape& aS)
Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasModified() const
Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasGenerated() const
Standard_Boolean BRepAlgoAPI_BuilderAlgo::HasDeleted() const
has been redefined to provide access to the history

II.1. class BOPTest
method:
void BOPTest::APICommands(Draw_Interpretor& theCommands)
has been added to provide tcl commands to launch the algorithms
implemented in BRepAlgoAPI package using DRAWEXE application.

method:
void BOPTest::OptionCommands(Draw_Interpretor& theCommands)
has been added to provide tcl commands to set/get the options that is
necessary for the algorithms implemented in BRepAlgoAPI package.

II.2. class BRepAlgoAPI
method:
void BRepAlgoAPI::DumpOper(const Standard_CString theFilePath,
                           const TopoDS_Shape& theShape1,
                           const TopoDS_Shape& theShape2,
                           const TopoDS_Shape& theResult,
                           BOPAlgo_Operation theOperation,
                           Standard_Boolean isNonValidArgs)
has been removed. The contents has been shifted into the file:
BRepAlgoAPI_BooleanOperation.cxx

II.3. classes QANewModTopOpe_Glue, QANewModTopOpe_Intersection
the modifications have been done to provide the consistency with the
modifications in BRepAlgoAPI package [I].
-------------------------------------------------------------------------------------------------------------
III. Modified entities:
packages:
BOPAlgo
BRepAlgoAPI
BOPTest
QANewModTopOpe

Test cases for issue CR25614
This commit is contained in:
pkv
2014-12-25 17:55:02 +03:00
committed by bugmaster
parent 6219c44ce7
commit 49b0c452e2
44 changed files with 2160 additions and 1030 deletions

View File

@@ -104,7 +104,6 @@ QANewModTopOpe_Glue::QANewModTopOpe_Glue(const TopoDS_Shape& theS1,
if (thePerformNow)
Build();
}
//=======================================================================
//function : Build
//purpose :
@@ -112,6 +111,9 @@ QANewModTopOpe_Glue::QANewModTopOpe_Glue(const TopoDS_Shape& theS1,
void QANewModTopOpe_Glue::Build()
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
if (myCompleted) return;
TopAbs_ShapeEnum aType1, aType2;

View File

@@ -323,6 +323,9 @@ Standard_Boolean QANewModTopOpe_Glue::SubstitudeSDFaces
void
QANewModTopOpe_Glue::PerformSDFaces()
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
TopExp_Explorer anExp;
TopoDS_Shape aS1, aS2;
Standard_Boolean aWire1 = Standard_False, aWire2 = Standard_False;

View File

@@ -322,7 +322,9 @@ CorrectAncestorsList (const TopoDS_Edge& theEdge, TopTools_ListOfShape& aListF)
void
QANewModTopOpe_Glue::PerformShell()
{
// Standard_Boolean isSolidShell = (myS1.ShapeType() == TopAbs_SOLID);
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
Standard_Boolean isSolidShell = Standard_False;
Standard_Integer i;

View File

@@ -32,6 +32,9 @@
void
QANewModTopOpe_Glue::PerformVertex()
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
BRepExtrema_DistShapeShape aExtrema (myS1, myS2);
if (!aExtrema.IsDone()) return;
if (aExtrema.InnerSolution()) {
@@ -43,7 +46,9 @@ QANewModTopOpe_Glue::PerformVertex()
TopTools_ListOfShape aList;
aList.Append (aV);
myMapGener.Bind(myS1, aList);
myShape = myS1;
myShape.Orientation(myS1.Orientation());
Done();

View File

@@ -575,6 +575,9 @@ UpdateEdgeOnFace (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace)
void
QANewModTopOpe_Glue::PerformShellWire()
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
Standard_Boolean anOnlyOneFace = Standard_False;
BRep_Builder aBld;
if(myS1.ShapeType() == TopAbs_FACE) {
@@ -1258,6 +1261,9 @@ static void FillMapModif(const BRepTools_Substitution &theSubst,
void
QANewModTopOpe_Glue::PerformWires()
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
Standard_Boolean S1IsEdge = Standard_False, S2IsEdge = Standard_False;
if(myS1.ShapeType() == TopAbs_EDGE) {
myS1 = BRepBuilderAPI_MakeWire(TopoDS::Edge(myS1));

View File

@@ -13,8 +13,9 @@
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Intersection from QANewModTopOpe inherits BooleanOperation from BRepAlgoAPI
class Intersection from QANewModTopOpe
inherits BooleanOperation from BRepAlgoAPI
---Purpose: provides intersection of two shapes;
uses

View File

@@ -46,10 +46,19 @@ static Standard_Boolean NoFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
return !f1&&!f2;
}
QANewModTopOpe_Intersection::QANewModTopOpe_Intersection( const TopoDS_Shape& theObject1,
const TopoDS_Shape& theObject2 )
: BRepAlgoAPI_BooleanOperation( theObject1, theObject2, BOPAlgo_SECTION)
//=======================================================================
//function : QANewModTopOpe_Intersection
//purpose :
//=======================================================================
QANewModTopOpe_Intersection::QANewModTopOpe_Intersection
( const TopoDS_Shape& theObject1,
const TopoDS_Shape& theObject2 )
:
BRepAlgoAPI_BooleanOperation( theObject1, theObject2, BOPAlgo_SECTION)
{
TopoDS_Shape& myS1=myArguments.First();
TopoDS_Shape& myS2=myTools.First();
myMapGener.Clear();
if(NoFaces(myS1, myS2)) {
@@ -100,14 +109,14 @@ QANewModTopOpe_Intersection::QANewModTopOpe_Intersection( const TopoDS_Shape& th
BB.Add(myShape, mkV.Vertex());
if (!myMapGener.IsBound(DSS. SupportOnShape1(i))) {
// for Mandrake-10 - mkv,02.06.06 - myMapGener.Bind(DSS.SupportOnShape1(i), TopTools_ListOfShape());
TopTools_ListOfShape aListOfShape1;
myMapGener.Bind(DSS.SupportOnShape1(i), aListOfShape1);
}
myMapGener(DSS.SupportOnShape1(i)).Append(mkV.Vertex());
if (!myMapGener.IsBound(DSS.SupportOnShape2(i))) {
// for Mandrake-10 - mkv,02.06.06 - myMapGener.Bind(DSS.SupportOnShape2(i), TopTools_ListOfShape());
TopTools_ListOfShape aListOfShape2;
myMapGener.Bind(DSS.SupportOnShape2(i), aListOfShape2);
}
@@ -123,20 +132,6 @@ QANewModTopOpe_Intersection::QANewModTopOpe_Intersection( const TopoDS_Shape& th
Done();
return;
}
Standard_Boolean bIsNewFiller = PrepareFiller();
//
if (myErrorStatus!=1) {
// there were errors during the preparation
return;
}
//
if (bIsNewFiller) {
//Prepare the DS
myDSFiller->Perform();
}
Build();
Standard_Boolean bcw = BuilderCanWork();
@@ -329,6 +324,9 @@ Standard_Boolean QANewModTopOpe_Intersection::IsDeleted(const TopoDS_Shape& aS)
//=======================================================================
Standard_Boolean QANewModTopOpe_Intersection::HasDeleted() const
{
const TopoDS_Shape& myS1=myArguments.First();
const TopoDS_Shape& myS2=myTools.First();
TopExp_Explorer anExp;
for(Standard_Integer argit = 0; argit < 2; argit++) {