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

0032276: Coding Rules - replace IntTools_CArray1OfReal by NCollection_Array1

IntTools_CArray1OfReal has been replaced by TColStd_Array1OfReal.
IntTools_CArray1OfInteger has been removed (unused).
This commit is contained in:
kgv 2021-04-02 12:35:23 +03:00 committed by bugmaster
parent 5e6e59146f
commit ae64fe0119
23 changed files with 91 additions and 1009 deletions

@ -4,15 +4,9 @@ IntTools_Array1OfRange.hxx
IntTools_Array1OfRoots.hxx IntTools_Array1OfRoots.hxx
IntTools_BaseRangeSample.cxx IntTools_BaseRangeSample.cxx
IntTools_BaseRangeSample.hxx IntTools_BaseRangeSample.hxx
IntTools_BaseRangeSample.lxx
IntTools_BeanFaceIntersector.cxx IntTools_BeanFaceIntersector.cxx
IntTools_BeanFaceIntersector.hxx IntTools_BeanFaceIntersector.hxx
IntTools_CArray1.gxx
IntTools_CArray1.lxx
IntTools_CArray1OfInteger.hxx
IntTools_CArray1OfInteger_0.cxx
IntTools_CArray1OfReal.hxx IntTools_CArray1OfReal.hxx
IntTools_CArray1OfReal_0.cxx
IntTools_CommonPrt.cxx IntTools_CommonPrt.cxx
IntTools_CommonPrt.hxx IntTools_CommonPrt.hxx
IntTools_Context.cxx IntTools_Context.cxx
@ -21,12 +15,9 @@ IntTools_Curve.cxx
IntTools_Curve.hxx IntTools_Curve.hxx
IntTools_CurveRangeLocalizeData.cxx IntTools_CurveRangeLocalizeData.cxx
IntTools_CurveRangeLocalizeData.hxx IntTools_CurveRangeLocalizeData.hxx
IntTools_CurveRangeLocalizeData.lxx
IntTools_CurveRangeSample.cxx IntTools_CurveRangeSample.cxx
IntTools_CurveRangeSample.hxx IntTools_CurveRangeSample.hxx
IntTools_CurveRangeSample.lxx
IntTools_CurveRangeSampleMapHasher.hxx IntTools_CurveRangeSampleMapHasher.hxx
IntTools_CurveRangeSampleMapHasher.lxx
IntTools_DataMapIteratorOfDataMapOfCurveSampleBox.hxx IntTools_DataMapIteratorOfDataMapOfCurveSampleBox.hxx
IntTools_DataMapIteratorOfDataMapOfSurfaceSampleBox.hxx IntTools_DataMapIteratorOfDataMapOfSurfaceSampleBox.hxx
IntTools_DataMapOfCurveSampleBox.hxx IntTools_DataMapOfCurveSampleBox.hxx
@ -52,7 +43,6 @@ IntTools_MapOfCurveSample.hxx
IntTools_MapOfSurfaceSample.hxx IntTools_MapOfSurfaceSample.hxx
IntTools_MarkedRangeSet.cxx IntTools_MarkedRangeSet.cxx
IntTools_MarkedRangeSet.hxx IntTools_MarkedRangeSet.hxx
IntTools_MarkedRangeSet.lxx
IntTools_PntOn2Faces.cxx IntTools_PntOn2Faces.cxx
IntTools_PntOn2Faces.hxx IntTools_PntOn2Faces.hxx
IntTools_PntOnFace.cxx IntTools_PntOnFace.cxx
@ -75,10 +65,9 @@ IntTools_SurfaceRangeSample.cxx
IntTools_SurfaceRangeSample.hxx IntTools_SurfaceRangeSample.hxx
IntTools_SurfaceRangeSample.lxx IntTools_SurfaceRangeSample.lxx
IntTools_SurfaceRangeSampleMapHasher.hxx IntTools_SurfaceRangeSampleMapHasher.hxx
IntTools_SurfaceRangeSampleMapHasher.lxx
IntTools_Tools.cxx IntTools_Tools.cxx
IntTools_Tools.hxx IntTools_Tools.hxx
IntTools_TopolTool.cxx IntTools_TopolTool.cxx
IntTools_TopolTool.hxx IntTools_TopolTool.hxx
IntTools_WLineTool.hxx IntTools_WLineTool.hxx
IntTools_WLineTool.cxx IntTools_WLineTool.cxx

