mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0023855: Old BOPs fail on Win7 64bit when using TBB
Minor code refactoring (readability) Test case for issue CR23855
This commit is contained in:
parent
265d4508bd
commit
091232bae7
@ -19,33 +19,49 @@
|
||||
#include <stdlib.h>
|
||||
#include <TopOpeBRep_define.hxx>
|
||||
|
||||
typedef Standard_Address BOA_t;
|
||||
typedef TopOpeBRepDS_ListOfInterference* BOA_t;
|
||||
|
||||
int compll(const void* v1, const void* v2) {
|
||||
const TopOpeBRepDS_ListOfInterference* l1 = (const TopOpeBRepDS_ListOfInterference*)(*((long int*)v1));
|
||||
const TopOpeBRepDS_ListOfInterference* l2 = (const TopOpeBRepDS_ListOfInterference*)(*((long int*)v2));
|
||||
static int compll(const void* v1, const void* v2) {
|
||||
BOA_t l1 = *(BOA_t*)v1;
|
||||
BOA_t l2 = *(BOA_t*)v2;
|
||||
if (l1->Extent() == 0) return (0);
|
||||
else if (l2->Extent() == 0) return (0);
|
||||
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) i1 = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(l1->First()); if (i1.IsNull()) return (0);
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) i2 = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(l2->First()); if (i2.IsNull()) return (0);
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) i1 = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(l1->First());
|
||||
if (i1.IsNull())
|
||||
return 0;
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) i2 = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(l2->First());
|
||||
if (i2.IsNull())
|
||||
return 0;
|
||||
Standard_Real p1 = i1->Parameter();
|
||||
Standard_Real p2 = i2->Parameter();
|
||||
if (p1 < p2) return (-1);
|
||||
else if (p1 > p2) return (1);
|
||||
else return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_EXPORT void BREP_sortonparameter2(TopOpeBRepDS_ListOfInterference& LOI)
|
||||
static void BREP_sortonparameter2(TopOpeBRepDS_ListOfInterference& LOI)
|
||||
{
|
||||
TopOpeBRepDS_TKI tki;tki.FillOnGeometry(LOI);
|
||||
Standard_Integer ng=0; for(tki.Init();tki.More();tki.Next()) ng++;
|
||||
size_t sng=(size_t)ng;size_t sad=sizeof(BOA_t);
|
||||
BOA_t* T = (BOA_t*)malloc((size_t)(sng*sad));TopOpeBRepDS_Kind K;Standard_Integer G;Standard_Integer j=0;
|
||||
for(tki.Init();tki.More();tki.Next(),j++) T[j]=(BOA_t)&(tki.Value(K,G));
|
||||
TopOpeBRepDS_TKI tki;
|
||||
tki.FillOnGeometry(LOI);
|
||||
Standard_Integer ng=0;
|
||||
for(tki.Init();tki.More();tki.Next())
|
||||
ng++;
|
||||
size_t sng=(size_t)ng;
|
||||
size_t sad=sizeof(BOA_t);
|
||||
BOA_t* T = (BOA_t*)Standard::Allocate (sng*sad);
|
||||
TopOpeBRepDS_Kind K;
|
||||
Standard_Integer G, j=0;
|
||||
for(tki.Init();tki.More();tki.Next(),j++)
|
||||
T[j]= &(tki.ChangeValue(K,G));
|
||||
qsort(T,sng,sad,compll);
|
||||
LOI.Clear();for(j=0;j<ng;j++) {TopOpeBRepDS_ListOfInterference& l=*((TopOpeBRepDS_ListOfInterference*)T[j]);LOI.Append(l);}
|
||||
free(T);
|
||||
LOI.Clear();
|
||||
for(j=0;j<ng;j++)
|
||||
{
|
||||
TopOpeBRepDS_ListOfInterference& l=*T[j];
|
||||
LOI.Append(l);
|
||||
}
|
||||
Standard::Free(T);
|
||||
}
|
||||
|
||||
Standard_EXPORT void BREP_sortonparameter(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
|
||||
|
11
tests/bugs/modalg_5/bug23855
Normal file
11
tests/bugs/modalg_5/bug23855
Normal file
@ -0,0 +1,11 @@
|
||||
puts "========="
|
||||
puts "OCC23855"
|
||||
puts "========="
|
||||
puts ""
|
||||
###########################################################
|
||||
# Old BOPs fail on Win7 64bit when using TBB
|
||||
###########################################################
|
||||
|
||||
psphere s1 10
|
||||
psphere s2 10
|
||||
common result s1 s2
|
Loading…
x
Reference in New Issue
Block a user