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

0024157: Parallelization of assembly part of BO

Patch 06

I.1. class Bnd_Box2d
- method:
inline Standard_Real Bnd_Box2d::SquareExtent() const
has been added.
Purpose : The method returns the squared diagonal of the bounding box.

I.3. class BOPCol_BoxBndTree
has been added.
Purpose : The class is the instantiation of the algorithm of unbalanced binary tree
of overlapped bounding boxes 3D.

I.4. class BOPCol_Box2DBndTree
has been added.
Purpose : The class is the instantiation of the algorithm of unbalanced binary tree
of overlapped bounding boxes 2D.

I.5. class BOPAlgo_Algo
- method:
void BOPAlgo_Algo::SetRunParallel(const Standard_Boolean theFlag)
has been added.
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

- method:
Standard_Boolean BOPAlgo_Algo::RunParallel()const
has been added
Purpose: Returns the flag of parallel processing

II.1. class BOPAlgo_Builder
- method:
void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
has been removed due to I.5.

- method:
Standard_Boolean BOPAlgo_Builder::RunParallel()const
has been removed due to I.5

II.2. class BOPDS_BoxBndTree
has been removed due to I.3

II.3. classes
BOPDS_Iterator,
BOPDS_IteratorSI,
BOPDS_SubIterator
BOPAlgo_PaveFiller,
BOPAlgo_Builder
the calls to BOPDS_BoxBndTree have been changed to
the calls to BOPCol_BoxBndTree
due to I.3

II.4. class BOPAlgo_BuilderFace
- method:
void BOPAlgo_BuilderFace::PerformLoops()
the changes that provide parallel run the  WireSplitter algorithm have been done.

- method:
void BOPAlgo_BuilderFace::PerformAreas()
the classification the grows and holes has been done using
the algorithm of unbalanced binary tree of overlapped bounding boxes

II.5. class BOPAlgo_WireSplitter
- method:
void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
			          BOPTools_ConnexityBlock& aCB)
the method is transferred to the static, the signature of the method have been changed

- method:
void BOPAlgo_WireSplitter::MakeWires()
the changes to provide parallel run the SplitBlock algorithm have been done
This commit is contained in:
pkv
2014-01-10 08:29:02 +04:00
committed by bugmaster
parent 15cea4ef7a
commit db8e4b9aa6
24 changed files with 667 additions and 295 deletions

View File

@@ -0,0 +1,85 @@
// 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;
}

View File

@@ -0,0 +1,52 @@
// 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

View File

@@ -0,0 +1,77 @@
// 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;
}

View File

@@ -0,0 +1,48 @@
// 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

View File

@@ -23,10 +23,11 @@
#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;

View File

@@ -29,6 +29,10 @@ BOPCol_SequenceOfReal.hxx
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