@ -13,6 +13,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <IntTools.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
@ -24,15 +25,14 @@
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <GProp_GProps.hxx> #include <GProp_GProps.hxx>
#include <IntTools.hxx>
#include <IntTools_Array1OfRoots.hxx> #include <IntTools_Array1OfRoots.hxx>
#include <IntTools_CArray1OfReal.hxx>
#include <IntTools_Root.hxx> #include <IntTools_Root.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx> #include <TColStd_ListIteratorOfListOfReal.hxx>
#include <TColStd_ListOfReal.hxx> #include <TColStd_ListOfReal.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <algorithm> #include <algorithm>
//======================================================================= //=======================================================================
//function : IntTools::GetRadius //function : IntTools::GetRadius
//purpose : //purpose :
@ -89,17 +89,17 @@
//function : PrepareArgs //function : PrepareArgs
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer IntTools::PrepareArgs(BRepAdaptor_Curve& C, Standard_Integer IntTools::PrepareArgs (BRepAdaptor_Curve& C,
const Standard_Real Tmax, const Standard_Real Tmax,
const Standard_Real Tmin, const Standard_Real Tmin,
const Standard_Integer Discret, const Standard_Integer Discret,
const Standard_Real Deflection, const Standard_Real Deflection,
IntTools_CArray1OfReal& anArgs) TColStd_Array1OfReal& anArgs)
{ {
TColStd_ListOfReal aPars; TColStd_ListOfReal aPars;
Standard_Real dt, tCurrent, tNext, aR, anAbsDeflection; Standard_Real dt, tCurrent, tNext, aR, anAbsDeflection;
Standard_Integer ip, i, j, aNbDeflectionPoints, aDiscretBis; Standard_Integer ip, i, j, aNbDeflectionPoints;
Standard_Boolean aRFlag; Standard_Boolean aRFlag;
GeomAbs_CurveType aCurveType; GeomAbs_CurveType aCurveType;
@ -150,11 +150,12 @@
} }
aPars.Append(Tmax); aPars.Append(Tmax);
aDiscretBis=aPars.Extent(); const Standard_Integer aDiscretBis = aPars.Extent();
anArgs.Resize(aDiscretBis); anArgs.Resize (0, aDiscretBis - 1, false);
TColStd_ListIteratorOfListOfReal anIt(aPars); TColStd_ListIteratorOfListOfReal anIt(aPars);
for (i=0; anIt.More(); anIt.Next(), i++) { for (i = 0; anIt.More(); anIt.Next(), i++)
anArgs(i)=anIt.Value(); {
anArgs.SetValue (i, anIt.Value());
} }
return 0; return 0;
} }

@ -16,123 +16,43 @@
#ifndef _IntTools_HeaderFile #ifndef _IntTools_HeaderFile
#define _IntTools_HeaderFile #define _IntTools_HeaderFile
#include <Standard.hxx> #include <IntTools_CArray1OfReal.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <IntTools_SequenceOfRoots.hxx> #include <IntTools_SequenceOfRoots.hxx>
#include <Standard_Integer.hxx>
class TopoDS_Edge; class TopoDS_Edge;
class gp_Pnt; class gp_Pnt;
class Geom_Curve; class Geom_Curve;
class BRepAdaptor_Curve; class BRepAdaptor_Curve;
class IntTools_CArray1OfReal;
class IntTools_Context;
class IntTools_ShrunkRange;
class IntTools_Range;
class IntTools_CommonPrt;
class IntTools_Root;
class IntTools_EdgeEdge;
class IntTools_EdgeFace;
class IntTools_FClass2d;
class IntTools_MarkedRangeSet;
class IntTools_BaseRangeSample;
class IntTools_CurveRangeSample;
class IntTools_SurfaceRangeSample;
class IntTools_CurveRangeLocalizeData;
class IntTools_SurfaceRangeLocalizeData;
class IntTools_BeanFaceIntersector;
class IntTools_Curve;
class IntTools_PntOnFace;
class IntTools_PntOn2Faces;
class IntTools_TopolTool;
class IntTools_FaceFace;
class IntTools_Tools;
class IntTools_CArray1;
class IntTools_CArray1OfInteger;
class IntTools_CArray1OfReal;
class IntTools_CurveRangeSampleMapHasher;
class IntTools_SurfaceRangeSampleMapHasher;
//! Contains classes for intersection and classification purposes and accompanying classes.
//! Contains classes for intersection and classification
//! purposes and accompanying classes
class IntTools class IntTools
{ {
public: public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! returns the length of the edge; //! returns the length of the edge;
Standard_EXPORT static Standard_Real Length (const TopoDS_Edge& E); Standard_EXPORT static Standard_Real Length (const TopoDS_Edge& E);
//! Remove from the sequence aSeq the Roots that have //! Remove from the sequence aSeq the Roots that have
//! values ti and tj such as |ti-tj] < anEpsT. //! values ti and tj such as |ti-tj] < anEpsT.
Standard_EXPORT static void RemoveIdenticalRoots (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsT); Standard_EXPORT static void RemoveIdenticalRoots (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsT);
//! Sort the sequence aSeq of the Roots to arrange the //! Sort the sequence aSeq of the Roots to arrange the Roots in increasing order.
//! Roons in increasing order
Standard_EXPORT static void SortRoots (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsT); Standard_EXPORT static void SortRoots (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsT);
//! Find the states (before and after) for each Root //! Find the states (before and after) for each Root from the sequence aSeq
//! from the sequence aSeq
Standard_EXPORT static void FindRootStates (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsNull); Standard_EXPORT static void FindRootStates (IntTools_SequenceOfRoots& aSeq, const Standard_Real anEpsNull);
Standard_EXPORT static Standard_Integer Parameter (const gp_Pnt& P, const Handle(Geom_Curve)& Curve, Standard_Real& aParm); Standard_EXPORT static Standard_Integer Parameter (const gp_Pnt& P, const Handle(Geom_Curve)& Curve, Standard_Real& aParm);
Standard_EXPORT static Standard_Integer GetRadius (const BRepAdaptor_Curve& C, const Standard_Real t1, const Standard_Real t3, Standard_Real& R); Standard_EXPORT static Standard_Integer GetRadius (const BRepAdaptor_Curve& C, const Standard_Real t1, const Standard_Real t3, Standard_Real& R);
Standard_EXPORT static Standard_Integer PrepareArgs (BRepAdaptor_Curve& C, const Standard_Real tMax, const Standard_Real tMin, const Standard_Integer Discret, const Standard_Real Deflect, IntTools_CArray1OfReal& anArgs);
Standard_EXPORT static Standard_Integer PrepareArgs (BRepAdaptor_Curve& C,
const Standard_Real tMax, const Standard_Real tMin,
const Standard_Integer Discret, const Standard_Real Deflect,
protected: TColStd_Array1OfReal& anArgs);
private:
friend class IntTools_Context;
friend class IntTools_ShrunkRange;
friend class IntTools_Range;
friend class IntTools_CommonPrt;
friend class IntTools_Root;
friend class IntTools_EdgeEdge;
friend class IntTools_EdgeFace;
friend class IntTools_FClass2d;
friend class IntTools_MarkedRangeSet;
friend class IntTools_BaseRangeSample;
friend class IntTools_CurveRangeSample;
friend class IntTools_SurfaceRangeSample;
friend class IntTools_CurveRangeLocalizeData;
friend class IntTools_SurfaceRangeLocalizeData;
friend class IntTools_BeanFaceIntersector;
friend class IntTools_Curve;
friend class IntTools_PntOnFace;
friend class IntTools_PntOn2Faces;
friend class IntTools_TopolTool;
friend class IntTools_FaceFace;
friend class IntTools_Tools;
friend class IntTools_CArray1;
friend class IntTools_CArray1OfInteger;
friend class IntTools_CArray1OfReal;
friend class IntTools_CurveRangeSampleMapHasher;
friend class IntTools_SurfaceRangeSampleMapHasher;
}; };
#endif // _IntTools_HeaderFile #endif // _IntTools_HeaderFile

