mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +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:
@@ -14,9 +14,6 @@ STEPConstruct_ExternRefs.cxx
|
||||
STEPConstruct_ExternRefs.hxx
|
||||
STEPConstruct_Part.cxx
|
||||
STEPConstruct_Part.hxx
|
||||
STEPConstruct_PointHasher.cxx
|
||||
STEPConstruct_PointHasher.hxx
|
||||
STEPConstruct_PointHasher.lxx
|
||||
STEPConstruct_Styles.cxx
|
||||
STEPConstruct_Styles.hxx
|
||||
STEPConstruct_Tool.cxx
|
||||
|
@@ -21,8 +21,8 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
typedef NCollection_DataMap<TCollection_AsciiString,Handle(Standard_Transient),TCollection_AsciiString> STEPConstruct_DataMapOfAsciiStringTransient;
|
||||
typedef NCollection_DataMap<TCollection_AsciiString,Handle(Standard_Transient),TCollection_AsciiString>::Iterator STEPConstruct_DataMapIteratorOfDataMapOfAsciiStringTransient;
|
||||
typedef NCollection_DataMap<TCollection_AsciiString,Handle(Standard_Transient)> STEPConstruct_DataMapOfAsciiStringTransient;
|
||||
typedef NCollection_DataMap<TCollection_AsciiString,Handle(Standard_Transient)>::Iterator STEPConstruct_DataMapIteratorOfDataMapOfAsciiStringTransient;
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -19,11 +19,10 @@
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <STEPConstruct_PointHasher.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
typedef NCollection_DataMap<gp_Pnt,Handle(Standard_Transient),STEPConstruct_PointHasher> STEPConstruct_DataMapOfPointTransient;
|
||||
typedef NCollection_DataMap<gp_Pnt,Handle(Standard_Transient),STEPConstruct_PointHasher>::Iterator STEPConstruct_DataMapIteratorOfDataMapOfPointTransient;
|
||||
typedef NCollection_DataMap<gp_Pnt,Handle(Standard_Transient)> STEPConstruct_DataMapOfPointTransient;
|
||||
typedef NCollection_DataMap<gp_Pnt,Handle(Standard_Transient)>::Iterator STEPConstruct_DataMapIteratorOfDataMapOfPointTransient;
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,29 +0,0 @@
|
||||
// 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 <gp_Pnt.hxx>
|
||||
#include <STEPConstruct_PointHasher.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_PointHasher::IsEqual(const gp_Pnt& point1,
|
||||
const gp_Pnt& point2)
|
||||
{
|
||||
if(Abs(point1.X()-point2.X()) > Epsilon(point1.X())) return Standard_False;
|
||||
if(Abs(point1.Y()-point2.Y()) > Epsilon(point1.Y())) return Standard_False;
|
||||
if(Abs(point1.Z()-point2.Z()) > Epsilon(point1.Z())) return Standard_False;
|
||||
return Standard_True;
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
// Created on: 2003-01-15
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 2003-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 _STEPConstruct_PointHasher_HeaderFile
|
||||
#define _STEPConstruct_PointHasher_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
|
||||
class STEPConstruct_PointHasher
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Computes a hash code for the point, in the range [1, theUpperBound]
|
||||
//! @param thePoint the point 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 gp_Pnt& thePoint, const Standard_Integer theUpperBound);
|
||||
|
||||
//! Returns True when the two keys are the same. Two
|
||||
//! same keys must have the same hashcode, the
|
||||
//! contrary is not necessary.
|
||||
Standard_EXPORT static Standard_Boolean IsEqual (const gp_Pnt& Point1, const gp_Pnt& Point2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <STEPConstruct_PointHasher.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPConstruct_PointHasher_HeaderFile
|
@@ -1,31 +0,0 @@
|
||||
// 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.
|
||||
|
||||
//=======================================================================
|
||||
// function : HashCode
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer STEPConstruct_PointHasher::HashCode (const gp_Pnt& thePoint,
|
||||
const Standard_Integer theUpperBound)
|
||||
{
|
||||
union
|
||||
{
|
||||
Standard_Real R[3];
|
||||
Standard_Integer I[6];
|
||||
} U;
|
||||
|
||||
thePoint.Coord (U.R[0], U.R[1], U.R[2]);
|
||||
|
||||
return ::HashCode (U.I[0] / 23 + U.I[1] / 19 + U.I[2] / 17 + U.I[3] / 13 + U.I[4] / 11 + U.I[5] / 7, theUpperBound);
|
||||
// return ::HashCode((U.I[0]>>4)+(U.I[1]>>3)+(U.I[2]>>2)+(U.I[3]>>1)+(U.I[4]>>4)+(U.I[5]>>3),theUpperBound);
|
||||
}
|
Reference in New Issue
Block a user