1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0024742: Remove rarely used collection classes: Set

Classes NCollection_Set and NCollection_HSet removed as unused (along with NCollection_DefineSet.hxx and NCollection_DefineHSet.hxx).

Classes TCollection_Set and TCollection_HSet removed (along with TCollection_SetIterator and TCollection_SetList nested classes).
Code previously using Set classes updated to equivalent use of Sequence (Adaptor3d and Visual3d packages) or TColStd_PackedMapOfInteger (BRepAlgo package).

In Adaptor3d_CurveOnSurface, calculation of continuity intervals refactored so as to build and store sorted sequence of reals, instead of collecting them to set, copying to array, and then sorting.
This commit is contained in:
dln
2014-04-08 12:55:04 +04:00
committed by abv
parent 6af4fe1c46
commit 54f7544df6
34 changed files with 353 additions and 1869 deletions

View File

@@ -39,7 +39,6 @@ Standard_Boolean IsEqual(const gp_Pnt& theP1, const gp_Pnt& theP2)
IMPLEMENT_HARRAY1(QANCollection_HArray1Func)
IMPLEMENT_HARRAY2(QANCollection_HArray2Func)
IMPLEMENT_HSET(QANCollection_HSetFunc)
IMPLEMENT_HSEQUENCE(QANCollection_HSequenceFunc)
//=======================================================================
@@ -207,21 +206,6 @@ static Standard_Integer QANColTestList(Draw_Interpretor& di, Standard_Integer ar
return 0;
}
//=======================================================================
//function : QANColTestSet
//purpose :
//=======================================================================
static Standard_Integer QANColTestSet(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if ( argc != 1) {
di << "Usage : " << argv[0] << "\n";
return 1;
}
QANCollection_SetFunc aSet;
TestSet(aSet);
return 0;
}
//=======================================================================
//function : QANColTestSequence
//purpose :
@@ -249,7 +233,6 @@ void QANCollection::Commands2(Draw_Interpretor& theCommands) {
theCommands.Add("QANColTestIndexedMap", "QANColTestIndexedMap", __FILE__, QANColTestIndexedMap, group);
theCommands.Add("QANColTestIndexedDataMap", "QANColTestIndexedDataMap", __FILE__, QANColTestIndexedDataMap, group);
theCommands.Add("QANColTestList", "QANColTestList", __FILE__, QANColTestList, group);
theCommands.Add("QANColTestSet", "QANColTestSet", __FILE__, QANColTestSet, group);
theCommands.Add("QANColTestSequence", "QANColTestSequence", __FILE__, QANColTestSequence, group);
return;

View File

@@ -28,7 +28,6 @@
IMPLEMENT_HARRAY1(QANCollection_HArray1Perf)
IMPLEMENT_HARRAY2(QANCollection_HArray2Perf)
IMPLEMENT_HSET(QANCollection_HSetPerf)
IMPLEMENT_HSEQUENCE(QANCollection_HSequencePerf)
//=======================================================================
@@ -97,20 +96,6 @@ static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer ar
return 0;
}
//=======================================================================
//function : QANColPerfSet
//purpose :
//=======================================================================
static Standard_Integer QANColPerfSet(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
Standard_Integer Repeat, Size;
if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
return 1;
}
CompSet(Repeat,Size);
return 0;
}
//=======================================================================
//function : QANColPerfSequence
//purpose :
@@ -216,7 +201,6 @@ void QANCollection::Commands3(Draw_Interpretor& theCommands) {
theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group);
theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);
theCommands.Add("QANColPerfDataMap", "QANColPerfDataMap Repeat Size", __FILE__, QANColPerfDataMap, group);

View File