@ -19,10 +19,8 @@
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
//! base class for range index management //! base class for range index management
class IntTools_BaseRangeSample class IntTools_BaseRangeSample
{ {
@ -30,38 +28,18 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
Standard_EXPORT IntTools_BaseRangeSample(); Standard_EXPORT IntTools_BaseRangeSample();
Standard_EXPORT IntTools_BaseRangeSample(const Standard_Integer theDepth); Standard_EXPORT IntTools_BaseRangeSample(const Standard_Integer theDepth);
void SetDepth (const Standard_Integer theDepth);
Standard_Integer GetDepth() const;
protected:
void SetDepth (const Standard_Integer theDepth) { myDepth = theDepth; }
Standard_Integer GetDepth() const { return myDepth; }
private: private:
Standard_Integer myDepth; Standard_Integer myDepth;
}; };
#include <IntTools_BaseRangeSample.lxx>
#endif // _IntTools_BaseRangeSample_HeaderFile #endif // _IntTools_BaseRangeSample_HeaderFile

@ -1,25 +0,0 @@
// Created on: 2005-10-05
// Created by: Mikhail KLOKOV
// Copyright (c) 2005-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.
inline void IntTools_BaseRangeSample::SetDepth(const Standard_Integer theDepth)
{
myDepth = theDepth;
}
inline Standard_Integer IntTools_BaseRangeSample::GetDepth() const
{
return myDepth;
}

