}
static void BoxCalculation(const TopTools_IndexedMapOfShape& Map,
- Bnd_SeqOfBox& SBox)
+ std::vector<Bnd_Box>& SBox)
{
for (Standard_Integer i = 1; i <= Map.Extent(); i++)
{
Bnd_Box box;
BRepBndLib::Add(Map(i), box);
- SBox.Append(box);
+ SBox.push_back(box);
}
}
BRepExtrema_SeqOfSolution* theSolutionsShape2,
const TopTools_IndexedMapOfShape* theMap1,
const TopTools_IndexedMapOfShape* theMap2,
- const Bnd_SeqOfBox* theLBox1,
- const Bnd_SeqOfBox* theLBox2,
+ const std::vector<Bnd_Box>* theLBox1,
+ const std::vector<Bnd_Box>* theLBox2,
const Message_ProgressRange theRange,
Standard_Boolean* theIsBreak,
Standard_Real* theDistRef,
BRepExtrema_SeqOfSolution* mySolutionsShape2;
const TopTools_IndexedMapOfShape* myMap1;
const TopTools_IndexedMapOfShape* myMap2;
- const Bnd_SeqOfBox* myLBox1;
- const Bnd_SeqOfBox* myLBox2;
+ const std::vector<Bnd_Box>* myLBox1;
+ const std::vector<Bnd_Box>* myLBox2;
Message_ProgressRange myRange;
Standard_Boolean* myIsBreak;
Standard_Real* myDistRef;
Message_ProgressScope aScope(theTask.myRange, NULL, aCount1);
+ Standard_Real aDistRef(0);
+ {
+ Standard_Mutex::Sentry aLock(theTask.myMutex.get());
+ aDistRef = *theTask.myDistRef;
+ }
+
for (Standard_Integer anIdx1 = theTask.myFirtsIndex; anIdx1 <= theTask.myLastIndex; ++anIdx1)
{
if (!aScope.More())
for (Standard_Integer anIdx2 = 1; anIdx2 <= aCount2; ++anIdx2)
{
- const Bnd_Box& aBox1 = theTask.myLBox1->Value(anIdx1);
- const Bnd_Box& aBox2 = theTask.myLBox2->Value(anIdx2);
- if (aBox1.IsVoid()
- || aBox2.IsVoid())
+ const Bnd_Box& aBox1 = theTask.myLBox1->at(anIdx1-1);
+ const Bnd_Box& aBox2 = theTask.myLBox2->at(anIdx2-1);
+ if (aBox1.IsVoid() || aBox2.IsVoid())
{
continue;
}
const TopoDS_Shape& aShape1 = theTask.myMap1->FindKey(anIdx1);
const TopoDS_Shape& aShape2 = theTask.myMap2->FindKey(anIdx2);
- Standard_Real aDistRef(0);
- {
- Standard_Mutex::Sentry aLock(theTask.myMutex.get());
- aDistRef = *theTask.myDistRef;
- }
BRepExtrema_DistanceSS aDistTool(aShape1, aShape2, aBox1, aBox2, aDistRef, theTask.myEps);
if (aDistTool.IsDone())
{
*theTask.myDistRef = aDistTool.DistValue();
}
}
+ aDistRef = *theTask.myDistRef;
}
}
}
void BRepExtrema_DistShapeShape::DistanceVertVert(const TopTools_IndexedMapOfShape& theMap1,
const TopTools_IndexedMapOfShape& theMap2,
- const Bnd_SeqOfBox& theLBox1,
- const Bnd_SeqOfBox& theLBox2,
+ const std::vector<Bnd_Box>& theLBox1,
+ const std::vector<Bnd_Box>& theLBox2,
const Message_ProgressRange& theRange)
{
const Standard_Integer aCount1 = theMap1.Extent();
}
for (Standard_Integer anIdx2 = 1; anIdx2 <= aCount2; ++anIdx2)
{
- const Bnd_Box& aBox1 = theLBox1.Value(anIdx1);
- const Bnd_Box& aBox2 = theLBox2.Value(anIdx2);
- if (aBox1.IsVoid()
- || aBox2.IsVoid())
+ const Bnd_Box& aBox1 = theLBox1[anIdx1];
+ const Bnd_Box& aBox2 = theLBox2[anIdx2];
+ if (aBox1.IsVoid() || aBox2.IsVoid())
{
continue;
}
BRepExtrema_SeqOfSolution* theSolutionsShape2,
const TopTools_IndexedMapOfShape* theMap1,
const TopTools_IndexedMapOfShape* theMap2,
- const Bnd_SeqOfBox* theLBox1,
- const Bnd_SeqOfBox* theLBox2,
+ const std::vector<Bnd_Box>* theLBox1,
+ const std::vector<Bnd_Box>* theLBox2,
const Message_ProgressRange theRange,
Standard_Boolean* theIsBreak,
Standard_Boolean* theIsDone,
const NCollection_Array1<BRepExtrema_CheckPair>* myArray;
const TopTools_IndexedMapOfShape* myMap1;
const TopTools_IndexedMapOfShape* myMap2;
- const Bnd_SeqOfBox* myLBox1;
- const Bnd_SeqOfBox* myLBox2;
+ const std::vector<Bnd_Box>* myLBox1;
+ const std::vector<Bnd_Box>* myLBox2;
Message_ProgressRange myRange;
Standard_Boolean* myIsBreak;
Standard_Boolean* myIsDone;
}
}
- const Bnd_Box& aBox1 = theTask.myLBox1->Value(aPair.Index1);
- const Bnd_Box& aBox2 = theTask.myLBox2->Value(aPair.Index2);
+ const Bnd_Box& aBox1 = theTask.myLBox1->at(aPair.Index1-1);
+ const Bnd_Box& aBox2 = theTask.myLBox2->at(aPair.Index2-1);
const TopoDS_Shape& aShape1 = theTask.myMap1->FindKey(aPair.Index1);
const TopoDS_Shape& aShape2 = theTask.myMap2->FindKey(aPair.Index2);
void BRepExtrema_DistShapeShape::DistanceMapMap (const TopTools_IndexedMapOfShape& theMap1,
const TopTools_IndexedMapOfShape& theMap2,
- const Bnd_SeqOfBox& theLBox1,
- const Bnd_SeqOfBox& theLBox2,
+ const std::vector<Bnd_Box>& theLBox1,
+ const std::vector<Bnd_Box>& theLBox2,
const Message_ProgressRange& theRange)
{
NCollection_Vector<BRepExtrema_CheckPair> aPairList;
}
for (Standard_Integer anIdx2 = 1; anIdx2 <= aCount2; ++anIdx2)
{
- const Bnd_Box& aBox1 = theLBox1.Value (anIdx1);
- const Bnd_Box& aBox2 = theLBox2.Value (anIdx2);
- if (aBox1.IsVoid()
- || aBox2.IsVoid())
+ const Bnd_Box& aBox1 = theLBox1[anIdx1-1];
+ const Bnd_Box& aBox2 = theLBox2[anIdx2-1];
+ if (aBox1.IsVoid() || aBox2.IsVoid())
{
continue;
}
break; // early search termination
}
- const Bnd_Box& aBox1 = theLBox1.Value(aPair.Index1);
- const Bnd_Box& aBox2 = theLBox2.Value(aPair.Index2);
+ const Bnd_Box& aBox1 = theLBox1[aPair.Index1-1];
+ const Bnd_Box& aBox2 = theLBox2[aPair.Index2-1];
const TopoDS_Shape& aShape1 = theMap1(aPair.Index1);
const TopoDS_Shape& aShape2 = theMap2(aPair.Index2);
{
if (!myIsInitS1) // rebuild cached data for 1st shape
{
- myBV1.Clear();
- myBE1.Clear();
- myBF1.Clear();
+ myBV1.clear();
+ myBE1.clear();
+ myBF1.clear();
BoxCalculation (myMapV1, myBV1);
BoxCalculation (myMapE1, myBE1);
if (!myIsInitS2) // rebuild cached data for 2nd shape
{
- myBV2.Clear();
- myBE2.Clear();
- myBF2.Clear();
+ myBV2.clear();
+ myBE2.clear();
+ myBF2.clear();
BoxCalculation (myMapV2, myBV2);
BoxCalculation (myMapE2, myBE2);
#include <Standard_Mutex.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <vector>
+
//! This class provides tools to compute minimum distance <br>
//! between two Shapes (Compound,CompSolid, Solid, Shell, Face, Wire, Edge, Vertex). <br>
class BRepExtrema_DistShapeShape
//! computes the minimum distance between two maps of shapes (Face,Edge,Vertex) <br>
Standard_EXPORT void DistanceMapMap(const TopTools_IndexedMapOfShape& Map1,
const TopTools_IndexedMapOfShape& Map2,
- const Bnd_SeqOfBox& LBox1,
- const Bnd_SeqOfBox& LBox2,
+ const std::vector<Bnd_Box>& LBox1,
+ const std::vector<Bnd_Box>& LBox2,
const Message_ProgressRange& theRange);
void DistanceVertVert(const TopTools_IndexedMapOfShape& theMap1,
const TopTools_IndexedMapOfShape& theMap2,
- const Bnd_SeqOfBox& theLBox1,
- const Bnd_SeqOfBox& theLBox2,
- const Message_ProgressRange& theRange);
+ const std::vector<Bnd_Box>& theLBox1,
+ const std::vector<Bnd_Box>& theLBox2,
+ const Message_ProgressRange& theRange);
void SolidTreatment(const TopoDS_Shape& theShape,
const TopTools_IndexedMapOfShape& theMap,
Standard_Boolean myIsInitS2;
Extrema_ExtFlag myFlag;
Extrema_ExtAlgo myAlgo;
- Bnd_SeqOfBox myBV1;
- Bnd_SeqOfBox myBV2;
- Bnd_SeqOfBox myBE1;
- Bnd_SeqOfBox myBE2;
- Bnd_SeqOfBox myBF1;
- Bnd_SeqOfBox myBF2;
+ std::vector<Bnd_Box> myBV1;
+ std::vector<Bnd_Box> myBV2;
+ std::vector<Bnd_Box> myBE1;
+ std::vector<Bnd_Box> myBE2;
+ std::vector<Bnd_Box> myBF1;
+ std::vector<Bnd_Box> myBF2;
Standard_Boolean myIsBreak;
mutable Handle(Standard_HMutex) myMutex;