@@ -67,14 +67,8 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapFunc,QANCollection_Key1BaseColFunc,Key
DEFINE_INDEXEDDATAMAP(QANCollection_IDMapFunc,QANCollection_BaseColFunc,Key1Type,ItemType)
#include <NCollection_DefineList.hxx>
#include <NCollection_DefineSet.hxx>
#include <NCollection_DefineHSet.hxx>
////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type)
////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set)
DEFINE_LIST(QANCollection_ListFunc,QANCollection_BaseColFunc,ItemType)
DEFINE_SET(QANCollection_SetFunc,QANCollection_Key2BaseColFunc,Key2Type)
DEFINE_HSET(QANCollection_HSetFunc,QANCollection_SetFunc)
#include <NCollection_DefineSequence.hxx>
#include <NCollection_DefineHSequence.hxx>

View File

@@ -67,14 +67,8 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapPerf,QANCollection_Key1BaseColPerf,Key
DEFINE_INDEXEDDATAMAP(QANCollection_IDMapPerf,QANCollection_BaseColPerf,Key1Type,ItemType)
#include <NCollection_DefineList.hxx>
#include <NCollection_DefineSet.hxx>
#include <NCollection_DefineHSet.hxx>
////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type)
////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set)
DEFINE_LIST(QANCollection_ListPerf,QANCollection_BaseColPerf,ItemType)
DEFINE_SET(QANCollection_SetPerf,QANCollection_Key2BaseColPerf,Key2Type)
DEFINE_HSET(QANCollection_HSetPerf,QANCollection_SetPerf)
#include <NCollection_DefineSequence.hxx>
#include <NCollection_DefineHSequence.hxx>

View File

@@ -70,58 +70,6 @@ void TestList (QANCollection_ListFunc& theL)
aL.Clear();
}
// ===================== Test methods of Set type =============================
////////////////////////////////void TestSet (QANCollection_Set& theS)
void TestSet (QANCollection_SetFunc& theS)
{
// Extent
Standard_Integer iExt=theS.Extent();
Standard_Integer i;
printf ("Info: testing Set(%d)\n", iExt);
Key2Type anItem;
// Constructor, Add
////////////////////////////////QANCollection_Set aSet1, aSet2, aSet;
QANCollection_SetFunc aSet1, aSet2, aSet;
for (i=1; i<=8; i++)
{
Random(anItem);
aSet1.Add(anItem);
if (i>4)
aSet2.Add(anItem);
}
for (i=1; i<=4; i++)
{
Random(anItem);
aSet2.Add(anItem);
}
if (!aSet2.Contains(anItem))
printf ("Error : set sais it does not contain its item\n");
// operator=, Union, Difference, Intersection
aSet = aSet1;
printCollection(aSet2,"Set2");
aSet1.Union(aSet2);
printCollection(aSet1,"Union");
if (!aSet1.IsAProperSubset(aSet2))
printf ("Error : not a proper subset?\n");
if (!aSet1.IsAProperSubset(aSet2))
printf ("Error : not a subset?!\n");
aSet1.Intersection(aSet);
printCollection(aSet,"Intersection");
aSet1.Difference(aSet2);
printCollection(aSet1,"Difference");
// operator=
////////////////////////////////Handle(QANCollection_HSet) aHS = new QANCollection_HSet(aSet);
Handle(QANCollection_HSetFunc) aHS = new QANCollection_HSetFunc(aSet);
// Assign
AssignCollection (aHS->ChangeSet(), theS);
// Clear
aSet.Clear();
}
// ===================== Test methods of Sequence type ========================
////////////////////////////////void TestSequence (QANCollection_Sequence& theS)
void TestSequence (QANCollection_SequenceFunc& theS)

View File

@@ -34,7 +34,6 @@
// Standard_EXPORT void TestInDaMap (QANCollection_IDMap& theNM);
#include <QANCollection_FuncMaps.hxx>
// Standard_EXPORT void TestList (QANCollection_List& theLi);
// Standard_EXPORT void TestSet (QANCollection_Set& theSe);
// Standard_EXPORT void TestSequence(QANCollection_Sequence& theSq);
#include <QANCollection_FuncLists.hxx>

View File