@ -1,169 +0,0 @@
// Created on: 2000-05-26
// Created by: Peter KURNEV
// Copyright (c) 2000-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 : IntTools_CArray1
//purpose :
//=======================================================================
IntTools_CArray1::IntTools_CArray1 (const Standard_Integer Length):
myStart(NULL),
myLength(0),
myIsAllocated(Standard_False)
{
Resize(Length);
}
//=======================================================================
//function : IntTools_CArray1
//purpose :
//=======================================================================
IntTools_CArray1::IntTools_CArray1 (const Array1Item& Item,
const Standard_Integer Length):
myLength(Length),
myIsAllocated(Standard_False)
{
Standard_ConstructionError_Raise_if(Length < 0,"IntTools_CArray1:: Length < 0");
myStart = (void*)(&Item);
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void IntTools_CArray1::Init (const Array1Item& V)
{
Array1Item* p = (Array1Item*) myStart;
for(Standard_Integer i = 0; i < Length() ; i++) {
*p++ = V;
}
}
//=======================================================================
//function : Destroy
//purpose :
//=======================================================================
void IntTools_CArray1::Destroy()
{
if (myIsAllocated) {
delete [] (Array1Item *)myStart;
myIsAllocated = Standard_False;
}
myStart = NULL;
}
//=======================================================================
//function : IsEqual
//purpose :
//=======================================================================
Standard_Boolean IntTools_CArray1::IsEqual(const IntTools_CArray1& Other) const
{
if (&Other == this)
return Standard_True;
else if (Length() != Other.Length())
return Standard_False;
else if (Length() == 0)
return Standard_True;
//
return Standard_False;
}
//=======================================================================
//function : Resize
//purpose :
//=======================================================================
void IntTools_CArray1::Resize(const Standard_Integer theNewLength)
{
Standard_ConstructionError_Raise_if(theNewLength < 0,"IntTools_CArray1: length < 0");
Array1Item* p = NULL;
Destroy();
myLength = theNewLength;
if (theNewLength > 0) {
// default creator called for each item of the array
p = new Array1Item[theNewLength];
if (!p) throw Standard_OutOfMemory("IntTools_CArray1 : Allocation failed.");
myIsAllocated = Standard_True;
}
myStart = (void*) p;
}
//=======================================================================
//function : Append
//purpose :
//=======================================================================
void IntTools_CArray1::Append (const Array1Item& Value)
{
const Standard_Integer theNewLength=myLength+1;
Array1Item* p = NULL;
if (theNewLength > 0) {
// default creator called for each item of the array
p = new Array1Item[theNewLength];
if (!p) throw Standard_OutOfMemory("IntTools_CArray1 : Allocation failed.");
if (myLength!=0) {
Standard_Integer aBytesPerItem=sizeof(Array1Item);
memcpy (p, myStart, myLength*aBytesPerItem);
}
*(p+myLength)=Value;
Destroy();
myLength = theNewLength;
myIsAllocated = Standard_True;
}
myStart = (void*) p;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
const Array1Item& IntTools_CArray1::Value(const Standard_Integer Index) const
{
if (myLength <1 || Index < 0 || Index >= myLength)
throw Standard_OutOfRange("IntTools_CArray1::Value");
return ((Array1Item *)myStart)[Index];
}
//=======================================================================
//function : SetValue
//purpose :
//=======================================================================
void IntTools_CArray1::SetValue (const Standard_Integer Index,
const Array1Item& Value)
{
ChangeValue(Index) = Value;
}
//=======================================================================
//function : ChangeValue
//purpose :
//=======================================================================
Array1Item& IntTools_CArray1::ChangeValue(const Standard_Integer Index)
{
if (myLength < 1 || Index < 0 || Index >= myLength)
throw Standard_OutOfRange("IntTools_CArray1::ChangeValue");
return ((Array1Item *)myStart)[Index];
}

@ -1,26 +0,0 @@
// Created on: 2000-05-26
// Created by: Peter KURNEV
// Copyright (c) 2000-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 <Standard_OutOfRange.hxx>
//=======================================================================
//function : Length
//purpose :
//=======================================================================
inline Standard_Integer IntTools_CArray1::Length() const
{
return myLength;
}

@ -1,153 +0,0 @@
// Created on: 2000-05-18
// Created by: Peter KURNEV
// Copyright (c) 2000-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 _IntTools_CArray1OfInteger_HeaderFile
#define _IntTools_CArray1OfInteger_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Address.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Standard_ConstructionError;
class Standard_OutOfRange;
class Standard_OutOfMemory;
class IntTools_CArray1OfInteger
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an array of given Length.
Standard_EXPORT IntTools_CArray1OfInteger(const Standard_Integer Length = 0);
//! Creates an array sharing datas with an other.
//! Example:
//! Item tab[100];
//! CArray1OfItem thetab (tab[0],100);
//!
//! CArray1OfItem aArray1(100);
//! CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length());
//!
//! Warning:
//! The validity of length are under the responsibility
//! of the user.
//! The sahred array must have a valid address during the life of
//! the Array1.
Standard_EXPORT IntTools_CArray1OfInteger(const Standard_Integer& Item, const Standard_Integer Length);
//! Initializes the array with a given value.
Standard_EXPORT void Init (const Standard_Integer& V);
//! destroy current content and realloc the new size
//! does nothing if Length() == theLength
Standard_EXPORT void Resize (const Standard_Integer theNewLength);
//! Frees the allocated area corresponding to the
//! array.
Standard_EXPORT void Destroy();
~IntTools_CArray1OfInteger()
{
Destroy();
}
//! Returns the number of elements of <me>.
Standard_Integer Length() const;
Standard_EXPORT void Append (const Standard_Integer& Value);
//! Sets the <Index>th element of the array to
//! <Value>.
Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Integer& Value);
//! Returns the value of the <Index>th element of the
//! array.
Standard_EXPORT const Standard_Integer& Value (const Standard_Integer Index) const;
const Standard_Integer& operator () (const Standard_Integer Index) const
{
return Value(Index);
}
//! Returns the value of the <Index>th element of the
//! array.
Standard_EXPORT Standard_Integer& ChangeValue (const Standard_Integer Index);
Standard_Integer& operator () (const Standard_Integer Index)
{
return ChangeValue(Index);
}
//! Applyies the == operator on each array item
Standard_EXPORT Standard_Boolean IsEqual (const IntTools_CArray1OfInteger& Other) const;
Standard_Boolean operator == (const IntTools_CArray1OfInteger& Other) const
{
return IsEqual(Other);
}
protected:
private:
//! Prohibits the creator by copy
Standard_EXPORT IntTools_CArray1OfInteger(const IntTools_CArray1OfInteger& AnArray);
Standard_Address myStart;
Standard_Integer myLength;
Standard_Boolean myIsAllocated;
};
#define Array1Item Standard_Integer
#define Array1Item_hxx <Standard_Integer.hxx>
#define IntTools_CArray1 IntTools_CArray1OfInteger
#define IntTools_CArray1_hxx <IntTools_CArray1OfInteger.hxx>
#include <IntTools_CArray1.lxx>
#undef Array1Item
#undef Array1Item_hxx
#undef IntTools_CArray1
#undef IntTools_CArray1_hxx
#endif // _IntTools_CArray1OfInteger_HeaderFile

@ -1,28 +0,0 @@
// Created on: 2000-05-18
// Created by: Peter KURNEV
// Copyright (c) 2000-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 <IntTools_CArray1OfInteger.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_OutOfMemory.hxx>
#define Array1Item Standard_Integer
#define Array1Item_hxx <Standard_Integer.hxx>
#define IntTools_CArray1 IntTools_CArray1OfInteger
#define IntTools_CArray1_hxx <IntTools_CArray1OfInteger.hxx>
#include <IntTools_CArray1.gxx>

