Allocator(me)
returns BaseAllocator from BOPCol;
---C++: return const &
-
+
+ SetRunParallel(me:out;
+ theFlag:Boolean from Standard);
+ ---Purpose: Set the flag of parallel processing
+ -- if <theFlag> is true the parallel processing is switched on
+ -- if <theFlag> is false the parallel processing is switched off
+ --
+ RunParallel(me)
+ returns Boolean from Standard;
+ ---Purpose: Returns the flag of parallel processing
+
fields
myAllocator : BaseAllocator from BOPCol is protected;
myErrorStatus : Integer from Standard is protected;
myWarningStatus : Integer from Standard is protected;
-
+ myRunParallel : Boolean from Standard is protected;
end Algo;
// function:
// purpose:
//=======================================================================
- BOPAlgo_Algo::BOPAlgo_Algo()
+BOPAlgo_Algo::BOPAlgo_Algo()
:
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
myErrorStatus(1),
- myWarningStatus(0)
+ myWarningStatus(0),
+ myRunParallel(Standard_False)
{}
//=======================================================================
// function:
// purpose:
//=======================================================================
- BOPAlgo_Algo::BOPAlgo_Algo(const Handle(NCollection_BaseAllocator)& theAllocator)
+BOPAlgo_Algo::BOPAlgo_Algo
+ (const Handle(NCollection_BaseAllocator)& theAllocator)
:
myAllocator(theAllocator),
myErrorStatus(1),
- myWarningStatus(0)
+ myWarningStatus(0),
+ myRunParallel(Standard_False)
{}
//=======================================================================
// function: ~
// purpose:
//=======================================================================
- BOPAlgo_Algo::~BOPAlgo_Algo()
+BOPAlgo_Algo::~BOPAlgo_Algo()
{
}
//=======================================================================
//function : Allocator
//purpose :
//=======================================================================
- const Handle(NCollection_BaseAllocator)& BOPAlgo_Algo::Allocator()const
+const Handle(NCollection_BaseAllocator)& BOPAlgo_Algo::Allocator()const
{
return myAllocator;
}
// function: CheckData
// purpose:
//=======================================================================
- void BOPAlgo_Algo::CheckData()
+void BOPAlgo_Algo::CheckData()
{
myErrorStatus=0;
}
// function: CheckResult
// purpose:
//=======================================================================
- void BOPAlgo_Algo::CheckResult()
+void BOPAlgo_Algo::CheckResult()
{
myErrorStatus=0;
}
// function: ErrorStatus
// purpose:
//=======================================================================
- Standard_Integer BOPAlgo_Algo::ErrorStatus()const
+Standard_Integer BOPAlgo_Algo::ErrorStatus()const
{
return myErrorStatus;
}
// function: WarningStatus
// purpose:
//=======================================================================
- Standard_Integer BOPAlgo_Algo::WarningStatus()const
+Standard_Integer BOPAlgo_Algo::WarningStatus()const
{
return myWarningStatus;
}
+//=======================================================================
+//function : SetRunParallel
+//purpose :
+//=======================================================================
+void BOPAlgo_Algo::SetRunParallel(const Standard_Boolean theFlag)
+{
+ myRunParallel=theFlag;
+}
+//=======================================================================
+//function : RunParallel
+//purpose :
+//=======================================================================
+Standard_Boolean BOPAlgo_Algo::RunParallel()const
+{
+ return myRunParallel;
+}
// myErrorStatus
//
// 1 - object is just initialized
---Purpose: Returns true if the shape theS has been deleted.
returns Boolean from Standard
is redefined;
-
- SetRunParallel(me:out;
- theFlag:Boolean from Standard);
- ---Purpose: Set the flag of parallel processing
- -- if <theFlag> is true the parallel processing is switched on
- -- if <theFlag> is false the parallel processing is switched off
- --
- RunParallel(me)
- returns Boolean from Standard;
- ---Purpose: Returns the flag of parallel processing
--
-- Debug
--
--
mySplits : DataMapOfShapeListOfShape from BOPCol is protected;
myOrigins : DataMapOfShapeShape from BOPCol is protected;
- --
- myRunParallel : Boolean from Standard is protected;
- --
+
end Builder;
myMapFence(100, myAllocator),
myPaveFiller(NULL),
myDS(NULL),
- //myContext(NULL),
myEntryPoint(0),
myImages(100, myAllocator),
myShapesSD(100, myAllocator),
mySplits(100, myAllocator),
- myOrigins(100, myAllocator),
- myRunParallel(Standard_False)
+ myOrigins(100, myAllocator)
{
}
//=======================================================================
myMapFence(100, myAllocator),
myPaveFiller(NULL),
myDS(NULL),
- //myContext(NULL),
myEntryPoint(0),
myImages(100, myAllocator),
myShapesSD(100, myAllocator),
mySplits(100, myAllocator),
- myOrigins(100, myAllocator),
- myRunParallel(Standard_False)
+ myOrigins(100, myAllocator)
{
}
//=======================================================================
myOrigins.Clear();
}
//=======================================================================
-//function : SetRunParallel
-//purpose :
-//=======================================================================
-void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
-{
- myRunParallel=theFlag;
-}
-//=======================================================================
-//function : RunParallel
-//purpose :
-//=======================================================================
-Standard_Boolean BOPAlgo_Builder::RunParallel()const
-{
- return myRunParallel;
-}
-//=======================================================================
//function : AddArgument
//purpose :
//=======================================================================
// Created by: Peter KURNEV
-// Copyright (c) 2010-2014 OPEN CASCADE SAS
+// Copyright (c) 2010-2012 OPEN CASCADE SAS
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This file is part of Open CASCADE Technology software library.
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public 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.
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
#include <BOPAlgo_BuilderFace.ixx>
static
void MakeInternalWires(const BOPCol_MapOfShape& ,
BOPCol_ListOfShape& );
-
+static
+ void GetWire(const TopoDS_Shape& ,
+ TopoDS_Shape& );
+//
+#include <NCollection_UBTreeFiller.hxx>
+#include <BOPCol_Box2DBndTree.hxx>
+#include <BRepTools.hxx>
+#include <TColStd_MapIntegerHasher.hxx>
+#include <NCollection_DataMap.hxx>
+//
+//=======================================================================
+//class : BOPAlgo_ShapeBox2D
+//purpose : Auxiliary class
+//=======================================================================
+class BOPAlgo_ShapeBox2D {
+ public:
+ BOPAlgo_ShapeBox2D() {
+ myIsHole=Standard_False;
+ };
+ //
+ ~BOPAlgo_ShapeBox2D() {
+ };
+ //
+ void SetShape(const TopoDS_Shape& aS) {
+ myShape=aS;
+ };
+ //
+ const TopoDS_Shape& Shape()const {
+ return myShape;
+ };
+ //
+ void SetBox2D(const Bnd_Box2d& aBox2D) {
+ myBox2D=aBox2D;
+ };
+ //
+ const Bnd_Box2d& Box2D()const {
+ return myBox2D;
+ };
+ //
+ void SetIsHole(const Standard_Boolean bFlag) {
+ myIsHole=bFlag;
+ };
+ //
+ Standard_Boolean IsHole()const {
+ return myIsHole;
+ };
+ //
+ protected:
+ Standard_Boolean myIsHole;
+ TopoDS_Shape myShape;
+ Bnd_Box2d myBox2D;
+};
+//
+typedef NCollection_DataMap\
+ <Standard_Integer, BOPAlgo_ShapeBox2D, TColStd_MapIntegerHasher> \
+ BOPAlgo_DataMapOfIntegerShapeBox2D;
+//
+typedef BOPAlgo_DataMapOfIntegerShapeBox2D::Iterator \
+ BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox2D;
+//
+//
//=======================================================================
//function :
//purpose :
//=======================================================================
- BOPAlgo_BuilderFace::BOPAlgo_BuilderFace()
+BOPAlgo_BuilderFace::BOPAlgo_BuilderFace()
:
BOPAlgo_BuilderArea()
{
//function :
//purpose :
//=======================================================================
- BOPAlgo_BuilderFace::BOPAlgo_BuilderFace(const Handle(NCollection_BaseAllocator)& theAllocator)
+BOPAlgo_BuilderFace::BOPAlgo_BuilderFace
+ (const Handle(NCollection_BaseAllocator)& theAllocator)
:
BOPAlgo_BuilderArea(theAllocator)
{
//function : SetFace
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::SetFace(const TopoDS_Face& theFace)
+void BOPAlgo_BuilderFace::SetFace(const TopoDS_Face& theFace)
{
myOrientation=theFace.Orientation();
myFace=theFace;
//function : Face
//purpose :
//=======================================================================
- const TopoDS_Face& BOPAlgo_BuilderFace::Face()const
+const TopoDS_Face& BOPAlgo_BuilderFace::Face()const
{
return myFace;
}
//function : CheckData
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::CheckData()
+void BOPAlgo_BuilderFace::CheckData()
{
myErrorStatus=0;
//
- if (myContext.IsNull()) {
- //myErrorStatus=11;// Null Context
- //return;
- myContext = new BOPInt_Context;
- }
- //
if (myFace.IsNull()) {
myErrorStatus=12;// Null face generix
return;
}
+ if (myContext.IsNull()) {
+ myContext = new BOPInt_Context;
+ }
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::Perform()
+void BOPAlgo_BuilderFace::Perform()
{
myErrorStatus=0;
//
//function :PerformShapesToAvoid
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::PerformShapesToAvoid()
+void BOPAlgo_BuilderFace::PerformShapesToAvoid()
{
Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbV, aNbE;
//function : PerformLoops
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::PerformLoops()
+void BOPAlgo_BuilderFace::PerformLoops()
{
myErrorStatus=0;
//
}
//
aWSp.SetWES(aWES);
+ aWSp.SetRunParallel(myRunParallel);
aWSp.Perform();
iErr=aWSp.ErrorStatus();
if (iErr) {
myLoopsInternal.Append(aW);
}//for (; aItM.More(); aItM.Next()) {
}
+//
+
//=======================================================================
//function : PerformAreas
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::PerformAreas()
+void BOPAlgo_BuilderFace::PerformAreas()
{
- myErrorStatus=0;
- //
Standard_Boolean bIsGrowth, bIsHole;
+ Standard_Integer k,aNbHoles;
Standard_Real aTol;
- TopoDS_Shape anInfinitePointShape;
+ TopLoc_Location aLoc;
+ Handle(Geom_Surface) aS;
+ BRep_Builder aBB;
+ TopoDS_Face aFace;
//
- BOPCol_ListOfShape aNewFaces, aHoleWires;
+ BOPCol_ListIteratorOfListOfInteger aItLI;
+ BOPCol_IndexedMapOfShape aMHE;
BOPCol_DataMapOfShapeShape aInOutMap;
+ BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
BOPCol_DataMapOfShapeListOfShape aMSH;
- BOPCol_IndexedMapOfShape aMHE;
-
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
- BOPCol_ListIteratorOfListOfShape aIt1, aIt2;
- BRep_Builder aBB;
- Handle(Geom_Surface) aS;
- TopLoc_Location aLoc;
+ BOPCol_ListIteratorOfListOfShape aIt1;
+ BOPAlgo_DataMapOfIntegerShapeBox2D aDMISB(100);
+ BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox2D aItDMISB;
+ //
+ BOPCol_Box2DBndTreeSelector aSelector;
+ BOPCol_Box2DBndTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, Bnd_Box2d> aTreeFiller(aBBTree);
+ //
+ myErrorStatus=0;
//
aTol=BRep_Tool::Tolerance(myFace);
aS=BRep_Tool::Surface(myFace, aLoc);
//
myAreas.Clear();
//
- // Draft faces [aNewFaces]
+ // 1. Growthes and Holes -> aDMISB: [Index/ShapeBox2D]
aIt1.Initialize(myLoops);
- for ( ; aIt1.More(); aIt1.Next()) {
+ for (k=0 ; aIt1.More(); aIt1.Next(), ++k) {
+ Bnd_Box2d aBox2D;
+ //
const TopoDS_Shape& aWire=aIt1.Value();
//
+ aBB.MakeFace(aFace, aS, aLoc, aTol);
+ aBB.Add (aFace, aWire);
+ BRepTools::AddUVBounds(aFace, aBox2D);
+ //
bIsGrowth=IsGrowthWire(aWire, aMHE);
if (bIsGrowth) {
- // make a growth face from a wire
- TopoDS_Face aFace;
- aBB.MakeFace(aFace, aS, aLoc, aTol);
- aBB.Add (aFace, aWire);
- //
- aNewFaces.Append (aFace);
+ bIsHole=Standard_False;
}
else{
// check if a wire is a hole
- //XX
- TopoDS_Face aFace;
- aBB.MakeFace(aFace, aS, aLoc, aTol);
- aBB.Add (aFace, aWire);
- //
IntTools_FClass2d& aClsf=myContext->FClass2d(aFace);
aClsf.Init(aFace, aTol);
//
bIsHole=aClsf.IsHole();
- //
- //bIsHole=BOPTools_AlgoTools::IsHole(aWire, myFace);
- //XX
if (bIsHole) {
- aHoleWires.Append(aWire);
BOPTools::MapShapes(aWire, TopAbs_EDGE, aMHE);
+ //
+ bIsHole=Standard_True;
}
else {
- // make a growth face from a wire
- TopoDS_Face aFace;
- aBB.MakeFace(aFace, aS, aLoc, aTol);
- aBB.Add (aFace, aWire);
- //
- aNewFaces.Append (aFace);
+ bIsHole=Standard_False;
}
}
+ //
+ BOPAlgo_ShapeBox2D aSB2D;
+ //
+ aSB2D.SetShape(aFace);
+ aSB2D.SetBox2D(aBox2D);
+ aSB2D.SetIsHole(bIsHole);
+ //
+ aDMISB.Bind(k, aSB2D);
+ }
+ //
+ // 2. Prepare TreeFiller
+ aItDMISB.Initialize(aDMISB);
+ for (; aItDMISB.More(); aItDMISB.Next()) {
+ k=aItDMISB.Key();
+ const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
+ //
+ bIsHole=aSB2D.IsHole();
+ if (bIsHole) {
+ const Bnd_Box2d& aBox2D=aSB2D.Box2D();
+ aTreeFiller.Add(k, aBox2D);
+ }
}
//
- // 2. Find outer growth shell that is most close to each hole shell
- aIt2.Initialize(aHoleWires);
- for (; aIt2.More(); aIt2.Next()) {
- const TopoDS_Shape& aHole = aIt2.Value();
+ // 3. Shake TreeFiller
+ aTreeFiller.Fill();
+ //
+ // 4. Find outer growth shell that is most close
+ // to each hole shell
+ aItDMISB.Initialize(aDMISB);
+ for (; aItDMISB.More(); aItDMISB.Next()) {
+ k=aItDMISB.Key();
+ const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
+ bIsHole=aSB2D.IsHole();
+ if (bIsHole) {
+ continue;
+ }
+ //
+ const Bnd_Box2d& aBox2DF=aSB2D.Box2D();
+ const TopoDS_Shape aF=aSB2D.Shape();
//
- aIt1.Initialize(aNewFaces);
- for ( ; aIt1.More(); aIt1.Next()) {
- const TopoDS_Shape& aF=aIt1.Value();
+ aSelector.Clear();
+ aSelector.SetBox(aBox2DF);
+ //
+ aNbHoles=aBBTree.Select(aSelector);
+ //
+ const BOPCol_ListOfInteger& aLI=aSelector.Indices();
+ //
+ aItLI.Initialize(aLI);
+ for (; aItLI.More(); aItLI.Next()) {
+ k=aItLI.Value();
+ const BOPAlgo_ShapeBox2D& aSB2Dk=aDMISB.Find(k);
+ const TopoDS_Shape& aHole=aSB2Dk.Shape();
//
if (!IsInside(aHole, aF, myContext)){
continue;
}
//
- if ( aInOutMap.IsBound (aHole)){
- const TopoDS_Shape& aF2=aInOutMap(aHole);
- if (IsInside(aF, aF2, myContext)) {
+ if (aInOutMap.IsBound (aHole)){
+ const TopoDS_Shape& aF2=aInOutMap(aHole);
+ if (IsInside(aF, aF2, myContext)) {
aInOutMap.UnBind(aHole);
aInOutMap.Bind (aHole, aF);
}
}
else{
- aInOutMap.Bind (aHole, aF);
+ aInOutMap.Bind(aHole, aF);
}
}
+ }
+ //
+ // 5. Map [Face/Holes] -> aMSH
+ aItDMSS.Initialize(aInOutMap);
+ for (; aItDMSS.More(); aItDMSS.Next()) {
+ const TopoDS_Shape& aHole=aItDMSS.Key();
+ const TopoDS_Shape& aF=aItDMSS.Value();
//
- // Add aHole to a map Face/ListOfHoles [aMSH]
- if (aInOutMap.IsBound(aHole)){
- const TopoDS_Shape& aF=aInOutMap(aHole);
- if (aMSH.IsBound(aF)) {
- BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aF);
- aLH.Append(aHole);
- }
- else {
- BOPCol_ListOfShape aLH;
- aLH.Append(aHole);
- aMSH.Bind(aF, aLH);
- }
+ if (aMSH.IsBound(aF)) {
+ BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aF);
+ aLH.Append(aHole);
+ }
+ else {
+ BOPCol_ListOfShape aLH;
+ aLH.Append(aHole);
+ aMSH.Bind(aF, aLH);
}
- }// for (; aIt2.More(); aIt2.Next())
+ }
//
- // 3. Add aHoles to Faces
+ // 6. Add aHoles to Faces,
aItMSH.Initialize(aMSH);
for (; aItMSH.More(); aItMSH.Next()) {
TopoDS_Face aF=(*(TopoDS_Face *)(&aItMSH.Key()));
//
const BOPCol_ListOfShape& aLH=aItMSH.Value();
- aIt2.Initialize(aLH);
- for (; aIt2.More(); aIt2.Next()) {
- const TopoDS_Shape& aHole = aIt2.Value();
- aBB.Add (aF, aHole);
+ aIt1.Initialize(aLH);
+ for (; aIt1.More(); aIt1.Next()) {
+ TopoDS_Shape aWHole;
+ //
+ const TopoDS_Shape& aFHole=aIt1.Value();
+ GetWire(aFHole, aWHole);
+ aBB.Add (aF, aWHole);
}
//
// update classifier
aClsf.Init(aF, aTol);
}
//
- // These aNewFaces are draft faces that
- // do not contain any internal shapes
+ // 7. Fill myAreas
+ // NB:These aNewFaces are draft faces that
+ // do not contain any internal shapes
+ aItDMISB.Initialize(aDMISB);
+ for (; aItDMISB.More(); aItDMISB.Next()) {
+ const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
+ bIsHole=aSB2D.IsHole();
+ if (!bIsHole) {
+ const TopoDS_Shape aF=aSB2D.Shape();
+ myAreas.Append(aF);
+ }
+ }
+}
+//=======================================================================
+//function : GetWire
+//purpose :
+//=======================================================================
+void GetWire(const TopoDS_Shape& aF, TopoDS_Shape& aW)
+{
+ TopoDS_Shape aWx;
+ TopoDS_Iterator aIt;
//
- aIt1.Initialize(aNewFaces);
- for ( ; aIt1.More(); aIt1.Next()) {
- const TopoDS_Shape& aF=aIt1.Value();
- myAreas.Append(aF);
+ aIt.Initialize(aF);
+ for (; aIt.More(); aIt.Next()) {
+ aW=aIt.Value();
}
}
//=======================================================================
//function : PerformInternalShapes
//purpose :
//=======================================================================
- void BOPAlgo_BuilderFace::PerformInternalShapes()
+void BOPAlgo_BuilderFace::PerformInternalShapes()
{
myErrorStatus=0;
//
BOPAlgo_BuilderFace& aBF=aVBF.Append1();
aBF.SetFace(aF);
aBF.SetShapes(aLE);
+ aBF.SetRunParallel(myRunParallel);
//
}// for (i=0; i<aNbS; ++i) {
//
#include <BOPAlgo_Builder.hxx>
#include <NCollection_IncAllocator.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+#include <Bnd_Box.hxx>
#include <TopAbs_State.hxx>
#include <TopoDS.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
+#include <BRepBndLib.hxx>
//
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_BoxBndTree.hxx>
+#include <BOPCol_ListOfInteger.hxx>
+#include <BOPCol_DataMapOfIntegerShape.hxx>
+//
+#include <BOPInt_Context.hxx>
//
#include <BOPDS_DS.hxx>
#include <BOPDS_ShapeInfo.hxx>
//
#include <BOPTools.hxx>
#include <BOPTools_AlgoTools.hxx>
-//
#include <BOPTools_MapOfSet.hxx>
#include <BOPTools_Set.hxx>
//
#include <BOPAlgo_BuilderSolid.hxx>
-
-#include <BOPCol_DataMapOfIntegerShape.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-
-#include <NCollection_UBTreeFiller.hxx>
-#include <BOPDS_BoxBndTree.hxx>
-#include <BOPCol_ListOfInteger.hxx>
-#include <BOPInt_Context.hxx>
#include <BOPAlgo_Builder_2Cnt.hxx>
}//for (i=0; i<aNbS; ++i) {
//
// 1.2. Prepare TreeFiller
- BOPDS_BoxBndTree aBBTree;
+ BOPCol_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aItDMISB.Initialize(aDMISB);
BOPCol_ListOfShape aLIF(aAlr1);
BOPCol_IndexedMapOfShape aMF(100, aAlr1);
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
- BOPDS_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTreeSelector aSelector;
Bnd_Box aBoxS;
//
const TopoDS_Shape& aS=aSI.Shape();
#include <Bnd_Box.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
#include <BOPCol_DataMapOfShapeInteger.hxx>
#include <BOPCol_DataMapOfIntegerShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeBox.hxx>
+#include <BOPCol_BoxBndTree.hxx>
//
#include <BOPInt_Context.hxx>
#include <BOPInt_ShrunkRange.hxx>
#include <BOPDS_VectorOfInterfEE.hxx>
#include <BOPDS_Interf.hxx>
#include <BOPDS_Pave.hxx>
-#include <BOPDS_BoxBndTree.hxx>
-
+//
#include <BOPAlgo_Tools.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
+
//=======================================================================
// function: PerformEE
// purpose:
//=======================================================================
- void BOPAlgo_PaveFiller::PerformEE()
+void BOPAlgo_PaveFiller::PerformEE()
{
Standard_Boolean bJustAdd, bOrder;
Standard_Integer i, iX, iSize, nE1, nE2, aDiscretize;
//function : PerformVertices
//purpose :
//=======================================================================
- Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE
- (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
- Handle(NCollection_BaseAllocator)& theAllocator)
+Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE
+ (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
+ Handle(NCollection_BaseAllocator)& theAllocator)
{
Standard_Integer aNbV, iRet;
//
//function : TreatNewVertices
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::TreatNewVertices(
- const BOPCol_IndexedDataMapOfShapeInteger& aMapVI,
- BOPCol_IndexedDataMapOfShapeListOfShape& myImages)
+void BOPAlgo_PaveFiller::TreatNewVertices
+ (const BOPCol_IndexedDataMapOfShapeInteger& aMapVI,
+ BOPCol_IndexedDataMapOfShapeListOfShape& myImages)
{
Standard_Integer j, i, aNbV, aNbVSD;
Standard_Real aTol;
BOPCol_DataMapOfIntegerShape aMIS;
BOPCol_IndexedDataMapOfShapeBox aMSB;
//
- BOPDS_BoxBndTreeSelector aSelector;
- BOPDS_BoxBndTree aBBTree;
+ BOPCol_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aNbV = aMapVI.Extent();
//function : FillShrunkData
//purpose :
//=======================================================================
- void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
+void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
{
Standard_Integer nE, nV1, nV2, iErr;
Standard_Real aT1, aT2, aTS1, aTS2;
-- Created by: Peter KURNEV
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
+-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
--- This file is part of Open CASCADE Technology software library.
+-- The content of this file is subject to the Open CASCADE Technology Public
+-- License Version 6.5 (the "License"). You may not use the content of this file
+-- except in compliance with the License. Please obtain a copy of the License
+-- at http://www.opencascade.org and read it completely before using this file.
--
--- This library is free software; you can redistribute it and / or modify it
--- under the terms of the GNU Lesser General Public 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.
+-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
+-- The Original Code and all software distributed under the License is
+-- distributed on an "AS IS" basis, without warranty of any kind, and the
+-- Initial Developer hereby disclaims all such warranties, including without
+-- limitation, any warranties of merchantability, fitness for a particular
+-- purpose or non-infringement. Please see the License for the specific terms
+-- and conditions governing the rights and limitations under the License.
class WireSplitter from BOPAlgo
inherits Algo from BOPAlgo
uses
Wire from TopoDS,
+ Face from TopoDS,
BaseAllocator from BOPCol,
ListOfShape from BOPCol,
WireEdgeSet from BOPAlgo,
is protected;
MakeWires(me:out)
- is protected;
-
- SplitBlock(me:out;
- theCB:out ConnexityBlock from BOPTools)
- is protected;
-
+ is protected;
+
+ SplitBlock(myclass;
+ theF :Face from TopoDS;
+ theCB:out ConnexityBlock from BOPTools);
+
fields
myWES : PWireEdgeSet from BOPAlgo is protected;
myLCB : ListOfConnexityBlock from BOPTools is protected;
// Created by: Peter KURNEV
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
+// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
-// This file is part of Open CASCADE Technology software library.
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public 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.
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
#include <BOPAlgo_WireSplitter.ixx>
#include <BOPCol_IndexedMapOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+#include <BOPCol_TBB.hxx>
+#include <BOPCol_NCVector.hxx>
#include <BOPTools.hxx>
//function :
//purpose :
//=======================================================================
- BOPAlgo_WireSplitter::BOPAlgo_WireSplitter()
+BOPAlgo_WireSplitter::BOPAlgo_WireSplitter()
:
BOPAlgo_Algo(),
myWES(NULL),
//function :
//purpose :
//=======================================================================
- BOPAlgo_WireSplitter::BOPAlgo_WireSplitter(const Handle(NCollection_BaseAllocator)& theAllocator)
+BOPAlgo_WireSplitter::BOPAlgo_WireSplitter
+ (const Handle(NCollection_BaseAllocator)& theAllocator)
:
BOPAlgo_Algo(theAllocator),
myWES(NULL),
//function : ~
//purpose :
//=======================================================================
- BOPAlgo_WireSplitter::~BOPAlgo_WireSplitter()
+BOPAlgo_WireSplitter::~BOPAlgo_WireSplitter()
{
}
//=======================================================================
//function : SetWES
//purpose :
//=======================================================================
- void BOPAlgo_WireSplitter::SetWES(const BOPAlgo_WireEdgeSet& theWES)
+void BOPAlgo_WireSplitter::SetWES(const BOPAlgo_WireEdgeSet& theWES)
{
myWES=(BOPAlgo_WireEdgeSet*)&theWES;
}
//function : WES
//purpose :
//=======================================================================
- BOPAlgo_WireEdgeSet& BOPAlgo_WireSplitter::WES()
+BOPAlgo_WireEdgeSet& BOPAlgo_WireSplitter::WES()
{
return *myWES;
}
// function: CheckData
// purpose:
//=======================================================================
- void BOPAlgo_WireSplitter::CheckData()
+void BOPAlgo_WireSplitter::CheckData()
{
myErrorStatus=0;
if (!myWES) {
//function : Perform
//purpose :
//=======================================================================
- void BOPAlgo_WireSplitter::Perform()
+void BOPAlgo_WireSplitter::Perform()
{
myErrorStatus=0;
//
MakeConnexityBlocks();
MakeWires();
}
-//=======================================================================
-//function : MakeWires
-//purpose :
-//=======================================================================
- void BOPAlgo_WireSplitter::MakeWires()
-{
- Standard_Boolean bIsRegular;
- TopoDS_Wire aW;
- BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
- BOPCol_ListIteratorOfListOfShape aIt;
- //
- aItCB.Initialize(myLCB);
- for (; aItCB.More(); aItCB.Next()) {
- BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
- bIsRegular=aCB.IsRegular();
- if (bIsRegular) {
- BOPCol_ListOfShape& aLE=aCB.ChangeShapes();
- BOPAlgo_WireSplitter::MakeWire(aLE, aW);
- myWES->AddShape(aW);
- }
- else {
- SplitBlock(aCB);
- //
- const BOPCol_ListOfShape& aLW=aCB.Loops();
- aIt.Initialize(aLW);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aWx=aIt.Value();
- myWES->AddShape(aWx);
- }
- }
- }
-}
+
//=======================================================================
//function : MakeConnexityBlocks
//purpose :
//=======================================================================
- void BOPAlgo_WireSplitter::MakeConnexityBlocks()
+void BOPAlgo_WireSplitter::MakeConnexityBlocks()
{
Standard_Boolean bRegular, bClosed;
Standard_Integer i, j, aNbV, aNbVS, aNbVP, k;
myLCB.Append(aCB);
}
}
+/////////////////////////////////////////////////////////////////////////
+
+typedef BOPCol_NCVector<BOPTools_ConnexityBlock> \
+ BOPTools_VectorOfConnexityBlock;
+
+//=======================================================================
+//class : WireSplitterFunctor
+//purpose :
+//=======================================================================
+class BOPAlgo_WireSplitterFunctor {
+ protected:
+ TopoDS_Face myFace;
+ BOPTools_VectorOfConnexityBlock* myPVCB;
+ //
+ public:
+ //
+ BOPAlgo_WireSplitterFunctor(const TopoDS_Face& aF,
+ BOPTools_VectorOfConnexityBlock& aVCB)
+ : myFace(aF), myPVCB(&aVCB) {
+ }
+ //
+ void operator()( const flexible_range<Standard_Size>& aBR ) const{
+ Standard_Size i, iBeg, iEnd;
+ //
+ BOPTools_VectorOfConnexityBlock& aVCB=*myPVCB;
+ //
+ iBeg=aBR.begin();
+ iEnd=aBR.end();
+ for(i=iBeg; i!=iEnd; ++i) {
+ BOPTools_ConnexityBlock& aCB=aVCB((Standard_Integer)i);
+ //
+ BOPAlgo_WireSplitter::SplitBlock(myFace, aCB);
+ }
+ }
+};
+//=======================================================================
+//class : BOPAlgo_WireSplitterCnt
+//purpose :
+//=======================================================================
+class BOPAlgo_WireSplitterCnt {
+ public:
+ //-------------------------------
+ // Perform
+ Standard_EXPORT
+ static void Perform(const Standard_Boolean bRunParallel,
+ const TopoDS_Face& aF,
+ BOPTools_VectorOfConnexityBlock& aVCB) {
+ //
+ BOPAlgo_WireSplitterFunctor aWSF(aF, aVCB);
+ Standard_Size aNbVCB=aVCB.Extent();
+ //
+ if (bRunParallel) {
+ flexible_for(flexible_range<Standard_Size>(0,aNbVCB), aWSF);
+ }
+ else {
+ aWSF.operator()(flexible_range<Standard_Size>(0,aNbVCB));
+ }
+ }
+ //
+};
+//=======================================================================
+//function : MakeWires
+//purpose :
+//=======================================================================
+void BOPAlgo_WireSplitter::MakeWires()
+{
+ Standard_Boolean bIsRegular;
+ Standard_Integer aNbVCB, k;
+ TopoDS_Wire aW;
+ BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
+ BOPCol_ListIteratorOfListOfShape aIt;
+ BOPTools_VectorOfConnexityBlock aVCB;
+ //
+ aItCB.Initialize(myLCB);
+ for (; aItCB.More(); aItCB.Next()) {
+ BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
+ bIsRegular=aCB.IsRegular();
+ if (bIsRegular) {
+ BOPCol_ListOfShape& aLE=aCB.ChangeShapes();
+ BOPAlgo_WireSplitter::MakeWire(aLE, aW);
+ myWES->AddShape(aW);
+ }
+ else {
+ aVCB.Append(aCB);
+ }
+ }
+ //
+ aNbVCB=aVCB.Extent();
+ const TopoDS_Face& aF=myWES->Face();
+ //===================================================
+ BOPAlgo_WireSplitterCnt::Perform(myRunParallel, aF, aVCB);
+ //===================================================
+ for (k=0; k<aNbVCB; ++k) {
+ const BOPTools_ConnexityBlock& aCB=aVCB(k);
+ const BOPCol_ListOfShape& aLW=aCB.Loops();
+ aIt.Initialize(aLW);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aWx=aIt.Value();
+ myWES->AddShape(aWx);
+ }
+ }
+}
//function : SplitBlock
//purpose :
//=======================================================================
- void BOPAlgo_WireSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
+void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
+ BOPTools_ConnexityBlock& aCB)
{
Standard_Boolean bNothingToDo;
Standard_Integer aIx, aNb, i, aCntIn, aCntOut;
BOPCol_ListIteratorOfListOfShape aIt;
BOPAlgo_ListIteratorOfListOfEdgeInfo aItLEI;
//
- BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo mySmartMap(100, myAllocator);
+ BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo mySmartMap(100);
//
- const TopoDS_Face& myFace=myWES->Face();
const BOPCol_ListOfShape& myEdges=aCB.Shapes();
//
// 1.Filling mySmartMap
const TopoDS_Shape& aV=aItS.Value();
aIx=mySmartMap.FindIndex(aV);
if (!aIx) {
- BOPAlgo_ListOfEdgeInfo aLEIx(myAllocator);
+ BOPAlgo_ListOfEdgeInfo aLEIx;
aIx=mySmartMap.Add(aV, aLEIx);
}
//
Standard_Integer aNbE, aNbMapEE;
Standard_Boolean bFlag;
//
- BOPCol_IndexedDataMapOfShapeListOfShape aMapEE(100, myAllocator);
+ BOPCol_IndexedDataMapOfShapeListOfShape aMapEE(100);
aNbE=myEdges.Extent();
//
aIt.Initialize(myEdges);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE = aIt.Value();
if (!aMapEE.Contains(aE)) {
- BOPCol_ListOfShape aLEx(myAllocator);
+ BOPCol_ListOfShape aLEx;
aLEx.Append(aE);
aMapEE.Add(aE, aLEx);
}
BOPCol_ListOfShape& aLoops=aCB.ChangeLoops();
aLoops.Append(aW);
//
- myErrorStatus=0;
return;
}
//
BOPAlgo_WireSplitter_1.cxx
BOPAlgo_ListOfCheckResult.hxx
BOPAlgo_Builder_2Cnt.hxx
-
BOPAlgo_CheckerSI_1.cxx
+
--- /dev/null
+// Created by: Peter KURNEV
+// Copyright (c) 2010-2012 OPEN CASCADE SAS
+// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
+// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#include <BOPCol_Box2DBndTree.hxx>
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+BOPCol_Box2DBndTreeSelector::BOPCol_Box2DBndTreeSelector()
+{
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+BOPCol_Box2DBndTreeSelector::~BOPCol_Box2DBndTreeSelector()
+{
+}
+//=======================================================================
+//function : Reject
+//purpose :
+//=======================================================================
+Standard_Boolean BOPCol_Box2DBndTreeSelector::Reject
+ (const Bnd_Box2d& aBox2D) const
+{
+ return myBox2D.IsOut(aBox2D);
+}
+//=======================================================================
+//function : Accept
+//purpose :
+//=======================================================================
+Standard_Boolean BOPCol_Box2DBndTreeSelector::Accept
+ (const Standard_Integer& aIndex)
+{
+ Standard_Boolean bRet=Standard_False;
+ //
+ myIndices.Append(aIndex);
+ bRet=!bRet;
+ //}
+ return bRet;
+}
+//=======================================================================
+//function : SetBox
+//purpose :
+//=======================================================================
+void BOPCol_Box2DBndTreeSelector::SetBox(const Bnd_Box2d& aBox2D)
+{
+ myBox2D=aBox2D;
+}
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+void BOPCol_Box2DBndTreeSelector::Clear()
+{
+ myIndices.Clear();
+}
+//=======================================================================
+//function : Indices
+//purpose :
+//=======================================================================
+const BOPCol_ListOfInteger& BOPCol_Box2DBndTreeSelector::Indices() const
+{
+ return myIndices;
+}
--- /dev/null
+// Created by: Peter KURNEV
+// Copyright (c) 2010-2012 OPEN CASCADE SAS
+// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
+// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
+//
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+//
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
+
+#ifndef BOPCol_Box2DBndTree_HeaderFile
+#define BOPCol_Box2DBndTree_HeaderFile
+
+#include <NCollection_UBTree.hxx>
+#include <Bnd_Box2d.hxx>
+#include <BOPCol_ListOfInteger.hxx>
+/**
+ * The instantiation of the algorithm of unbalanced binary tree
+ * of overlapped bounding boxes 2D.
+ *
+*/
+typedef NCollection_UBTree <Standard_Integer , Bnd_Box2d> BOPCol_Box2DBndTree;
+
+ class BOPCol_Box2DBndTreeSelector : public BOPCol_Box2DBndTree::Selector {
+ public:
+ Standard_EXPORT BOPCol_Box2DBndTreeSelector();
+ Standard_EXPORT virtual Standard_Boolean Reject(const Bnd_Box2d&) const;
+ Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
+ Standard_EXPORT virtual ~BOPCol_Box2DBndTreeSelector();
+
+ Standard_EXPORT void Clear();
+ Standard_EXPORT void SetBox(const Bnd_Box2d&);
+ Standard_EXPORT const BOPCol_ListOfInteger& Indices() const;
+
+ protected:
+ Bnd_Box2d myBox2D;
+ BOPCol_ListOfInteger myIndices;
+ };
+
+#endif
--- /dev/null
+// Created by: Peter KURNEV
+// Copyright (c) 2010-2014 OPEN CASCADE SAS
+// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
+// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public 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 <BOPCol_BoxBndTree.hxx>
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+BOPCol_BoxBndTreeSelector::BOPCol_BoxBndTreeSelector()
+{
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+BOPCol_BoxBndTreeSelector::~BOPCol_BoxBndTreeSelector()
+{
+}
+//=======================================================================
+//function : Reject
+//purpose :
+//=======================================================================
+ Standard_Boolean BOPCol_BoxBndTreeSelector::Reject (const Bnd_Box& aBox) const
+{
+ return myBox.IsOut(aBox);
+}
+//=======================================================================
+//function : Accept
+//purpose :
+//=======================================================================
+Standard_Boolean BOPCol_BoxBndTreeSelector::Accept (const Standard_Integer& aIndex)
+{
+ Standard_Boolean bRet=Standard_False;
+ //
+ myIndices.Append(aIndex);
+ bRet=!bRet;
+ return bRet;
+}
+//=======================================================================
+//function : SetBox
+//purpose :
+//=======================================================================
+void BOPCol_BoxBndTreeSelector::SetBox(const Bnd_Box& aBox)
+{
+ myBox=aBox;
+}
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+void BOPCol_BoxBndTreeSelector::Clear()
+{
+ myIndices.Clear();
+}
+//=======================================================================
+//function : Indices
+//purpose :
+//=======================================================================
+const BOPCol_ListOfInteger& BOPCol_BoxBndTreeSelector::Indices() const
+{
+ return myIndices;
+}
--- /dev/null
+// Created by: Peter KURNEV
+// Copyright (c) 2010-2014 OPEN CASCADE SAS
+// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
+// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public 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 NMTDS_BoxBndTree_HeaderFile
+#define NMTDS_BoxBndTree_HeaderFile
+
+#include <NCollection_UBTree.hxx>
+#include <Bnd_Box.hxx>
+#include <BOPCol_ListOfInteger.hxx>
+/**
+ * The instantiation of the algorithm of unbalanced binary tree
+ * of overlapped bounding boxes.
+ *
+*/
+typedef NCollection_UBTree <Standard_Integer , Bnd_Box> BOPCol_BoxBndTree;
+
+ class BOPCol_BoxBndTreeSelector : public BOPCol_BoxBndTree::Selector {
+ public:
+ Standard_EXPORT BOPCol_BoxBndTreeSelector();
+ Standard_EXPORT virtual Standard_Boolean Reject(const Bnd_Box&) const;
+ Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
+ Standard_EXPORT virtual ~BOPCol_BoxBndTreeSelector();
+
+ Standard_EXPORT void Clear();
+ Standard_EXPORT void SetBox(const Bnd_Box&);
+ Standard_EXPORT const BOPCol_ListOfInteger& Indices() const;
+
+ protected:
+ Bnd_Box myBox;
+ BOPCol_ListOfInteger myIndices;
+
+ };
+
+#endif
#endif
#include <TopoDS_Shape.hxx>
-#include <TopTools_ShapeMapHasher.hxx>
+#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
+
typedef NCollection_DataMap<Standard_Integer, TopoDS_Shape, TColStd_MapIntegerHasher> BOPCol_DataMapOfIntegerShape;
typedef BOPCol_DataMapOfIntegerShape::Iterator BOPCol_DataMapIteratorOfDataMapOfIntegerShape;
BOPCol_DataMapOfIntegerShape.hxx
BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx
BOPCol_IndexedDataMapOfShapeInteger.hxx
-
BOPCol_TBB.hxx
BOPCol_NCVector.hxx
+
+BOPCol_BoxBndTree.hxx
+BOPCol_BoxBndTree.cxx
+BOPCol_Box2DBndTree.hxx
+BOPCol_Box2DBndTree.cxx
+++ /dev/null
-// Created by: Peter KURNEV
-// Copyright (c) 2010-2014 OPEN CASCADE SAS
-// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
-// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
-// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public 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 <BOPDS_BoxBndTree.hxx>
-//=======================================================================
-//function :
-//purpose :
-//=======================================================================
- BOPDS_BoxBndTreeSelector::BOPDS_BoxBndTreeSelector()
-{
-}
-//=======================================================================
-//function : ~
-//purpose :
-//=======================================================================
- BOPDS_BoxBndTreeSelector::~BOPDS_BoxBndTreeSelector()
-{
-}
-//=======================================================================
-//function : Reject
-//purpose :
-//=======================================================================
- Standard_Boolean BOPDS_BoxBndTreeSelector::Reject (const Bnd_Box& aBox) const
-{
- return myBox.IsOut(aBox);
-}
-//=======================================================================
-//function : Accept
-//purpose :
-//=======================================================================
- Standard_Boolean BOPDS_BoxBndTreeSelector::Accept (const Standard_Integer& aIndex)
-{
- Standard_Boolean bRet=Standard_False;
- //
- //if (myFence.Add(aIndex)) {
- myIndices.Append(aIndex);
- bRet=!bRet;
- //}
- return bRet;
-}
-//=======================================================================
-//function : SetBox
-//purpose :
-//=======================================================================
- void BOPDS_BoxBndTreeSelector::SetBox(const Bnd_Box& aBox)
-{
- myBox=aBox;
-}
-//=======================================================================
-//function : Clear
-//purpose :
-//=======================================================================
- void BOPDS_BoxBndTreeSelector::Clear()
-{
- //myFence.Clear();
- myIndices.Clear();
-}
-//=======================================================================
-//function : Indices
-//purpose :
-//=======================================================================
- const BOPCol_ListOfInteger& BOPDS_BoxBndTreeSelector::Indices() const
-{
- return myIndices;
-}
+++ /dev/null
-// Created by: Peter KURNEV
-// Copyright (c) 2010-2014 OPEN CASCADE SAS
-// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
-// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
-// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public 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 NMTDS_BoxBndTree_HeaderFile
-#define NMTDS_BoxBndTree_HeaderFile
-
-#include <NCollection_UBTree.hxx>
-#include <Bnd_Box.hxx>
-#include <BOPCol_ListOfInteger.hxx>
-/**
- * The instantiation of the algorithm of unbalanced binary tree
- * of overlapped bounding boxes.
- *
-*/
-typedef NCollection_UBTree <Standard_Integer , Bnd_Box> BOPDS_BoxBndTree;
-
- class BOPDS_BoxBndTreeSelector : public BOPDS_BoxBndTree::Selector {
- public:
- Standard_EXPORT BOPDS_BoxBndTreeSelector();
- Standard_EXPORT virtual Standard_Boolean Reject(const Bnd_Box&) const;
- Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
- Standard_EXPORT virtual ~BOPDS_BoxBndTreeSelector();
-
- Standard_EXPORT void Clear();
- Standard_EXPORT void SetBox(const Bnd_Box&);
- Standard_EXPORT const BOPCol_ListOfInteger& Indices() const;
-
- protected:
- Bnd_Box myBox;
- BOPCol_ListOfInteger myIndices;
-
- };
-
-#endif
#include <BOPCol_DataMapOfIntegerMapOfInteger.hxx>
#include <BOPCol_MapOfInteger.hxx>
//
-#include <BOPDS_BoxBndTree.hxx>
+#include <BOPCol_BoxBndTree.hxx>
#include <BOPDS_IndexRange.hxx>
#include <BOPDS_PassKeyBoolean.hxx>
#include <BOPDS_MapOfPassKeyBoolean.hxx>
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
BOPDS_PassKeyBoolean aPKXB;
//
- BOPDS_BoxBndTreeSelector aSelector;
- BOPDS_BoxBndTree aBBTree;
+ BOPCol_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aNb=myDS->NbSourceShapes();
#include <BRep_Tool.hxx>
#include <NCollection_UBTreeFiller.hxx>
-#include <BOPDS_BoxBndTree.hxx>
+#include <BOPCol_BoxBndTree.hxx>
#include <BOPDS_IndexRange.hxx>
#include <BOPDS_PassKeyBoolean.hxx>
#include <BOPDS_MapOfPassKeyBoolean.hxx>
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
BOPDS_PassKeyBoolean aPKXB;
//
- BOPDS_BoxBndTreeSelector aSelector;
- BOPDS_BoxBndTree aBBTree;
+ BOPCol_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
// myPairsAvoid, aMSI, aMSB
#include <BOPCol_DataMapOfIntegerInteger.hxx>
#include <BOPCol_DataMapOfIntegerMapOfInteger.hxx>
#include <BOPCol_MapOfInteger.hxx>
+#include <BOPCol_BoxBndTree.hxx>
//
-#include <BOPDS_BoxBndTree.hxx>
#include <BOPDS_IndexRange.hxx>
#include <BOPDS_PassKeyBoolean.hxx>
#include <BOPDS_MapOfPassKeyBoolean.hxx>
BOPDS_MapOfPassKeyBoolean aMPKXB(100, aAllocator);
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
//
- BOPDS_BoxBndTreeSelector aSelector;
- BOPDS_BoxBndTree aBBTree;
+ BOPCol_BoxBndTreeSelector aSelector;
+ BOPCol_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aIt1.Initialize(*mySubSet1);
BOPDS_VectorOfShapeInfo.hxx
BOPDS_VectorOfIndexRange.hxx
BOPDS_ListOfPassKeyBoolean.hxx
-BOPDS_BoxBndTree.cxx
-BOPDS_BoxBndTree.hxx
BOPDS_MapOfPassKeyBoolean.hxx
BOPDS_MapOfPassKey.hxx
BOPDS_ListIteratorOfListOfPassKeyBoolean.hxx
BOPDS_VectorOfInterfEE.hxx
BOPDS_VectorOfInterfEF.hxx
BOPDS_VectorOfInterfFF.hxx
+BOPDS_VectorOfInterfVZ.hxx
+BOPDS_VectorOfInterfEZ.hxx
+BOPDS_VectorOfInterfFZ.hxx
+BOPDS_VectorOfInterfZZ.hxx
BOPDS_Interf.hxx
BOPDS_DataMapOfPaveBlockListOfPaveBlock.hxx
BOPDS_MapOfPaveBlock.hxx
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx
BOPDS_DataMapOfPaveBlockCommonBlock.hxx
-BOPDS_VectorOfInterfVZ.hxx
-BOPDS_VectorOfInterfEZ.hxx
-BOPDS_VectorOfInterfFZ.hxx
-BOPDS_VectorOfInterfZZ.hxx
-- Created on: 1991-01-28
-- Created by: Remi Lequette
-- Copyright (c) 1991-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
+-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
--- This file is part of Open CASCADE Technology software library.
+-- The content of this file is subject to the Open CASCADE Technology Public
+-- License Version 6.5 (the "License"). You may not use the content of this file
+-- except in compliance with the License. Please obtain a copy of the License
+-- at http://www.opencascade.org and read it completely before using this file.
--
--- This library is free software; you can redistribute it and / or modify it
--- under the terms of the GNU Lesser General Public 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.
+-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
+-- The Original Code and all software distributed under the License is
+-- distributed on an "AS IS" basis, without warranty of any kind, and the
+-- Initial Developer hereby disclaims all such warranties, including without
+-- limitation, any warranties of merchantability, fitness for a particular
+-- purpose or non-infringement. Please see the License for the specific terms
+-- and conditions governing the rights and limitations under the License.
+
+
class Box2d from Bnd
---Level: Public
---C++: inline
- Dump(me) is static;
-
+ Dump(me) is static;
+
+ SquareExtent(me)
+ returns Real from Standard;
+ --- Purpose : Computes the squared diagonal of me.
+ ---C++: inline
fields Xmin : Real;
Xmax : Real;
// Created on: 1997-11-27
// Created by: Christophe MARION
// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
+// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
-// This file is part of Open CASCADE Technology software library.
+// The content of this file is subject to the Open CASCADE Technology Public
+// License Version 6.5 (the "License"). You may not use the content of this file
+// except in compliance with the License. Please obtain a copy of the License
+// at http://www.opencascade.org and read it completely before using this file.
//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public 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.
+// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
+// The Original Code and all software distributed under the License is
+// distributed on an "AS IS" basis, without warranty of any kind, and the
+// Initial Developer hereby disclaims all such warranties, including without
+// limitation, any warranties of merchantability, fitness for a particular
+// purpose or non-infringement. Please see the License for the specific terms
+// and conditions governing the rights and limitations under the License.
+
#define VoidMask 0x01
#define XminMask 0x02
{
return Transformed(T1).IsOut (Other.Transformed(T2));
}
+//=======================================================================
+//function : SquareExtent
+//purpose : Computes the squared diagonal
+//=======================================================================
+inline Standard_Real Bnd_Box2d::SquareExtent() const
+{
+ if ( IsVoid() ) return 0.;
+ Standard_Real dx = Xmax-Xmin+Gap;
+ Standard_Real dy = Ymax-Ymin+Gap;
+ return dx*dx + dy*dy;
+}