1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0033370: Foundation Classes - Moving into STL and Boost functionality

NCollection containers update:
  - NCollection_Array1 - updated functionality
  - NCollection_Array2 - NCollection_Array1 as a wrapper for 2array
  - NCollection_Vector -> NCollection_DynamicArray was renamed and reworked.
TCollection:
  - Use static empty string to avoid allocations on empty string
 NCollection allocators update:
  - NCollection_Allocator - allocator that used Standard::Allocate
  - NCollection_OccAllocator - allocator-wrapper that used OCC BaseAllocator objects
  - NCollection_IncAllocator - rework to increase performance
Standard:
  - Rework functionality to use different allocation libs
  - Implement basic of new way to wrap allocations tools
  - Define 4 ways to allocation (defines in configure stage)
 Additional changes:
  - Hash function uses std::hash functionality
   - size_t as a hash value
  - New HashUtils with Murmur and FVN hash algo for x32 and x64
  - Deprecated _0.cxx and .gxx DE classes reorganized
  - Create own utility for std memory
  - Update Standard_Transient to be more platform-independent
 Math TK changes:
  - math_Vector -> match_BaseVector<>
    - Buffer decreased to cash 32 elements instead of 512
This commit is contained in:
dpasukhi 2023-08-05 17:53:19 +01:00
parent 6dbfade692
commit 1103eb60af
649 changed files with 10704 additions and 12037 deletions
samples/ios/UIKitSample/UIKitSample
src
AIS
AdvApprox
AppCont
Approx
ApproxInt
Aspect
BOPAlgo
BOPDS
BOPTools
BRep
BRepAlgo
BRepApprox
BRepBlend
BRepBuilderAPI
BRepCheck
BRepClass3d
BRepFill
BRepGProp
BRepLib
BRepMAT2d
BRepMesh
BRepMeshData
BRepOffset
BRepOffsetAPI
BRepPrimAPI
BSplCLib
BinMDF
BinMNaming
BinObjMgt
BinTObjDrivers

@ -23,12 +23,11 @@
#define CafShapePrs_h
#include <TDF_Label.hxx>
#include <TDF_LabelMapHasher.hxx>
#include <XCAFPrs_AISObject.hxx>
#include <XCAFPrs_Style.hxx>
typedef NCollection_DataMap<TopoDS_Shape, Handle(AIS_ColoredDrawer), TopTools_ShapeMapHasher> CafDataMapOfShapeColor;
typedef NCollection_DataMap<TDF_Label, Handle(AIS_InteractiveObject), TDF_LabelMapHasher> MapOfPrsForShapes;
typedef NCollection_DataMap<TDF_Label, Handle(AIS_InteractiveObject)> MapOfPrsForShapes;
//! Interactive object for shape in DECAF document
class CafShapePrs : public XCAFPrs_AISObject

@ -21,7 +21,6 @@
#include <NCollection_IndexedDataMap.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TColStd_MapTransientHasher.hxx>
class StdSelect_BRepOwner;
@ -104,7 +103,7 @@ protected: //! @name override presentation computation
protected:
typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound, TColStd_MapTransientHasher> DataMapOfDrawerCompd;
typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound> DataMapOfDrawerCompd;
protected:

@ -30,7 +30,6 @@
#include <StdSelect.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ConnectedInteractive,AIS_InteractiveObject)
@ -241,7 +240,7 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
const Standard_Integer theMode)
{
typedef NCollection_List<Handle(Select3D_SensitiveEntity)> SensitiveList;
typedef NCollection_DataMap<TopoDS_Shape, SensitiveList, TopTools_OrientedShapeMapHasher>
typedef NCollection_DataMap<TopoDS_Shape, SensitiveList>
Shapes2EntitiesMap;
if (!myReference->HasSelection (theMode))

@ -19,11 +19,10 @@
#include <AIS_InteractiveObject.hxx>
#include <AIS_GlobalStatus.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus),TColStd_MapTransientHasher> AIS_DataMapOfIOStatus;
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus),TColStd_MapTransientHasher>::Iterator AIS_DataMapIteratorOfDataMapOfIOStatus;
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus)> AIS_DataMapOfIOStatus;
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus)>::Iterator AIS_DataMapIteratorOfDataMapOfIOStatus;
#endif

@ -640,18 +640,9 @@ protected:
protected:
//! Trivial hasher to avoid ambiguity with enumeration type.
struct IntegerHasher
{
static Standard_Integer HashCode (Standard_Integer theValue, Standard_Integer theUpper) { return ::HashCode (theValue, theUpper); }
static Standard_Boolean IsEqual (Standard_Integer theA, Standard_Integer theB) { return theA == theB; }
};
protected:
NCollection_DataMap<V3d_TypeOfOrientation, TCollection_AsciiString, IntegerHasher>
NCollection_DataMap<V3d_TypeOfOrientation, TCollection_AsciiString>
myBoxSideLabels; //!< map with box side labels
NCollection_DataMap<Prs3d_DatumParts, TCollection_AsciiString, IntegerHasher>
NCollection_DataMap<Prs3d_DatumParts, TCollection_AsciiString>
myAxesLabels; //!< map with axes labels
Handle(Prs3d_ShadingAspect) myBoxEdgeAspect; //!< style for box edges
Handle(Prs3d_ShadingAspect) myBoxCornerAspect; //!< style for box corner

@ -30,7 +30,6 @@
#include <TColgp_HArray2OfPnt2d.hxx>
#include <TColgp_HArray2OfPnt.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Standard_Address.hxx>
#include <AdvApprox_EvaluatorFunction.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>

@ -24,7 +24,6 @@
#include <Standard_Integer.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <Standard_Address.hxx>
#include <GeomAbs_Shape.hxx>
#include <AdvApprox_EvaluatorFunction.hxx>
#include <TColStd_Array1OfInteger.hxx>

@ -1238,7 +1238,7 @@ void VBernstein(const Standard_Integer classe,
if (nbpoints > 24) throw Standard_DimensionError("VBernstein: nbpoints > 24");
// math_Matrix VB(classe, nbpoints);
Standard_Integer i, j, k = 0, Som;
Standard_Integer i, j, Som;
// 300 = 1+2+ ... +24 points.
Som = (Standard_Integer )( 300*((classe-1)*classe/2.-1) + classe * (nbpoints-1)*nbpoints/2.);
@ -1248,7 +1248,6 @@ void VBernstein(const Standard_Integer classe,
for (j = 1; j <= nbpoints; j++) {
M(i, j) = *tmpVB;
tmpVB++;
k++;
}
}
}

@ -22,7 +22,7 @@
#include <math_Matrix.hxx>
#include <NCollection_Array1.hxx>
#include <AppParCurves_Constraint.hxx>
#include <math_Vector.hxx>
struct PeriodicityInfo
{

@ -13,7 +13,6 @@
// commercial license or contractual agreement.
#include <Approx_ParametrizationType.hxx>
#include Approx_ParLeastSquareOfMyGradient_hxx
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
@ -1392,7 +1391,7 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
Standard_Boolean Parallel;
#endif
Standard_Integer myfirstpt = firstpt, mylastpt = lastpt;
Standard_Integer nbp = lastpt-firstpt+1, Kopt = 0;
Standard_Integer nbp = lastpt-firstpt+1;
math_Vector Para(firstpt, lastpt);
Parameters(Line, firstpt, lastpt, Para);
@ -1427,11 +1426,6 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
Tangent1 = LineTool::Tangency(Line, myfirstpt, tabV1);
Tangent2 = LineTool::Tangency(Line, mylastpt, tabV2);
}
if (Tangent1) Kopt++;
if (Tangent2) Kopt++;
if (nbp == 2) {
// S il n y a que 2 points, on verifie quand meme que les tangentes sont
// alignees.

@ -14,34 +14,21 @@
#ifndef _ApproxInt_KnotTools_HeaderFile
#define _ApproxInt_KnotTools_HeaderFile
#ifndef _Standard_DefineAlloc_HeaderFile
#include <Standard_DefineAlloc.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#include <TColgp_Array1OfPnt2d.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_List.hxx>
#include <math_Vector.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <NCollection_LocalArray.hxx>
#include <NCollection_Vector.hxx>
#include <Approx_ParametrizationType.hxx>
class math_Vector;
template <class A> class NCollection_Sequence;
template <class A> class NCollection_List;
template <class A> class NCollection_Vector;
class IntPatch_WLine;
// Corresponds for debug information output.

@ -53,6 +53,6 @@ protected:
};
//! Map of actions with action Id as a key.
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRAction), TCollection_AsciiString> Aspect_XRActionMap;
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRAction)> Aspect_XRActionMap;
#endif // _Aspect_XRAction_HeaderFile

@ -50,6 +50,6 @@ protected:
Aspect_XRActionMap myActions; //!< map of actions
};
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRActionSet), TCollection_AsciiString> Aspect_XRActionSetMap;
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Aspect_XRActionSet)> Aspect_XRActionSetMap;
#endif // _Aspect_XRActionSet_HeaderFile

