mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0023032: A crash of a draw-command voxeloctboolds on MMGT_OPT=0, MMGT_REENTRANT=1
This commit is contained in:
parent
c0a681bc51
commit
d5e4971b17
@ -23,6 +23,9 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||||
|
|
||||||
static Standard_Byte gbits[8] = {1, 2, 4, 8, 16, 32, 64, 128};
|
static Standard_Byte gbits[8] = {1, 2, 4, 8, 16, 32, 64, 128};
|
||||||
static Standard_Byte gnbits[8] = {255-1, 255-2, 255-4, 255-8, 255-16, 255-32, 255-64, 255-128};
|
static Standard_Byte gnbits[8] = {255-1, 255-2, 255-4, 255-8, 255-16, 255-32, 255-64, 255-128};
|
||||||
static iXYZ xyz;
|
static iXYZ xyz;
|
||||||
@ -270,6 +273,7 @@ void Voxel_OctBoolDS::OptimizeMemory()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Standard_Byte value;
|
Standard_Byte value;
|
||||||
|
TColStd_ListOfInteger ixs, iys, izs, values;
|
||||||
iXYZBool::Iterator itr(*((iXYZBool*)mySubVoxels));
|
iXYZBool::Iterator itr(*((iXYZBool*)mySubVoxels));
|
||||||
for (; itr.More(); itr.Next())
|
for (; itr.More(); itr.Next())
|
||||||
{
|
{
|
||||||
@ -277,11 +281,25 @@ void Voxel_OctBoolDS::OptimizeMemory()
|
|||||||
if (value == 0 || value == 255)
|
if (value == 0 || value == 255)
|
||||||
{
|
{
|
||||||
xyz = itr.Key();
|
xyz = itr.Key();
|
||||||
Set(xyz.ix, xyz.iy, xyz.iz, value ? Standard_True : Standard_False);
|
ixs.Append(xyz.ix);
|
||||||
UnSplit(xyz.ix, xyz.iy, xyz.iz);
|
iys.Append(xyz.iy);
|
||||||
|
izs.Append(xyz.iz);
|
||||||
|
values.Append((Standard_Integer)value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TColStd_ListIteratorOfListOfInteger itrix(ixs), itriy(iys), itriz(izs), itrvalues(values);
|
||||||
|
for (; itrix.More(); itrix.Next(), itriy.Next(), itriz.Next(), itrvalues.Next())
|
||||||
|
{
|
||||||
|
const Standard_Integer ix = itrix.Value();
|
||||||
|
const Standard_Integer iy = itriy.Value();
|
||||||
|
const Standard_Integer iz = itriz.Value();
|
||||||
|
const Standard_Integer value = itrvalues.Value();
|
||||||
|
|
||||||
|
Set(ix, iy, iz, (value ? Standard_True : Standard_False));
|
||||||
|
UnSplit(ix, iy, iz);
|
||||||
|
}
|
||||||
|
|
||||||
// If the map is empty, release it.
|
// If the map is empty, release it.
|
||||||
if (((iXYZBool*)mySubVoxels)->IsEmpty())
|
if (((iXYZBool*)mySubVoxels)->IsEmpty())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user