@ -16,139 +16,9 @@
#ifndef _IntTools_CArray1OfReal_HeaderFile #ifndef _IntTools_CArray1OfReal_HeaderFile
#define _IntTools_CArray1OfReal_HeaderFile #define _IntTools_CArray1OfReal_HeaderFile
#include <Standard.hxx> #include <TColStd_Array1OfReal.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Address.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Standard_ConstructionError;
class Standard_OutOfRange;
class Standard_OutOfMemory;
class IntTools_CArray1OfReal
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an array of given Length.
Standard_EXPORT IntTools_CArray1OfReal(const Standard_Integer Length = 0);
//! Creates an array sharing datas with an other.
//! Example:
//! Item tab[100];
//! CArray1OfItem thetab (tab[0],100);
//!
//! CArray1OfItem aArray1(100);
//! CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length());
//!
//! Warning:
//! The validity of length are under the responsibility
//! of the user.
//! The sahred array must have a valid address during the life of
//! the Array1.
Standard_EXPORT IntTools_CArray1OfReal(const Standard_Real& Item, const Standard_Integer Length);
//! Initializes the array with a given value.
Standard_EXPORT void Init (const Standard_Real& V);
//! destroy current content and realloc the new size
//! does nothing if Length() == theLength
Standard_EXPORT void Resize (const Standard_Integer theNewLength);
//! Frees the allocated area corresponding to the
//! array.
Standard_EXPORT void Destroy();
~IntTools_CArray1OfReal()
{
Destroy();
}
//! Returns the number of elements of <me>.
Standard_Integer Length() const;
Standard_EXPORT void Append (const Standard_Real& Value);
//! Sets the <Index>th element of the array to
//! <Value>.
Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Real& Value);
//! Returns the value of the <Index>th element of the
//! array.
Standard_EXPORT const Standard_Real& Value (const Standard_Integer Index) const;
const Standard_Real& operator () (const Standard_Integer Index) const
{
return Value(Index);
}
//! Returns the value of the <Index>th element of the
//! array.
Standard_EXPORT Standard_Real& ChangeValue (const Standard_Integer Index);
Standard_Real& operator () (const Standard_Integer Index)
{
return ChangeValue(Index);
}
//! Applies the == operator on each array item
Standard_EXPORT Standard_Boolean IsEqual (const IntTools_CArray1OfReal& Other) const;
Standard_Boolean operator == (const IntTools_CArray1OfReal& Other) const
{
return IsEqual(Other);
}
protected:
private:
//! Prohibits the creator by copy
Standard_EXPORT IntTools_CArray1OfReal(const IntTools_CArray1OfReal& AnArray);
Standard_Address myStart;
Standard_Integer myLength;
Standard_Boolean myIsAllocated;
};
#define Array1Item Standard_Real
#define Array1Item_hxx <Standard_Real.hxx>
#define IntTools_CArray1 IntTools_CArray1OfReal
#define IntTools_CArray1_hxx <IntTools_CArray1OfReal.hxx>
#include <IntTools_CArray1.lxx>
#undef Array1Item
#undef Array1Item_hxx
#undef IntTools_CArray1
#undef IntTools_CArray1_hxx
Standard_DEPRECATED("Deprecated alias - TColStd_Array1OfReal should be used instead")
typedef TColStd_Array1OfReal IntTools_CArray1OfReal;
#endif // _IntTools_CArray1OfReal_HeaderFile #endif // _IntTools_CArray1OfReal_HeaderFile

@ -1,28 +0,0 @@
// Created on: 2000-05-18
// Created by: Peter KURNEV
// Copyright (c) 2000-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 <IntTools_CArray1OfReal.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_OutOfMemory.hxx>
#define Array1Item Standard_Real
#define Array1Item_hxx <Standard_Real.hxx>
#define IntTools_CArray1 IntTools_CArray1OfReal
#define IntTools_CArray1_hxx <IntTools_CArray1OfReal.hxx>
#include <IntTools_CArray1.gxx>

@ -19,18 +19,14 @@
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
#include <IntTools_MapOfCurveSample.hxx> #include <IntTools_MapOfCurveSample.hxx>
#include <IntTools_DataMapOfCurveSampleBox.hxx> #include <IntTools_DataMapOfCurveSampleBox.hxx>
#include <Standard_Boolean.hxx>
#include <IntTools_ListOfCurveRangeSample.hxx> #include <IntTools_ListOfCurveRangeSample.hxx>
class IntTools_CurveRangeSample; class IntTools_CurveRangeSample;
class Bnd_Box; class Bnd_Box;
class IntTools_CurveRangeLocalizeData class IntTools_CurveRangeLocalizeData
{ {
public: public:
@ -40,46 +36,27 @@ public:
Standard_EXPORT IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample, const Standard_Real theMinRange); Standard_EXPORT IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample, const Standard_Real theMinRange);
Standard_Integer GetNbSample() const; Standard_Integer GetNbSample() const { return myNbSampleC; }
Standard_Real GetMinRange() const; Standard_Real GetMinRange() const { return myMinRangeC; }
Standard_EXPORT void AddOutRange (const IntTools_CurveRangeSample& theRange); Standard_EXPORT void AddOutRange (const IntTools_CurveRangeSample& theRange);
Standard_EXPORT void AddBox (const IntTools_CurveRangeSample& theRange, const Bnd_Box& theBox); Standard_EXPORT void AddBox (const IntTools_CurveRangeSample& theRange, const Bnd_Box& theBox);
Standard_EXPORT Standard_Boolean FindBox (const IntTools_CurveRangeSample& theRange, Bnd_Box& theBox) const; Standard_EXPORT Standard_Boolean FindBox (const IntTools_CurveRangeSample& theRange, Bnd_Box& theBox) const;
Standard_EXPORT Standard_Boolean IsRangeOut (const IntTools_CurveRangeSample& theRange) const; Standard_EXPORT Standard_Boolean IsRangeOut (const IntTools_CurveRangeSample& theRange) const;
Standard_EXPORT void ListRangeOut (IntTools_ListOfCurveRangeSample& theList) const; Standard_EXPORT void ListRangeOut (IntTools_ListOfCurveRangeSample& theList) const;
protected:
private: private:
Standard_Integer myNbSampleC; Standard_Integer myNbSampleC;
Standard_Real myMinRangeC; Standard_Real myMinRangeC;
IntTools_MapOfCurveSample myMapRangeOut; IntTools_MapOfCurveSample myMapRangeOut;
IntTools_DataMapOfCurveSampleBox myMapBox; IntTools_DataMapOfCurveSampleBox myMapBox;
}; };
#include <IntTools_CurveRangeLocalizeData.lxx>
#endif // _IntTools_CurveRangeLocalizeData_HeaderFile #endif // _IntTools_CurveRangeLocalizeData_HeaderFile