@ -167,7 +167,7 @@ void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange)
void BOPAlgo_BuilderFace::PerformShapesToAvoid(const Message_ProgressRange& theRange)
{
Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbV, aNbE;
Standard_Integer i, aNbV, aNbE;
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
TopTools_ListIteratorOfListOfShape aIt;
//
@ -175,14 +175,11 @@ void BOPAlgo_BuilderFace::PerformShapesToAvoid(const Message_ProgressRange& theR
//
Message_ProgressScope aPS(theRange, NULL, 1);
//
iCnt=0;
for(;;) {
if (UserBreak(aPS))
{
return;
}
++iCnt;
bFound=Standard_False;
//
// 1. MEF

@ -142,7 +142,7 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange)
void BOPAlgo_BuilderSolid::PerformShapesToAvoid(const Message_ProgressRange& theRange)
{
Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbE, aNbF;
Standard_Integer i, aNbE, aNbF;
TopAbs_Orientation aOrE;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
TopTools_ListIteratorOfListOfShape aIt;
@ -151,12 +151,10 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid(const Message_ProgressRange& the
//
Message_ProgressScope aPS(theRange, NULL, 1);
//
iCnt=0;
for(;;) {
if (UserBreak(aPS)) {
return;
}
++iCnt;
bFound=Standard_False;
//
// 1. MEF

@ -549,8 +549,7 @@ void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange)
//=======================================================================
typedef
NCollection_IndexedDataMap<BOPTools_Set,
TopTools_ListOfShape,
BOPTools_SetMapHasher> BOPAlgo_IndexedDataMapOfSetListOfShape;
TopTools_ListOfShape> BOPAlgo_IndexedDataMapOfSetListOfShape;
static void AddEdgeSet(const TopoDS_Shape& theS,
BOPAlgo_IndexedDataMapOfSetListOfShape& theMap,
@ -619,8 +618,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
// Data map of set of edges with all faces having this set
NCollection_IndexedDataMap<BOPTools_Set,
TopTools_ListOfShape,
BOPTools_SetMapHasher> anESetFaces(1, aAllocator);
TopTools_ListOfShape> anESetFaces(1, aAllocator);
// Map of planar bounded faces. If such faces have the same Edge set
// they are considered Same domain, without additional check.
TopTools_MapOfShape aMFPlanar(1, aAllocator);
@ -700,7 +698,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
if (bCheckPlanar && aMFPlanar.Contains(aF2))
{
// Consider planar bounded faces as Same Domain without additional check
BOPAlgo_Tools::FillMap<TopoDS_Shape, TopTools_ShapeMapHasher>(aF1, aF2, aDMSLS, aAllocator);
BOPAlgo_Tools::FillMap(aF1, aF2, aDMSLS, aAllocator);
continue;
}
// Add pair for analysis
@ -736,14 +734,12 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
{
BOPAlgo_PairOfShapeBoolean& aPSB = aVPSB(i);
if (aPSB.Flag())
BOPAlgo_Tools::FillMap<TopoDS_Shape, TopTools_ShapeMapHasher>
(aPSB.Shape1(), aPSB.Shape2(), aDMSLS, aAllocator);
BOPAlgo_Tools::FillMap(aPSB.Shape1(), aPSB.Shape2(), aDMSLS, aAllocator);
}
aVPSB.Clear();
// Make blocks of SD faces using the back and forth map
BOPAlgo_Tools::MakeBlocks<TopoDS_Shape, TopTools_ShapeMapHasher>
(aDMSLS, aMBlocks, aAllocator);
BOPAlgo_Tools::MakeBlocks(aDMSLS, aMBlocks, aAllocator);
Message_ProgressScope aPS(aPSOuter.Next(3), "Filling same domain faces map", aMBlocks.Size());
// Fill same domain faces map
@ -1027,7 +1023,7 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm);
for (; aItLEIm.More(); aItLEIm.Next())
{
TopoDS_Edge& aSp = TopoDS::Edge(aItLEIm.Value());
TopoDS_Edge& aSp = TopoDS::Edge(aItLEIm.ChangeValue());
// Check if the split has multi-connected vertices
if (!bIsDegenerated && HasMultiConnected(aSp, aVerticesCounter))

@ -27,7 +27,6 @@
#include <NCollection_DataMap.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
//! BOPAlgo_MakeConnected is the algorithm for making the touching
//! shapes connected or glued, i.e. for making the coinciding geometries
@ -321,8 +320,7 @@ protected: //! @name Fields
// Results
NCollection_DataMap
<TopoDS_Shape,
TopTools_ListOfShape,
TopTools_OrientedShapeMapHasher> myMaterials; //!< Map of the materials associations
TopTools_ListOfShape> myMaterials; //!< Map of the materials associations
//! for the border elements
TopTools_DataMapOfShapeListOfShape myOrigins; //!< Map of origins
//! (allows tracking the shape's ancestors)

@ -180,13 +180,11 @@ protected:
typedef NCollection_DataMap
<Handle(BOPDS_PaveBlock),
Bnd_Box,
TColStd_MapTransientHasher> BOPAlgo_DataMapOfPaveBlockBndBox;
Bnd_Box> BOPAlgo_DataMapOfPaveBlockBndBox;
typedef NCollection_DataMap
<Handle(BOPDS_PaveBlock),
TColStd_ListOfInteger,
TColStd_MapTransientHasher> BOPAlgo_DataMapOfPaveBlockListOfInteger;
TColStd_ListOfInteger> BOPAlgo_DataMapOfPaveBlockListOfInteger;
typedef NCollection_DataMap
<Standard_Integer,
@ -658,8 +656,8 @@ protected: //! Fields
//! on a section curve.
NCollection_DataMap <BOPDS_Pair,
NCollection_List<EdgeRangeDistance>,
BOPDS_PairMapHasher> myDistances; //!< Map to store minimal distances between shapes
NCollection_List<EdgeRangeDistance>>
myDistances; //!< Map to store minimal distances between shapes
//! which have no real intersections
};

@ -75,7 +75,7 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange)
//
if (myDS->HasInterf(n1, n2))
{
BOPAlgo_Tools::FillMap<Standard_Integer, TColStd_MapIntegerHasher>(n1, n2, aMILI, aAllocator);
BOPAlgo_Tools::FillMap(n1, n2, aMILI, aAllocator);
continue;
}
@ -91,12 +91,12 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange)
iFlag = BOPTools_AlgoTools::ComputeVV(aV1, aV2, myFuzzyValue);
if (!iFlag) {
BOPAlgo_Tools::FillMap<Standard_Integer, TColStd_MapIntegerHasher>(n1, n2, aMILI, aAllocator);
BOPAlgo_Tools::FillMap(n1, n2, aMILI, aAllocator);
}
}
//
// 2. Make blocks
BOPAlgo_Tools::MakeBlocks<Standard_Integer, TColStd_MapIntegerHasher>(aMILI, aMBlocks, aAllocator);
BOPAlgo_Tools::MakeBlocks(aMILI, aMBlocks, aAllocator);
//
// 3. Make vertices
NCollection_List<TColStd_ListOfInteger>::Iterator aItB(aMBlocks);

@ -229,7 +229,7 @@ void BOPAlgo_PaveFiller::IntersectVE
// for all vertices having the same SD vertex.
// It will also be used as a Fence map to avoid repeated
// intersection of the same SD vertex with edge
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aDMVSD;
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger> aDMVSD;
//
Message_ProgressScope aPSOuter(theRange, NULL, 10);
for (i = 1; i <= aNbVE; ++i) {
@ -407,8 +407,7 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
BOPDS_MapOfPair aMPairs;
// Map to treat the Common Blocks
NCollection_IndexedDataMap<Handle(BOPDS_CommonBlock),
BOPDS_ListOfPaveBlock,
TColStd_MapTransientHasher> aMCBNewPB;
BOPDS_ListOfPaveBlock> aMCBNewPB;
//
// Map of vertices to init the pave blocks for them
TColStd_MapOfInteger aMVerticesToInitPB;
@ -507,7 +506,7 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
const BOPDS_ListOfPaveBlock& aLPBN = aMCBNewPB(i);
//
// For each group of pave blocks with the same vertices make new common block
NCollection_IndexedDataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock, BOPDS_PairMapHasher> aMInds;
NCollection_IndexedDataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock> aMInds;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPBN);
for (; aItLPB.More(); aItLPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value();

@ -526,7 +526,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
// 2
myDS->AddInterf(nE1, nE2);
//
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher>(aPB1, aPB2, aMPBLPB, aAllocator);
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock)>(aPB1, aPB2, aMPBLPB, aAllocator);
}//case TopAbs_EDGE
break;
default:
@ -964,8 +964,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
// Fill the connection map from bounding vertices to pave blocks
// having those bounding vertices
NCollection_IndexedDataMap<BOPDS_Pair,
BOPDS_ListOfPaveBlock,
BOPDS_PairMapHasher> aPBMap(1, anAlloc);
BOPDS_ListOfPaveBlock> aPBMap(1, anAlloc);
// Fence map of pave blocks
BOPDS_MapOfPaveBlock aMPBFence(1, anAlloc);
@ -1147,7 +1146,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
aPBMap.Clear();
aMPBFence.Clear();
anAlloc->Reset();
anAlloc->Reset(false);
Message_ProgressScope aPS(aPSOuter.Next(9), "Checking for coinciding edges", aNbPairs);
for (Standard_Integer i = 0; i < aNbPairs; i++)
@ -1221,14 +1220,11 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
const BOPDS_ListOfPaveBlock& aLPBCB = myDS->CommonBlock(aPB[j])->PaveBlocks();
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPBCB);
for (; aItLPB.More(); aItLPB.Next())
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock),
TColStd_MapTransientHasher>(aPB[j], aItLPB.Value(), aMPBLPB, anAlloc);
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock)>(aPB[j], aItLPB.Value(), aMPBLPB, anAlloc);
}
}
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock),
TColStd_MapTransientHasher>(aPB[0], aPB[1], aMPBLPB, anAlloc);
BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock)>(aPB[0], aPB[1], aMPBLPB, anAlloc);
}
// Create new common blocks of coinciding pairs.
BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, anAlloc, myDS);
}