@@ -18,7 +18,6 @@
#include <QANCollection_ListOfPnt.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_SetOfInteger.hxx>
// ===================== Test perform of List type ==========================
void CompList (const Standard_Integer theRep,
@@ -92,98 +91,6 @@ void CompList (const Standard_Integer theRep,
}
// ===================== Test perform of Set type ==========================
void CompSet (const Standard_Integer theRep,
const Standard_Integer theSize)
{
Standard_Integer i,j;
////////////////////////////////Perf_Meter aNPush ("NCollection_Set pushing",0);
////////////////////////////////Perf_Meter aTPush ("TCollection_Set pushing",0);
////////////////////////////////Perf_Meter aNFind ("NCollection_Set finding",0);
////////////////////////////////Perf_Meter aTFind ("TCollection_Set finding",0);
////////////////////////////////Perf_Meter aNOper ("NCollection_Set operator=",0);
////////////////////////////////Perf_Meter aTOper ("TCollection_Set operator=",0);
////////////////////////////////Perf_Meter aNClea ("NCollection_Set clearing",0);
////////////////////////////////Perf_Meter aTClea ("TCollection_Set clearing",0);
////////////////////////////////Perf_Meter aNAssi ("NCollection_Set Assign",0);
for (i=0; i<theRep; i++)
{
////////////////////////////////QANCollection_Set a1, a2;
QANCollection_SetPerf a1, a2;
////////////////////////////////aNPush.Start();
PERF_START_METER("NCollection_Set pushing")
for (j=1; j<=theSize; j++)
{
Key2Type anItem;
Random(anItem);
a1.Add(anItem);
}
////////////////////////////////aNPush.Stop();
PERF_STOP_METER("NCollection_Set pushing")
////////////////////////////////aNFind.Start();
PERF_START_METER("NCollection_Set finding")
for (j=1; j<=theSize; j++)
{
Key2Type anItem;
Random(anItem);
a1.Contains(anItem);
}
////////////////////////////////aNFind.Stop();
PERF_STOP_METER("NCollection_Set finding")
////////////////////////////////aNOper.Start();
PERF_START_METER("NCollection_Set operator=")
a2 = a1;
////////////////////////////////aNOper.Stop();
PERF_STOP_METER("NCollection_Set operator=")
////////////////////////////////aNAssi.Start();
PERF_START_METER("NCollection_Set Assign")
a2.Assign(a1);
////////////////////////////////aNAssi.Stop();
PERF_STOP_METER("NCollection_Set Assign")
////////////////////////////////aNClea.Start();
PERF_START_METER("NCollection_Set clearing")
a2.Clear();
////////////////////////////////aNClea.Stop();
PERF_STOP_METER("NCollection_Set clearing")
}
for (i=0; i<theRep; i++)
{
TColStd_SetOfInteger a1, a2;
////////////////////////////////aTPush.Start();
PERF_START_METER("TCollection_Set pushing")
for (j=1; j<=theSize; j++)
{
Key2Type anItem;
Random(anItem);
a1.Add(anItem);
}
////////////////////////////////aTPush.Stop();
PERF_STOP_METER("TCollection_Set pushing")
////////////////////////////////aTFind.Start();
PERF_START_METER("TCollection_Set finding")
for (j=1; j<=theSize; j++)
{
Key2Type anItem;
Random(anItem);
a1.Contains(anItem);
}
////////////////////////////////aTFind.Stop();
PERF_STOP_METER("TCollection_Set finding")
////////////////////////////////aTOper.Start();
PERF_START_METER("TCollection_Set operator=")
a2 = a1;
////////////////////////////////aTOper.Stop();
PERF_STOP_METER("TCollection_Set operator=")
////////////////////////////////aTClea.Start();
PERF_START_METER("TCollection_Set clearing")
a2.Clear();
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Set clearing")
}
PERF_PRINT_ALL
}
// ===================== Test perform of Sequence type ==========================
void CompSequence (const Standard_Integer theRep,