@ -1,27 +0,0 @@
// Created on: 2005-10-14
// Created by: Mikhail KLOKOV
// Copyright (c) 2005-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.
inline Standard_Integer IntTools_CurveRangeLocalizeData::GetNbSample() const
{
return myNbSampleC;
}
inline Standard_Real IntTools_CurveRangeLocalizeData::GetMinRange() const
{
return myMinRangeC;
}

@ -24,8 +24,8 @@
#include <IntTools_BaseRangeSample.hxx> #include <IntTools_BaseRangeSample.hxx>
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#include <Standard_Real.hxx> #include <Standard_Real.hxx>
class IntTools_Range;
class IntTools_Range;
//! class for range index management of curve //! class for range index management of curve
class IntTools_CurveRangeSample : public IntTools_BaseRangeSample class IntTools_CurveRangeSample : public IntTools_BaseRangeSample
@ -39,39 +39,26 @@ public:
Standard_EXPORT IntTools_CurveRangeSample(const Standard_Integer theIndex); Standard_EXPORT IntTools_CurveRangeSample(const Standard_Integer theIndex);
void SetRangeIndex (const Standard_Integer theIndex); void SetRangeIndex (const Standard_Integer theIndex) { myIndex = theIndex; }
Standard_Integer GetRangeIndex() const; Standard_Integer GetRangeIndex() const { return myIndex; }
Standard_Boolean IsEqual (const IntTools_CurveRangeSample& Other) const; Standard_Boolean IsEqual (const IntTools_CurveRangeSample& Other) const
{
return ((myIndex == Other.myIndex) && (GetDepth() == Other.GetDepth()));
}
Standard_EXPORT IntTools_Range GetRange (const Standard_Real theFirst, const Standard_Real theLast, const Standard_Integer theNbSample) const; Standard_EXPORT IntTools_Range GetRange (const Standard_Real theFirst, const Standard_Real theLast, const Standard_Integer theNbSample) const;
Standard_Integer GetRangeIndexDeeper (const Standard_Integer theNbSample) const; Standard_Integer GetRangeIndexDeeper (const Standard_Integer theNbSample) const
{
return myIndex * theNbSample;
}
protected:
private: private:
Standard_Integer myIndex; Standard_Integer myIndex;
}; };
#include <IntTools_CurveRangeSample.lxx>
#endif // _IntTools_CurveRangeSample_HeaderFile #endif // _IntTools_CurveRangeSample_HeaderFile

@ -1,36 +0,0 @@
// Created on: 2005-10-05
// Created by: Mikhail KLOKOV
// Copyright (c) 2005-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.
inline void IntTools_CurveRangeSample::SetRangeIndex(const Standard_Integer theIndex)
{
myIndex = theIndex;
}
inline Standard_Integer IntTools_CurveRangeSample::GetRangeIndex() const
{
return myIndex;
}
inline Standard_Boolean IntTools_CurveRangeSample::IsEqual(const IntTools_CurveRangeSample& Other) const
{
return ((myIndex == Other.myIndex) && (GetDepth() == Other.GetDepth()));
}
inline Standard_Integer IntTools_CurveRangeSample::GetRangeIndexDeeper(const Standard_Integer theNbSample) const
{
return myIndex * theNbSample;
}

@ -16,14 +16,11 @@
#ifndef _IntTools_CurveRangeSampleMapHasher_HeaderFile #ifndef _IntTools_CurveRangeSampleMapHasher_HeaderFile
#define _IntTools_CurveRangeSampleMapHasher_HeaderFile #define _IntTools_CurveRangeSampleMapHasher_HeaderFile
#include <IntTools_CurveRangeSample.hxx>
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class IntTools_CurveRangeSample;
//! class for range index management of curve //! class for range index management of curve
class IntTools_CurveRangeSampleMapHasher class IntTools_CurveRangeSampleMapHasher
@ -36,35 +33,19 @@ public:
//! @param theKey the key which hash code is to be computed //! @param theKey the key which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within //! @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] //! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const IntTools_CurveRangeSample& theKey, const Standard_Integer theUpperBound); static Standard_Integer HashCode (const IntTools_CurveRangeSample& theKey, const Standard_Integer theUpperBound)
{
return ::HashCode(theKey.GetDepth(), theUpperBound);
}
//! Returns True when the two keys are the same. Two //! Returns True when the two keys are the same. Two
//! same keys must have the same hashcode, the //! same keys must have the same hashcode, the
//! contrary is not necessary. //! contrary is not necessary.
static Standard_Boolean IsEqual (const IntTools_CurveRangeSample& S1, const IntTools_CurveRangeSample& S2); static Standard_Boolean IsEqual (const IntTools_CurveRangeSample& S1, const IntTools_CurveRangeSample& S2)
{
return S1.IsEqual(S2);
}
protected:
private:
}; };
#include <IntTools_CurveRangeSampleMapHasher.lxx>
#endif // _IntTools_CurveRangeSampleMapHasher_HeaderFile #endif // _IntTools_CurveRangeSampleMapHasher_HeaderFile