@ -172,7 +172,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange)
//
// Avoid repeated intersection of the same vertex with face in case
// the group of vertices formed a single SD vertex
NCollection_DataMap<BOPDS_Pair, TColStd_MapOfInteger, BOPDS_PairMapHasher> aMVFPairs;
NCollection_DataMap<BOPDS_Pair, TColStd_MapOfInteger> aMVFPairs;
for (; myIterator->More(); myIterator->Next()) {
if (UserBreak(aPSOuter))
{

@ -573,30 +573,11 @@ Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
const TColStd_MapOfInteger& aMIFOn,
const TColStd_MapOfInteger& aMIFIn)
{
Standard_Boolean bRet;
Standard_Integer nV;
TColStd_MapIteratorOfMapOfInteger aIt;
//
bRet=Standard_False;
//
aIt.Initialize(aMIFOn);
for (; aIt.More(); aIt.Next()) {
nV=aIt.Value();
if (nV==nVx) {
bRet=!bRet;
return bRet;
}
if (aMIFOn.Contains(nVx) || aMIFIn.Contains(nVx))
{
return true;
}
aIt.Initialize(aMIFIn);
for (; aIt.More(); aIt.Next()) {
nV=aIt.Value();
if (nV==nVx) {
bRet=!bRet;
return bRet;
}
}
//
return bRet;
return false;
}
//=======================================================================
// function: CheckFacePaves
@ -1073,7 +1054,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
aPSOuter.Next(0.7);
aPBMap.Clear();
anAlloc->Reset();
anAlloc->Reset(false);
Message_ProgressScope aPS(aPSOuter.Next(9), "Checking for edges coinciding with faces", aNbEFs);
for (Standard_Integer i = 0; i < aNbEFs; i++)

@ -281,7 +281,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
//
// Collect all pairs of Edge/Edge interferences to check if
// some faces have to be moved to obtain more precise intersection
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aEEMap;
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger> aEEMap;
const BOPDS_VectorOfInterfEE& aVEEs = myDS->InterfEE();
for (Standard_Integer iEE = 0; iEE < aVEEs.Size(); ++iEE)
{
@ -1198,8 +1198,7 @@ void BOPAlgo_PaveFiller::PostTreatFF
// Map to store the real tolerance of the common block
// and avoid repeated computation of it
NCollection_DataMap<Handle(BOPDS_CommonBlock),
Standard_Real,
TColStd_MapTransientHasher> aMCBTol;
Standard_Real> aMCBTol;
// Map to avoid creation of different pave blocks for
// the same intersection edge
NCollection_DataMap<Standard_Integer, Handle(BOPDS_PaveBlock)> aMEPB;

@ -119,7 +119,7 @@ void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPav
}
// Make Blocks of the pave blocks
NCollection_List<BOPDS_ListOfPaveBlock> aMBlocks(aAllocator);
BOPAlgo_Tools::MakeBlocks<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher>(aMPBLPB, aMBlocks, aAllocator);
BOPAlgo_Tools::MakeBlocks(aMPBLPB, aMBlocks, aAllocator);
// Use temporary allocator for the local fence map
Handle(NCollection_IncAllocator) anAllocTmp = new NCollection_IncAllocator;
@ -132,7 +132,7 @@ void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPav
continue;
// Reset the allocator
anAllocTmp->Reset();
anAllocTmp->Reset(false);
// New common block
Handle(BOPDS_CommonBlock) aCB;
// Faces of the common block
@ -1068,11 +1068,11 @@ void BOPAlgo_Tools::IntersectVertices(const TopTools_IndexedDataMapOfShapeReal&
for (Standard_Integer iPair = 0; iPair < aNbPairs; ++iPair)
{
const BOPTools_BoxPairSelector::PairIDs& aPair = aPairs[iPair];
BOPAlgo_Tools::FillMap<Standard_Integer, TColStd_MapIntegerHasher> (aPair.ID1, aPair.ID2, aMILI, anAlloc);
BOPAlgo_Tools::FillMap (aPair.ID1, aPair.ID2, aMILI, anAlloc);
}
NCollection_List<TColStd_ListOfInteger> aBlocks (anAlloc);
BOPAlgo_Tools::MakeBlocks<Standard_Integer, TColStd_MapIntegerHasher> (aMILI, aBlocks, anAlloc);
NCollection_List<TColStd_ListOfInteger> aBlocks(anAlloc);
BOPAlgo_Tools::MakeBlocks (aMILI, aBlocks, anAlloc);
NCollection_List<TColStd_ListOfInteger>::Iterator itLI (aBlocks);
for (; itLI.More(); itLI.Next())

@ -42,31 +42,31 @@ class BOPAlgo_Tools
{
public:
//! Makes the chains of the connected elements from the given connexity map
template <class theType, class theTypeHasher>
static void MakeBlocks(const NCollection_IndexedDataMap<theType, NCollection_List<theType>, theTypeHasher>& theMILI,
NCollection_List<NCollection_List<theType>>& theMBlocks,
//! Makes the chains of the connected elements from the given convexity map
template <class TheMap, class TheList>
static void MakeBlocks(const TheMap& theMILI,
TheList& theMBlocks,
const Handle(NCollection_BaseAllocator)& theAllocator)
{
NCollection_Map<theType, theTypeHasher> aMFence;
NCollection_Map<typename TheMap::key_type, typename TheMap::hasher> aMFence;
Standard_Integer i, aNb = theMILI.Extent();
for (i = 1; i <= aNb; ++i) {
const theType& n = theMILI.FindKey(i);
const typename TheMap::key_type& n = theMILI.FindKey(i);
if (!aMFence.Add(n))
continue;
//
// Start the chain
NCollection_List<theType>& aChain = theMBlocks.Append(NCollection_List<theType>(theAllocator));
typename TheList::value_type& aChain = theMBlocks.Append(typename TheList::value_type(theAllocator));
aChain.Append(n);
// Look for connected elements
typename NCollection_List<theType>::Iterator aItLChain(aChain);
typename TheList::value_type::Iterator aItLChain(aChain);
for (; aItLChain.More(); aItLChain.Next()) {
const theType& n1 = aItLChain.Value();
const NCollection_List<theType>& aLI = theMILI.FindFromKey(n1);
const typename TheMap::key_type& n1 = aItLChain.Value();
const typename TheList::value_type& aLI = theMILI.FindFromKey(n1);
// Add connected elements into the chain
typename NCollection_List<theType>::Iterator aItLI(aLI);
typename TheList::value_type::Iterator aItLI(aLI);
for (; aItLI.More(); aItLI.Next()) {
const theType& n2 = aItLI.Value();
const typename TheMap::key_type& n2 = aItLI.Value();
if (aMFence.Add(n2)) {
aChain.Append(n2);
}
@ -76,21 +76,21 @@ public:
}
//! Fills the map with the connected entities
template <class theType, class theTypeHasher>
static void FillMap(const theType& n1,
const theType& n2,
NCollection_IndexedDataMap<theType, NCollection_List<theType>, theTypeHasher>& theMILI,
template <class TheType, class TheMap>
static void FillMap(const TheType& n1,
const TheType& n2,
TheMap& theMILI,
const Handle(NCollection_BaseAllocator)& theAllocator)
{
NCollection_List<theType> *pList1 = theMILI.ChangeSeek(n1);
typename TheMap::value_type *pList1 = theMILI.ChangeSeek(n1);
if (!pList1) {
pList1 = &theMILI(theMILI.Add(n1, NCollection_List<theType>(theAllocator)));
pList1 = &theMILI(theMILI.Add(n1, NCollection_List<TheType>(theAllocator)));
}
pList1->Append(n2);
//
NCollection_List<theType> *pList2 = theMILI.ChangeSeek(n2);
typename TheMap::value_type*pList2 = theMILI.ChangeSeek(n2);
if (!pList2) {
pList2 = &theMILI(theMILI.Add(n2, NCollection_List<theType>(theAllocator)));
pList2 = &theMILI(theMILI.Add(n2, typename TheMap::value_type(theAllocator)));
}
pList2->Append(n1);
}

@ -965,8 +965,8 @@ void BOPDS_DS::UpdateCommonBlock(const Handle(BOPDS_CommonBlock)& theCB,
Standard_Integer nE, iRef, n1, n2;
BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB, aItPBN;
BOPDS_ListOfPaveBlock aLPBN;
NCollection_DataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock, BOPDS_PairMapHasher> aMPKLPB;
NCollection_DataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock, BOPDS_PairMapHasher>::Iterator aItMPKLPB;
NCollection_DataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock> aMPKLPB;
NCollection_DataMap<BOPDS_Pair, BOPDS_ListOfPaveBlock>::Iterator aItMPKLPB;
Handle(BOPDS_PaveBlock) aPB;
Handle(BOPDS_CommonBlock) aCBx;
BOPDS_Pair aPK;

@ -18,6 +18,6 @@
#include <NCollection_DataMap.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
typedef NCollection_DataMap<Standard_Integer, BOPDS_ListOfPaveBlock, TColStd_MapIntegerHasher> BOPDS_DataMapOfIntegerListOfPaveBlock;
typedef NCollection_DataMap<Standard_Integer, BOPDS_ListOfPaveBlock> BOPDS_DataMapOfIntegerListOfPaveBlock;
#endif

@ -17,10 +17,9 @@
#define BOPDS_DataMapOfPaveBlockCommonBlock_HeaderFile
#include <NCollection_DataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_CommonBlock.hxx>
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), Handle(BOPDS_CommonBlock), TColStd_MapTransientHasher> BOPDS_DataMapOfPaveBlockCommonBlock;
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), Handle(BOPDS_CommonBlock)> BOPDS_DataMapOfPaveBlockCommonBlock;
typedef BOPDS_DataMapOfPaveBlockCommonBlock::Iterator BOPDS_DataMapIteratorOfDataMapOfPaveBlockCommonBlock;
#endif

@ -16,10 +16,9 @@
#define BOPDS_DataMapOfPaveBlockListOfInteger_HeaderFile
#include <NCollection_DataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <TColStd_ListOfInteger.hxx>
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), TColStd_ListOfInteger, TColStd_MapTransientHasher> BOPDS_DataMapOfPaveBlockListOfInteger;
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), TColStd_ListOfInteger> BOPDS_DataMapOfPaveBlockListOfInteger;
typedef BOPDS_DataMapOfPaveBlockListOfInteger::Iterator BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger;
#endif

@ -16,11 +16,10 @@
#define BOPDS_DataMapOfPaveBlockListOfPaveBlock_HeaderFile
#include <NCollection_DataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), BOPDS_ListOfPaveBlock, TColStd_MapTransientHasher> BOPDS_DataMapOfPaveBlockListOfPaveBlock;
typedef NCollection_DataMap<Handle(BOPDS_PaveBlock), BOPDS_ListOfPaveBlock> BOPDS_DataMapOfPaveBlockListOfPaveBlock;
typedef BOPDS_DataMapOfPaveBlockListOfPaveBlock::Iterator BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfPaveBlock;
#endif

@ -16,10 +16,9 @@
#define BOPDS_IndexedDataMapOfPaveBlockListOfInteger_HeaderFile
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <BOPDS_PaveBlock.hxx>
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), TColStd_ListOfInteger, TColStd_MapTransientHasher> BOPDS_IndexedDataMapOfPaveBlockListOfInteger;
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), TColStd_ListOfInteger> BOPDS_IndexedDataMapOfPaveBlockListOfInteger;
#endif

@ -16,10 +16,9 @@
#define BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock_HeaderFile
#include <NCollection_IndexedDataMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_PaveBlock.hxx>
#include <BOPDS_ListOfPaveBlock.hxx>
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), BOPDS_ListOfPaveBlock, TColStd_MapTransientHasher> BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock;
typedef NCollection_IndexedDataMap<Handle(BOPDS_PaveBlock), BOPDS_ListOfPaveBlock> BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock;
#endif

@ -16,9 +16,8 @@
#define BOPDS_IndexedMapOfPaveBlock_HeaderFile
#include <NCollection_IndexedMap.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_PaveBlock.hxx>
typedef NCollection_IndexedMap<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher> BOPDS_IndexedMapOfPaveBlock;
typedef NCollection_IndexedMap<Handle(BOPDS_PaveBlock)> BOPDS_IndexedMapOfPaveBlock;
#endif

@ -16,8 +16,10 @@
#define BOPDS_ListOfPaveBlock_HeaderFile
#include <NCollection_List.hxx>
#include <Standard_Handle.hxx>
class BOPDS_PaveBlock;
typedef NCollection_List<Handle(BOPDS_PaveBlock)> BOPDS_ListOfPaveBlock;
typedef BOPDS_ListOfPaveBlock::Iterator BOPDS_ListIteratorOfListOfPaveBlock;

@ -16,10 +16,9 @@
#define BOPDS_MapOfCommonBlock_HeaderFile
#include <NCollection_Map.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_CommonBlock.hxx>
typedef NCollection_Map<Handle(BOPDS_CommonBlock), TColStd_MapTransientHasher> BOPDS_MapOfCommonBlock;
typedef NCollection_Map<Handle(BOPDS_CommonBlock)> BOPDS_MapOfCommonBlock;
typedef BOPDS_MapOfCommonBlock::Iterator BOPDS_MapIteratorOfMapOfCommonBlock;
#endif

@ -16,10 +16,9 @@
#define BOPDS_MapOfPair_HeaderFile
#include <NCollection_Map.hxx>
#include <BOPDS_PairMapHasher.hxx>
#include <BOPDS_Pair.hxx>
typedef NCollection_Map<BOPDS_Pair, BOPDS_PairMapHasher> BOPDS_MapOfPair;
typedef NCollection_Map<BOPDS_Pair> BOPDS_MapOfPair;
typedef BOPDS_MapOfPair::Iterator BOPDS_MapIteratorOfMapOfPair;
#endif

@ -16,10 +16,9 @@
#define BOPDS_MapOfPave_HeaderFile
#include <NCollection_Map.hxx>
#include <BOPDS_PaveMapHasher.hxx>
#include <BOPDS_Pave.hxx>
typedef NCollection_Map<BOPDS_Pave, BOPDS_PaveMapHasher> BOPDS_MapOfPave;
typedef NCollection_Map<BOPDS_Pave> BOPDS_MapOfPave;
typedef BOPDS_MapOfPave::Iterator BOPDS_MapIteratorOfMapOfPave;
#endif

@ -16,10 +16,9 @@
#define BOPDS_MapOfPaveBlock_HeaderFile
#include <NCollection_Map.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <BOPDS_PaveBlock.hxx>
typedef NCollection_Map<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher> BOPDS_MapOfPaveBlock;
typedef NCollection_Map<Handle(BOPDS_PaveBlock)> BOPDS_MapOfPaveBlock;
typedef BOPDS_MapOfPaveBlock::Iterator BOPDS_MapIteratorOfMapOfPaveBlock;
#endif

@ -17,6 +17,7 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_HashUtils.hxx>
//! The class is to provide the pair of indices of interfering shapes.
@ -62,12 +63,9 @@ class BOPDS_Pair {
(myIndex1 == theOther.myIndex2 && myIndex2 == theOther.myIndex1);
}
//! Computes a hash code for this pair, in the range [1, theUpperBound]
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
Standard_Integer HashCode (const Standard_Integer theUpperBound) const
bool operator==(const BOPDS_Pair& theOther) const
{
return ::HashCode(myIndex1 + myIndex2, theUpperBound);
return IsEqual(theOther);
}
protected:
@ -75,4 +73,23 @@ class BOPDS_Pair {
Standard_Integer myIndex2;
};
namespace std
{
template <>
struct hash<BOPDS_Pair>
{
size_t operator()(const BOPDS_Pair& thePair) const noexcept
{
// Combine two int values into a single hash value.
int aCombination[2];
thePair.Indices(aCombination[0], aCombination[1]);
if (aCombination[0] > aCombination[1])
{
std::swap(aCombination[0], aCombination[1]);
}
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
};
}
#endif // _BOPDS_Pair

@ -1,53 +0,0 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2017 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_PairMapHasher_HeaderFile
#define _BOPDS_PairMapHasher_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Integer.hxx>
#include <BOPDS_Pair.hxx>
class BOPDS_Pair;
class BOPDS_PairMapHasher
{
public:
DEFINE_STANDARD_ALLOC
//! Computes a hash code for the given pair, in the range [1, theUpperBound]
//! @param thePair the pair which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const BOPDS_Pair& thePair, const Standard_Integer theUpperBound)
{
return thePair.HashCode (theUpperBound);
}
static Standard_Boolean IsEqual(const BOPDS_Pair& thePair1,
const BOPDS_Pair& thePair2)
{
return thePair1.IsEqual(thePair2);
}
protected:
private:
};
#endif // _BOPDS_PairMapHasher_HeaderFile

@ -103,6 +103,20 @@ private:
};
namespace std
{
template <>
struct hash<BOPDS_Pave>
{
size_t operator()(const BOPDS_Pave& thePave) const noexcept
{
size_t aCombination[2];
aCombination[0] = opencascade::hash(thePave.Index());
aCombination[1] = opencascade::hash(thePave.Parameter());
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
};
}
#include <BOPDS_Pave.lxx>

@ -1,64 +0,0 @@
// Created by: Eugeny MALTCHIKOV
// 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_PaveMapHasher_HeaderFile
#define _BOPDS_PaveMapHasher_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Integer.hxx>
class BOPDS_Pave;
class BOPDS_PaveMapHasher
{
public:
DEFINE_STANDARD_ALLOC
//! Computes a hash code for the given pave, in the range [1, theUpperBound]
//! @param thePave the pave which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const BOPDS_Pave& thePave, Standard_Integer theUpperBound);
static Standard_Boolean IsEqual (const BOPDS_Pave& aPave1, const BOPDS_Pave& aPave2);
protected:
private:
};
#include <BOPDS_PaveMapHasher.lxx>
#endif // _BOPDS_PaveMapHasher_HeaderFile

@ -1,35 +0,0 @@
// Created by: Eugeny MALTCHIKOV
// 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.
#include <BOPDS_Pave.hxx>
//=======================================================================
// function : HashCode
// purpose :
//=======================================================================
inline Standard_Integer BOPDS_PaveMapHasher::HashCode (const BOPDS_Pave& thePave, const Standard_Integer theUpperBound)
{
return ::HashCode (thePave.Index(), theUpperBound);
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
inline
Standard_Boolean BOPDS_PaveMapHasher::IsEqual(const BOPDS_Pave& aPave1,
const BOPDS_Pave& aPave2)
{
return aPave1.IsEqual(aPave2);
}

@ -35,8 +35,6 @@ BOPDS_Pave.hxx
BOPDS_Pave.lxx
BOPDS_PaveBlock.cxx
BOPDS_PaveBlock.hxx
BOPDS_PaveMapHasher.hxx
BOPDS_PaveMapHasher.lxx
BOPDS_PDS.hxx
BOPDS_PIterator.hxx
BOPDS_PIteratorSI.hxx
@ -67,7 +65,6 @@ BOPDS_VectorOfPave.hxx
BOPDS_VectorOfPoint.hxx
BOPDS_VectorOfShapeInfo.hxx
BOPDS_Pair.hxx
BOPDS_PairMapHasher.hxx
BOPDS_MapOfPair.hxx
BOPDS_VectorOfPair.hxx
BOPDS_VectorOfVectorOfPair.hxx

@ -16,10 +16,9 @@
#define BOPTools_IndexedDataMapOfSetShape_HeaderFile
#include <BOPTools_Set.hxx>
#include <BOPTools_SetMapHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <TopoDS_Shape.hxx>
typedef NCollection_IndexedDataMap<BOPTools_Set, TopoDS_Shape, BOPTools_SetMapHasher> BOPTools_IndexedDataMapOfSetShape;
typedef NCollection_IndexedDataMap<BOPTools_Set, TopoDS_Shape> BOPTools_IndexedDataMapOfSetShape;
#endif

@ -16,11 +16,10 @@
#define BOPTools_MapOfSet_HeaderFile
#include <BOPTools_Set.hxx>
#include <BOPTools_SetMapHasher.hxx>
#include <NCollection_Map.hxx>
typedef NCollection_Map<BOPTools_Set, BOPTools_SetMapHasher> BOPTools_MapOfSet;
typedef NCollection_Map<BOPTools_Set> BOPTools_MapOfSet;
typedef BOPTools_MapOfSet::Iterator BOPTools_MapIteratorOfMapOfSet;
#endif

@ -50,25 +50,6 @@ class BOPTools_Parallel
template<class TypeSolverVector, class TypeContext>
class ContextFunctor
{
//! Auxiliary thread ID hasher.
struct Hasher
{
//! Computes a hash code for the given thread identifier, in the range [1, theUpperBound]
//! @param theThreadId the thread identifier which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const Standard_ThreadId theThreadId, const Standard_Integer theUpperBound)
{
return ::HashCode (theThreadId, theUpperBound);
}
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
const Standard_ThreadId theKey2)
{
return theKey1 == theKey2;
}
};
public:
//! Constructor
@ -116,7 +97,7 @@ class BOPTools_Parallel
private:
TypeSolverVector& mySolverVector;
mutable NCollection_DataMap<Standard_ThreadId, opencascade::handle<TypeContext>, Hasher> myContextMap;
mutable NCollection_DataMap<Standard_ThreadId, opencascade::handle<TypeContext>> myContextMap;
mutable Standard_Mutex myMutex;
};

@ -21,8 +21,8 @@
#include <TopTools_MapOfShape.hxx>
static
Standard_Integer NormalizedIds(const Standard_Integer aId,
const Standard_Integer aDiv);
size_t NormalizedIds(const size_t aId,
const Standard_Integer aDiv);
//=======================================================================
//function :
@ -127,15 +127,6 @@ const TopoDS_Shape& BOPTools_Set::Shape()const
return myShape;
}
//=======================================================================
// function : HashCode
// purpose :
//=======================================================================
Standard_Integer BOPTools_Set::HashCode (const Standard_Integer theUpperBound) const
{
return ::HashCode (mySum, theUpperBound);
}
//=======================================================================
//function : IsEqual
//purpose :
@ -177,7 +168,7 @@ Standard_Boolean BOPTools_Set::IsEqual
void BOPTools_Set::Add(const TopoDS_Shape& theS,
const TopAbs_ShapeEnum theType)
{
Standard_Integer aId, aIdN;
size_t aId, aIdN;
TopAbs_Orientation aOr;
TopExp_Explorer aExp;
//
@ -223,7 +214,7 @@ void BOPTools_Set::Add(const TopoDS_Shape& theS,
aIt.Initialize(myShapes);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSx=aIt.Value();
aId=aSx.HashCode(myUpper);
aId = TopTools_ShapeMapHasher{}(aSx) % myUpper + 1;
aIdN=NormalizedIds(aId, myNbShapes);
mySum+=aIdN;
}
@ -232,13 +223,13 @@ void BOPTools_Set::Add(const TopoDS_Shape& theS,
// function: NormalizedIds
// purpose :
//=======================================================================
Standard_Integer NormalizedIds(const Standard_Integer aId,
const Standard_Integer aDiv)
size_t NormalizedIds(const size_t aId,
const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
size_t aMax, aTresh, aIdRet;
//
aIdRet=aId;
aMax=::IntegerLast();
aMax=SIZE_MAX;
aTresh=aMax/aDiv;
if (aId>aTresh) {
aIdRet=aId%aTresh;

@ -55,11 +55,12 @@ BOPTools_Set& operator = (const BOPTools_Set& Other)
Standard_EXPORT Standard_Boolean IsEqual (const BOPTools_Set& aOther) const;
//! Computes a hash code for this set, in the range [1, theUpperBound]
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
Standard_EXPORT Standard_Integer HashCode (Standard_Integer theUpperBound) const;
bool operator==(const BOPTools_Set& theOther) const
{
return IsEqual(theOther);
}
size_t GetSum() const { return mySum; }
protected:
@ -71,22 +72,20 @@ protected:
TopTools_ListOfShape myShapes;
TopoDS_Shape myShape;
Standard_Integer myNbShapes;
Standard_Integer mySum;
size_t mySum;
Standard_Integer myUpper;
private:
};
namespace std
{
template <>
struct hash<BOPTools_Set>
{
size_t operator()(const BOPTools_Set& theSet) const noexcept
{
return theSet.GetSum();
}
};
}
#endif // _BOPTools_Set_HeaderFile

@ -1,64 +0,0 @@
// 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 _BOPTools_SetMapHasher_HeaderFile
#define _BOPTools_SetMapHasher_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Integer.hxx>
class BOPTools_Set;
class BOPTools_SetMapHasher
{
public:
DEFINE_STANDARD_ALLOC
//! Computes a hash code for the given set, in the range [1, theUpperBound]
//! @param theSet the set which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const BOPTools_Set& theSet, Standard_Integer theUpperBound);
static Standard_Boolean IsEqual (const BOPTools_Set& aSet1, const BOPTools_Set& aSet2);
protected:
private:
};
#include <BOPTools_SetMapHasher.lxx>
#endif // _BOPTools_SetMapHasher_HeaderFile

@ -1,35 +0,0 @@
// 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.
//#include <BOPTools_SetMapHasher.ixx>
//=======================================================================
// function : HashCode
// purpose :
//=======================================================================
inline Standard_Integer BOPTools_SetMapHasher::HashCode (const BOPTools_Set& theSet,
const Standard_Integer theUpperBound)
{
return theSet.HashCode (theUpperBound);
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
inline Standard_Boolean BOPTools_SetMapHasher::IsEqual(const BOPTools_Set& theSS1,
const BOPTools_Set& theSS2)
{
return theSS1.IsEqual(theSS2);
}

@ -19,5 +19,3 @@ BOPTools_PairSelector.hxx
BOPTools_Parallel.hxx
BOPTools_Set.cxx
BOPTools_Set.hxx
BOPTools_SetMapHasher.hxx
BOPTools_SetMapHasher.lxx

@ -356,7 +356,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
}
if (itcr.More()) {
Handle(BRep_CurveRepresentation)& cr = itcr.Value();
Handle(BRep_CurveRepresentation) cr = itcr.Value();
cr->Continuity(C);
}
else {
@ -380,7 +380,7 @@ static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
}
if (itpr.More()) {
Handle(BRep_PointRepresentation)& pr = itpr.Value();
Handle(BRep_PointRepresentation) pr = itpr.Value();
pr->Parameter(p);
}
else {
@ -404,7 +404,7 @@ static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
}
if (itpr.More()) {
Handle(BRep_PointRepresentation)& pr = itpr.Value();
Handle(BRep_PointRepresentation) pr = itpr.Value();
pr->Parameter(p);
}
else {
@ -430,7 +430,7 @@ static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
}
if (itpr.More()) {
Handle(BRep_PointRepresentation)& pr = itpr.Value();
Handle(BRep_PointRepresentation) pr = itpr.Value();
pr->Parameter(p1);
// pr->Parameter(p2); // skv
pr->Parameter2(p2); // skv

@ -1053,7 +1053,7 @@ void BRep_Tool::SetUVPoints(const TopoDS_Edge& E,
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
while (itcr.More()) {
Handle(BRep_CurveRepresentation)& cr = itcr.Value();
Handle(BRep_CurveRepresentation) cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed)
{

@ -384,7 +384,7 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
// Reorientation of all closed wires to the left.
//---------------------------------------------------------
for (; it.More(); it.Next()) {
TopoDS_Wire& W = TopoDS::Wire(it.Value());
TopoDS_Wire& W = TopoDS::Wire(it.ChangeValue());
TopoDS_Shape aLocalShape = myFace.EmptyCopied();
TopoDS_Face NF = TopoDS::Face(aLocalShape);
// TopoDS_Face NF = TopoDS::Face(myFace.EmptyCopied());
@ -402,7 +402,7 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
// Classification of wires ones compared to the others.
//---------------------------------------------------------
for (it.Initialize(wires) ; it.More(); it.Next()) {
TopoDS_Wire& W1 = TopoDS::Wire(it.Value());
const TopoDS_Wire& W1 = TopoDS::Wire(it.Value());
TopTools_ListIteratorOfListOfShape it2(wires);
if (IsClosed(W1)) {

@ -572,7 +572,7 @@ void BRepAlgo_Loop::Perform()
if (pLCE)
{
for (itl1.Initialize(*pLCE); itl1.More(); itl1.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl1.Value());
TopoDS_Edge& E = TopoDS::Edge(itl1.ChangeValue());
if (!Emap.Add(E))
continue;
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
@ -585,7 +585,7 @@ void BRepAlgo_Loop::Perform()
// => call only once StoreInMVE which should double them
TopTools_MapOfShape DejaVu;
for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl.Value());
TopoDS_Edge& E = TopoDS::Edge(itl.ChangeValue());
if (DejaVu.Add(E))
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
}
@ -900,7 +900,7 @@ void BRepAlgo_Loop::WiresToFaces()
// Standard_False);
TopTools_ListIteratorOfListOfShape it(myNewWires);
for (; it.More(); it.Next()) {
FR.Add(TopoDS::Wire(it.Value()));
FR.Add(TopoDS::Wire(it.ChangeValue()));
}
FR.Perform();

@ -21,7 +21,6 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Address.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>

@ -20,7 +20,6 @@
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Address.hxx>
#include <math_Vector.hxx>
#include <Blend_Point.hxx>
#include <gp_Pnt.hxx>

@ -22,6 +22,7 @@
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <Standard_HashUtils.hxx>
namespace
{
@ -47,32 +48,30 @@ namespace
return Standard_False;
}
bool operator==(const Edge& theOther) const
{
return theOther.Idx1 == Idx1 && theOther.Idx2 == Idx2;
}
//! First index. It is lower or equal than the second.
Standard_Integer Idx1;
//! Second index.
Standard_Integer Idx2;
};
}
//! Hasher of Edge structure.
struct EdgeHasher
namespace std
{
template <>
struct hash<Edge>
{
//! Returns hash code for the given edge.
static Standard_Integer HashCode(const Edge& theEdge,
const Standard_Integer theUpperBound)
size_t operator()(const Edge& theEdge) const noexcept
{
// Circle-based collisions.
return ::HashCode(theEdge.Idx1 * theEdge.Idx1 + theEdge.Idx2 * theEdge.Idx2, theUpperBound);
// Combine two int values into a single hash value.
int aCombination[2]{ theEdge.Idx1, theEdge.Idx2 };
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
//! Returns true if two edges are equal.
static Standard_Boolean IsEqual(const Edge& theEdge1,
const Edge& theEdge2)
{
return theEdge1.Idx1 == theEdge2.Idx1 && theEdge1.Idx2 == theEdge2.Idx2;
}
};
}
@ -115,7 +114,7 @@ void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange
}
// Build shared edges.
NCollection_IndexedDataMap<Edge, TopoDS_Edge, EdgeHasher> anEdgeToTEgeMap;
NCollection_IndexedDataMap<Edge, TopoDS_Edge> anEdgeToTEgeMap;
for (Standard_Integer i = 1; i <= aNbTriangles; ++i)
{
aPS.Next();

@ -50,14 +50,13 @@
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
#include <TopTools_SequenceOfShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepCheck_Face,BRepCheck_Result)
//#include <BRepAdaptor_Curve2d.hxx>
//#include <Geom2dInt_GInter.hxx>
typedef NCollection_DataMap<TopoDS_Shape, Bnd_Box2d, TopTools_OrientedShapeMapHasher> DataMapOfShapeBox2d;
typedef NCollection_DataMap<TopoDS_Shape, Bnd_Box2d> DataMapOfShapeBox2d;
static Standard_Boolean Intersect(const TopoDS_Wire&,
const TopoDS_Wire&,

@ -19,10 +19,9 @@
#include <TopoDS_Shape.hxx>
#include <BRepCheck_Result.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
typedef NCollection_IndexedDataMap<TopoDS_Shape,Handle(BRepCheck_Result),TopTools_OrientedShapeMapHasher> BRepCheck_IndexedDataMapOfShapeResult;
typedef NCollection_IndexedDataMap<TopoDS_Shape,Handle(BRepCheck_Result)> BRepCheck_IndexedDataMapOfShapeResult;
#endif

@ -82,9 +82,9 @@ Standard_EXPORT Standard_Integer BRepCheck_Trace(const Standard_Integer phase) {
return BRC_Trace;
}
void PrintShape(const TopoDS_Shape& theShape, const Standard_Integer upper) {
void PrintShape(const TopoDS_Shape& theShape) {
if (!theShape.IsNull()) {
Standard_Integer code = theShape.HashCode(upper);
size_t code = TopTools_ShapeMapHasher{}(theShape);
std::cout << TopAbs::ShapeTypeToString (theShape.ShapeType()) << " : " << code
<< " " << TopAbs::ShapeOrientationToString(theShape.Orientation()) << std::endl;
}

@ -18,7 +18,6 @@
#define BRepClass3d_MapOfInter_HeaderFile
#include <TopoDS_Shape.hxx>
#include <Standard_Address.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <NCollection_DataMap.hxx>

@ -19,11 +19,10 @@
#include <MAT_Node.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Handle(MAT_Node),TopTools_DataMapOfShapeShape,TColStd_MapTransientHasher> BRepFill_DataMapOfNodeDataMapOfShapeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopTools_DataMapOfShapeShape,TColStd_MapTransientHasher>::Iterator BRepFill_DataMapIteratorOfDataMapOfNodeDataMapOfShapeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopTools_DataMapOfShapeShape> BRepFill_DataMapOfNodeDataMapOfShapeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopTools_DataMapOfShapeShape>::Iterator BRepFill_DataMapIteratorOfDataMapOfNodeDataMapOfShapeShape;
#endif

@ -19,11 +19,10 @@
#include <MAT_Node.hxx>
#include <TopoDS_Shape.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Handle(MAT_Node),TopoDS_Shape,TColStd_MapTransientHasher> BRepFill_DataMapOfNodeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopoDS_Shape,TColStd_MapTransientHasher>::Iterator BRepFill_DataMapIteratorOfDataMapOfNodeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopoDS_Shape> BRepFill_DataMapOfNodeShape;
typedef NCollection_DataMap<Handle(MAT_Node),TopoDS_Shape>::Iterator BRepFill_DataMapIteratorOfDataMapOfNodeShape;
#endif

@ -19,11 +19,10 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<TopoDS_Shape,TopTools_ListOfShape,TopTools_OrientedShapeMapHasher> BRepFill_DataMapOfOrientedShapeListOfShape;
typedef NCollection_DataMap<TopoDS_Shape,TopTools_ListOfShape,TopTools_OrientedShapeMapHasher>::Iterator BRepFill_DataMapIteratorOfDataMapOfOrientedShapeListOfShape;
typedef NCollection_DataMap<TopoDS_Shape,TopTools_ListOfShape> BRepFill_DataMapOfOrientedShapeListOfShape;
typedef NCollection_DataMap<TopoDS_Shape,TopTools_ListOfShape>::Iterator BRepFill_DataMapIteratorOfDataMapOfOrientedShapeListOfShape;
#endif

@ -1953,7 +1953,7 @@ void BRepFill_Evolved::Transfert( BRepFill_Evolved& Vevo,
TopTools_ListIteratorOfListOfShape itl;
for (itl.Initialize(GenShapes); itl.More(); itl.Next()) {
itl.Value().Move(LS);
itl.ChangeValue().Move(LS);
}
if (!myMap.IsBound(InitialSpine)) {

@ -19,10 +19,9 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
typedef NCollection_IndexedDataMap<TopoDS_Shape,TopTools_ListOfShape,TopTools_OrientedShapeMapHasher> BRepFill_IndexedDataMapOfOrientedShapeListOfShape;
typedef NCollection_IndexedDataMap<TopoDS_Shape,TopTools_ListOfShape> BRepFill_IndexedDataMapOfOrientedShapeListOfShape;
#endif

@ -1068,8 +1068,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
{
const TopTools_ListOfShape& listSh = aSubst.Copy(itl.Value());
TopAbs_Orientation SaveOr = itl.Value().Orientation();
itl.Value() = listSh.First();
itl.Value().Orientation(SaveOr);
itl.ChangeValue() = listSh.First();
itl.ChangeValue().Orientation(SaveOr);
}
}
}

@ -238,7 +238,7 @@ static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
((*((Handle(BRep_TEdge)*)&E.TShape()))->ChangeCurves());
while (itcr.More()) {
Handle(BRep_CurveRepresentation)& cr = itcr.Value();
Handle(BRep_CurveRepresentation) cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
if (GC->IsCurveOnClosedSurface() && Eisreversed)

@ -17,7 +17,8 @@
#include <NCollection_Handle.hxx>
#include <NCollection_Array1.hxx>
class math_Vector;
template<typename T> class math_VectorBase;
using math_Vector = math_VectorBase<double>;
//! Class performs computing of the global inertia properties
//! of geometric object in 3D space by adaptive and non-adaptive

@ -20,7 +20,6 @@
#include <Standard_DefineAlloc.hxx>
#include <GProp_GProps.hxx>
#include <Standard_Address.hxx>
class BRepGProp_Face;
class BRepGProp_Domain;
class gp_Pln;

@ -74,6 +74,7 @@
#include <BRepTools_ReShape.hxx>
#include <TopTools_DataMapOfShapeReal.hxx>
#include <TopoDS_LockedShape.hxx>
#include <Standard_HashUtils.hxx>
#include <algorithm>
@ -2235,7 +2236,6 @@ static void EncodeRegularity(const TopoDS_Shape& theShape,
TopTools_ListIteratorOfListOfShape It;
TopExp_Explorer Ex;
TopoDS_Face F1,F2;
Standard_Boolean found;
for (Standard_Integer i = 1; i <= M.Extent(); i++){
TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
if (!theEdgesToEncode.IsEmpty())
@ -2247,7 +2247,7 @@ static void EncodeRegularity(const TopoDS_Shape& theShape,
continue;
}
found = Standard_False;
Standard_Boolean found = Standard_False;
F1.Nullify();
for (It.Initialize(M.FindFromIndex(i)); It.More() && !found; It.Next()){
if (F1.IsNull()) { F1 = TopoDS::Face(It.Value()); }
@ -2511,12 +2511,6 @@ namespace
Node[1] = theNode2;
}
//! Computes a hash code for the this link
Standard_Integer HashCode (const Standard_Integer theUpperBound) const
{
return ::HashCode (Node[0] + Node[1], theUpperBound);
}
//! Returns true if this link has the same nodes as the other.
Standard_Boolean IsEqual (const Link& theOther) const
{
@ -2530,12 +2524,23 @@ namespace
return IsEqual (theOther);
}
};
}
//! Computes a hash code for the given link
inline Standard_Integer HashCode (const Link& theLink, const Standard_Integer theUpperBound)
namespace std
{
template <>
struct hash<Link>
{
return theLink.HashCode (theUpperBound);
}
size_t operator()(const Link& theLink) const noexcept
{
int aCombination[2]{ theLink.Node[0], theLink.Node[1] };
if (aCombination[0] > aCombination[1])
{
std::swap(aCombination[0], aCombination[1]);
}
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
};
}
void BRepLib::UpdateDeflection (const TopoDS_Shape& theShape)
@ -2823,7 +2828,7 @@ void BRepLib::BoundingVertex(const NCollection_List<TopoDS_Shape>& theLV,
// of addition, thus sort the coordinates for stable result
Standard_Integer i;
NCollection_Array1<gp_Pnt> aPoints(0, aNb-1);
NCollection_List<TopoDS_Edge>::Iterator aIt(theLV);
NCollection_List<TopoDS_Shape>::Iterator aIt(theLV);
for (i = 0; aIt.More(); aIt.Next(), ++i) {
const TopoDS_Vertex& aVi = *((TopoDS_Vertex*)(&aIt.Value()));
gp_Pnt aPi = BRep_Tool::Pnt(aVi);

@ -1055,7 +1055,7 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOldEdge,
iter.Next();
for (; iter.More(); iter.Next())
{
TopoDS_Edge& E = TopoDS::Edge(iter.Value());
const TopoDS_Edge& E = TopoDS::Edge(iter.Value());
Standard_Real first, last;
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface( E, Surf, loc, first, last );
Handle(Geom2d_BoundedCurve) BC = Handle(Geom2d_BoundedCurve)::DownCast(C);

@ -379,7 +379,7 @@ void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
if (IsNewEdge)
{
TopoDS_Shape NewE = aCE.EmptyCopied();
NCollection_List<TopoDS_Edge>::Iterator it(aVList);
NCollection_List<TopoDS_Vertex>::Iterator it(aVList);
for (; it.More(); it.Next())
aBB.Add(NewE, it.Value());
theNewEList.Append(TopoDS::Edge(NewE));

@ -19,11 +19,10 @@
#include <MAT_BasicElt.hxx>
#include <TopoDS_Shape.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Handle(MAT_BasicElt),TopoDS_Shape,TColStd_MapTransientHasher> BRepMAT2d_DataMapOfBasicEltShape;
typedef NCollection_DataMap<Handle(MAT_BasicElt),TopoDS_Shape,TColStd_MapTransientHasher>::Iterator BRepMAT2d_DataMapIteratorOfDataMapOfBasicEltShape;
typedef NCollection_DataMap<Handle(MAT_BasicElt),TopoDS_Shape> BRepMAT2d_DataMapOfBasicEltShape;
typedef NCollection_DataMap<Handle(MAT_BasicElt),TopoDS_Shape>::Iterator BRepMAT2d_DataMapIteratorOfDataMapOfBasicEltShape;
#endif

@ -17,6 +17,7 @@
#include <Standard.hxx>
#include <BRepMesh_DegreeOfFreedom.hxx>
#include <BRepMesh_OrientedEdge.hxx>
#include <Standard_HashUtils.hxx>
//! Light weighted structure representing link of the mesh.
class BRepMesh_Edge : public BRepMesh_OrientedEdge
@ -84,13 +85,28 @@ private:
BRepMesh_DegreeOfFreedom myMovability;
};
//! Computes a hash code for the given edge, in the range [1, theUpperBound]
//! @param theEdge the edge which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
inline Standard_Integer HashCode (const BRepMesh_Edge& theEdge, const Standard_Integer theUpperBound)
namespace std
{
return theEdge.HashCode (theUpperBound);
template <>
struct hash<BRepMesh_Edge>
{
size_t operator()(const BRepMesh_Edge& theEdge) const noexcept
{
union Combination
{
unsigned short Arr[2]; // Node can be represented as a short
uint32_t Hash;
} aCombination;
aCombination.Arr[0] = static_cast<unsigned short>(theEdge.FirstNode());
aCombination.Arr[1] = static_cast<unsigned short>(theEdge.LastNode());
if (aCombination.Arr[0] > aCombination.Arr[1])
{
std::swap(aCombination.Arr[0], aCombination.Arr[1]);
}
return static_cast<size_t>(aCombination.Hash);
}
};
}
#endif

@ -15,6 +15,7 @@
#define _BRepMesh_OrientedEdge_HeaderFile
#include <Standard.hxx>
#include <Standard_HashUtils.hxx>
#include <Standard_DefineAlloc.hxx>
//! Light weighted structure representing simple link.
@ -52,14 +53,6 @@ public:
return myLastNode;
}
//! Computes a hash code for this oriented edge, in the range [1, theUpperBound]
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
Standard_Integer HashCode (const Standard_Integer theUpperBound) const
{
return ::HashCode (myFirstNode + myLastNode, theUpperBound);
}
//! Checks this and other edge for equality.
//! @param theOther edge to be checked against this one.
//! @return TRUE if edges have the same orientation, FALSE if not.
@ -80,13 +73,24 @@ private:
Standard_Integer myLastNode;
};
//! Computes a hash code for the given oriented edge, in the range [1, theUpperBound]
//! @param theOrientedEdge the oriented edge which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
inline Standard_Integer HashCode (const BRepMesh_OrientedEdge& theOrientedEdge, const Standard_Integer theUpperBound)
namespace std
{
return theOrientedEdge.HashCode (theUpperBound);
template <>
struct hash<BRepMesh_OrientedEdge>
{
size_t operator()(const BRepMesh_OrientedEdge& theOrientedEdge) const noexcept
{
union Combination
{
unsigned short Arr[2]; // Node can be represented as a short
uint32_t Hash;
} aCombination;
aCombination.Arr[0] = static_cast<unsigned short>(theOrientedEdge.FirstNode());
aCombination.Arr[1] = static_cast<unsigned short>(theOrientedEdge.LastNode());
return static_cast<size_t>(aCombination.Hash);
}
};
}
#endif

@ -19,6 +19,7 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_HashUtils.hxx>
#include <BRepMesh_DegreeOfFreedom.hxx>
@ -91,14 +92,6 @@ public:
myMovability = theMovability;
}
//! Computes a hash code for this triangle, in the range [1, theUpperBound]
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
Standard_Integer HashCode (const Standard_Integer theUpperBound) const
{
return ::HashCode (myEdges[0] + myEdges[1] + myEdges[2], theUpperBound);
}
//! Checks for equality with another triangle.
//! @param theOther triangle to be checked against this one.
//! @return TRUE if equal, FALSE if not.
@ -142,13 +135,18 @@ public:
BRepMesh_DegreeOfFreedom myMovability;
};
//! Computes a hash code for the given triangle, in the range [1, theUpperBound]
//! @param theTriangle the triangle which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
inline Standard_Integer HashCode (const BRepMesh_Triangle& theTriangle, const Standard_Integer theUpperBound)
namespace std
{
return theTriangle.HashCode (theUpperBound);
template <>
struct hash<BRepMesh_Triangle>
{
size_t operator()(const BRepMesh_Triangle& theTriangle) const noexcept
{
int aCombination[3] = { theTriangle.myEdges[0], theTriangle.myEdges[1], theTriangle.myEdges[2] };
std::sort(aCombination, aCombination + 3); // Sort the numbers in ascending order
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
};
}
#endif

@ -103,14 +103,6 @@ public:
myMovability = theMovability;
}
//! Computes a hash code for this vertex, in the range [1, theUpperBound]
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
Standard_Integer HashCode(const Standard_Integer theUpperBound) const
{
return ::HashCode(Floor(1e5 * myUV.X()) * Floor(1e5 * myUV.Y()), theUpperBound);
}
//! Checks for equality with another vertex.
//! @param theOther vertex to be checked against this one.
//! @return TRUE if equal, FALSE if not.
@ -138,13 +130,16 @@ private:
BRepMesh_DegreeOfFreedom myMovability;
};
//! Computes a hash code for the given vertex, in the range [1, theUpperBound]
//! @param theVertex the vertex which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
inline Standard_Integer HashCode (const BRepMesh_Vertex& theVertex, const Standard_Integer theUpperBound)
namespace std
{
return theVertex.HashCode (theUpperBound);
template <>
struct hash<BRepMesh_Vertex>
{
size_t operator()(const BRepMesh_Vertex& theVertex) const noexcept
{
return std::hash<double>{}((Floor(1e5 * theVertex.Coord().X()) * Floor(1e5 * theVertex.Coord().Y())));
}
};
}
#endif

@ -24,8 +24,8 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMeshData_Curve, IMeshData_Curve)
// Purpose :
//=======================================================================
BRepMeshData_Curve::BRepMeshData_Curve (const Handle (NCollection_IncAllocator)& theAllocator)
: myPoints (NCollection_StdAllocator<gp_Pnt>(theAllocator)),
myParameters (NCollection_StdAllocator<Standard_Real>(theAllocator))
: myPoints (NCollection_OccAllocator<gp_Pnt>(theAllocator)),
myParameters (NCollection_OccAllocator<Standard_Real>(theAllocator))
{
}

@ -32,7 +32,7 @@ BRepMeshData_Model::BRepMeshData_Model (const TopoDS_Shape& theShape)
myDFaces (256, myAllocator),
myDEdges (256, myAllocator)
{
myAllocator->SetThreadSafe();
myAllocator->SetThreadSafe(true);
}
//=======================================================================
@ -59,8 +59,7 @@ Standard_Integer BRepMeshData_Model::FacesNb () const
const IMeshData::IFaceHandle& BRepMeshData_Model::AddFace (const TopoDS_Face& theFace)
{
IMeshData::IFaceHandle aFace (new (myAllocator) BRepMeshData_Face (theFace, myAllocator));
myDFaces.Append (aFace);
return myDFaces (FacesNb () - 1);
return myDFaces.Append (aFace);
}
//=======================================================================
@ -88,8 +87,7 @@ Standard_Integer BRepMeshData_Model::EdgesNb () const
const IMeshData::IEdgeHandle& BRepMeshData_Model::AddEdge (const TopoDS_Edge& theEdge)
{
IMeshData::IEdgeHandle aEdge (new (myAllocator) BRepMeshData_Edge (theEdge, myAllocator));
myDEdges.Append (aEdge);
return myDEdges (EdgesNb () - 1);
return myDEdges.Append (aEdge);
}
//=======================================================================

@ -29,9 +29,9 @@ BRepMeshData_PCurve::BRepMeshData_PCurve (
const TopAbs_Orientation theOrientation,
const Handle (NCollection_IncAllocator)& theAllocator)
: IMeshData_PCurve (theDFace, theOrientation),
myPoints2d (NCollection_StdAllocator<gp_Pnt2d>(theAllocator)),
myParameters (NCollection_StdAllocator<Standard_Real>(theAllocator)),
myIndices (NCollection_StdAllocator<Standard_Integer>(theAllocator))
myPoints2d (NCollection_OccAllocator<gp_Pnt2d>(theAllocator)),
myParameters (NCollection_OccAllocator<Standard_Real>(theAllocator)),
myIndices (NCollection_OccAllocator<Standard_Integer>(theAllocator))
{
}

@ -4720,7 +4720,7 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
const TopoDS_Shape& aFR = aItLR.Value();
// Reset the local allocator
anAllocLoc->Reset();
anAllocLoc->Reset(false);
// Find the last splits of the root face, including the ones
// created during MakeVolume operation
TopTools_ListOfShape aLFIm(anAllocLoc);
@ -4739,7 +4739,7 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
}
// Reset the local allocator
anAllocLoc->Reset();
anAllocLoc->Reset(false);
// It is necessary to rebuild the solids, avoiding internal faces
// Map faces to solids
TopTools_IndexedDataMapOfShapeListOfShape aDMFS(1, anAllocLoc);
@ -4787,7 +4787,7 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
//
aLF.Clear();
aDMFS.Clear();
anAllocLoc->Reset();
anAllocLoc->Reset(true);
// the result is non-manifold - resolve it comparing normal
// directions of the offset faces and original faces
@ -4896,7 +4896,7 @@ const TopTools_ListOfShape& BRepOffset_MakeOffset::Generated (const TopoDS_Shape
// Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next())
it.Value().Reverse();
it.ChangeValue().Reverse();
}
}
break;
@ -4951,7 +4951,7 @@ const TopTools_ListOfShape& BRepOffset_MakeOffset::Modified (const TopoDS_Shape&
// Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next())
it.Value().Reverse();
it.ChangeValue().Reverse();
}
}
}

@ -17,13 +17,16 @@
#define _BRepOffset_SimpleOffset_HeaderFile
#include <BRepTools_Modification.hxx>
#include <GeomAbs_Shape.hxx>
#include <Geom2d_Curve.hxx>
#include <Standard_Real.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Type.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <GeomAbs_Shape.hxx>
#include <NCollection_DataMap.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Real.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
class BRepOffset_SimpleOffset;

@ -4016,7 +4016,7 @@ void BRepOffset_Tool::CorrectOrientation(const TopoDS_Shape& SI,
// BRepTopAdaptor_FClass2d FC (TopoDS::Face(FI.Oriented(TopAbs_FORWARD)),
// Precision::Confusion());
for (itE.Initialize(LOE); itE.More(); itE.Next()) {
TopoDS_Shape& OE = itE.Value();
TopoDS_Shape& OE = itE.ChangeValue();
if (NewEdges.Contains(OE)) {
Handle(Geom2d_Curve) CO2d =
BRep_Tool::CurveOnSurface(TopoDS::Edge(OE),OF,f,l);

@ -235,7 +235,7 @@ static void BuildDomains(TopoDS_Face& myFace,
//====================================================
TopTools_ListIteratorOfListOfShape itl(WorkWires);
for (; itl.More(); itl.Next()) {
TopoDS_Wire& W = TopoDS::Wire(itl.Value());
TopoDS_Wire& W = TopoDS::Wire(itl.ChangeValue());
if (W.Closed()){
FR.Add(W);
continue;
@ -291,7 +291,7 @@ static void BuildDomains(TopoDS_Face& myFace,
// for (TopTools_ListIteratorOfListOfShape itF(Faces); itF.More(); itF.Next()) {
TopTools_ListIteratorOfListOfShape itF;
for (itF.Initialize(Faces) ; itF.More(); itF.Next()) {
TopoDS_Face& F = TopoDS::Face(itF.Value());
TopoDS_Face& F = TopoDS::Face(itF.ChangeValue());
BRepAdaptor_Surface S(F,0);
Standard_Real Tol = BRep_Tool::Tolerance(F);
@ -299,7 +299,7 @@ static void BuildDomains(TopoDS_Face& myFace,
TopTools_ListIteratorOfListOfShape itW(LOW);
while (itW.More()) {
TopoDS_Wire& W = TopoDS::Wire(itW.Value());
const TopoDS_Wire& W = TopoDS::Wire(itW.Value());
//=======================================================
// Choice of a point on the wire. + projection on the face.
//=======================================================
@ -409,7 +409,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
for (itOW.Initialize(myLeft); itOW.More(); itOW.Next())
{
BRepFill_OffsetWire& Algo = itOW.Value();
BRepFill_OffsetWire& Algo = itOW.ChangeValue();
Algo.Perform(Abs(Offset),Alt);
if (Algo.IsDone() && !Algo.Shape().IsNull())
{
@ -432,7 +432,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
for(itOW.Initialize(myRight); itOW.More(); itOW.Next())
{
BRepFill_OffsetWire& Algo = itOW.Value();
BRepFill_OffsetWire& Algo = itOW.ChangeValue();
Algo.Perform(Offset,Alt);
if (Algo.IsDone() && !Algo.Shape().IsNull())
@ -494,7 +494,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_MakeOffset::Generated
Algos = &myRight;
}
for (itOW.Initialize(*Algos); itOW.More(); itOW.Next()) {
BRepFill_OffsetWire& OW = itOW.Value();
BRepFill_OffsetWire& OW = itOW.ChangeValue();
TopTools_ListOfShape L;
L = OW.GeneratedShapes(S.Oriented(TopAbs_FORWARD));
myGenerated.Append(L);

@ -109,7 +109,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_MakeThickSolid::Modified (const TopoDS
// Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next())
it.Value().Reverse();
it.ChangeValue().Reverse();
}
}
else if (myLastUsedAlgo == OffsetAlgo_SIMPLE)

@ -23,7 +23,6 @@
#include <BRepPrim_Revolution.hxx>
#include <BRepPrimAPI_MakeOneAxis.hxx>
#include <Standard_Address.hxx>
class Geom_Curve;
class gp_Ax2;

@ -35,6 +35,7 @@
#include <PLib.hxx>
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
#include <math_Vector.hxx>
typedef gp_Pnt Pnt;
typedef gp_Vec Vec;

@ -18,11 +18,10 @@
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Handle(Standard_Type),Handle(BinMDF_ADriver),TColStd_MapTransientHasher> BinMDF_TypeADriverMap;
typedef NCollection_DataMap<Handle(Standard_Type),Handle(BinMDF_ADriver),TColStd_MapTransientHasher>::Iterator BinMDF_DataMapIteratorOfTypeADriverMap;
typedef NCollection_DataMap<Handle(Standard_Type),Handle(BinMDF_ADriver)> BinMDF_TypeADriverMap;
typedef NCollection_DataMap<Handle(Standard_Type),Handle(BinMDF_ADriver)>::Iterator BinMDF_DataMapIteratorOfTypeADriverMap;
#endif

@ -18,12 +18,10 @@
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DoubleMap.hxx>
typedef NCollection_DoubleMap<Handle(Standard_Type),Standard_Integer,TColStd_MapTransientHasher,TColStd_MapIntegerHasher> BinMDF_TypeIdMap;
typedef NCollection_DoubleMap<Handle(Standard_Type),Standard_Integer,TColStd_MapTransientHasher,TColStd_MapIntegerHasher>::Iterator BinMDF_DoubleMapIteratorOfTypeIdMap;
typedef NCollection_DoubleMap<Handle(Standard_Type),Standard_Integer> BinMDF_TypeIdMap;
typedef NCollection_DoubleMap<Handle(Standard_Type),Standard_Integer>::Iterator BinMDF_DoubleMapIteratorOfTypeIdMap;
#endif

@ -276,7 +276,6 @@ void BinMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
if (myIsQuickPart) // enables direct writing of shapes to the stream
aDirectStream = theTarget.GetOStream();
Standard_Integer i = 1;
for (TNaming_Iterator SIterator(aSAtt); SIterator.More(); SIterator.Next()) {
const TopoDS_Shape& anOldShape = SIterator.OldShape();
const TopoDS_Shape& aNewShape = SIterator.NewShape();
@ -296,8 +295,6 @@ void BinMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
else
TranslateTo (aNewShape, theTarget, static_cast<BinTools_ShapeSet*>(aShapeSet));
}
i++;
}
}

@ -32,7 +32,6 @@
#include <BinObjMgt_Position.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Standard_Address.hxx>
class TCollection_AsciiString;
class TCollection_ExtendedString;
class TDF_Label;

@ -18,7 +18,6 @@
#ifndef BinTObjDrivers_HeaderFile
#define BinTObjDrivers_HeaderFile
#include <TObj_Common.hxx>
#include <Standard_GUID.hxx>
class BinMDF_ADriverTable;

@ -18,7 +18,6 @@
#ifndef BinTObjDrivers_DocumentRetrievalDriver_HeaderFile
#define BinTObjDrivers_DocumentRetrievalDriver_HeaderFile
#include <TObj_Common.hxx>
#include <BinLDrivers_DocumentRetrievalDriver.hxx>
#include <BinMDF_ADriverTable.hxx>

@ -18,7 +18,6 @@
#ifndef BinTObjDrivers_DocumentStorageDriver_HeaderFile
#define BinTObjDrivers_DocumentStorageDriver_HeaderFile
#include <TObj_Common.hxx>
#include <BinLDrivers_DocumentStorageDriver.hxx>
#include <BinMDF_ADriverTable.hxx>

@ -18,7 +18,6 @@
#ifndef BinTObjDrivers_IntSparseArrayDriver_HeaderFile
#define BinTObjDrivers_IntSparseArrayDriver_HeaderFile
#include <TObj_Common.hxx>
#include <BinMDF_ADriver.hxx>
class BinTObjDrivers_IntSparseArrayDriver : public BinMDF_ADriver

@ -18,7 +18,6 @@
#ifndef BinTObjDrivers_ModelDriver_HeaderFile
#define BinTObjDrivers_ModelDriver_HeaderFile
#include <TObj_Common.hxx>
#include <BinMDF_ADriver.hxx>
class BinTObjDrivers_ModelDriver : public BinMDF_ADriver

Some files were not shown because too many files have changed in this diff Show More