mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-08 05:38:12 +08: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:
@@ -21,23 +21,23 @@
|
||||
deferred class BooleanOperation from BRepAlgoAPI
|
||||
inherits MakeShape from BRepBuilderAPI
|
||||
|
||||
---Purpose: The abstract class BooleanOperation is the root
|
||||
-- class of Boolean Operations (see Overview).
|
||||
-- Boolean Operations algorithm is divided onto two parts.
|
||||
-- - The first one is computing interference between arguments.
|
||||
-- - The second one is building the result of operation.
|
||||
-- The BooleanOperation class provides execution of both parts
|
||||
-- of the Boolean Operations algorithm. The second part
|
||||
-- (building the result) depends on given type of the Boolean
|
||||
-- Operation (see Constructor).
|
||||
---Purpose: The abstract class BooleanOperation is the root
|
||||
-- class of Boolean Operations (see Overview).
|
||||
-- Boolean Operations algorithm is divided onto two parts.
|
||||
-- - The first one is computing interference between arguments.
|
||||
-- - The second one is building the result of operation.
|
||||
-- The BooleanOperation class provides execution of both parts
|
||||
-- of the Boolean Operations algorithm. The second part
|
||||
-- (building the result) depends on given type of the Boolean
|
||||
-- Operation (see Constructor).
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
ListOfShape from TopTools,
|
||||
Operation from BOPAlgo,
|
||||
BOP from BOPAlgo,
|
||||
PBOP from BOPAlgo,
|
||||
Operation from BOPAlgo,
|
||||
Builder from BOPAlgo,
|
||||
PBuilder from BOPAlgo,
|
||||
PaveFiller from BOPAlgo,
|
||||
PPaveFiller from BOPAlgo,
|
||||
DataMapOfIntegerListOfShape from TopTools,
|
||||
@@ -46,146 +46,144 @@ uses
|
||||
|
||||
is
|
||||
|
||||
Initialize (S1 :Shape from TopoDS;
|
||||
S2 :Shape from TopoDS;
|
||||
anOperation:Operation from BOPAlgo);
|
||||
---Purpose: Prepares the operations for S1 and S2.
|
||||
Initialize (S1 :Shape from TopoDS;
|
||||
S2 :Shape from TopoDS;
|
||||
anOperation:Operation from BOPAlgo);
|
||||
---Purpose: Prepares the operations for S1 and S2.
|
||||
|
||||
Initialize (S1 :Shape from TopoDS;
|
||||
S2 :Shape from TopoDS;
|
||||
aDSF :PaveFiller from BOPAlgo;
|
||||
anOperation:Operation from BOPAlgo);
|
||||
---Purpose: Prepares the operations for S1 and S2.
|
||||
S2 :Shape from TopoDS;
|
||||
aDSF :PaveFiller from BOPAlgo;
|
||||
anOperation:Operation from BOPAlgo);
|
||||
---Purpose: Prepares the operations for S1 and S2.
|
||||
|
||||
SetOperation (me:out;
|
||||
anOp: Operation from BOPAlgo);
|
||||
---Purpose: Sets the type of Boolean operation to perform
|
||||
--- It can be BOPAlgo_SECTION
|
||||
--- BOPAlgo_COMMON
|
||||
--- BOPAlgo_FUSE
|
||||
--- BOPAlgo_CUT
|
||||
--- BOPAlgo_CUT21
|
||||
---
|
||||
|
||||
anOp: Operation from BOPAlgo);
|
||||
---Purpose: Sets the type of Boolean operation to perform
|
||||
--- It can be BOPAlgo_SECTION
|
||||
--- BOPAlgo_COMMON
|
||||
--- BOPAlgo_FUSE
|
||||
--- BOPAlgo_CUT
|
||||
--- BOPAlgo_CUT21
|
||||
---
|
||||
|
||||
|
||||
Build (me:out)
|
||||
is redefined virtual;
|
||||
---Purpose: Provides the algorithm of Boolean Operations
|
||||
-- - Filling interference Data Structure (if it is necessary)
|
||||
-- - Building the result of the operation.
|
||||
is redefined virtual;
|
||||
---Purpose: Provides the algorithm of Boolean Operations
|
||||
-- - Filling interference Data Structure (if it is necessary)
|
||||
-- - Building the result of the operation.
|
||||
|
||||
Shape1(me)
|
||||
returns Shape from TopoDS
|
||||
is static;
|
||||
---Purpose: Returns the first shape involved in this Boolean operation.
|
||||
---C++: return const &
|
||||
Shape1(me)
|
||||
returns Shape from TopoDS
|
||||
is static;
|
||||
---Purpose: Returns the first shape involved in this Boolean operation.
|
||||
---C++: return const &
|
||||
|
||||
Shape2(me)
|
||||
returns Shape from TopoDS
|
||||
is static;
|
||||
---Purpose: Returns the second shape involved in this Boolean operation.
|
||||
---C++: return const &
|
||||
returns Shape from TopoDS
|
||||
is static;
|
||||
---Purpose: Returns the second shape involved in this Boolean operation.
|
||||
---C++: return const &
|
||||
|
||||
Operation (me)
|
||||
returns Operation from BOPAlgo;
|
||||
---Purpose: Returns the type of Boolean Operation that has been performed.
|
||||
|
||||
FuseEdges(me) returns Boolean from Standard;
|
||||
---Purpose: Returns the flag of edge refining
|
||||
returns Operation from BOPAlgo;
|
||||
---Purpose: Returns the type of Boolean Operation that has been performed.
|
||||
|
||||
FuseEdges(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns the flag of edge refining
|
||||
|
||||
RefineEdges(me:out);
|
||||
---Purpose: Fuse C1 edges
|
||||
---Purpose: Fuse C1 edges
|
||||
|
||||
PrepareFiller(me:out)
|
||||
returns Boolean from Standard
|
||||
is protected;
|
||||
|
||||
|
||||
---Category: Querying
|
||||
returns Boolean from Standard
|
||||
is protected;
|
||||
|
||||
---Category: Querying
|
||||
BuilderCanWork(me)
|
||||
returns Boolean from Standard;
|
||||
returns Boolean from Standard;
|
||||
|
||||
ErrorStatus(me)
|
||||
returns Integer from Standard;
|
||||
---Purpose: Returns the error status of operation.
|
||||
--- 0 - Ok
|
||||
--- 1 - The Object is created but Nothing is Done
|
||||
--- 2 - Null source shapes is not allowed
|
||||
--- 3 - Check types of the arguments
|
||||
--- 4 - Can not allocate memory for the DSFiller
|
||||
--- 5 - The Builder can not work with such types of arguments
|
||||
--- 6 - Unknown operation is not allowed
|
||||
--- 7 - Can not allocate memory for the Builder
|
||||
-- > 100 - See the Builder's ErrorStatus
|
||||
returns Integer from Standard;
|
||||
---Purpose: Returns the error status of operation.
|
||||
--- 0 - Ok
|
||||
--- 1 - The Object is created but Nothing is Done
|
||||
--- 2 - Null source shapes is not allowed
|
||||
--- 3 - Check types of the arguments
|
||||
--- 4 - Can not allocate memory for the DSFiller
|
||||
--- 5 - The Builder can not work with such types of arguments
|
||||
--- 6 - Unknown operation is not allowed
|
||||
--- 7 - Can not allocate memory for the Builder
|
||||
-- > 100 - See the Builder's ErrorStatus
|
||||
|
||||
Modified (me: in out;
|
||||
aS : Shape from TopoDS)
|
||||
returns ListOfShape from TopTools
|
||||
is redefined virtual;
|
||||
---Purpose: Returns the list of shapes modified from the shape <S>.
|
||||
---C++: return const &
|
||||
aS : Shape from TopoDS)
|
||||
returns ListOfShape from TopTools
|
||||
is redefined virtual;
|
||||
---Purpose: Returns the list of shapes modified from the shape <S>.
|
||||
---C++: return const &
|
||||
|
||||
IsDeleted (me: in out;
|
||||
aS : Shape from TopoDS)
|
||||
returns Boolean
|
||||
is redefined virtual;
|
||||
---Purpose: Returns true if the shape S has been deleted. The
|
||||
-- result shape of the operation does not contain the shape S.
|
||||
aS : Shape from TopoDS)
|
||||
returns Boolean
|
||||
is redefined virtual;
|
||||
---Purpose: Returns true if the shape S has been deleted. The
|
||||
-- result shape of the operation does not contain the shape S.
|
||||
|
||||
Generated (me: in out; S : Shape from TopoDS)
|
||||
returns ListOfShape from TopTools
|
||||
is redefined virtual;
|
||||
---Purpose: Returns the list of shapes generated from the shape <S>.
|
||||
--- For use in BRepNaming.
|
||||
---C++: return const &
|
||||
Generated (me: in out;
|
||||
S : Shape from TopoDS)
|
||||
returns ListOfShape from TopTools
|
||||
is redefined virtual;
|
||||
---Purpose: Returns the list of shapes generated from the shape <S>.
|
||||
--- For use in BRepNaming.
|
||||
---C++: return const &
|
||||
|
||||
HasModified (me)
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one modified shape.
|
||||
--- For use in BRepNaming.
|
||||
HasModified (me)
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one modified shape.
|
||||
--- For use in BRepNaming.
|
||||
|
||||
HasGenerated (me)
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one generated shape.
|
||||
--- For use in BRepNaming.
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one generated shape.
|
||||
--- For use in BRepNaming.
|
||||
|
||||
HasDeleted (me)
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one deleted shape.
|
||||
--- For use in BRepNaming.
|
||||
returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns true if there is at least one deleted shape.
|
||||
--- For use in BRepNaming.
|
||||
|
||||
Destroy (me: in out);
|
||||
---C++: alias "Standard_EXPORT virtual ~BRepAlgoAPI_BooleanOperation(){Destroy();}"
|
||||
|
||||
--modified by NIZNHY-PKV Wed Mar 20 10:29:30 2002 f
|
||||
|
||||
SectionEdges (me: in out)
|
||||
returns ListOfShape from TopTools;
|
||||
--- Purpose: Returns a list of section edges.
|
||||
-- The edges represent the result of intersection between arguments of
|
||||
-- Boolean Operation. They are computed during operation execution.
|
||||
---C++: return const &
|
||||
--modified by NIZNHY-PKV Wed Mar 20 10:29:35 2002 t
|
||||
returns ListOfShape from TopTools;
|
||||
--- Purpose: Returns a list of section edges.
|
||||
-- The edges represent the result of intersection between arguments of
|
||||
-- Boolean Operation. They are computed during operation execution.
|
||||
---C++: return const &
|
||||
|
||||
RefinedList (me: in out; theL : ListOfShape from TopTools)
|
||||
returns ListOfShape from TopTools
|
||||
is private;
|
||||
---Purpose: Returns the list of shapes generated from the shape <S>.
|
||||
--- For use in BRepNaming.
|
||||
---C++: return const &
|
||||
RefinedList (me: in out;
|
||||
theL : ListOfShape from TopTools)
|
||||
returns ListOfShape from TopTools
|
||||
is private;
|
||||
---Purpose: Returns the list of shapes generated from the shape <S>.
|
||||
--- For use in BRepNaming.
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
myS1 : Shape from TopoDS is protected;
|
||||
myS2 : Shape from TopoDS is protected;
|
||||
myBuilderCanWork : Boolean from Standard is protected;
|
||||
myOperation : Operation from BOPAlgo is protected;
|
||||
myErrorStatus : Integer from Standard is protected;
|
||||
myDSFiller : PPaveFiller from BOPAlgo is protected;
|
||||
myBuilder : PBOP from BOPAlgo is protected;
|
||||
|
||||
myErrorStatus : Integer from Standard is protected;
|
||||
myDSFiller : PPaveFiller from BOPAlgo is protected;
|
||||
myBuilder : PBuilder from BOPAlgo is protected;
|
||||
myEntryType : Integer from Standard;
|
||||
|
||||
-- for edge refiner
|
||||
|
||||
@@ -24,17 +24,21 @@
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <BOPDS_DS.hxx>
|
||||
|
||||
#include <BOPAlgo_PaveFiller.hxx>
|
||||
#include <BOPAlgo_BOP.hxx>
|
||||
#include <BOPDS_DS.hxx>
|
||||
#include <BOPAlgo_Section.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAlgoAPI_BooleanOperation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation(const TopoDS_Shape& aS1,
|
||||
const TopoDS_Shape& aS2,
|
||||
const BOPAlgo_Operation anOp)
|
||||
BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation
|
||||
(const TopoDS_Shape& aS1,
|
||||
const TopoDS_Shape& aS2,
|
||||
const BOPAlgo_Operation anOp)
|
||||
:
|
||||
myS1(aS1),
|
||||
myS2(aS2),
|
||||
@@ -268,11 +272,21 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
|
||||
}
|
||||
//
|
||||
myShape.Nullify();
|
||||
|
||||
myBuilder=new BOPAlgo_BOP;
|
||||
myBuilder->AddArgument(aS1);
|
||||
myBuilder->AddTool(aS2);
|
||||
myBuilder->SetOperation(myOperation);
|
||||
//
|
||||
if (myOperation==BOPAlgo_SECTION) {
|
||||
myBuilder=new BOPAlgo_Section;
|
||||
myBuilder->AddArgument(aS1);
|
||||
myBuilder->AddArgument(aS2);
|
||||
}
|
||||
else {
|
||||
BOPAlgo_BOP *pBOP;
|
||||
//
|
||||
pBOP=new BOPAlgo_BOP;
|
||||
myBuilder=pBOP;
|
||||
pBOP->AddArgument(aS1);
|
||||
pBOP->AddTool(aS2);
|
||||
pBOP->SetOperation(myOperation);
|
||||
}
|
||||
//
|
||||
myBuilder->PerformWithFiller(*myDSFiller);
|
||||
iErr = myBuilder->ErrorStatus();
|
||||
@@ -285,7 +299,12 @@ const TopTools_ListOfShape& BRepAlgoAPI_BooleanOperation::Modified(const TopoDS_
|
||||
BRepAlgoAPI_Check aCheckRes(myShape);
|
||||
isDumpRes = !aCheckRes.IsValid();
|
||||
if (isDumpArgs || isDumpRes) {
|
||||
BRepAlgoAPI::DumpOper(aPath, aS1, aS2, myShape, myOperation, isDumpArgs);
|
||||
BRepAlgoAPI::DumpOper(aPath,
|
||||
aS1,
|
||||
aS2,
|
||||
myShape,
|
||||
myOperation,
|
||||
isDumpArgs);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user