mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
1. The methods PerformVZ, PerformEZ, PerformFZ and PerformZZ have been transferred from BOPAlgo_PaveFiller to BOPAlgo_CheckerSI class to perform intersection of sub-shapes with solids only in self-intersection mode. 2. The checks for solids built from the same (shared) faces have been added into methods building the result of Boolean operations - BOPAlgo_BOP::BuildRC() and BOPAlgo_BOP::BuildSolid(). 3. Since the NonDestructive mode is now natively supported by the BOPAlgo_PaveFiller the methods providing the support of this mode by CheckerSI (BOPAlgo_CheckerSI::PrepareCopy() and BOPAlgo_CheckerSI::PostTreatCopy()) are not needed and have been removed. 4. The pairs of sub-shapes with interfering bounding boxes are now sorted before real intersection to guarantee the constant order of intersection of sub-shapes and produce more stable result. The class BOPDS_PassKey has been replaced with simpler class BOPDS_Pair. 5. The class BOPDS_SubIterator has been refactored. 6. Test cases for the issue. 7. Adjustment of the test case boolean volumemaker D2.
136 lines
3.6 KiB
C++
136 lines
3.6 KiB
C++
// Created by: Peter KURNEV
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#ifndef _BOPDS_SubIterator_HeaderFile
|
|
#define _BOPDS_SubIterator_HeaderFile
|
|
|
|
#include <Standard.hxx>
|
|
#include <Standard_DefineAlloc.hxx>
|
|
#include <Standard_Handle.hxx>
|
|
|
|
#include <BOPCol_BaseAllocator.hxx>
|
|
#include <BOPDS_PDS.hxx>
|
|
#include <BOPDS_Pair.hxx>
|
|
#include <BOPDS_VectorOfPair.hxx>
|
|
#include <BOPCol_PListOfInteger.hxx>
|
|
#include <BOPCol_ListOfInteger.hxx>
|
|
#include <Standard_Boolean.hxx>
|
|
#include <Standard_Integer.hxx>
|
|
class BOPDS_DS;
|
|
|
|
|
|
//! The class BOPDS_SubIterator is used to compute intersections between
|
|
//! bounding boxes of two sub-sets of BRep sub-shapes of arguments
|
|
//! of an operation (see the class BOPDS_DS).
|
|
//! The class provides interface to iterate the pairs of intersected sub-shapes.
|
|
|
|
class BOPDS_SubIterator
|
|
{
|
|
public:
|
|
|
|
DEFINE_STANDARD_ALLOC
|
|
|
|
//! Empty constructor
|
|
Standard_EXPORT BOPDS_SubIterator();
|
|
Standard_EXPORT virtual ~BOPDS_SubIterator();
|
|
|
|
//! Constructor
|
|
//! theAllocator - the allocator to manage the memory
|
|
Standard_EXPORT BOPDS_SubIterator(const BOPCol_BaseAllocator& theAllocator);
|
|
|
|
//! Sets the data structure <pDS> to process.
|
|
//! It is used to access the shapes and their bounding boxes.
|
|
void SetDS (const BOPDS_PDS& pDS)
|
|
{
|
|
myDS = pDS;
|
|
}
|
|
|
|
//! Returns the data structure
|
|
const BOPDS_DS& DS() const
|
|
{
|
|
return *myDS;
|
|
}
|
|
|
|
//! Sets the first set of indices <theLI> to process
|
|
void SetSubSet1 (const BOPCol_ListOfInteger& theLI)
|
|
{
|
|
mySubSet1 = (BOPCol_PListOfInteger)&theLI;
|
|
}
|
|
|
|
//! Returns the first set of indices to process
|
|
const BOPCol_ListOfInteger& SubSet1() const
|
|
{
|
|
return *mySubSet1;
|
|
}
|
|
|
|
//! Sets the second set of indices <theLI> to process
|
|
void SetSubSet2 (const BOPCol_ListOfInteger& theLI)
|
|
{
|
|
mySubSet2 = (BOPCol_PListOfInteger)&theLI;
|
|
}
|
|
|
|
//! Returns the second set of indices to process
|
|
const BOPCol_ListOfInteger& SubSet2() const
|
|
{
|
|
return *mySubSet2;
|
|
}
|
|
|
|
//! Initializes the iterator
|
|
Standard_EXPORT void Initialize();
|
|
|
|
//! Returns true if there are more pairs of intersected shapes
|
|
Standard_Boolean More() const
|
|
{
|
|
return myIterator.More();
|
|
}
|
|
|
|
//! Moves iterations ahead
|
|
void Next()
|
|
{
|
|
myIterator.Next();
|
|
}
|
|
|
|
//! Returns indices (DS) of intersected shapes
|
|
//! theIndex1 - the index of the first shape
|
|
//! theIndex2 - the index of the second shape
|
|
Standard_EXPORT void Value (Standard_Integer& theIndex1, Standard_Integer& theIndex2) const;
|
|
|
|
//! Perform the intersection algorithm and prepare
|
|
//! the results to be used
|
|
Standard_EXPORT virtual void Prepare();
|
|
|
|
//! Returns the number of interfering pairs
|
|
Standard_Integer ExpectedLength() const
|
|
{
|
|
return myList.Extent();
|
|
}
|
|
|
|
protected:
|
|
|
|
//! Performs intersection of bounding boxes
|
|
Standard_EXPORT virtual void Intersect();
|
|
|
|
BOPCol_BaseAllocator myAllocator;
|
|
BOPDS_PDS myDS;
|
|
BOPDS_VectorOfPair myList;
|
|
BOPDS_VectorOfPair::Iterator myIterator;
|
|
BOPCol_PListOfInteger mySubSet1;
|
|
BOPCol_PListOfInteger mySubSet2;
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
#endif // _BOPDS_SubIterator_HeaderFile
|