@ -1,29 +0,0 @@
// Created on: 2005-10-14
// Created by: Mikhail KLOKOV
// Copyright (c) 2005-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 IntTools_CurveRangeSampleMapHasher::HashCode (const IntTools_CurveRangeSample& theKey,
const Standard_Integer theUpperBound)
{
return ::HashCode(theKey.GetDepth(), theUpperBound);
}
inline Standard_Boolean IntTools_CurveRangeSampleMapHasher::IsEqual(const IntTools_CurveRangeSample& S1,
const IntTools_CurveRangeSample& S2) {
return S1.IsEqual(S2);
}

@ -39,7 +39,6 @@
#include <IntCurveSurface_IntersectionPoint.hxx> #include <IntCurveSurface_IntersectionPoint.hxx>
#include <IntTools.hxx> #include <IntTools.hxx>
#include <IntTools_BeanFaceIntersector.hxx> #include <IntTools_BeanFaceIntersector.hxx>
#include <IntTools_CArray1OfInteger.hxx>
#include <IntTools_CommonPrt.hxx> #include <IntTools_CommonPrt.hxx>
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <IntTools_FClass2d.hxx> #include <IntTools_FClass2d.hxx>

@ -11,9 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <IntTools_CArray1OfReal.hxx>
#include <IntTools_MarkedRangeSet.hxx> #include <IntTools_MarkedRangeSet.hxx>
#include <IntTools_Range.hxx> #include <IntTools_Range.hxx>
IntTools_MarkedRangeSet::IntTools_MarkedRangeSet() : IntTools_MarkedRangeSet::IntTools_MarkedRangeSet() :
@ -28,9 +27,8 @@ IntTools_MarkedRangeSet::IntTools_MarkedRangeSet(const Standard_Real theFirst
SetBoundaries(theFirstBoundary, theLastBoundary, theInitFlag); SetBoundaries(theFirstBoundary, theLastBoundary, theInitFlag);
} }
IntTools_MarkedRangeSet::IntTools_MarkedRangeSet(const IntTools_CArray1OfReal& theSortedArray, IntTools_MarkedRangeSet::IntTools_MarkedRangeSet (const TColStd_Array1OfReal& theSortedArray,
const Standard_Integer theInitFlag) const Standard_Integer theInitFlag)
{ {
SetRanges(theSortedArray, theInitFlag); SetRanges(theSortedArray, theInitFlag);
} }
@ -47,19 +45,19 @@ void IntTools_MarkedRangeSet::SetBoundaries(const Standard_Real theFirstBound
myFlags.Append(theInitFlag); myFlags.Append(theInitFlag);
} }
void IntTools_MarkedRangeSet::SetRanges(const IntTools_CArray1OfReal& theSortedArray, void IntTools_MarkedRangeSet::SetRanges (const TColStd_Array1OfReal& theSortedArray,
const Standard_Integer theInitFlag) const Standard_Integer theInitFlag)
{ {
myRangeSetStorer.Clear(); myRangeSetStorer.Clear();
myFlags.Clear(); myFlags.Clear();
Standard_Integer i = 0; for (TColStd_Array1OfReal::Iterator aRangeIter (theSortedArray); aRangeIter.More(); aRangeIter.Next())
{
for(i = 0; i < theSortedArray.Length(); i++) { myRangeSetStorer.Append (aRangeIter.Value());
myRangeSetStorer.Append(theSortedArray(i));
} }
myRangeNumber = myRangeSetStorer.Length() - 1; myRangeNumber = myRangeSetStorer.Length() - 1;
for(i = 1; i <= myRangeNumber; i++) { for (Standard_Integer i = 1; i <= myRangeNumber; i++)
{
myFlags.Append(theInitFlag); myFlags.Append(theInitFlag);
} }
} }

@ -16,18 +16,11 @@
#ifndef _IntTools_MarkedRangeSet_HeaderFile #ifndef _IntTools_MarkedRangeSet_HeaderFile
#define _IntTools_MarkedRangeSet_HeaderFile #define _IntTools_MarkedRangeSet_HeaderFile
#include <Standard.hxx> #include <IntTools_CArray1OfReal.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_SequenceOfReal.hxx> #include <TColStd_SequenceOfReal.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_SequenceOfInteger.hxx> #include <TColStd_SequenceOfInteger.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class IntTools_CArray1OfReal;
class IntTools_Range;
class IntTools_Range;
//! class MarkedRangeSet provides continuous set of ranges marked with flags //! class MarkedRangeSet provides continuous set of ranges marked with flags
class IntTools_MarkedRangeSet class IntTools_MarkedRangeSet
@ -36,8 +29,6 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Empty constructor //! Empty constructor
Standard_EXPORT IntTools_MarkedRangeSet(); Standard_EXPORT IntTools_MarkedRangeSet();
@ -52,7 +43,7 @@ public:
//! Warning: //! Warning:
//! The constructor do not check if the values of array are not sorted //! The constructor do not check if the values of array are not sorted
//! It should be checked before function invocation //! It should be checked before function invocation
Standard_EXPORT IntTools_MarkedRangeSet(const IntTools_CArray1OfReal& theSortedArray, const Standard_Integer theInitFlag); Standard_EXPORT IntTools_MarkedRangeSet(const TColStd_Array1OfReal& theSortedArray, const Standard_Integer theInitFlag);
//! build set of ranges which consists of one range with //! build set of ranges which consists of one range with
@ -65,7 +56,7 @@ public:
//! Warning: //! Warning:
//! The function do not check if the values of array are not sorted //! The function do not check if the values of array are not sorted
//! It should be checked before function invocation //! It should be checked before function invocation
Standard_EXPORT void SetRanges (const IntTools_CArray1OfReal& theSortedArray, const Standard_Integer theInitFlag); Standard_EXPORT void SetRanges (const TColStd_Array1OfReal& theSortedArray, const Standard_Integer theInitFlag);
//! Inserts a new range marked with flag theFlag //! Inserts a new range marked with flag theFlag
@ -123,42 +114,21 @@ public:
//! can be equal to theValue, otherwise upper boundary of the range //! can be equal to theValue, otherwise upper boundary of the range
//! can be equal to theValue. //! can be equal to theValue.
Standard_EXPORT Standard_Integer GetIndex (const Standard_Real theValue, const Standard_Boolean UseLower) const; Standard_EXPORT Standard_Integer GetIndex (const Standard_Real theValue, const Standard_Boolean UseLower) const;
//! Returns number of ranges //! Returns number of ranges
Standard_Integer Length() const; Standard_Integer Length() const { return myRangeNumber; }
//! Returns the range with index theIndex. //! Returns the range with index theIndex.
//! the Index can be from 1 to Length() //! the Index can be from 1 to Length()
Standard_EXPORT IntTools_Range Range (const Standard_Integer theIndex) const; Standard_EXPORT IntTools_Range Range (const Standard_Integer theIndex) const;
protected:
private: private:
TColStd_SequenceOfReal myRangeSetStorer; TColStd_SequenceOfReal myRangeSetStorer;
Standard_Integer myRangeNumber; Standard_Integer myRangeNumber;
TColStd_SequenceOfInteger myFlags; TColStd_SequenceOfInteger myFlags;
TColStd_SequenceOfInteger myFoundIndices; TColStd_SequenceOfInteger myFoundIndices;
}; };
#include <IntTools_MarkedRangeSet.lxx>
#endif // _IntTools_MarkedRangeSet_HeaderFile #endif // _IntTools_MarkedRangeSet_HeaderFile

@ -1,17 +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.
inline Standard_Integer IntTools_MarkedRangeSet::Length() const
{
return myRangeNumber;
}

@ -16,15 +16,11 @@
#ifndef _IntTools_SurfaceRangeSampleMapHasher_HeaderFile #ifndef _IntTools_SurfaceRangeSampleMapHasher_HeaderFile
#define _IntTools_SurfaceRangeSampleMapHasher_HeaderFile #define _IntTools_SurfaceRangeSampleMapHasher_HeaderFile
#include <IntTools_SurfaceRangeSample.hxx>
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class IntTools_SurfaceRangeSample;
class IntTools_SurfaceRangeSampleMapHasher class IntTools_SurfaceRangeSampleMapHasher
{ {
@ -36,35 +32,19 @@ public:
//! @param theKey the key which hash code is to be computed //! @param theKey the key which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within //! @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] //! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const IntTools_SurfaceRangeSample& theKey, Standard_Integer theUpperBound); static Standard_Integer HashCode (const IntTools_SurfaceRangeSample& theKey, Standard_Integer theUpperBound)
{
return ::HashCode (theKey.GetIndexU() * theKey.GetIndexV(), theUpperBound);
}
//! Returns True when the two keys are the same. Two //! Returns True when the two keys are the same. Two
//! same keys must have the same hashcode, the //! same keys must have the same hashcode, the
//! contrary is not necessary. //! contrary is not necessary.
static Standard_Boolean IsEqual (const IntTools_SurfaceRangeSample& S1, const IntTools_SurfaceRangeSample& S2); static Standard_Boolean IsEqual (const IntTools_SurfaceRangeSample& S1, const IntTools_SurfaceRangeSample& S2)
{
return S1.IsEqual(S2);
}
protected:
private:
}; };
#include <IntTools_SurfaceRangeSampleMapHasher.lxx>
#endif // _IntTools_SurfaceRangeSampleMapHasher_HeaderFile #endif // _IntTools_SurfaceRangeSampleMapHasher_HeaderFile

@ -1,30 +0,0 @@
// Created on: 2005-10-14
// Created by: Mikhail KLOKOV
// Copyright (c) 2005-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 IntTools_SurfaceRangeSampleMapHasher::HashCode (const IntTools_SurfaceRangeSample& theKey,
const Standard_Integer theUpperBound)
{
// return (((K.GetDepthU() % Upper) ^ (K.GetDepthV() % Upper)) % Upper);
return ::HashCode (theKey.GetIndexU() * theKey.GetIndexV(), theUpperBound);
}
inline Standard_Boolean IntTools_SurfaceRangeSampleMapHasher::IsEqual(const IntTools_SurfaceRangeSample& S1,
const IntTools_SurfaceRangeSample& S2) {
return S1.IsEqual(S2);
}